diff --git a/bucket/sing-box.json b/bucket/sing-box.json index 98abc6a340262..a8f44667df6f1 100644 --- a/bucket/sing-box.json +++ b/bucket/sing-box.json @@ -3,6 +3,11 @@ "description": "The universal proxy platform.", "homepage": "https://sing-box.sagernet.org/", "license": "GPL-3.0-or-later", + "notes": [ + "If you want to use TUN mode, please run sing-box with administrator privileges.", + "Your configuration and cache files are persisted in '$persist_dir'.", + "You can run with a directory of configs using: 'sing-box run -C $persist_dir\\config.d'" + ], "architecture": { "64bit": { "url": "https://github.com/SagerNet/sing-box/releases/download/v1.12.19/sing-box-1.12.19-windows-amd64.zip", @@ -20,23 +25,37 @@ "extract_dir": "sing-box-1.12.19-windows-arm64" } }, + "pre_install": [ + "if (!(Test-Path \"$persist_dir\")) { New-Item -Path \"$persist_dir\" -ItemType Directory | Out-Null }", + "if (!(Test-Path \"$persist_dir\\config.json\")) {", + " $utf8NoBom = New-Object System.Text.UTF8Encoding($false)", + " [System.IO.File]::WriteAllText(\"$persist_dir\\config.json\", \"{}`n\", $utf8NoBom)", + "}", + "if (!(Test-Path \"$persist_dir\\cache.db\")) { New-Item -Path \"$persist_dir\\cache.db\" -ItemType File | Out-Null }" + ], "bin": "sing-box.exe", + "persist": [ + "config.json", + "cache.db", + "config.d", + "config" + ], "checkver": { "github": "https://github.com/SagerNet/sing-box/", - "regex": "(?v([\\d.]+))" + "regex": "/releases/tag/v(?[\\d.]+)" }, "autoupdate": { "architecture": { "64bit": { - "url": "https://github.com/SagerNet/sing-box/releases/download/$matchTag/sing-box-$version-windows-amd64.zip", + "url": "https://github.com/SagerNet/sing-box/releases/download/v$version/sing-box-$version-windows-amd64.zip", "extract_dir": "sing-box-$version-windows-amd64" }, "32bit": { - "url": "https://github.com/SagerNet/sing-box/releases/download/$matchTag/sing-box-$version-windows-386.zip", + "url": "https://github.com/SagerNet/sing-box/releases/download/v$version/sing-box-$version-windows-386.zip", "extract_dir": "sing-box-$version-windows-386" }, "arm64": { - "url": "https://github.com/SagerNet/sing-box/releases/download/$matchTag/sing-box-$version-windows-arm64.zip", + "url": "https://github.com/SagerNet/sing-box/releases/download/v$version/sing-box-$version-windows-arm64.zip", "extract_dir": "sing-box-$version-windows-arm64" } }