Commit a3731cf3623f181e25113ebbb2415d7dddb630b2

Authored by Jacob Vosmaer
1 parent 485162ec

Use peer-based authentication for PostgreSQL

config/database.yml.postgresql
@@ -6,8 +6,8 @@ production: @@ -6,8 +6,8 @@ production:
6 encoding: unicode 6 encoding: unicode
7 database: gitlabhq_production 7 database: gitlabhq_production
8 pool: 10 8 pool: 10
9 - username: git  
10 - password: 9 + # username: git
  10 + # password:
11 # host: localhost 11 # host: localhost
12 # port: 5432 12 # port: 5432
13 # socket: /tmp/postgresql.sock 13 # socket: /tmp/postgresql.sock
doc/install/databases.md
@@ -58,7 +58,7 @@ GitLab supports the following databases: @@ -58,7 +58,7 @@ GitLab supports the following databases:
58 sudo -u postgres psql -d template1 58 sudo -u postgres psql -d template1
59 59
60 # Create a user for GitLab. (change $password to a real password) 60 # Create a user for GitLab. (change $password to a real password)
61 - template1=# CREATE USER git WITH PASSWORD '$password'; 61 + template1=# CREATE USER git;
62 62
63 # Create the GitLab production database & grant all privileges on database 63 # Create the GitLab production database & grant all privileges on database
64 template1=# CREATE DATABASE gitlabhq_production OWNER git; 64 template1=# CREATE DATABASE gitlabhq_production OWNER git;
doc/install/installation.md
@@ -216,17 +216,18 @@ Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup. @@ -216,17 +216,18 @@ Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup.
216 # Mysql 216 # Mysql
217 sudo -u git cp config/database.yml.mysql config/database.yml 217 sudo -u git cp config/database.yml.mysql config/database.yml
218 218
219 - or  
220 -  
221 - # PostgreSQL  
222 - sudo -u git cp config/database.yml.postgresql config/database.yml  
223 -  
224 # Make sure to update username/password in config/database.yml. 219 # Make sure to update username/password in config/database.yml.
225 # You only need to adapt the production settings (first part). 220 # You only need to adapt the production settings (first part).
226 # If you followed the database guide then please do as follows: 221 # If you followed the database guide then please do as follows:
227 # Change 'secure password' with the value you have given to $password 222 # Change 'secure password' with the value you have given to $password
228 # You can keep the double quotes around the password 223 # You can keep the double quotes around the password
229 sudo -u git -H editor config/database.yml 224 sudo -u git -H editor config/database.yml
  225 +
  226 + or
  227 +
  228 + # PostgreSQL
  229 + sudo -u git cp config/database.yml.postgresql config/database.yml
  230 +
230 231
231 # Make config/database.yml readable to git only 232 # Make config/database.yml readable to git only
232 sudo -u git -H chmod o-rwx config/database.yml 233 sudo -u git -H chmod o-rwx config/database.yml