Commit 3ad6c6124182e3524fb99361110f4e3431849656

Authored by Dmitriy Zaporozhets
2 parents c7fd8276 427e68ec

Merge branch 'master' of github.com:gitlabhq/gitlabhq

doc/install/installation.md
1 1 # Select Version to Install
2 2 Make sure you view this installation guide from the branch (version) of GitLab you would like to install. In most cases
3   -this should be the highest numbered stable branch (example shown below).
  3 +this should be the highest numbered stable branch (example shown below).
4 4  
5 5 ![capture](https://f.cloud.github.com/assets/1192780/564911/2f9f3e1e-c5b7-11e2-9f89-98e527d1adec.png)
6 6  
... ... @@ -105,7 +105,7 @@ Is the system packaged Git too old? Remove it and compile from source.
105 105 mail server. By default, Debian is shipped with exim4 whereas Ubuntu
106 106 does not ship with one. The recommended mail server is postfix and you can install it with:
107 107  
108   - sudo apt-get install -y postfix
  108 + sudo apt-get install -y postfix
109 109  
110 110 Then select 'Internet Site' and press enter to confirm the hostname.
111 111  
... ... @@ -247,7 +247,7 @@ Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup.
247 247 # PostgreSQL
248 248 sudo -u git cp config/database.yml.postgresql config/database.yml
249 249  
250   -
  250 +
251 251 # Make config/database.yml readable to git only
252 252 sudo -u git -H chmod o-rwx config/database.yml
253 253  
... ... @@ -276,7 +276,12 @@ Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup.
276 276 Download the init script (will be /etc/init.d/gitlab):
277 277  
278 278 sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
279   - sudo chmod +x /etc/init.d/gitlab
  279 +
  280 +And if you are installing with a non-default folder or user copy and edit the defaults file:
  281 +
  282 + sudo cp lib/support/init.d/gitlab.default.example /etc/default/gitlab
  283 +
  284 +If you installed gitlab in another directory or as a user other than the default you should change these settings in /etc/default/gitlab. Do not edit /etc/init.d/gitlab as it will be changed on upgrade.
280 285  
281 286 Make GitLab start on boot:
282 287  
... ... @@ -369,7 +374,7 @@ a different host, you can configure its connection string via the
369 374 # example
370 375 production: redis://redis.example.tld:6379
371 376  
372   -If you want to connect the Redis server via socket, then use the "unix:" URL scheme
  377 +If you want to connect the Redis server via socket, then use the "unix:" URL scheme
373 378 and the path to the Redis socket file in the `config/resque.yml` file.
374 379  
375 380 # example
... ... @@ -405,7 +410,7 @@ These steps are fairly general and you will need to figure out the exact details
405 410 * Add provider specific configuration options to your `config/gitlab.yml` (you can use the [auth providers section of the example config](https://github.com/gitlabhq/gitlabhq/blob/master/config/gitlab.yml.example) as a reference)
406 411  
407 412 * Add the gem to your [Gemfile](https://github.com/gitlabhq/gitlabhq/blob/master/Gemfile)
408   - `gem "omniauth-your-auth-provider"`
  413 + `gem "omniauth-your-auth-provider"`
409 414 * If you're using MySQL, install the new Omniauth provider gem by running the following command:
410 415 `sudo -u git -H bundle install --without development test postgres --path vendor/bundle --no-deployment`
411 416  
... ...
lib/support/init.d/gitlab
... ... @@ -15,11 +15,20 @@
15 15 # Description: GitLab git repository management
16 16 ### END INIT INFO
17 17  
  18 +
  19 +###
  20 +# DO NOT EDIT THIS FILE!
  21 +# This file will be overwritten on update.
  22 +# Instead add/change your variables in /etc/default/gitlab
  23 +# An example defaults file can be found in lib/support/default/gitlab
  24 +###
  25 +
  26 +
18 27 ### Environment variables
19 28 RAILS_ENV="production"
20 29  
21   -# Script variable names should be lower-case not to conflict with internal
22   -# /bin/sh variables such as PATH, EDITOR or SHELL.
  30 +# Script variable names should be lower-case not to conflict with
  31 +# internal /bin/sh variables such as PATH, EDITOR or SHELL.
23 32 app_user="git"
24 33 app_root="/home/$app_user/gitlab"
25 34 pid_path="$app_root/tmp/pids"
... ... @@ -27,10 +36,6 @@ socket_path="$app_root/tmp/sockets"
27 36 web_server_pid_path="$pid_path/unicorn.pid"
28 37 sidekiq_pid_path="$pid_path/sidekiq.pid"
29 38  
30   -
31   -
32   -### Here ends user configuration ###
33   -
34 39 # Read configuration variable file if it is present
35 40 test -f /etc/default/gitlab && . /etc/default/gitlab
36 41  
... ... @@ -39,11 +44,12 @@ if [ "$USER" != "$app_user" ]; then
39 44 sudo -u "$app_user" -H -i $0 "$@"; exit;
40 45 fi
41 46  
42   -# Switch to the gitlab path, if it fails exit with an error.
  47 +# Switch to the gitlab path, exit on failure.
43 48 if ! cd "$app_root" ; then
44 49 echo "Failed to cd into $app_root, exiting!"; exit 1
45 50 fi
46 51  
  52 +
47 53 ### Init Script functions
48 54  
49 55 ## Gets the pids from the files
... ...
lib/support/init.d/gitlab.default.example 0 → 100755
... ... @@ -0,0 +1,14 @@
  1 +# Copy this lib/support/init.d/gitlab.default.example file to
  2 +# /etc/default/gitlab in order for it to apply to your system.
  3 +
  4 +# RAILS_ENV defines the type of installation that is running.
  5 +# Normal values are "production", "test" and "development".
  6 +RAILS_ENV="production"
  7 +
  8 +# app_user defines the user that GitLab is run as.
  9 +# The default is "git".
  10 +app_user="git"
  11 +
  12 +# app_root defines the folder in which gitlab and it's components are installed.
  13 +# The default is "/home/$app_user/gitlab"
  14 +app_root="/home/$app_user/gitlab"
... ...