Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue 12 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions post_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,21 @@ cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1 > /root/dbpasswor
PASS=`cat /root/dbpassword`

# create user git
psql -d template1 -U pgsql -c "CREATE USER ${USER} CREATEDB SUPERUSER;"
psql -d template1 -U postgres -c "CREATE USER ${USER} CREATEDB SUPERUSER;"

# Create the GitLab production database & grant all privileges on database
psql -d template1 -U pgsql -c "CREATE DATABASE ${DB} OWNER ${USER};"
psql -d template1 -U postgres -c "CREATE DATABASE ${DB} OWNER ${USER};"

# Set a password on the postgres account
psql -d template1 -U pgsql -c "ALTER USER ${USER} WITH PASSWORD '${PASS}';"
psql -d template1 -U postgres -c "ALTER USER ${USER} WITH PASSWORD '${PASS}';"

# Connect as superuser to gitlab db and enable pg_trgm extension
psql -U pgsql -d ${DB} -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
psql -U postgres -d ${DB} -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
psql -U postgres -d ${DB} -c "CREATE EXTENSION IF NOT EXISTS btree_gist;"

# Fix permission for postgres
echo "listen_addresses = '*'" >> /usr/local/pgsql/data/postgresql.conf
echo "host all all 0.0.0.0/0 md5" >> /usr/local/pgsql/data/pg_hba.conf
echo "listen_addresses = '*'" >> /var/db/postgres/data13/postgresql.conf
echo "host all all 0.0.0.0/0 md5" >> /var/db/postgres/data13/pg_hba.conf

# Restart postgresql after config change
service postgresql restart
Expand Down Expand Up @@ -88,7 +89,7 @@ su -l git -c "cd /usr/local/www/gitlab-ce && echo "yes" | rake gitlab:setup RAIL
su -l git -c "cd /usr/local/www/gitlab-ce && rake gettext:compile RAILS_ENV=production"

#Workaround to fix fetch failers
su -l git -c "cd /usr/local/www/gitlab-ce && rake yarn:install --har RAILS_ENV=production NODE_ENV=production"
su -l git -c "cd /usr/local/www/gitlab-ce && rake yarn:install RAILS_ENV=production NODE_ENV=production"

# Update node dependencies and recompile assets
su -l git -c "cd /usr/local/www/gitlab-ce && rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production"
Expand Down