check if letsencrypt cert is already present

This commit is contained in:
Praveen Arimbrathodiyil 2016-04-04 23:12:52 +05:30
parent 6206489e19
commit 404502f470
2 changed files with 13 additions and 7 deletions

1
debian/changelog vendored
View file

@ -6,6 +6,7 @@ gitlab (8.5.8+dfsg-3) UNRELEASED; urgency=medium
* Use embedded copy of fuzzaldrin-plus (See #814871 for more details)
* Bring back db check in postinst (initialize the db only if it is empty)
* Choose unicode for db encoding (fixes wiki creation error)
* Don't run letsencrypt if certificate is already present
-- Pirate Praveen <praveen@debian.org> Sun, 03 Apr 2016 17:41:28 +0530

5
debian/postinst vendored
View file

@ -97,6 +97,10 @@ case "$1" in
# Check if letsencrypt option is selected
db_get gitlab/letsencrypt
if [ "${RET}" = "true" ]; then
# Check if certificate is already present
if [ -e /etc/letsencrypt/live/${GITLAB_HOST}/fullchain.pem ]; then
echo "Let's encrypt certificate already present."
else
ln -sf /etc/letsencrypt/live/${GITLAB_HOST}/fullchain.pem \
/etc/gitlab/ssl/gitlab.crt
ln -sf /etc/letsencrypt/live/${GITLAB_HOST}/privkey.pem \
@ -106,6 +110,7 @@ case "$1" in
letsencrypt -d ${GITLAB_HOST} certonly
fi
fi
fi
if test -f ${nginx_conf_example}; then
sed -e "s/YOUR_SERVER_FQDN/${GITLAB_HOST}/"\