BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c67271cd
Commit
c67271cd
authored
Mar 05, 2017
by
Guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Database SSL support for backup script.
parent
76a15db4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
1440-db-backup-ssl-support.yml
changelogs/unreleased/1440-db-backup-ssl-support.yml
+4
-0
database.rb
lib/backup/database.rb
+21
-5
No files found.
changelogs/unreleased/1440-db-backup-ssl-support.yml
0 → 100644
View file @
c67271cd
---
title
:
Database SSL support for backup script.
merge_request
:
9715
author
:
Guillaume Simon
lib/backup/database.rb
View file @
c67271cd
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment