fix(upgrader): remove unused settings import and simplify GitHub proxy checks

This commit is contained in:
Jacky 2025-05-07 01:02:54 +00:00
parent 3461ad3c24
commit 39daf0be53
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D

View file

@ -17,7 +17,6 @@ import (
_github "github.com/0xJacky/Nginx-UI/.github" _github "github.com/0xJacky/Nginx-UI/.github"
"github.com/0xJacky/Nginx-UI/internal/helper" "github.com/0xJacky/Nginx-UI/internal/helper"
"github.com/0xJacky/Nginx-UI/internal/version" "github.com/0xJacky/Nginx-UI/internal/version"
"github.com/0xJacky/Nginx-UI/settings"
"github.com/minio/selfupdate" "github.com/minio/selfupdate"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/uozi-tech/cosy/logger" "github.com/uozi-tech/cosy/logger"
@ -154,8 +153,7 @@ func (u *Upgrader) DownloadLatestRelease(progressChan chan float64) (tarName str
return return
} }
githubProxy := settings.HTTPSettings.GithubProxy if u.Channel != string(version.ReleaseTypeDev) {
if githubProxy != "" && u.Channel != string(version.ReleaseTypeDev) {
digest.BrowserDownloadUrl = version.GetUrl(digest.BrowserDownloadUrl) digest.BrowserDownloadUrl = version.GetUrl(digest.BrowserDownloadUrl)
} }
@ -169,7 +167,7 @@ func (u *Upgrader) DownloadLatestRelease(progressChan chan float64) (tarName str
dir := filepath.Dir(u.ExPath) dir := filepath.Dir(u.ExPath)
if githubProxy != "" && u.Channel != string(version.ReleaseTypeDev) { if u.Channel != string(version.ReleaseTypeDev) {
downloadUrl = version.GetUrl(downloadUrl) downloadUrl = version.GetUrl(downloadUrl)
} }