From f890d36ad112ccee95e52596d2be68d9a44c027c Mon Sep 17 00:00:00 2001 From: Thomas Hiller Date: Thu, 10 Oct 2024 10:02:10 +0200 Subject: [PATCH 1/5] pages namespace in path --- assets/runtime/config/gitlab-pages/config | 4 +++- assets/runtime/config/gitlabhq/gitlab.yml | 1 + assets/runtime/env-defaults | 2 ++ assets/runtime/functions | 5 +++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/assets/runtime/config/gitlab-pages/config b/assets/runtime/config/gitlab-pages/config index 409786090..c27dffb45 100644 --- a/assets/runtime/config/gitlab-pages/config +++ b/assets/runtime/config/gitlab-pages/config @@ -4,5 +4,7 @@ auth-redirect-uri={{GITLAB_PAGES_ACCESS_REDIRECT_URI}} auth-secret={{GITLAB_PAGES_ACCESS_SECRET}} gitlab-server={{GITLAB_PAGES_ACCESS_CONTROL_SERVER}} artifacts-server={{GITLAB_PAGES_ARTIFACTS_SERVER_URL}} -internal-gitlab-server=http://localhost:8181 +internal-gitlab-server=http://127.0.0.1:8080{{GITLAB_RELATIVE_URL_ROOT}} api-secret-key={{GITLAB_INSTALL_DIR}}/.gitlab_pages_secret +log-verbose={{GITLAB_PAGES_LOG_VERBOSE}} +namespace-in-path={{GITLAB_PAGES_NAMESPACE_IN_PATH}} diff --git a/assets/runtime/config/gitlabhq/gitlab.yml b/assets/runtime/config/gitlabhq/gitlab.yml index f828dd6f5..81ea4f07d 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). diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index 14e0ccc16..c5c3c6879 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 67750f2f7..8710c54c0 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,9 @@ if [[ ${GITLAB_PAGES_ACCESS_CONTROL} == true ]]; then fi else update_template ${GITLAB_PAGES_CONFIG} \ + GITLAB_RELATIVE_URL_ROOT \ + 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} From 5152bcf6acd0633789dfc8a9c056495169c3e407 Mon Sep 17 00:00:00 2001 From: Thomas Hiller Date: Thu, 10 Oct 2024 10:08:55 +0200 Subject: [PATCH 2/5] add new options to README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index f87c98d1b..db287f50a 100644 --- a/README.md +++ b/README.md @@ -1594,6 +1594,14 @@ Client Secret from earlier generated OAuth application Redirect URI, non existing pages domain to redirect to pages daemon, `https://projects.example.io/auth` +##### `GITLAB_PAGES_NAMESPACE_IN_PATH` + +Enable namespace-in-path option for gitlab pages, defaults to `false`. + +##### `GITLAB_PAGES_LOG_VERBOSE` + +Enable verbose logging for gitlab pages, defaults to `falsee`. + ##### `GITLAB_HTTPS` Set to `true` to enable https support, disabled by default. From fe9ed85383e739099e6a5da6db86e23981016d08 Mon Sep 17 00:00:00 2001 From: th-2021 <90853655+th-2021@users.noreply.github.com> Date: Wed, 4 Jun 2025 09:20:08 +0200 Subject: [PATCH 3/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab79f9ce9..3e0032645 100644 --- a/README.md +++ b/README.md @@ -1600,7 +1600,7 @@ Enable namespace-in-path option for gitlab pages, defaults to `false`. ##### `GITLAB_PAGES_LOG_VERBOSE` -Enable verbose logging for gitlab pages, defaults to `falsee`. +Enable verbose logging for gitlab pages, defaults to `false`. ##### `GITLAB_HTTPS` From b879531258fe80a58cf8ec69c77a0a7308f97d1b Mon Sep 17 00:00:00 2001 From: th-2021 <90853655+th-2021@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:15:17 +0200 Subject: [PATCH 4/5] Update functions --- assets/runtime/functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/runtime/functions b/assets/runtime/functions index 8710c54c0..66ef9562c 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -1412,7 +1412,8 @@ 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 if [[ -n ${GITLAB_PAGES_EXTERNAL_HTTP} ]]; then update_template ${GITLAB_CONFIG} \ @@ -2155,6 +2156,7 @@ if [[ ${GITLAB_PAGES_ACCESS_CONTROL} == true ]]; then GITLAB_PAGES_ACCESS_CONTROL_SERVER \ GITLAB_PAGES_NAMESPACE_IN_PATH \ GITLAB_PAGES_LOG_VERBOSE \ + GITLAB_PAGES_NAMESPACE_IN_PATH \ GITLAB_INSTALL_DIR if [[ -n ${GITLAB_PAGES_ARTIFACTS_SERVER_URL} ]]; then From b3be3a720f8ed93e8a645cf5aa38e88cd8d1f43d Mon Sep 17 00:00:00 2001 From: th-2021 <90853655+th-2021@users.noreply.github.com> Date: Sat, 7 Jun 2025 16:57:20 +0200 Subject: [PATCH 5/5] Update functions --- assets/runtime/functions | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/runtime/functions b/assets/runtime/functions index 66ef9562c..52e064772 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -2156,7 +2156,6 @@ if [[ ${GITLAB_PAGES_ACCESS_CONTROL} == true ]]; then GITLAB_PAGES_ACCESS_CONTROL_SERVER \ GITLAB_PAGES_NAMESPACE_IN_PATH \ GITLAB_PAGES_LOG_VERBOSE \ - GITLAB_PAGES_NAMESPACE_IN_PATH \ GITLAB_INSTALL_DIR if [[ -n ${GITLAB_PAGES_ARTIFACTS_SERVER_URL} ]]; then