.secret file has to be created
This commit is contained in:
parent
beb47e181f
commit
d5e765bbfe
2 changed files with 9 additions and 2 deletions
1
debian/postinst
vendored
1
debian/postinst
vendored
|
@ -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
|
||||
|
||||
|
|
10
debian/rake-tasks.sh
vendored
10
debian/rake-tasks.sh
vendored
|
@ -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')" = \
|
||||
|
|
Loading…
Reference in a new issue