From e77afc3a964ca357fdc69eee8c8bf001bd3ec407 Mon Sep 17 00:00:00 2001 From: Praveen Arimbrathodiyil Date: Sat, 23 Jan 2016 23:47:33 +0530 Subject: [PATCH] configure hostname and email --- debian/postinst | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/debian/postinst b/debian/postinst index c54478a503..a1e5941ba8 100755 --- a/debian/postinst +++ b/debian/postinst @@ -47,6 +47,19 @@ case "$1" in su ${gitlab_user} -s /bin/sh -c "mkdir -p -m 750 ${gitlab_home}/public/uploads" su ${gitlab_user} -s /bin/sh -c 'git config --global core.autocrlf "input"' cd ${gitlab_home} + db_get gitlab/fqdn + if [ "${RET}" = "true" ]; then + db_go + if ! grep GITLAB_HOST /etc/gitlab/gitlab-debian.conf + then + echo export GITLAB_HOST=${RET} >> /etc/gitlab/gitlab-debian.conf + echo export GITLAB_EMAIL_FROM="no-reply@${RET}" >> /etc/gitlab/gitlab-debian.conf + echo export GITLAB_EMAIL_DISPLAY_NAME="Gitlab" >> /etc/gitlab/gitlab-debian.conf + echo export GITLAB_EMAIL_REPLY_TO="no-reply@${RET}" >> /etc/gitlab/gitlab-debian.conf + fi + fi + db_stop + echo "Create database if not present" if ! su postgres -s /bin/sh -c "psql gitlab_production -c ''" then @@ -63,29 +76,7 @@ case "$1" in # Move these to rails-common . /usr/lib/gitlab/scripts/rake-tasks.sh - # Get ssl choice - db_get gitlab/ssl - if [ "${RET}" = "true" ]; then - db_go - # Configure instance address. - db_get gitlab/fqdn - echo "SSL enabled, configuring nginx for ${RET}..." - #/usr/lib/diaspora-common/scripts/set-env-nginx.sh ${RET} - db_go - else - db_go - # Configure instance address. - db_get gitlab/fqdn - echo "SSL disabled, skip nginx configuration for ${RET}..." - #if ! grep SERVERNAME /etc/diaspora.conf - #then - # echo export SERVERNAME=${RET} >> /etc/diaspora.conf - # export SERVERNAME=${RET} - # echo export ENVIRONMENT_URL="http://$SERVERNAME:3000" >> /etc/diaspora.conf - #fi - fi - db_stop - + ;; abort-upgrade|abort-remove|abort-deconfigure)