configure ssl in nginx
This commit is contained in:
parent
e1a6f889a3
commit
e7b6777216
2 changed files with 29 additions and 16 deletions
1
debian/conf/gitlab-debian.conf
vendored
1
debian/conf/gitlab-debian.conf
vendored
|
@ -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
|
||||||
|
|
44
debian/postinst
vendored
44
debian/postinst
vendored
|
@ -51,24 +51,36 @@ case "$1" in
|
||||||
su ${gitlab_user} -s /bin/sh -c 'git config --global core.autocrlf "input"'
|
su ${gitlab_user} -s /bin/sh -c 'git config --global core.autocrlf "input"'
|
||||||
cd ${gitlab_home}
|
cd ${gitlab_home}
|
||||||
db_get gitlab/fqdn
|
db_get gitlab/fqdn
|
||||||
if [ "${RET}" != "" ]; then
|
if [ "${RET}" != "" ]; then
|
||||||
if ! grep GITLAB_HOST ${gitlab_debian_conf}
|
if ! grep GITLAB_HOST ${gitlab_debian_conf}
|
||||||
then
|
then
|
||||||
echo GITLAB_HOST=${RET} >> ${gitlab_debian_conf}
|
export GITLAB_HOST=${RET} # We need this to configure nginx below
|
||||||
echo GITLAB_EMAIL_FROM="no-reply@${RET}" >> ${gitlab_debian_conf}
|
echo GITLAB_HOST=${RET} >> ${gitlab_debian_conf}
|
||||||
echo GITLAB_EMAIL_DISPLAY_NAME="Gitlab" >> ${gitlab_debian_conf}
|
echo GITLAB_EMAIL_FROM="no-reply@${RET}" >> ${gitlab_debian_conf}
|
||||||
echo GITLAB_EMAIL_REPLY_TO="no-reply@${RET}" >> ${gitlab_debian_conf}
|
echo GITLAB_EMAIL_DISPLAY_NAME="Gitlab" >> ${gitlab_debian_conf}
|
||||||
fi
|
echo GITLAB_EMAIL_REPLY_TO="no-reply@${RET}" >> ${gitlab_debian_conf}
|
||||||
|
fi
|
||||||
if test -f ${nginx_conf_example}
|
db_get gitlab/ssl
|
||||||
|
if [ "${RET}" = "true" ]
|
||||||
|
then
|
||||||
|
if [ -f "${nginx_ssl_conf_example_gz}" ]
|
||||||
then
|
then
|
||||||
sed -e "s/YOUR_SERVER_FQDN/${RET}/"\
|
# undo dh_installdocs auto compress
|
||||||
${nginx_conf_example} >/etc/nginx/sites-available/${RET}
|
zcat ${nginx_ssl_conf_example_gz} >/tmp/gitlab-ssl
|
||||||
ln -fs /etc/nginx/sites-available/${RET} /etc/nginx/sites-enabled/
|
export nginx_conf_example="/tmp/gitlab-ssl"
|
||||||
else
|
|
||||||
echo "nginx.conf.example not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -f ${nginx_conf_example}
|
||||||
|
then
|
||||||
|
sed -e "s/YOUR_SERVER_FQDN/${GITLAB_HOST}/"\
|
||||||
|
${nginx_conf_example} >/etc/nginx/sites-available/${GITLAB_HOST}
|
||||||
|
ln -fs /etc/nginx/sites-available/${RET} /etc/nginx/sites-enabled/
|
||||||
|
rm -f /tmp/gitlab-ssl
|
||||||
|
else
|
||||||
|
echo "nginx.conf.example not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Failed to retrieve fully qualified domain name"
|
echo "Failed to retrieve fully qualified domain name"
|
||||||
|
|
Loading…
Reference in a new issue