Rename PostgreSQL SSL config variables

e.g. s/sslmode/ssl_mode/g to conform with borgmatic naming conventions.
This commit is contained in:
Edward Shornock 2020-06-19 12:46:27 +03:00
parent 33113890f5
commit a16fed8887
2 changed files with 14 additions and 14 deletions

View file

@ -556,7 +556,7 @@ map:
documentation for details. Note that format is
ignored when the database name is "all".
example: directory
sslmode:
ssl_mode:
type: str
enum: ['disable', 'allow', 'prefer', 'require', 'verify-ca', 'verify-full']
desc: |
@ -564,22 +564,22 @@ map:
"require", "verify-ca" or "verify-full". Defaults to "disable". See
https://www.postgresql.org/docs/current/libpq-ssl.html for details.
example: disable
sslcert:
ssl_cert:
type: str
desc: |
Path to a client certificate.
example: "/root/.postgresql/postgresql.crt"
sslkey:
ssl_key:
type: str
desc: |
Path to a private client key.
example: "/root/.postgresql/postgresql.key"
sslrootcert:
ssl_root_cert:
type: str
desc: |
Path to a root certificate containing a list of trusted certificate authorities.
example: "/root/.postgresql/root.crt"
sslcrl:
ssl_crl:
type: str
desc: |
Path to a certificate revocation list.

View file

@ -22,15 +22,15 @@ def make_extra_environment(database):
extra = dict()
if 'password' in database:
extra['PGPASSWORD'] = database['password']
extra['PGSSLMODE'] = database.get('sslmode', 'disable')
if 'sslcert' in database:
extra['PGSSLCERT'] = database['sslcert']
if 'sslkey' in database:
extra['PGSSLKEY'] = database['sslkey']
if 'sslrootcert' in database:
extra['PGSSLROOTCERT'] = database['sslrootcert']
if 'sslcrl' in database:
extra['PGSSLCRL'] = database['sslcrl']
extra['PGSSLMODE'] = database.get('ssl_mode', 'disable')
if 'ssl_cert' in database:
extra['PGSSLCERT'] = database['ssl_cert']
if 'ssl_key' in database:
extra['PGSSLKEY'] = database['ssl_key']
if 'ssl_root_cert' in database:
extra['PGSSLROOTCERT'] = database['ssl_root_cert']
if 'ssl_crl' in database:
extra['PGSSLCRL'] = database['ssl_crl']
return extra