Commit a73d20f4 authored by Kirill Smelkov's avatar Kirill Smelkov

gitlab/database.yml: Tweak to integrate gitlab with internal postgresql

We tweak database.yml to point to our postgresql unix socket; set
adapter to hardcoded postgresql, encoding to unicode and omit collation
(which according to omnibus-gitlab is used for mysql only).

The only instance parameter imported from omnibus is `db_pool` - how
many connection to a DB to keep open in a RoR thread/process.

XXX we use db's superuser as a user to connect. Is it ok to do even if
    the whole DB is used only for gitlab? (I think it is ok for the
    first iteration, but we'll probably need to refine this later)

/cc @kazuhiko, @jerome
parent 2e81276b
......@@ -9,3 +9,6 @@
# (last updated for omnibus-gitlab 8.2.3+ce.0-0-g8eda093)
[gitlab-parameters]
# db advanced
configuration.db_pool = 10
......@@ -147,6 +147,8 @@ template = {{ config_ru_in }}
[database.yml]
<= gitlab-etc-template
template= {{ database_yml_in }}
context-extra =
section pgsql service-postgresql
[gitlab-shell-config.yml]
<= etc-template
......
......@@ -4,16 +4,24 @@
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/database.yml.erb
# (last updated for 8.2.3+ce.0-0-g8eda093)
{% from 'macrolib.cfg.in' import cfg with context %}
production:
adapter: <%= @db_adapter %>
encoding: <%= @db_encoding %>
adapter: postgresql
encoding: unicode
{# collation is mainly for mysql
collation: <%= @db_collation %>
database: <%= @db_database %>
pool: <%= @db_pool %>
username: <%= single_quote(@db_username) %>
password: <%= single_quote(@db_password) %>
host: <%= single_quote(@db_host) %>
port: <%= @db_port %>
socket: <%= single_quote(@db_socket) %>
#}
database: {{ pgsql.dbname }}
pool: {{ cfg('db_pool') }}
{# XXX is it ok to use superuser, even if the whole database is only for gitlab? #}
username: '{{ pgsql.superuser }}'
{# we have no password - access is via unix socket #}
password:
host: '{{ pgsql["pgdata-directory"] }}'
port:
socket:
{# not needed for unix socket
sslmode: <%= single_quote(@db_sslmode) %>
sslrootcert: <%= single_quote(@db_sslrootcert) %>
#}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment