[DRE-commits] [gitlab] 01/02: configure nginx
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Sun Jan 24 08:08:52 UTC 2016
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository gitlab.
commit e57c0f6ce783167e95bfd669e74d523ce8d97a64
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Sun Jan 24 09:47:27 2016 +0530
configure nginx
---
debian/conf/gitlab-debian.conf | 1 +
debian/gitlab.docs | 1 +
debian/postinst | 24 ++++++++++++++++++------
3 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/debian/conf/gitlab-debian.conf b/debian/conf/gitlab-debian.conf
index b18291a..2876752 100644
--- a/debian/conf/gitlab-debian.conf
+++ b/debian/conf/gitlab-debian.conf
@@ -9,3 +9,4 @@ export gitlab_nginx_log=/var/log/gitlab
export gitlab_ssl_path=/etc/gitlab/ssl
export gitlab_shell_root=/usr/share/gitlab-shell
export gitlab_shell_log=/var/log/gitlab-shell
+export nginx_conf_example=/usr/share/doc/gitlab/nginx.conf.example
diff --git a/debian/gitlab.docs b/debian/gitlab.docs
index 389dbb9..d782b1f 100644
--- a/debian/gitlab.docs
+++ b/debian/gitlab.docs
@@ -1,2 +1,3 @@
README.md
debian/README.Debian
+debian/conf/nginx.conf.example
diff --git a/debian/postinst b/debian/postinst
index f3a9b0e..686db77 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -31,7 +31,8 @@ case "$1" in
# Show debconf questions
. /usr/share/debconf/confmodule
- . /etc/gitlab/gitlab-debian.conf
+ gitlab_debian_conf=/etc/gitlab/gitlab-debian.conf
+ . ${gitlab_debian_conf}
. /usr/lib/gitlab/scripts/adduser.sh
gitlab_repo_path=${gitlab_data_dir}/repositories
mkdir -p ${gitlab_repo_path}
@@ -50,13 +51,24 @@ case "$1" in
db_get gitlab/fqdn
if [ "${RET}" != "" ]; then
db_go
- if ! grep GITLAB_HOST /etc/gitlab/gitlab-debian.conf
+ if ! grep GITLAB_HOST ${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
+ echo export GITLAB_HOST=${RET} >> ${gitlab_debian_conf}
+ echo export GITLAB_EMAIL_FROM="no-reply@${RET}" >> ${gitlab_debian_conf}
+ echo export GITLAB_EMAIL_DISPLAY_NAME="Gitlab" >> ${gitlab_debian_conf}
+ echo export GITLAB_EMAIL_REPLY_TO="no-reply@${RET}" >> ${gitlab_debian_conf}
fi
+
+ if test -f ${nginx_conf_example}
+ then
+ sed -e "s/YOUR_SERVER_FQDN/${RET}/"\
+ ${nginx_conf_example} >/etc/nginx/sites-available/${RET}
+ ln -fs /etc/nginx/sites-available/${RET} /etc/nginx/sites-enabled/
+ else
+ echo "nginx.conf.example not found"
+ exit 1
+ fi
+
else
echo "Failed to retrieve fully qualified domain name"
exit 1
--
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