[DRE-commits] [gitlab] 01/01: .secret file has to be created

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Thu Feb 18 16:31:19 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 d5e765bbfe24e12a4a76f3ce0d842bea80c53826
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Thu Feb 18 22:00:42 2016 +0530

    .secret file has to be created
---
 debian/postinst      |  1 -
 debian/rake-tasks.sh | 10 +++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/debian/postinst b/debian/postinst
index 1443310..4c80c35 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -137,7 +137,6 @@ case "$1" in
     ln -sf ${gitlab_data_dir}/Gemfile.lock ${gitlab_app_root}/Gemfile.lock
     
     if ! [ -e ${gitlab_app_root}/.secret ] ; then
-      su ${gitlab_user} -s /bin/sh -c "touch ${gitlab_data_dir}/.secret"
       ln -s ${gitlab_data_dir}/.secret ${gitlab_app_root}/.secret
     fi
 
diff --git a/debian/rake-tasks.sh b/debian/rake-tasks.sh
index 156db7e..b6e2572 100755
--- a/debian/rake-tasks.sh
+++ b/debian/rake-tasks.sh
@@ -5,9 +5,17 @@ export $(cat /etc/gitlab/gitlab-debian.conf)
 
 if ! [ -f "${gitlab_app_root}/config/secrets.yml" ]; then
   echo "Creating secrets.yml..."
-  gitlab_app_secret=$(openssl rand -hex 64)
+  # Check if .secret file exist already in gitlab_app_root
+  # See if it is an empty file
+  test -e ${gitlab_app_root}/.secret &&\
+  gitlab_app_secret=$(cat ${gitlab_app_root}/.secret);\
+  test -n "${gitlab_app_secret}" ||\
+  { gitlab_app_secret=$(openssl rand -hex 64)
+
   cp ${gitlab_app_root}/config/secrets.yml.example ${gitlab_app_root}/config/secrets.yml
   sed -i "s/# db_key_base:/db_key_base: ${gitlab_app_secret}/" ${gitlab_app_root}/config/secrets.yml
+  echo ${gitlab_app_root} > ${gitlab_app_root}/.secret
+  }
 fi
 echo "Initializing database..."
 if [ "$(su postgres -c 'psql gitlab_production -c \\d')" = \

-- 
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