configure ssl in nginx

This commit is contained in:
Praveen Arimbrathodiyil 2016-02-07 14:22:01 +05:30
parent e1a6f889a3
commit e7b6777216
2 changed files with 29 additions and 16 deletions

View file

@ -10,3 +10,4 @@ gitlab_ssl_path=/etc/gitlab/ssl
gitlab_shell_root=/usr/share/gitlab-shell gitlab_shell_root=/usr/share/gitlab-shell
gitlab_shell_log=/var/log/gitlab-shell gitlab_shell_log=/var/log/gitlab-shell
nginx_conf_example=/usr/share/doc/gitlab/nginx.conf.example nginx_conf_example=/usr/share/doc/gitlab/nginx.conf.example
nginx_ssl_conf_example_gz=/usr/share/doc/gitlab/nginx.ssl.conf.example.gz

16
debian/postinst vendored
View file

@ -54,17 +54,29 @@ case "$1" in
if [ "${RET}" != "" ]; then if [ "${RET}" != "" ]; then
if ! grep GITLAB_HOST ${gitlab_debian_conf} if ! grep GITLAB_HOST ${gitlab_debian_conf}
then then
export GITLAB_HOST=${RET} # We need this to configure nginx below
echo GITLAB_HOST=${RET} >> ${gitlab_debian_conf} echo GITLAB_HOST=${RET} >> ${gitlab_debian_conf}
echo GITLAB_EMAIL_FROM="no-reply@${RET}" >> ${gitlab_debian_conf} echo GITLAB_EMAIL_FROM="no-reply@${RET}" >> ${gitlab_debian_conf}
echo GITLAB_EMAIL_DISPLAY_NAME="Gitlab" >> ${gitlab_debian_conf} echo GITLAB_EMAIL_DISPLAY_NAME="Gitlab" >> ${gitlab_debian_conf}
echo GITLAB_EMAIL_REPLY_TO="no-reply@${RET}" >> ${gitlab_debian_conf} echo GITLAB_EMAIL_REPLY_TO="no-reply@${RET}" >> ${gitlab_debian_conf}
fi fi
db_get gitlab/ssl
if [ "${RET}" = "true" ]
then
if [ -f "${nginx_ssl_conf_example_gz}" ]
then
# undo dh_installdocs auto compress
zcat ${nginx_ssl_conf_example_gz} >/tmp/gitlab-ssl
export nginx_conf_example="/tmp/gitlab-ssl"
fi
fi
if test -f ${nginx_conf_example} if test -f ${nginx_conf_example}
then then
sed -e "s/YOUR_SERVER_FQDN/${RET}/"\ sed -e "s/YOUR_SERVER_FQDN/${GITLAB_HOST}/"\
${nginx_conf_example} >/etc/nginx/sites-available/${RET} ${nginx_conf_example} >/etc/nginx/sites-available/${GITLAB_HOST}
ln -fs /etc/nginx/sites-available/${RET} /etc/nginx/sites-enabled/ ln -fs /etc/nginx/sites-available/${RET} /etc/nginx/sites-enabled/
rm -f /tmp/gitlab-ssl
else else
echo "nginx.conf.example not found" echo "nginx.conf.example not found"
exit 1 exit 1