chore: migrate self-distribution links from GitHub to self-hosted Gitea
GitHub accounts suspended; all first-party distribution now served from git.881218.xyz/rogue/NexusGate (Gitea): - raw: /rogue/NexusGate/raw/branch/<branch>/<path> - release assets and source archives under the same repo path - scripts gain a GIT_BASE variable built from NG_REPO (default rogue/NexusGate); NG_REPO/NG_BRANCH/--repo/--branch semantics unchanged - panel enrollment/uninstall commands in public/app.js point at Gitea raw - install.sh/nexusgate.sh/agent-singbox.sh stats source previously defaulted to the upstream repo (a2899882); defaults now this repo Upstream dependency references (sagernet/sing-box Go module) untouched.
This commit is contained in:
@@ -14,7 +14,7 @@ if [[ -x "$target" && -x "$stats_target" && "${2:-}" != '--force' ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 优先从 GitHub Release 下载预编译二进制,免去现场编译
|
||||
# 优先从 Gitea Release 下载预编译二进制,免去现场编译
|
||||
# Release tag: sing-box-v1.13.21,需上传 nexusgate-sing-box-linux-<arch> 和 nexusgate-sing-box-stats-linux-<arch>
|
||||
try_prebuilt() {
|
||||
local arch dl_arch release_tag base_url tmp_bin tmp_stats
|
||||
@@ -24,11 +24,11 @@ try_prebuilt() {
|
||||
*) return 1 ;;
|
||||
esac
|
||||
release_tag="${NG_SINGBOX_RELEASE:-sing-box-v1.13.21}"
|
||||
base_url="https://github.com/aaaamoooo/NexusGate/releases/download/${release_tag}"
|
||||
base_url="https://git.881218.xyz/${NG_REPO:-rogue/NexusGate}/releases/download/${release_tag}"
|
||||
tmp_bin="$(mktemp /tmp/nexusgate-singbox-bin.XXXXXX)"
|
||||
tmp_stats="$(mktemp /tmp/nexusgate-singbox-stats.XXXXXX)"
|
||||
trap 'rm -f -- "$tmp_bin" "$tmp_stats"' RETURN
|
||||
printf '尝试从 GitHub Release 下载预编译 sing-box...\n'
|
||||
printf '尝试从 Gitea Release 下载预编译 sing-box...\n'
|
||||
if curl -fL --retry 2 --connect-timeout 15 -o "$tmp_bin" "${base_url}/nexusgate-sing-box-linux-${dl_arch}" 2>/dev/null && \
|
||||
curl -fL --retry 2 --connect-timeout 15 -o "$tmp_stats" "${base_url}/nexusgate-sing-box-stats-linux-${dl_arch}" 2>/dev/null; then
|
||||
chmod +x "$tmp_bin" "$tmp_stats"
|
||||
@@ -80,12 +80,12 @@ printf '构建 sing-box %s(启用 V2Ray 统计 API,首次需下载 Go 依赖
|
||||
GOBIN="$build_dir" GOTOOLCHAIN=auto GOMAXPROCS=1 go install -trimpath -ldflags='-s -w' -p 1 -tags with_v2ray_api "github.com/sagernet/sing-box/cmd/sing-box@${version}"
|
||||
[[ -s "$build_dir/sing-box" ]] || { printf 'sing-box 构建失败\n' >&2; exit 1; }
|
||||
|
||||
repo="${NG_REPO:-a2899882/NexusGate}"
|
||||
repo="${NG_REPO:-rogue/NexusGate}"
|
||||
branch="${NG_BRANCH:-main}"
|
||||
if [[ -n "${NG_STATS_SOURCE:-}" ]]; then
|
||||
install -m 0600 "$NG_STATS_SOURCE" "$stats_source_dir/stats-query.go"
|
||||
else
|
||||
curl -fL --retry 3 "https://raw.githubusercontent.com/${repo}/${branch}/agent/stats-query.go" -o "$stats_source_dir/stats-query.go"
|
||||
curl -fL --retry 3 "https://git.881218.xyz/${repo}/raw/branch/${branch}/agent/stats-query.go" -o "$stats_source_dir/stats-query.go"
|
||||
fi
|
||||
( cd "$stats_source_dir"
|
||||
GOTOOLCHAIN=auto go mod init nexusgate/statsquery
|
||||
|
||||
Reference in New Issue
Block a user