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:
authorJaime Martinez <jmartinez@gitlab.com>2021-07-02 05:18:39 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-07-12 06:33:45 +0300
commit4d1dcf7933442c4b062b85fe26a2aa6cc75a078d (patch)
treed666b9d1ed7b452a439e9c8761701acae694ffc0 /internal/httpfs
parent98303e171b4e7ce5152cadb71afaded07944f92c (diff)
Disable chroot and add daemon-enable-jail flag
- Disable chroot mechanism by default. - Adds the daemon-enable-jail flag which will allow users to enable the legacy chroot mechanism if anything goes wrong. This flag won't be available via Omnibus, instead users will need to define the environment variable and pass to Pages. - Simplify chroot logic from http_fs - Update jail documentation - Enable chroot when domain-config-source=disk Changelog: changed
Diffstat (limited to 'internal/httpfs')
-rw-r--r--internal/httpfs/http_fs_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/httpfs/http_fs_test.go b/internal/httpfs/http_fs_test.go
index 7885dbf2..f47e17ff 100644
--- a/internal/httpfs/http_fs_test.go
+++ b/internal/httpfs/http_fs_test.go
@@ -65,6 +65,12 @@ func TestFSOpen(t *testing.T) {
expectedErrMsg: "no such file or directory",
chrootPath: wd + "/testdata",
},
+ "chroot_path_empty_finds_file": {
+ allowedPaths: []string{wd + "/testdata"},
+ fileName: wd + "/testdata/file1.txt",
+ expectedContent: "file1.txt\n",
+ chrootPath: "",
+ },
}
for name, test := range tests {
@@ -151,6 +157,13 @@ func TestFileSystemPathCanServeHTTP(t *testing.T) {
expectedStatusCode: http.StatusNotFound,
expectedContent: "404 page not found\n",
},
+ "chroot_path_empty_in_unit_test_file_found": {
+ path: wd + "/testdata",
+ fileName: "file1.txt",
+ chrootPath: "",
+ expectedStatusCode: http.StatusOK,
+ expectedContent: "file1.txt\n",
+ },
}
for name, test := range tests {