diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/packages.go | 5 | ||||
-rw-r--r-- | modules/test/utils.go | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/modules/setting/packages.go b/modules/setting/packages.go index b225615a24..00fba67b39 100644 --- a/modules/setting/packages.go +++ b/modules/setting/packages.go @@ -6,7 +6,6 @@ package setting import ( "fmt" "math" - "net/url" "os" "path/filepath" @@ -19,7 +18,6 @@ var ( Storage *Storage Enabled bool ChunkedUploadPath string - RegistryHost string LimitTotalOwnerCount int64 LimitTotalOwnerSize int64 @@ -66,9 +64,6 @@ func loadPackagesFrom(rootCfg ConfigProvider) (err error) { return err } - appURL, _ := url.Parse(AppURL) - Packages.RegistryHost = appURL.Host - Packages.ChunkedUploadPath = filepath.ToSlash(sec.Key("CHUNKED_UPLOAD_PATH").MustString("tmp/package-upload")) if !filepath.IsAbs(Packages.ChunkedUploadPath) { Packages.ChunkedUploadPath = filepath.ToSlash(filepath.Join(AppDataPath, Packages.ChunkedUploadPath)) diff --git a/modules/test/utils.go b/modules/test/utils.go index 4a0c2f1b3b..8dee92fbce 100644 --- a/modules/test/utils.go +++ b/modules/test/utils.go @@ -34,8 +34,10 @@ func IsNormalPageCompleted(s string) bool { return strings.Contains(s, `<footer class="page-footer"`) && strings.Contains(s, `</html>`) } -func MockVariableValue[T any](p *T, v T) (reset func()) { +func MockVariableValue[T any](p *T, v ...T) (reset func()) { old := *p - *p = v + if len(v) > 0 { + *p = v[0] + } return func() { *p = old } } |