sameersbn / docker-gitlab

Dockerized GitLab
http://www.damagehead.com/docker-gitlab/
MIT License
7.88k stars 2.14k forks source link

Please support pages namespace_in_path #2923

Open th-2021 opened 6 months ago

th-2021 commented 6 months ago

Starting with 16.7 a new pages feature us delivered (as experimental): https://docs.gitlab.com/ee/administration/pages/#pages-domain-without-wildcard-dns

Please add this option.

JKHSDTV commented 2 weeks ago

This feature is now out of experimental and made it into GA in 17.4. Updoot for letting us set it.

th-2021 commented 2 weeks ago

Here is a first cut on the settings. I couldn't make it work so far (up to 17.3). Still working on it before creating a PR.

diff --git a/assets/runtime/config/gitlabhq/gitlab.yml b/assets/runtime/config/gitlabhq/gitlab.yml index f828dd6f..71113b50 100644 --- a/assets/runtime/config/gitlabhq/gitlab.yml +++ b/assets/runtime/config/gitlabhq/gitlab.yml @@ -410,6 +410,8 @@ production: &base artifacts_server: {{GITLAB_PAGES_ARTIFACTS_SERVER}} # Set to false if you want to disable online view of HTML artifacts external_http: {{GITLAB_PAGES_EXTERNAL_HTTP}} # If defined, enables custom domain support in GitLab Pages external_https: {{GITLAB_PAGES_EXTERNAL_HTTPS}} # If defined, enables custom domain and certificate support in GitLab Pages

th-2021 commented 2 weeks ago
index 14e0ccc1..c5c3c687 100644
--- a/assets/runtime/env-defaults
+++ b/assets/runtime/env-defaults
@@ -617,6 +617,8 @@ GITLAB_PAGES_ACCESS_CLIENT_ID=${GITLAB_PAGES_ACCESS_CLIENT_ID:-}
 GITLAB_PAGES_ACCESS_CLIENT_SECRET=${GITLAB_PAGES_ACCESS_CLIENT_SECRET:-}
 GITLAB_PAGES_ACCESS_REDIRECT_URI=${GITLAB_PAGES_ACCESS_REDIRECT_URI:-}
 GITLAB_PAGES_NGINX_PROXY=${GITLAB_PAGES_NGINX_PROXY:-true}
+GITLAB_PAGES_NAMESPACE_IN_PATH=${GITLAB_PAGES_NAMESPACE_IN_PATH:-false}
+GITLAB_PAGES_LOG_VERBOSE=${GITLAB_PAGES_LOG_VERBOSE:-false}

 ## Gitaly
 GITALY_CLIENT_PATH=${GITALY_CLIENT_PATH:-$GITLAB_GITALY_INSTALL_DIR}
diff --git a/assets/runtime/functions b/assets/runtime/functions
index 67750f2f..7728c490 100644
--- a/assets/runtime/functions
+++ b/assets/runtime/functions
@@ -2153,6 +2153,8 @@ if [[ ${GITLAB_PAGES_ACCESS_CONTROL} == true ]]; then
       GITLAB_PAGES_ACCESS_REDIRECT_URI \
       GITLAB_PAGES_ACCESS_SECRET \
       GITLAB_PAGES_ACCESS_CONTROL_SERVER \
+      GITLAB_PAGES_NAMESPACE_IN_PATH \
+      GITLAB_PAGES_LOG_VERBOSE \
       GITLAB_INSTALL_DIR

   if [[ -n ${GITLAB_PAGES_ARTIFACTS_SERVER_URL} ]]; then
@@ -2162,6 +2164,8 @@ if [[ ${GITLAB_PAGES_ACCESS_CONTROL} == true ]]; then
   fi
 else
   update_template ${GITLAB_PAGES_CONFIG} \
+      GITLAB_PAGES_NAMESPACE_IN_PATH \
+      GITLAB_PAGES_LOG_VERBOSE \
       GITLAB_INSTALL_DIR

   exec_as_git sed -i "/{{GITLAB_PAGES_ACCESS_CLIENT_ID}}/d" ${GITLAB_PAGES_CONFIG}

Fixed patch.

th-2021 commented 1 week ago

To get the correct links in deploy-pages the following patch is needed as well:

diff --git a/assets/runtime/config/gitlabhq/gitlab.yml b/assets/runtime/config/gitlabhq/gitlab.yml
index 63353d89..d2c1c427 100644
--- a/assets/runtime/config/gitlabhq/gitlab.yml
+++ b/assets/runtime/config/gitlabhq/gitlab.yml
@@ -410,6 +410,7 @@ production: &base
     artifacts_server: {{GITLAB_PAGES_ARTIFACTS_SERVER}} # Set to false if you want to disable online view of HTML artifacts
     external_http: {{GITLAB_PAGES_EXTERNAL_HTTP}} # If defined, enables custom domain support in GitLab Pages
     external_https: {{GITLAB_PAGES_EXTERNAL_HTTPS}} # If defined, enables custom domain and certificate support in GitLab Pages
+    namespace_in_path: {{GITLAB_PAGES_NAMESPACE_IN_PATH}}

     # File that contains the shared secret key for verifying access for gitlab-pages.
     # Default is '.gitlab_pages_secret' relative to Rails.root (i.e. root of the GitLab app).
✔ ~/Projects/docker-gitlab [support-builtin-kas|✚ 1…5⚑ 2]