diff --git a/CHANGELOG b/CHANGELOG index 9909233..01d7652 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,6 +21,7 @@ omnibus-gitlab repository. - Change default Runit log rotation from 10x1MB to 30x24h - Security: Restrict redis and postgresql log directory permissions to 0700 - Add a 'gitlab-ctl deploy-page' command +- Automatically create /etc/gitlab/gitlab.rb after the package is installed 6.9.2 - Create the authorized-keys.lock file for gitlab-shell 1.9.4 diff --git a/README.md b/README.md index f758eb1..1e8d1b9 100644 --- a/README.md +++ b/README.md @@ -159,22 +159,12 @@ Note that you cannot use a Unicorn reload to update the Ruby runtime. ## Configuration -### Creating the gitlab.rb configuration file - -```shell -sudo mkdir -p /etc/gitlab -sudo touch /etc/gitlab/gitlab.rb -sudo chmod 600 /etc/gitlab/gitlab.rb -``` - -Below several examples are given for settings in `/etc/gitlab/gitlab.rb`. -Please restart each time you made a change. - ### Configuring the external URL for GitLab In order for GitLab to display correct repository clone links to your users it needs to know the URL under which it is reached by your users, e.g. -`http://gitlab.example.com`. Add the following line to `/etc/gitlab/gitlab.rb`: +`http://gitlab.example.com`. Add or edit the following line in +`/etc/gitlab/gitlab.rb`: ```ruby external_url "http://gitlab.example.com" diff --git a/package-scripts/gitlab/postinst b/package-scripts/gitlab/postinst index aab50c5..f27ca67 100755 --- a/package-scripts/gitlab/postinst +++ b/package-scripts/gitlab/postinst @@ -17,6 +17,16 @@ do ln -sf /opt/gitlab/bin/$command /usr/bin || error_exit "Could not symlink $command in /usr/bin" done +# Create a minimal gitlab.rb template if /etc/gitlab/gitlab.rb does not exist. +if ! [ -e /etc/gitlab/gitlab.rb ] ; then + mkdir -p /etc/gitlab + cat > /etc/gitlab/gitlab.rb <<'EOF' +# Change the external_url to the address your users will type in their browser +external_url 'http://gitlab.example.com' +EOF + chmod 600 /etc/gitlab/gitlab.rb +fi + echo "Thank you for installing GitLab!" echo "You can configure GitLab for your system by running the following command:" echo -- libgit2 0.21.2