diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-26 11:13:42 +0000 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-26 11:13:42 +0000 |
commit | ca6cc6014eed02b2e74bc8ffe65d3c1cc2e511b4 (patch) | |
tree | 2c7f9b643463a69b5010b8942eaa2e3c58fd59c9 /lib/backup/database.rb | |
parent | af6e3e57e4c0ee861e26310c65be2e5e8547ca68 (diff) | |
parent | 52bd4b88dc557f0b3c63e82d0f2093f22b28ae9d (diff) | |
download | gitlab-ce-ca6cc6014eed02b2e74bc8ffe65d3c1cc2e511b4.tar.gz |
Merge branch 'master' into 'add-sentry-js-again-with-vue'
# Conflicts:
# config/webpack.config.js
Diffstat (limited to 'lib/backup/database.rb')
-rw-r--r-- | lib/backup/database.rb | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb index 4016ac76348..d97e5d98229 100644 --- a/lib/backup/database.rb +++ b/lib/backup/database.rb @@ -80,16 +80,32 @@ module Backup 'port' => '--port', 'socket' => '--socket', 'username' => '--user', - 'encoding' => '--default-character-set' + 'encoding' => '--default-character-set', + # SSL + 'sslkey' => '--ssl-key', + 'sslcert' => '--ssl-cert', + 'sslca' => '--ssl-ca', + 'sslcapath' => '--ssl-capath', + 'sslcipher' => '--ssl-cipher' } args.map { |opt, arg| "#{arg}=#{config[opt]}" if config[opt] }.compact end def pg_env - ENV['PGUSER'] = config["username"] if config["username"] - ENV['PGHOST'] = config["host"] if config["host"] - ENV['PGPORT'] = config["port"].to_s if config["port"] - ENV['PGPASSWORD'] = config["password"].to_s if config["password"] + args = { + 'username' => 'PGUSER', + 'host' => 'PGHOST', + 'port' => 'PGPORT', + 'password' => 'PGPASSWORD', + # SSL + 'sslmode' => 'PGSSLMODE', + 'sslkey' => 'PGSSLKEY', + 'sslcert' => 'PGSSLCERT', + 'sslrootcert' => 'PGSSLROOTCERT', + 'sslcrl' => 'PGSSLCRL', + 'sslcompression' => 'PGSSLCOMPRESSION' + } + args.each { |opt, arg| ENV[arg] = config[opt].to_s if config[opt] } end def report_success(success) |