Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/config/config.go1
-rw-r--r--internal/httpfs/http_fs.go7
-rw-r--r--internal/vfs/zip/vfs.go2
3 files changed, 1 insertions, 9 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 6de66bcf..20a9ad8b 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -338,7 +338,6 @@ func loadConfig() *Config {
// To be removed after we roll-out zip architecture completely https://gitlab.com/gitlab-org/gitlab-pages/-/issues/561
if config.Daemon.InplaceChroot {
config.Zip.ChrootPath = *pagesRoot
- config.Zip.AllowedPaths = append(config.Zip.AllowedPaths, "/")
}
validateConfig(config)
diff --git a/internal/httpfs/http_fs.go b/internal/httpfs/http_fs.go
index 1ce90057..cd2edb83 100644
--- a/internal/httpfs/http_fs.go
+++ b/internal/httpfs/http_fs.go
@@ -55,13 +55,6 @@ func (p *fileSystemPaths) Open(name string) (http.File, error) {
return nil, err
}
for _, allowedPath := range p.allowedPaths {
- // TODO: this is a temporary workaround for https://gitlab.com/gitlab-org/gitlab/-/issues/326117#note_546346101
- // where daemon-inplace-chroot=true fails to serve zip archives when pages_serve_with_zip_file_protocol is enabled
- // To be removed after we roll-out zip architecture completely https://gitlab.com/gitlab-org/gitlab-pages/-/issues/561
- if allowedPath == "/" {
- return os.Open(absPath)
- }
-
if strings.HasPrefix(absPath, allowedPath+"/") {
return os.Open(absPath)
}
diff --git a/internal/vfs/zip/vfs.go b/internal/vfs/zip/vfs.go
index fc83fca2..e8cae63c 100644
--- a/internal/vfs/zip/vfs.go
+++ b/internal/vfs/zip/vfs.go
@@ -262,5 +262,5 @@ func (fs *zipVFS) removeChrootPath(path string) string {
return path
}
- return strings.ReplaceAll(path, fs.chrootPath, "")
+ return strings.Replace(path, fs.chrootPath, "", 1)
}