Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support pages namespace_in_path #2923

Open
th-2021 opened this issue Apr 1, 2024 · 4 comments
Open

Please support pages namespace_in_path #2923

th-2021 opened this issue Apr 1, 2024 · 4 comments

Comments

@th-2021
Copy link

th-2021 commented Apr 1, 2024

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
Copy link

JKHSDTV commented Sep 27, 2024

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

@th-2021
Copy link
Author

th-2021 commented Sep 27, 2024

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

  • namespace_in_path: {{GITLAB_PAGES_NAMESPACE_IN_PATH}}

  • log_verbose: {{GITLAB_PAGES_LOG_VERBOSE}}

    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).

diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults
index 14e0ccc1..13bf2ab2 100644
--- a/assets/runtime/env-defaults
+++ b/assets/runtime/env-defaults
@@ -617,6 +617,7 @@ 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}

Gitaly

GITALY_CLIENT_PATH=${GITALY_CLIENT_PATH:-$GITLAB_GITALY_INSTALL_DIR}
diff --git a/assets/runtime/functions b/assets/runtime/functions
index 67750f2f..84af9aed 100644
--- a/assets/runtime/functions
+++ b/assets/runtime/functions
@@ -1412,7 +1412,9 @@ gitlab_configure_pages(){
GITLAB_PAGES_PORT
GITLAB_PAGES_HTTPS
GITLAB_PAGES_ARTIFACTS_SERVER \

  • GITLAB_PAGES_ACCESS_CONTROL
  • GITLAB_PAGES_ACCESS_CONTROL \
  • GITLAB_PAGES_NAMESPACE_IN_PATH \
  • GITLAB_PAGES_LOG_VERBOSE

if [[ -n ${GITLAB_PAGES_EXTERNAL_HTTP} ]]; then
update_template ${GITLAB_CONFIG} \

@th-2021
Copy link
Author

th-2021 commented Sep 30, 2024

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
Copy link
Author

th-2021 commented Oct 7, 2024

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants