Skip to content

Commit

Permalink
fixed relative_url support
Browse files Browse the repository at this point in the history
  • Loading branch information
Sameer Naik committed Mar 27, 2016
1 parent aefad44 commit 6eceaf2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This file only reflects the changes that are made in this image. Please refer to
- gitlab-workhorse: upgrade to v0.7.1
- gitlab: upgrade to CE v8.6.0
- exposed configuration parameters for auth0 OAUTH support
- fixed relative_url support

**8.5.8**
- gitlab: upgrade to CE v8.5.8
Expand Down
10 changes: 10 additions & 0 deletions assets/runtime/config/gitlabhq/relative_url.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Relative URL support
# WARNING: We recommend using an FQDN to host GitLab in a root path instead
# of using a relative URL.
# Documentation: http://doc.gitlab.com/ce/install/relative_url.html
# Copy this file to relative_url.rb and customize it to run in a non-root path
#

Rails.application.configure do
config.relative_url_root = "{{GITLAB_RELATIVE_URL_ROOT}}"
end
13 changes: 13 additions & 0 deletions assets/runtime/functions
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ USERCONF_TEMPLATES_DIR="${GITLAB_DATA_DIR}/config"
GITLAB_CONFIG="${GITLAB_INSTALL_DIR}/config/gitlab.yml"
GITLAB_DATABASE_CONFIG="${GITLAB_INSTALL_DIR}/config/database.yml"
GITLAB_UNICORN_CONFIG="${GITLAB_INSTALL_DIR}/config/unicorn.rb"
GITLAB_RELATIVE_URL_CONFIG="${GITLAB_INSTALL_DIR}/config/initializers/relative_url.rb"
GITLAB_RACK_ATTACK_CONFIG="${GITLAB_INSTALL_DIR}/config/initializers/rack_attack.rb"
GITLAB_SMTP_CONFIG="${GITLAB_INSTALL_DIR}/config/initializers/smtp_settings.rb"
GITLAB_RESQUE_CONFIG="${GITLAB_INSTALL_DIR}/config/resque.yml"
Expand Down Expand Up @@ -286,6 +287,13 @@ gitlab_configure_unicorn() {
UNICORN_TIMEOUT
}

gitlab_configure_relative_url() {
if [[ -n ${GITLAB_RELATIVE_URL_ROOT} ]]; then
echo "Configuring gitlab::relative_url..."
update_template ${GITLAB_RELATIVE_URL_CONFIG} GITLAB_RELATIVE_URL_ROOT
fi
}

gitlab_configure_timezone() {
echo "Configuring gitlab::timezone..."
update_template ${GITLAB_CONFIG} GITLAB_TIMEZONE
Expand Down Expand Up @@ -1042,6 +1050,10 @@ install_configuration_templates() {
install_template ${GITLAB_USER}: gitlabhq/secrets.yml ${GITLAB_SECRETS_CONFIG} 0600
install_template ${GITLAB_USER}: gitlab-shell/config.yml ${GITLAB_SHELL_CONFIG} 0640

if [[ -n ${GITLAB_RELATIVE_URL_ROOT} ]]; then
install_template ${GITLAB_USER}: gitlabhq/relative_url.rb ${GITLAB_RELATIVE_URL_CONFIG} 0644
fi

if [[ ${SMTP_ENABLED} == true ]]; then
install_template ${GITLAB_USER}: gitlabhq/smtp_settings.rb ${GITLAB_SMTP_CONFIG}
fi
Expand Down Expand Up @@ -1094,6 +1106,7 @@ configure_gitlab() {
gitlab_configure_secrets
gitlab_configure_sidekiq
gitlab_configure_gitlab_workhorse
gitlab_configure_relative_url
gitlab_configure_unicorn
gitlab_configure_timezone
gitlab_configure_rack_attack
Expand Down

0 comments on commit 6eceaf2

Please sign in to comment.