diff --git a/Changelog.md b/Changelog.md index 90ef440d..eb562222 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,7 @@ - gitlab: upgrade to CE v.7.5.1 - gitlab-shell to v2.2.0 - added `GITLAB_TIMEZONE` configuration option +- added `GITLAB_EMAIL_ENABLED` configuration option **7.4.4** - gitlab: upgrade to CE v.7.4.4 diff --git a/README.md b/README.md index c0dbc04a..a26568a3 100644 --- a/README.md +++ b/README.md @@ -699,6 +699,7 @@ Below is the complete list of available options that can be used to customize yo - **GITLAB_PORT**: The port of the GitLab server. Defaults to `80` for plain http and `443` when https is enabled. - **GITLAB_TIMEZONE**: Configure the timezone for the gitlab application. Defaults to `UTC`. - **GITLAB_EMAIL**: The email address for the GitLab server. Defaults to `example@example.com`. +- **GITLAB_EMAIL_ENABLED**: Enable or disable gitlab mailer. Defaults to the `SMTP_ENABLED` configuration. - **GITLAB_SIGNUP**: Enable or disable user signups. Default is `false`. - **GITLAB_SIGNIN**: If set to `false`, standard login form won't be shown on the sign-in page. Default is `true`. - **GITLAB_PROJECTS_LIMIT**: Set default projects limit. Defaults to `100`. diff --git a/assets/config/gitlabhq/gitlab.yml b/assets/config/gitlabhq/gitlab.yml index fddcf195..1f0476e4 100644 --- a/assets/config/gitlabhq/gitlab.yml +++ b/assets/config/gitlabhq/gitlab.yml @@ -40,7 +40,7 @@ production: &base ## Email settings # Uncomment and set to false if you need to disable email sending from GitLab (default: true) - # email_enabled: true + email_enabled: {{GITLAB_EMAIL_ENABLED}} # Email address used in the "From" field in mails sent by GitLab email_from: "{{GITLAB_EMAIL}}" diff --git a/assets/init b/assets/init index 4237816c..e535f5fd 100755 --- a/assets/init +++ b/assets/init @@ -78,6 +78,7 @@ if [ -n "${SMTP_USER}" ]; then SMTP_AUTHENTICATION=${SMTP_AUTHENTICATION:-login} fi SMTP_ENABLED=${SMTP_ENABLED:-false} +GITLAB_EMAIL_ENABLED=${GITLAB_EMAIL_ENABLED:-$SMTP_ENABLED} LDAP_ENABLED=${LDAP_ENABLED:-false} LDAP_HOST=${LDAP_HOST:-} @@ -440,8 +441,9 @@ sudo -u git -H sed 's/{{UNICORN_WORKERS}}/'"${UNICORN_WORKERS}"'/' -i config/uni # configure unicorn timeout sudo -u git -H sed 's/{{UNICORN_TIMEOUT}}/'"${UNICORN_TIMEOUT}"'/' -i config/unicorn.rb +# configure mail delivery +sudo -u git -H sed 's/{{GITLAB_EMAIL_ENABLED}}/'"${GITLAB_EMAIL_ENABLED}"'/' -i config/gitlab.yml if [ "${SMTP_ENABLED}" == "true" ]; then - # configure mail delivery sudo -u git -H sed 's/{{SMTP_HOST}}/'"${SMTP_HOST}"'/' -i config/initializers/smtp_settings.rb sudo -u git -H sed 's/{{SMTP_PORT}}/'"${SMTP_PORT}"'/' -i config/initializers/smtp_settings.rb