diff --git a/borgmatic/config/schema.yaml b/borgmatic/config/schema.yaml index 210148b..bddd6fb 100644 --- a/borgmatic/config/schema.yaml +++ b/borgmatic/config/schema.yaml @@ -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. diff --git a/borgmatic/hooks/postgresql.py b/borgmatic/hooks/postgresql.py index 765d92a..f566090 100644 --- a/borgmatic/hooks/postgresql.py +++ b/borgmatic/hooks/postgresql.py @@ -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