chore: 发布源与镜像指向自建 Gitea
ci / frontend (push) Failing after 14s
ci / backend (push) Failing after 42s

- selfupdate:Release 改从 gitea.bcde.io/wangdefa/ARTEX 取,API 路径换成
  /api/v1/repos/<repo>/releases/latest;白名单从 GitHub 五个域名收紧到
  gitea.bcde.io;github.go 改名 source.go,文案统一为「发布源」。
- README:clone / Releases 链接与镜像说明改为 Gitea 地址,补充发布源写死说明。
- docker-compose:镜像改为 gitea.bcde.io/wangdefa/artex。
- 前端与 server/update.go:GitHub 文案改为「发布源」。
This commit is contained in:
wangdefa committed 2026-10-20 21:45:44 -07:00
1 parent 2511c2e041
commit cadc8af05d
10 files changed
+57 -57

No files matched your search

+9 -8
View File
@@ -378,12 +378,13 @@ func TestExtractBinaryMissingEntry(t *testing.T) {
}
}
func TestCheckURLRejectsNonGitHub(t *testing.T) {
func TestCheckURLRejectsNonReleaseHost(t *testing.T) {
bad := []string{
"http://github.com/x", // 非 HTTPS
"https://evil.com/artex.zip", // 域名不在白名单
"https://github.com.evil.com/x", // 后缀伪装
"https://raw.githubusercontent.com.evil.com/x",
"http://gitea.bcde.io/x", // 非 HTTPS
"https://evil.com/artex.zip", // 域名不在白名单
"https://gitea.bcde.io.evil.com/x", // 后缀伪装
"https://api.github.com/repos/x/releases/latest", // 上游发布源已不是 GitHub
"https://objects.githubusercontent.com/blah", // 附件不再经过对象存储
}
for _, raw := range bad {
u := mustParse(t, raw)
@@ -392,9 +393,9 @@ func TestCheckURLRejectsNonGitHub(t *testing.T) {
}
}
good := []string{
"https://api.github.com/repos/x/releases/latest",
"https://objects.githubusercontent.com/blah",
"https://GitHub.com/x", // 域名大小写不敏感
"https://gitea.bcde.io/api/v1/repos/wangdefa/ARTEX/releases/latest",
"https://gitea.bcde.io/wangdefa/ARTEX/releases/download/v0.3.16/artex-0.3.16-linux-amd64.zip",
"https://Gitea.bcde.io/x", // 域名大小写不敏感
}
for _, raw := range good {
u := mustParse(t, raw)