From 8ccf4132aff92e4cf5f0195b62ce33cfb7cff450 Mon Sep 17 00:00:00 2001 From: Gary Or Date: Thu, 11 Sep 2014 15:15:30 +0800 Subject: [PATCH] add option to configure the gitlab ssh host --- README.md | 1 + assets/config/gitlabhq/gitlab.yml | 6 +++--- assets/init | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 61c839cd..d0b85334 100644 --- a/README.md +++ b/README.md @@ -746,6 +746,7 @@ Below is the complete list of available options that can be used to customize yo - **GITLAB_RESTRICTED_VISIBILITY**: Comma seperated list of visibility levels to restrict non-admin users to set. Possible visibility options are `public`, `private` and `internal`. - **GITLAB_BACKUPS**: Setup cron job to automatic backups. Possible values `disable`, `daily` or `monthly`. Disabled by default - **GITLAB_BACKUP_EXPIRY**: Configure how long (in seconds) to keep backups before they are deleted. By default when automated backups are disabled backups are kept forever (0 seconds), else the backups expire in 7 days (604800 seconds). +- **GITLAB_SSH_HOST**: The ssh host. Defaults to **GITLAB_HOST**. - **GITLAB_SSH_PORT**: The ssh port number. Defaults to `22`. - **GITLAB_RELATIVE_URL_ROOT**: The relative url of the GitLab server, e.g. `/git`. No default. - **GITLAB_HTTPS**: Set to `true` to enable https support, disabled by default. diff --git a/assets/config/gitlabhq/gitlab.yml b/assets/config/gitlabhq/gitlab.yml index 25592401..d3055d96 100644 --- a/assets/config/gitlabhq/gitlab.yml +++ b/assets/config/gitlabhq/gitlab.yml @@ -22,7 +22,7 @@ production: &base # Uncommment this line below if your ssh host is different from HTTP/HTTPS one # (you'd obviously need to replace ssh.host_example.com with your own host). # Otherwise, ssh host will be set to the `host:` value above - # ssh_host: ssh.host_example.com + ssh_host: "{{GITLAB_SSH_HOST}}" # WARNING: See config/application.rb under "Relative url support" for the list of # other files that need to be changed for relative url support @@ -261,9 +261,9 @@ test: port: {{GITLAB_PORT}} # When you run tests we clone and setup gitlab-shell - # In order to setup it correctly you need to specify + # In order to setup it correctly you need to specify # your system username you use to run GitLab - # user: YOUR_USERNAME + # user: YOUR_USERNAME satellites: path: tmp/tests/gitlab-satellites/ gitlab_shell: diff --git a/assets/init b/assets/init index 13fb9c23..e03ce77c 100755 --- a/assets/init +++ b/assets/init @@ -11,6 +11,7 @@ USERCONF_TEMPLATES_DIR="${GITLAB_DATA_DIR}/config" GITLAB_HOST=${GITLAB_HOST:-localhost} GITLAB_PORT=${GITLAB_PORT:-} +GITLAB_SSH_HOST=${GITLAB_SSH_HOST:-$GITLAB_HOST} GITLAB_SSH_PORT=${GITLAB_SSH_PORT:-$GITLAB_SHELL_SSH_PORT} # for backwards compatibility GITLAB_SSH_PORT=${GITLAB_SSH_PORT:-22} GITLAB_HTTPS=${GITLAB_HTTPS:-false} @@ -279,6 +280,7 @@ sudo -u git -H sed 's/{{GITLAB_HTTPS}}/'"${GITLAB_HTTPS}"'/' -i config/gitlab.ym sudo -u git -H sed 's/{{GITLAB_EMAIL}}/'"${GITLAB_EMAIL}"'/' -i config/gitlab.yml sudo -u git -H sed 's/{{GITLAB_BACKUP_EXPIRY}}/'"${GITLAB_BACKUP_EXPIRY}"'/' -i config/gitlab.yml sudo -u git -H sed 's/{{GITLAB_MAX_SIZE}}/'"${GITLAB_MAX_SIZE}"'/' -i config/gitlab.yml +sudo -u git -H sed 's/{{GITLAB_SSH_HOST}}/'"${GITLAB_SSH_HOST}"'/' -i config/gitlab.yml sudo -u git -H sed 's/{{GITLAB_SSH_PORT}}/'"${GITLAB_SSH_PORT}"'/' -i config/gitlab.yml # configure gitlab signup configuration