From 1dc8a660741ad162f8b59a74f07b5517467c5262 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 10 Jun 2024 12:04:49 +0800 Subject: [PATCH] Remove sub-path from container registry realm (#31293) (#31300) Backport #31293 by wxiaoguang Co-authored-by: wxiaoguang --- modules/setting/packages.go | 5 ----- modules/test/utils.go | 6 ++++-- routers/api/packages/container/container.go | 6 +++--- routers/web/user/package.go | 8 +++++++- tests/integration/api_packages_container_test.go | 12 +++++++++--- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/modules/setting/packages.go b/modules/setting/packages.go index b225615a240..00fba67b393 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 4a0c2f1b3b2..8dee92fbce4 100644 --- a/modules/test/utils.go +++ b/modules/test/utils.go @@ -34,8 +34,10 @@ func IsNormalPageCompleted(s string) bool { return strings.Contains(s, `