Skip to content

Instantly share code, notes, and snippets.

@techdecline
Created September 9, 2021 08:35
Show Gist options
  • Select an option

  • Save techdecline/dbe59ce2eea5fb080a7e16006049fb1e to your computer and use it in GitHub Desktop.

Select an option

Save techdecline/dbe59ce2eea5fb080a7e16006049fb1e to your computer and use it in GitHub Desktop.
Init-Gitlab-EE-Server
#!/bin/bash
external_url=$(wc -l < $1)
password=$(wc -l < $2)
# All actions based on https://docs.gitlab.com/ee/install/azure/
export config_file=/etc/gitlab/gitlab.rb
# Replace External URL
sed -i "s,external_url.*$,external_url $external_url,g" $config_file
# Comment https redirect
perl -pi.bak -e 's/(^nginx\[.redire.*$)/# $1/g' $config_file
# Comment SSL
perl -pi.bak -e 's/(^nginx\[.ssl_certifi.*$)/# $1/g' $config_file
# Reconfigure Gitlab after Config Modification
gitlab-ctl reconfigure
# Prevent Reset after reboot
mv /opt/bitnami/apps/gitlab/bnconfig /opt/bitnami/apps/gitlab/bnconfig.bak
# Resetting Password
gitlab-rails runner -e production " \
user = User.find(1); \
user.password = user.password_confirmation = '$password'; \
user.save!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment