[DRE-commits] [gitlab] 01/01: add debconf option
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Sat Jan 16 10:14:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch debconf
in repository gitlab.
commit 757cee6e009186269c2e3d1655d30012f689d194
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Sat Jan 16 15:43:30 2016 +0530
add debconf option
---
debian/config | 9 +++++++++
debian/gitlab.templates | 19 +++++++++++++------
debian/postinst | 34 ++++++++++++++++++++++++++++++----
3 files changed, 52 insertions(+), 10 deletions(-)
diff --git a/debian/config b/debian/config
old mode 100644
new mode 100755
index 8db43ff..e799296
--- a/debian/config
+++ b/debian/config
@@ -6,3 +6,12 @@ set -e
echo "Call debconf to configure gitlab"
# source debconf stuffs
. /usr/share/debconf/confmodule
+
+# What is your fqdn?
+db_input high gitlab/fqdn || true
+db_go
+
+# Do you want https?
+db_input high gitlab/ssl || true
+db_go
+
diff --git a/debian/gitlab.templates b/debian/gitlab.templates
index 326bc72..df17d6c 100644
--- a/debian/gitlab.templates
+++ b/debian/gitlab.templates
@@ -1,9 +1,15 @@
-Template: gitlab/dbpass
-Type: note
-_Description: PostgreSQL application password
- You can leave the PostgreSQL application password blank, as the "ident"
- authentication method is used, allowing the gitlab user on the system
- to connect to the gitlab database without a password.
+Template: gitlab/fqdn
+Type: string
+Default: localhost
+_Description: Fully qualified domain name for this instance of Gitlab:
+ Please choose the domain name which should be used to access this
+ instance of Gitlab.
+ .
+ This should be the fully qualified name as seen from the Internet, with
+ the domain name that will be used to access the pod.
+ .
+ If a reverse proxy is used, give the hostname that the proxy server
+ responds to.
Template: gitlab/ssl
Type: boolean
@@ -21,3 +27,4 @@ _Description: Enable https?
You can disable https if you want to access Gitlab only locally, via
Unicorn on port 3000. If you disable https, Nginx configuration will be
skipped.
+
diff --git a/debian/postinst b/debian/postinst
index 1fb0332..ce691c8 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -28,6 +28,10 @@ set -e
case "$1" in
configure)
+ echo "I'm here............................"
+ # Show debconf questions
+ . /usr/share/debconf/confmodule
+
. /etc/gitlab/gitlab-debian.conf
. /usr/lib/gitlab/scripts/adduser.sh
gitlab_repo_path=${gitlab_data_dir}/repositories
@@ -42,12 +46,10 @@ 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}
- # Show debconf questions
- . /usr/share/debconf/confmodule
echo "Create database if not present"
- if ! su postgres -s /bin/sh -c "psql gitlab_production -c ''"
+ if ! su postgres -s /bin/sh -c "psql gitlab_production -c ''"
then
- su postgres -c 'createdb gitlab_production'
+ su postgres -c 'createdb gitlab_production'
fi
# Adjust database privileges
@@ -62,6 +64,30 @@ case "$1" in
echo "Running final rake tasks..."
# 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)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gitlab.git
More information about the Pkg-ruby-extras-commits
mailing list