doracoin ha revisionato questo gist . Vai alla revisione
1 file changed, 89 insertions, 38 deletions
winsw-dufs-config.yml
| @@ -3,12 +3,13 @@ | |||
| 3 | 3 | # 你可以根据需要注释掉或修改 | |
| 4 | 4 | ||
| 5 | 5 | # 要服务的根目录(默认当前目录 .) | |
| 6 | - | serve-path: 'D:\Share' | |
| 6 | + | serve-path: '/path/to/serve' | |
| 7 | 7 | ||
| 8 | 8 | # 监听地址 | |
| 9 | - | # - 0.0.0.0:允许所有网络接口访问(推荐公网或内网暴露时用) | |
| 9 | + | # - 0.0.0.0: 允许所有网络接口访问(推荐公网或内网暴露时用) | |
| 10 | 10 | # - 127.0.0.1:仅本地访问(最安全) | |
| 11 | - | # - :::IPv6 全监听 | |
| 11 | + | # - :: IPv6 全监听 | |
| 12 | + | # - ::1 IPv6 仅本地监听 | |
| 12 | 13 | # - /run/dufs.sock:Unix socket(抽象路径用 @/tmp/dufs.sock) | |
| 13 | 14 | bind: 127.0.0.1 | |
| 14 | 15 | ||
| @@ -22,12 +23,17 @@ port: 5000 | |||
| 22 | 23 | # 隐藏的文件/目录(glob 模式,支持多个) | |
| 23 | 24 | # 不会在列表中显示,但仍可通过直链访问(除非权限限制) | |
| 24 | 25 | hidden: | |
| 25 | - | - .git | |
| 26 | - | - .DS_Store | |
| 27 | - | - Thumbs.db | |
| 28 | - | - '*.log' | |
| 29 | - | - 'temp/' | |
| 26 | + | - 'tmp' | |
| 27 | + | - 'temp' | |
| 30 | 28 | - '__pycache__' | |
| 29 | + | - '*.log' | |
| 30 | + | - '*.lock' | |
| 31 | + | - '.git' | |
| 32 | + | - '.svn' | |
| 33 | + | - '.DS_Store' | |
| 34 | + | - '*.db' | |
| 35 | + | - '*.bak' | |
| 36 | + | - '*.pem' | |
| 31 | 37 | ||
| 32 | 38 | # 认证规则(最重要部分!) | |
| 33 | 39 | # 格式:user:pass@路径:权限 | |
| @@ -35,49 +41,94 @@ hidden: | |||
| 35 | 41 | # 支持 hashed 密码(从 0.37 开始),但这里示例用明文(生产建议 hashed) | |
| 36 | 42 | # '@/' 表示匿名访问(公开) | |
| 37 | 43 | auth: | |
| 38 | - | # 管理员:对整个站点读写 | |
| 39 | - | - admin:admin@/:rw | |
| 40 | - | ||
| 41 | - | # 普通用户:只对 /share 读写,其他路径只读(如果有匿名规则) | |
| 42 | - | - guest:guest123@/share:rw | |
| 43 | - | ||
| 44 | - | # 公开匿名只读(对整个站点) | |
| 45 | - | - '@/' | |
| 46 | - | ||
| 47 | - | # 是否允许所有操作(upload/delete 等),设为 true 会覆盖下面的 allow-xxx | |
| 48 | - | # allow-all: false | |
| 49 | - | ||
| 50 | - | # 细粒度权限开关(默认大多 true) | |
| 51 | - | allow-upload: true # 允许上传文件/文件夹 | |
| 52 | - | allow-delete: false # 允许删除 | |
| 53 | - | allow-search: true # 允许搜索 (?q=xxx) | |
| 54 | - | allow-symlink: true # 允许跟随根目录外的符号链接 | |
| 55 | - | allow-archive: true # 允许打包下载文件夹为 zip | |
| 56 | - | allow-hash: true # 允许 ?hash 获取文件 SHA-256 | |
| 44 | + | # 管理员 | |
| 45 | + | - admin:StrongPassword@/:rw | |
| 46 | + | ||
| 47 | + | # 用户1 | |
| 48 | + | - user1:password1@/private/user1:rw | |
| 49 | + | ||
| 50 | + | # 用户2 | |
| 51 | + | - user2:password2@/private/user2:rw | |
| 52 | + | ||
| 53 | + | # 共享下载区 | |
| 54 | + | - download:downloadpass@/downloads:ro | |
| 55 | + | ||
| 56 | + | # 匿名访问(只读) | |
| 57 | + | - '@/public:ro' | |
| 58 | + | ||
| 59 | + | # ======================== | |
| 60 | + | # 功能控制 | |
| 61 | + | # ======================== | |
| 62 | + | # 是否允许所有操作(upload/delete 等),设为 true 会覆盖下面的 allow-* | |
| 63 | + | allow-all: false | |
| 64 | + | ||
| 65 | + | # 允许上传文件/文件夹 | |
| 66 | + | allow-upload: true | |
| 67 | + | ||
| 68 | + | # 允许删除 | |
| 69 | + | allow-delete: false | |
| 57 | 70 | ||
| 71 | + | # 允许搜索 (?q=xxx) | |
| 72 | + | allow-search: false | |
| 73 | + | ||
| 74 | + | # 允许跟随根目录外的符号链接 | |
| 75 | + | allow-symlink: true | |
| 76 | + | ||
| 77 | + | # 允许打包下载文件夹为 zip | |
| 78 | + | allow-archive: false | |
| 79 | + | ||
| 80 | + | # 允许 ?hash 获取文件 SHA-256 | |
| 81 | + | allow-hash: false | |
| 82 | + | ||
| 83 | + | # ======================== | |
| 58 | 84 | # CORS 支持(前端跨域请求时有用,默认 true) | |
| 85 | + | # ======================== | |
| 59 | 86 | enable-cors: true | |
| 60 | 87 | ||
| 61 | - | # 目录索引行为 | |
| 62 | - | render-index: true # 如果目录有 index.html,直接返回它(否则 404) | |
| 63 | - | render-try-index: true # 有 index.html 就返回,没有就显示列表(推荐开启) | |
| 64 | - | render-spa: true # 单页应用模式(路径不存在时回退到 index.html,常用于前端项目) | |
| 88 | + | # ======================== | |
| 89 | + | # Web UI 渲染 | |
| 90 | + | # ======================== | |
| 91 | + | # 有 index.html 就返回,没有就显示列表(推荐开启,自定义主题的话则必须开启) | |
| 92 | + | render-try-index: true | |
| 93 | + | ||
| 94 | + | # 单页应用模式(路径不存在时回退到 index.html,和上面一条配置搭配使用,常用于前端项目) | |
| 95 | + | render-spa: true | |
| 65 | 96 | ||
| 97 | + | # 如果目录有 index.html,直接返回它(否则 404) | |
| 98 | + | render-index: false | |
| 99 | + | ||
| 100 | + | # ======================== | |
| 66 | 101 | # 自定义 UI 资源目录(想改 dufs 的网页界面时用) | |
| 67 | - | # assets: ./my-custom-assets/ | |
| 102 | + | # ======================== | |
| 103 | + | assets: ./dufs-material-assets/ | |
| 68 | 104 | ||
| 69 | - | # 日志相关 | |
| 105 | + | # ======================== | |
| 106 | + | # 日志 | |
| 107 | + | # ======================== | |
| 70 | 108 | log-format: '$remote_addr - $user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"' | |
| 71 | - | # log-file: ./dufs-access.log # 指定日志文件(默认输出到终端) | |
| 72 | 109 | ||
| 110 | + | # 指定日志文件(默认输出到终端) | |
| 111 | + | # log-file: ./dufs-access.log | |
| 112 | + | ||
| 113 | + | # ======================== | |
| 73 | 114 | # ZIP 压缩级别(打包下载文件夹时) | |
| 115 | + | # ======================== | |
| 74 | 116 | # none / low / medium / high(默认 low,平衡速度和体积) | |
| 75 | - | compress: medium | |
| 117 | + | compress: low | |
| 76 | 118 | ||
| 77 | - | # HTTPS 支持(生产环境强烈推荐) | |
| 119 | + | # ======================== | |
| 120 | + | # TLS HTTPS | |
| 121 | + | # ======================== | |
| 122 | + | # 直接用 dufs 开 HTTPS | |
| 123 | + | # 不建议公网这样用 | |
| 124 | + | # 更推荐用 Caddy/Nginx | |
| 78 | 125 | # tls-cert: /path/to/fullchain.pem | |
| 79 | 126 | # tls-key: /path/to/privkey.pem | |
| 80 | 127 | ||
| 81 | 128 | # 其他高级/不常用选项(按需启用) | |
| 82 | - | # tls-port: 443 # 如果想单独监听 HTTPS 端口 | |
| 83 | - | # redirect-to-https: true # HTTP 自动跳 HTTPS(需同时配 tls-cert/key) | |
| 129 | + | ||
| 130 | + | # 如果想单独监听 HTTPS 端口 | |
| 131 | + | # tls-port: 443 | |
| 132 | + | ||
| 133 | + | # HTTP 自动跳 HTTPS(需同时配 tls-cert/key) | |
| 134 | + | # redirect-to-https: true | |
doracoin ha revisionato questo gist . Vai alla revisione
2 files changed, 18 insertions
dufs-config.yml rinominato come winsw-dufs-config.yml
File rinominato senza modifiche
winsw-frpc-config.toml(file creato)
| @@ -0,0 +1,18 @@ | |||
| 1 | + | serverAddr = "server.frp.twotiger.cn" | |
| 2 | + | serverPort = 7000 | |
| 3 | + | auth.token = "StrongPassword" | |
| 4 | + | ||
| 5 | + | [[proxies]] | |
| 6 | + | name = "A" | |
| 7 | + | type = "tcp" | |
| 8 | + | localIP = "192.168.0.11" | |
| 9 | + | localPort = 7001 | |
| 10 | + | remotePort = 7001 | |
| 11 | + | ||
| 12 | + | [[proxies]] | |
| 13 | + | name = "B" | |
| 14 | + | type = "tcp" | |
| 15 | + | localIP = "192.168.0.12" | |
| 16 | + | localPort = 7002 | |
| 17 | + | remotePort = 7002 | |
| 18 | + | ||
doracoin ha revisionato questo gist . Vai alla revisione
2 files changed, 89 insertions, 2 deletions
dufs-config.yml(file creato)
| @@ -0,0 +1,83 @@ | |||
| 1 | + | # dufs.yaml - 通用的配置文件示例 | |
| 2 | + | # 所有选项都有默认值,以下是推荐的通用设置 + 注释 | |
| 3 | + | # 你可以根据需要注释掉或修改 | |
| 4 | + | ||
| 5 | + | # 要服务的根目录(默认当前目录 .) | |
| 6 | + | serve-path: 'D:\Share' | |
| 7 | + | ||
| 8 | + | # 监听地址 | |
| 9 | + | # - 0.0.0.0:允许所有网络接口访问(推荐公网或内网暴露时用) | |
| 10 | + | # - 127.0.0.1:仅本地访问(最安全) | |
| 11 | + | # - :::IPv6 全监听 | |
| 12 | + | # - /run/dufs.sock:Unix socket(抽象路径用 @/tmp/dufs.sock) | |
| 13 | + | bind: 127.0.0.1 | |
| 14 | + | ||
| 15 | + | # 监听端口(默认 5000) | |
| 16 | + | port: 5000 | |
| 17 | + | ||
| 18 | + | # URL 路径前缀,例如访问 http://your-ip:5000/dufs/ 才生效 | |
| 19 | + | # 留空或注释掉 = 无前缀(根路径 / 直接服务) | |
| 20 | + | # path-prefix: /dufs | |
| 21 | + | ||
| 22 | + | # 隐藏的文件/目录(glob 模式,支持多个) | |
| 23 | + | # 不会在列表中显示,但仍可通过直链访问(除非权限限制) | |
| 24 | + | hidden: | |
| 25 | + | - .git | |
| 26 | + | - .DS_Store | |
| 27 | + | - Thumbs.db | |
| 28 | + | - '*.log' | |
| 29 | + | - 'temp/' | |
| 30 | + | - '__pycache__' | |
| 31 | + | ||
| 32 | + | # 认证规则(最重要部分!) | |
| 33 | + | # 格式:user:pass@路径:权限 | |
| 34 | + | # 权限:rw(读写)、ro(只读)、wo(只写,很少用)、空=只读 | |
| 35 | + | # 支持 hashed 密码(从 0.37 开始),但这里示例用明文(生产建议 hashed) | |
| 36 | + | # '@/' 表示匿名访问(公开) | |
| 37 | + | auth: | |
| 38 | + | # 管理员:对整个站点读写 | |
| 39 | + | - admin:admin@/:rw | |
| 40 | + | ||
| 41 | + | # 普通用户:只对 /share 读写,其他路径只读(如果有匿名规则) | |
| 42 | + | - guest:guest123@/share:rw | |
| 43 | + | ||
| 44 | + | # 公开匿名只读(对整个站点) | |
| 45 | + | - '@/' | |
| 46 | + | ||
| 47 | + | # 是否允许所有操作(upload/delete 等),设为 true 会覆盖下面的 allow-xxx | |
| 48 | + | # allow-all: false | |
| 49 | + | ||
| 50 | + | # 细粒度权限开关(默认大多 true) | |
| 51 | + | allow-upload: true # 允许上传文件/文件夹 | |
| 52 | + | allow-delete: false # 允许删除 | |
| 53 | + | allow-search: true # 允许搜索 (?q=xxx) | |
| 54 | + | allow-symlink: true # 允许跟随根目录外的符号链接 | |
| 55 | + | allow-archive: true # 允许打包下载文件夹为 zip | |
| 56 | + | allow-hash: true # 允许 ?hash 获取文件 SHA-256 | |
| 57 | + | ||
| 58 | + | # CORS 支持(前端跨域请求时有用,默认 true) | |
| 59 | + | enable-cors: true | |
| 60 | + | ||
| 61 | + | # 目录索引行为 | |
| 62 | + | render-index: true # 如果目录有 index.html,直接返回它(否则 404) | |
| 63 | + | render-try-index: true # 有 index.html 就返回,没有就显示列表(推荐开启) | |
| 64 | + | render-spa: true # 单页应用模式(路径不存在时回退到 index.html,常用于前端项目) | |
| 65 | + | ||
| 66 | + | # 自定义 UI 资源目录(想改 dufs 的网页界面时用) | |
| 67 | + | # assets: ./my-custom-assets/ | |
| 68 | + | ||
| 69 | + | # 日志相关 | |
| 70 | + | log-format: '$remote_addr - $user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"' | |
| 71 | + | # log-file: ./dufs-access.log # 指定日志文件(默认输出到终端) | |
| 72 | + | ||
| 73 | + | # ZIP 压缩级别(打包下载文件夹时) | |
| 74 | + | # none / low / medium / high(默认 low,平衡速度和体积) | |
| 75 | + | compress: medium | |
| 76 | + | ||
| 77 | + | # HTTPS 支持(生产环境强烈推荐) | |
| 78 | + | # tls-cert: /path/to/fullchain.pem | |
| 79 | + | # tls-key: /path/to/privkey.pem | |
| 80 | + | ||
| 81 | + | # 其他高级/不常用选项(按需启用) | |
| 82 | + | # tls-port: 443 # 如果想单独监听 HTTPS 端口 | |
| 83 | + | # redirect-to-https: true # HTTP 自动跳 HTTPS(需同时配 tls-cert/key) | |
winsw-dufs.xml
| @@ -18,16 +18,20 @@ | |||
| 18 | 18 | ||
| 19 | 19 | <!-- Path to the executable, which should be started --> | |
| 20 | 20 | <executable>%BASE%\dufs.exe</executable> | |
| 21 | - | <arguments> -A C:\Users\Administrator\Music\ -a user:pa55w0rd@/:r --bind 127.0.0.1 --port 4800 --allow-search --allow-archive --hidden ".*" --log-format "$remote_addr $remote_user \"$request\" $status" </arguments> | |
| 21 | + | <arguments> -c %BASE%\config.yml</arguments> | |
| 22 | 22 | ||
| 23 | 23 | <!-- https://github.com/winsw/winsw/blob/master/doc/loggingAndErrorReporting.md --> | |
| 24 | 24 | <logpath>%BASE%\logs</logpath> | |
| 25 | 25 | <log mode="roll-by-size"> | |
| 26 | - | <sizeThreshold>1024</sizeThreshold> | |
| 26 | + | <sizeThreshold>10240</sizeThreshold> <!-- 10MB --> | |
| 27 | 27 | <keepFiles>4</keepFiles> | |
| 28 | 28 | </log> | |
| 29 | 29 | <onfailure action="restart" delay="10 sec"/> | |
| 30 | 30 | <onfailure action="restart" delay="20 sec"/> | |
| 31 | 31 | <onfailure action="none" /> | |
| 32 | + | <!-- 服务启动模式:Automatic(自动启动),也可设为 Manual 或 Disabled --> | |
| 33 | + | <startmode>Manual</startmode> | |
| 34 | + | <!-- 是否延迟自动启动,默认 false --> | |
| 35 | + | <delayedAutoStart>true</delayedAutoStart> | |
| 32 | 36 | ||
| 33 | 37 | </service> | |
doracoin ha revisionato questo gist . Vai alla revisione
1 file changed, 33 insertions
winsw-dufs.xml(file creato)
| @@ -0,0 +1,33 @@ | |||
| 1 | + | <!-- | |
| 2 | + | This is an example of a minimal Windows Service Wrapper configuration, which includes only mandatory options. | |
| 3 | + | ||
| 4 | + | This configuration file should be placed near the WinSW executable, the name should be the same. | |
| 5 | + | E.g. for myapp.exe the configuration file name should be myapp.xml | |
| 6 | + | ||
| 7 | + | You can find more information about the configuration options here: https://github.com/kohsuke/winsw/blob/master/doc/xmlConfigFile.md | |
| 8 | + | Full example: https://github.com/kohsuke/winsw/blob/master/examples/sample-allOptions.xml | |
| 9 | + | --> | |
| 10 | + | <service> | |
| 11 | + | ||
| 12 | + | <!-- ID of the service. It should be unique across the Windows system--> | |
| 13 | + | <id>dufs</id> | |
| 14 | + | <!-- Display name of the service --> | |
| 15 | + | <name>dufs</name> | |
| 16 | + | <!-- Service description --> | |
| 17 | + | <description>"A file server that supports static serving, uploading, searching, accessing control, webdav"</description> | |
| 18 | + | ||
| 19 | + | <!-- Path to the executable, which should be started --> | |
| 20 | + | <executable>%BASE%\dufs.exe</executable> | |
| 21 | + | <arguments> -A C:\Users\Administrator\Music\ -a user:pa55w0rd@/:r --bind 127.0.0.1 --port 4800 --allow-search --allow-archive --hidden ".*" --log-format "$remote_addr $remote_user \"$request\" $status" </arguments> | |
| 22 | + | ||
| 23 | + | <!-- https://github.com/winsw/winsw/blob/master/doc/loggingAndErrorReporting.md --> | |
| 24 | + | <logpath>%BASE%\logs</logpath> | |
| 25 | + | <log mode="roll-by-size"> | |
| 26 | + | <sizeThreshold>1024</sizeThreshold> | |
| 27 | + | <keepFiles>4</keepFiles> | |
| 28 | + | </log> | |
| 29 | + | <onfailure action="restart" delay="10 sec"/> | |
| 30 | + | <onfailure action="restart" delay="20 sec"/> | |
| 31 | + | <onfailure action="none" /> | |
| 32 | + | ||
| 33 | + | </service> | |
doracoin ha revisionato questo gist . Vai alla revisione
1 file changed, 34 insertions
winsw-stashapp.xml(file creato)
| @@ -0,0 +1,34 @@ | |||
| 1 | + | <!-- | |
| 2 | + | This is an example of a minimal Windows Service Wrapper configuration, which includes only mandatory options. | |
| 3 | + | ||
| 4 | + | This configuration file should be placed near the WinSW executable, the name should be the same. | |
| 5 | + | E.g. for myapp.exe the configuration file name should be myapp.xml | |
| 6 | + | ||
| 7 | + | You can find more information about the configuration options here: https://github.com/kohsuke/winsw/blob/master/doc/xmlConfigFile.md | |
| 8 | + | Full example: https://github.com/kohsuke/winsw/blob/master/examples/sample-allOptions.xml | |
| 9 | + | --> | |
| 10 | + | <service> | |
| 11 | + | ||
| 12 | + | <!-- ID of the service. It should be unique across the Windows system--> | |
| 13 | + | <id>Stash</id> | |
| 14 | + | <!-- Display name of the service --> | |
| 15 | + | <name>Stash</name> | |
| 16 | + | <!-- Service description --> | |
| 17 | + | <description>Stash v0.28.1</description> | |
| 18 | + | ||
| 19 | + | <!-- Path to the executable, which should be started --> | |
| 20 | + | <executable>%BASE%\stash-win-v0.28.1.exe</executable> | |
| 21 | + | <arguments></arguments> | |
| 22 | + | ||
| 23 | + | <!-- https://github.com/winsw/winsw/blob/master/doc/loggingAndErrorReporting.md --> | |
| 24 | + | <logpath>%BASE%\logs</logpath> | |
| 25 | + | <log mode="roll-by-size"> | |
| 26 | + | <sizeThreshold>1024</sizeThreshold> | |
| 27 | + | <keepFiles>4</keepFiles> | |
| 28 | + | </log> | |
| 29 | + | ||
| 30 | + | <onfailure action="restart" delay="10 sec"/> | |
| 31 | + | <onfailure action="restart" delay="20 sec"/> | |
| 32 | + | <onfailure action="none" /> | |
| 33 | + | ||
| 34 | + | </service> | |
doracoin ha revisionato questo gist . Vai alla revisione
1 file changed, 34 insertions
winsw-frpc.xml(file creato)
| @@ -0,0 +1,34 @@ | |||
| 1 | + | <!-- | |
| 2 | + | This is an example of a minimal Windows Service Wrapper configuration, which includes only mandatory options. | |
| 3 | + | ||
| 4 | + | This configuration file should be placed near the WinSW executable, the name should be the same. | |
| 5 | + | E.g. for myapp.exe the configuration file name should be myapp.xml | |
| 6 | + | ||
| 7 | + | You can find more information about the configuration options here: https://github.com/kohsuke/winsw/blob/master/doc/xmlConfigFile.md | |
| 8 | + | Full example: https://github.com/kohsuke/winsw/blob/master/examples/sample-allOptions.xml | |
| 9 | + | --> | |
| 10 | + | <service> | |
| 11 | + | ||
| 12 | + | <!-- ID of the service. It should be unique across the Windows system--> | |
| 13 | + | <id>Frpc</id> | |
| 14 | + | <!-- Display name of the service --> | |
| 15 | + | <name>Frpc</name> | |
| 16 | + | <!-- Service description --> | |
| 17 | + | <description>Frp Client</description> | |
| 18 | + | ||
| 19 | + | <!-- Path to the executable, which should be started --> | |
| 20 | + | <executable>%BASE%\frpc.exe</executable> | |
| 21 | + | <arguments> -c %BASE%\frpc.toml</arguments> | |
| 22 | + | ||
| 23 | + | <!-- https://github.com/winsw/winsw/blob/master/doc/loggingAndErrorReporting.md --> | |
| 24 | + | <logpath>%BASE%\winsw-logs</logpath> | |
| 25 | + | <log mode="roll-by-size"> | |
| 26 | + | <sizeThreshold>1024</sizeThreshold> | |
| 27 | + | <keepFiles>10</keepFiles> | |
| 28 | + | </log> | |
| 29 | + | ||
| 30 | + | <onfailure action="restart" delay="10 sec"/> | |
| 31 | + | <onfailure action="restart" delay="20 sec"/> | |
| 32 | + | <onfailure action="none" /> | |
| 33 | + | ||
| 34 | + | </service> | |
doracoin ha revisionato questo gist . Vai alla revisione
1 file changed, 34 insertions
winsw-gopeedweb.xml(file creato)
| @@ -0,0 +1,34 @@ | |||
| 1 | + | <!-- | |
| 2 | + | This is an example of a minimal Windows Service Wrapper configuration, which includes only mandatory options. | |
| 3 | + | ||
| 4 | + | This configuration file should be placed near the WinSW executable, the name should be the same. | |
| 5 | + | E.g. for myapp.exe the configuration file name should be myapp.xml | |
| 6 | + | ||
| 7 | + | You can find more information about the configuration options here: https://github.com/kohsuke/winsw/blob/master/doc/xmlConfigFile.md | |
| 8 | + | Full example: https://github.com/kohsuke/winsw/blob/master/examples/sample-allOptions.xml | |
| 9 | + | --> | |
| 10 | + | <service> | |
| 11 | + | ||
| 12 | + | <!-- ID of the service. It should be unique across the Windows system--> | |
| 13 | + | <id>GopeedWeb</id> | |
| 14 | + | <!-- Display name of the service --> | |
| 15 | + | <name>GopeedWeb</name> | |
| 16 | + | <!-- Service description --> | |
| 17 | + | <description>GopeedWeb</description> | |
| 18 | + | ||
| 19 | + | <!-- Path to the executable, which should be started --> | |
| 20 | + | <executable>%BASE%\gopeed.exe</executable> | |
| 21 | + | <arguments></arguments> | |
| 22 | + | ||
| 23 | + | <!-- https://github.com/winsw/winsw/blob/master/doc/loggingAndErrorReporting.md --> | |
| 24 | + | <logpath>%BASE%\logs</logpath> | |
| 25 | + | <log mode="roll-by-size"> | |
| 26 | + | <sizeThreshold>1024</sizeThreshold> | |
| 27 | + | <keepFiles>4</keepFiles> | |
| 28 | + | </log> | |
| 29 | + | ||
| 30 | + | <onfailure action="restart" delay="10 sec"/> | |
| 31 | + | <onfailure action="restart" delay="20 sec"/> | |
| 32 | + | <onfailure action="none" /> | |
| 33 | + | ||
| 34 | + | </service> | |
doracoin ha revisionato questo gist . Vai alla revisione
1 file changed, 34 insertions
winsw-gitea.xml(file creato)
| @@ -0,0 +1,34 @@ | |||
| 1 | + | <!-- | |
| 2 | + | This is an example of a minimal Windows Service Wrapper configuration, which includes only mandatory options. | |
| 3 | + | ||
| 4 | + | This configuration file should be placed near the WinSW executable, the name should be the same. | |
| 5 | + | E.g. for myapp.exe the configuration file name should be myapp.xml | |
| 6 | + | ||
| 7 | + | You can find more information about the configuration options here: https://github.com/kohsuke/winsw/blob/master/doc/xmlConfigFile.md | |
| 8 | + | Full example: https://github.com/kohsuke/winsw/blob/master/examples/sample-allOptions.xml | |
| 9 | + | --> | |
| 10 | + | <service> | |
| 11 | + | ||
| 12 | + | <!-- ID of the service. It should be unique across the Windows system--> | |
| 13 | + | <id>Gitea</id> | |
| 14 | + | <!-- Display name of the service --> | |
| 15 | + | <name>Gitea</name> | |
| 16 | + | <!-- Service description --> | |
| 17 | + | <description>Gitea Windows </description> | |
| 18 | + | ||
| 19 | + | <!-- Path to the executable, which should be started --> | |
| 20 | + | <executable>%BASE%\gitea-1.24.6-windows-4.0-amd64.exe</executable> | |
| 21 | + | <arguments></arguments> | |
| 22 | + | ||
| 23 | + | <!-- https://github.com/winsw/winsw/blob/master/doc/loggingAndErrorReporting.md --> | |
| 24 | + | <logpath>%BASE%\winsw-logs</logpath> | |
| 25 | + | <log mode="roll-by-size"> | |
| 26 | + | <sizeThreshold>1024</sizeThreshold> | |
| 27 | + | <keepFiles>10</keepFiles> | |
| 28 | + | </log> | |
| 29 | + | ||
| 30 | + | <onfailure action="restart" delay="10 sec"/> | |
| 31 | + | <onfailure action="restart" delay="20 sec"/> | |
| 32 | + | <onfailure action="none" /> | |
| 33 | + | ||
| 34 | + | </service> | |
doracoin ha revisionato questo gist . Vai alla revisione
1 file changed, 34 insertions
winsw-nginx.xml(file creato)
| @@ -0,0 +1,34 @@ | |||
| 1 | + | <!-- | |
| 2 | + | This is an example of a minimal Windows Service Wrapper configuration, which includes only mandatory options. | |
| 3 | + | ||
| 4 | + | This configuration file should be placed near the WinSW executable, the name should be the same. | |
| 5 | + | E.g. for myapp.exe the configuration file name should be myapp.xml | |
| 6 | + | ||
| 7 | + | You can find more information about the configuration options here: https://github.com/kohsuke/winsw/blob/master/doc/xmlConfigFile.md | |
| 8 | + | Full example: https://github.com/kohsuke/winsw/blob/master/examples/sample-allOptions.xml | |
| 9 | + | --> | |
| 10 | + | <service> | |
| 11 | + | ||
| 12 | + | <!-- ID of the service. It should be unique across the Windows system--> | |
| 13 | + | <id>Nginx</id> | |
| 14 | + | <!-- Display name of the service --> | |
| 15 | + | <name>Nginx</name> | |
| 16 | + | <!-- Service description --> | |
| 17 | + | <description>Nginx 1.22.1 </description> | |
| 18 | + | ||
| 19 | + | <!-- Path to the executable, which should be started --> | |
| 20 | + | <executable>%BASE%\nginx.exe</executable> | |
| 21 | + | <arguments></arguments> | |
| 22 | + | ||
| 23 | + | <!-- https://github.com/winsw/winsw/blob/master/doc/loggingAndErrorReporting.md --> | |
| 24 | + | <logpath>%BASE%\logs</logpath> | |
| 25 | + | <log mode="roll-by-size"> | |
| 26 | + | <sizeThreshold>1024</sizeThreshold> | |
| 27 | + | <keepFiles>4</keepFiles> | |
| 28 | + | </log> | |
| 29 | + | ||
| 30 | + | <onfailure action="restart" delay="10 sec"/> | |
| 31 | + | <onfailure action="restart" delay="20 sec"/> | |
| 32 | + | <onfailure action="none" /> | |
| 33 | + | ||
| 34 | + | </service> | |
doracoin ha revisionato questo gist . Vai alla revisione
1 file changed, 48 insertions
winsw-nexus.xml(file creato)
| @@ -0,0 +1,48 @@ | |||
| 1 | + | <service> | |
| 2 | + | <!-- 服务的唯一标识符,建议与名称保持一致 --> | |
| 3 | + | <id>nexus</id> | |
| 4 | + | <!-- 服务显示名称,可自定义 --> | |
| 5 | + | <name>Nexus Repository Manager</name> | |
| 6 | + | <!-- 服务描述 --> | |
| 7 | + | <description>Sonatype Nexus Repository Manager (wrapped by WinSW)</description> | |
| 8 | + | ||
| 9 | + | <!-- 可执行文件路径:请替换为您的 Nexus 安装目录下的 nexus.exe --> | |
| 10 | + | <executable>%BASE%\nexus.exe</executable> | |
| 11 | + | <!-- 运行参数:/run 让 nexus.exe 以前台模式运行,便于服务管理 --> | |
| 12 | + | <arguments>/run</arguments> | |
| 13 | + | ||
| 14 | + | <!-- 工作目录:通常设为 nexus.exe 所在目录或 Nexus 安装根目录 --> | |
| 15 | + | <workingdirectory>%BASE%</workingdirectory> | |
| 16 | + | ||
| 17 | + | <!-- 服务启动模式:Automatic(自动启动),也可设为 Manual 或 Disabled --> | |
| 18 | + | <startmode>Automatic</startmode> | |
| 19 | + | <!-- 是否延迟自动启动,默认 false --> | |
| 20 | + | <delayedAutoStart>true</delayedAutoStart> | |
| 21 | + | ||
| 22 | + | <!-- 服务依赖项(可选),例如依赖数据库服务,留空表示无依赖 --> | |
| 23 | + | <depend></depend> | |
| 24 | + | ||
| 25 | + | <!-- 日志输出目录,请替换为实际路径 --> | |
| 26 | + | <logpath>%BASE%\logs</logpath> | |
| 27 | + | <!-- 日志滚动模式:rotate(按日期/大小滚动),也可设为 append(单一文件追加)或 none(不记录) --> | |
| 28 | + | ||
| 29 | + | <log mode="roll-by-size"> | |
| 30 | + | <sizeThreshold>1024</sizeThreshold> | |
| 31 | + | <keepFiles>10</keepFiles> | |
| 32 | + | </log> | |
| 33 | + | ||
| 34 | + | <!-- 可选:指定服务登录账户,若不需要可删除此块或留空 --> | |
| 35 | + | <!-- | |
| 36 | + | <serviceaccount> | |
| 37 | + | <domain>YOUR_DOMAIN</domain> | |
| 38 | + | <user>YOUR_USER</user> | |
| 39 | + | <password>YOUR_PASSWORD</password> | |
| 40 | + | </serviceaccount> | |
| 41 | + | --> | |
| 42 | + | ||
| 43 | + | <!-- 可选:环境变量设置,例如若 Nexus 需要特定的 JAVA_HOME,可在此指定 --> | |
| 44 | + | <!-- | |
| 45 | + | <env name="JAVA_HOME" value="C:\Program Files\Java\jdk1.8.0_201"/> | |
| 46 | + | <env name="NEXUS_HOME" value="C:\Program Files\sonatype\nexus"/> | |
| 47 | + | --> | |
| 48 | + | </service> | |