链接迁移: fork 脚本复活指 Gitea、上游三件套中和、面板自更新链改指本仓
- install-master.sh/install-agent.sh: 二进制下载源由已封账号 aaaamoooo/3x-ui-diy 改指本仓 Gitea Releases (tag 沿用 v3.7.0-agent.1); README 同步撤下'暂不可用'标注 - install.sh/update.sh: 未被 fork 部署链引用, 整文件替换为中英双语短桩 (exit 1), 防旧习惯调用时静默装成/更新成上游原版 - x-ui.sh: 保留全部管理功能, 仅中和 install/update/update_dev/update_menu/ legacy_version/update_shell 的上游下载分支与 uninstall 打印的上游命令, 一律改为提示本仓 Gitea Releases 地址后退出该分支 - panel.go: 面板自更新运行时耦合处理 — panelUpdaterURL 与版本检查 API 由 MHSanaei GitHub 改指本仓 Gitea (raw update.sh + /api/v1 releases, 响应字段 tag_name/body/target_commitish 与原解析结构一致); 下载到的将是本仓 update.sh 短桩, 面板更新会安全失败而非覆盖成原版 - deploy/cloud-init: curl 上游 install.sh 改为本仓 install-master.sh (Gitea raw); 头部注明 XUI_* 非交互旋钮与 install-result.env 凭据回显在 fork 安装脚本下无等价物
This commit is contained in:
@@ -40,7 +40,7 @@ type PanelUpdateInfo struct {
|
||||
}
|
||||
|
||||
const (
|
||||
panelUpdaterURL = "https://raw.githubusercontent.com/MHSanaei/3x-ui/main/update.sh"
|
||||
panelUpdaterURL = "https://git.881218.xyz/rogue/3x-ui-agent/raw/branch/main/update.sh"
|
||||
maxPanelUpdaterBytes = 2 << 20
|
||||
// devReleaseTag is the fixed-tag rolling pre-release the CI force-moves to the
|
||||
// newest main commit; the dev update channel installs from it.
|
||||
@@ -125,7 +125,7 @@ func (s *PanelService) RestartPanel(delay time.Duration) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetUpdateInfo checks GitHub for the latest 3x-ui release. When the dev channel
|
||||
// GetUpdateInfo checks this fork's Gitea repository for the latest release. When the dev channel
|
||||
// is enabled on a dev build it compares commits against the rolling dev release;
|
||||
// otherwise it compares versions against the latest stable tag.
|
||||
func (s *PanelService) GetUpdateInfo() (*PanelUpdateInfo, error) {
|
||||
@@ -427,12 +427,14 @@ func fetchLatestPanelVersion() (string, error) {
|
||||
return release.TagName, nil
|
||||
}
|
||||
|
||||
// fetchPanelRelease fetches a release from GitHub. An empty tag resolves the
|
||||
// latest stable release; a non-empty tag (e.g. dev-latest) resolves that tag.
|
||||
// fetchPanelRelease fetches a release from this fork's Gitea repository
|
||||
// (its API returns the same tag_name/body/target_commitish shape). An empty
|
||||
// tag resolves the latest stable release; a non-empty tag (e.g. dev-latest)
|
||||
// resolves that tag.
|
||||
func fetchPanelRelease(tag string) (*service.Release, error) {
|
||||
url := "https://api.github.com/repos/MHSanaei/3x-ui/releases/latest"
|
||||
url := "https://git.881218.xyz/api/v1/repos/rogue/3x-ui-agent/releases/latest"
|
||||
if tag != "" {
|
||||
url = "https://api.github.com/repos/MHSanaei/3x-ui/releases/tags/" + tag
|
||||
url = "https://git.881218.xyz/api/v1/repos/rogue/3x-ui-agent/releases/tags/" + tag
|
||||
}
|
||||
client := (&service.SettingService{}).NewProxiedHTTPClient(10 * time.Second)
|
||||
req, reqErr := http.NewRequestWithContext(context.Background(), http.MethodGet, url, nil)
|
||||
@@ -445,7 +447,7 @@ func fetchPanelRelease(tag string) (*service.Release, error) {
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, fmt.Errorf("GitHub API returned status %d: %s", resp.StatusCode, resp.Status)
|
||||
return nil, fmt.Errorf("release API returned status %d: %s", resp.StatusCode, resp.Status)
|
||||
}
|
||||
|
||||
var release service.Release
|
||||
|
||||
Reference in New Issue
Block a user