From 6106a61eff305f0271dba54e7535fcccf14a42e0 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sun, 9 Jun 2024 16:29:29 +0800 Subject: [PATCH] Remove sub-path from container registry realm (#31293) Container registry requires that the "/v2" must be in the root, so the sub-path in AppURL should be removed --- 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, `