diff --git a/Changelog.md b/Changelog.md index 915a2e30..da69ea03 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,7 +1,7 @@ # Changelog **latest** -- added HSTS_ENABLED configuration option (advanced config) +- added GITLAB_HTTPS_HSTS_ENABLED configuration option (advanced config) - added GITLAB_HTTPS_HSTS_MAXAGE configuration option (advanced config) - upgrade to gitlab-shell 1.9.8 - purge development packages after install. shaves off ~300MB from the image. diff --git a/README.md b/README.md index a8ad4475..0e98da47 100644 --- a/README.md +++ b/README.md @@ -751,6 +751,7 @@ Below is the complete list of available options that can be used to customize yo - **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. +- **GITLAB_HTTPS_HSTS_MAXAGE**: Advanced configuration option for turning off the HSTS configuration. Applicable only when SSL is in use. Defaults to `true`. See [#138](https://github.com/sameersbn/docker-gitlab/issues/138) for use case scenario. - **GITLAB_HTTPS_HSTS_MAXAGE**: Advanced configuration option for setting the HSTS max-age in the gitlab nginx vHost configuration. Applicable only when SSL is in use. Defaults to `31536000`. - **SSL_SELF_SIGNED**: Set to `true` when using self signed ssl certificates. `false` by default. - **SSL_CERTIFICATE_PATH**: Location of the ssl certificate. Defaults to `/home/git/data/certs/gitlab.crt` @@ -759,7 +760,6 @@ Below is the complete list of available options that can be used to customize yo - **CA_CERTIFICATES_PATH**: List of SSL certificates to trust. Defaults to `/home/git/data/certs/ca.crt`. - **NGINX_MAX_UPLOAD_SIZE**: Maximum acceptable upload size. Defaults to `20m`. - **NGINX_X_FORWARDED_PROTO**: Advanced configuration option for the `proxy_set_header X-Forwarded-Proto` setting in the gitlab nginx vHost configuration. Defaults to `https` when `GITLAB_HTTPS` is `true`, else defaults to `$scheme`. -- **HSTS_ENABLED**: Advanced configuration option for turning off the HSTS configuration. Applicable only when SSL is in use. Defaults to `true`. See [#138](https://github.com/sameersbn/docker-gitlab/issues/138) for use case scenario. - **REDIS_HOST**: The hostname of the redis server. Defaults to `localhost` - **REDIS_PORT**: The connection port of the redis server. Defaults to `6379`. - **UNICORN_WORKERS**: The number of unicorn workers to start. Defaults to `2`. diff --git a/assets/init b/assets/init index ca0390b7..790fd5a0 100755 --- a/assets/init +++ b/assets/init @@ -82,7 +82,7 @@ LDAP_ALLOW_USERNAME_OR_EMAIL_LOGIN=${LDAP_ALLOW_USERNAME_OR_EMAIL_LOGIN:-} LDAP_BASE=${LDAP_BASE:-} LDAP_USER_FILTER=${LDAP_USER_FILTER:-} -HSTS_ENABLED=${HSTS_ENABLED:-true} +GITLAB_HTTPS_HSTS_ENABLED=${GITLAB_HTTPS_HSTS_ENABLED:-true} GITLAB_HTTPS_HSTS_MAXAGE=${GITLAB_HTTPS_HSTS_MAXAGE:-31536000} REDMINE_URL=${REDMINE_URL:-} @@ -460,7 +460,7 @@ sed 's,{{SSL_DHPARAM_PATH}},'"${SSL_DHPARAM_PATH}"',' -i /etc/nginx/sites-enable sed 's/{{NGINX_MAX_UPLOAD_SIZE}}/'"${NGINX_MAX_UPLOAD_SIZE}"'/' -i /etc/nginx/sites-enabled/gitlab sed 's/{{NGINX_X_FORWARDED_PROTO}}/'"${NGINX_X_FORWARDED_PROTO}"'/' -i /etc/nginx/sites-enabled/gitlab -if [ "${HSTS_ENABLED}" == "true" ]; then +if [ "${GITLAB_HTTPS_HSTS_ENABLED}" == "true" ]; then sed 's/{{GITLAB_HTTPS_HSTS_MAXAGE}}/'"${GITLAB_HTTPS_HSTS_MAXAGE}"'/' -i /etc/nginx/sites-enabled/gitlab else sed '/{{GITLAB_HTTPS_HSTS_MAXAGE}}/d' -i /etc/nginx/sites-enabled/gitlab