2015-10-24 13:00:34 +05:30
|
|
|
#!/bin/sh
|
|
|
|
# config maintainer script for gitlab
|
2017-04-19 14:20:58 +05:30
|
|
|
|
|
|
|
CONFIGFILE=/etc/gitlab/gitlab-debian.conf
|
2015-10-24 13:00:34 +05:30
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# source debconf stuffs
|
|
|
|
. /usr/share/debconf/confmodule
|
2016-01-16 15:43:30 +05:30
|
|
|
|
2017-04-19 14:20:58 +05:30
|
|
|
# Load config file, if it exists.
|
|
|
|
if [ -e $CONFIGFILE ]; then
|
|
|
|
. $CONFIGFILE || true
|
|
|
|
|
|
|
|
# Store values from config file into
|
|
|
|
# debconf db.
|
|
|
|
db_set gitlab/fqdn "$GITLAB_HOST"
|
2017-04-20 11:32:10 +05:30
|
|
|
db_set gitlab/ssl "${GITLAB_HTTPS:-false}"
|
|
|
|
db_set gitlab/letsencrypt "${gitlab_letsencrypt:-false}"
|
2017-04-26 20:23:50 +05:30
|
|
|
if [ -n "$gitlab_letsencrypt_email" ]; then
|
|
|
|
db_set gitlab/letsencrypt_email "${gitlab_letsencrypt_email}"
|
|
|
|
fi
|
2017-04-19 14:20:58 +05:30
|
|
|
fi
|
|
|
|
|
2016-01-16 15:43:30 +05:30
|
|
|
# What is your fqdn?
|
|
|
|
db_input high gitlab/fqdn || true
|
|
|
|
db_go
|
|
|
|
|
|
|
|
# Do you want https?
|
|
|
|
db_input high gitlab/ssl || true
|
|
|
|
db_go
|
|
|
|
|
2016-04-03 11:37:40 +05:30
|
|
|
# Don't prompt for letsencrypt if not installed
|
2016-04-03 12:02:39 +05:30
|
|
|
if command -v letsencrypt >/dev/null; then
|
2016-04-03 11:37:40 +05:30
|
|
|
# Do you want Let's Encrypt?
|
|
|
|
db_get gitlab/ssl
|
|
|
|
if [ "${RET}" = "true" ]
|
|
|
|
then
|
|
|
|
db_input high gitlab/letsencrypt || true
|
|
|
|
db_go
|
2017-04-26 20:23:50 +05:30
|
|
|
db_get gitlab/letsencrypt
|
2017-04-27 11:23:26 +05:30
|
|
|
gitlab_letsencrypt=$RET
|
2017-04-26 20:23:50 +05:30
|
|
|
if [ "$gitlab_letsencrypt" = "true" ]; then
|
|
|
|
# Get email for letsencrypt updates
|
|
|
|
db_input high gitlab/letsencrypt_email || true
|
2017-04-27 11:23:26 +05:30
|
|
|
db_go
|
2017-04-26 20:23:50 +05:30
|
|
|
fi
|
2016-04-03 11:37:40 +05:30
|
|
|
fi
|
2016-02-06 00:13:36 +05:30
|
|
|
fi
|
2017-02-15 11:49:55 +05:30
|
|
|
|
2018-06-12 21:00:26 +05:30
|
|
|
db_get gitlab-common/user
|
2017-04-21 12:47:11 +05:30
|
|
|
gitlab_user=$RET
|
|
|
|
|
|
|
|
# source dbconfig-common shell library, and call the hook function
|
|
|
|
if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
|
|
|
|
. /usr/share/dbconfig-common/dpkg/config
|
|
|
|
|
|
|
|
dbc_dbtypes="pgsql"
|
|
|
|
dbc_dbname="gitlab_production"
|
|
|
|
dbc_dbuser="$gitlab_user"
|
2017-05-12 09:57:29 +05:30
|
|
|
|
|
|
|
dbc_go gitlab "$@"
|
2017-04-21 12:47:11 +05:30
|
|
|
fi
|