mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
Allow psql client certificate authentication
This commit is contained in:
parent
741152dd50
commit
a5c6dab7c3
@ -86,6 +86,36 @@ changed here.
|
|||||||
|
|
||||||
Default is `prefer`.
|
Default is `prefer`.
|
||||||
|
|
||||||
|
`PAPERLESS_DBSSLROOTCERT=<ca-path>`
|
||||||
|
|
||||||
|
: SSL root certificate path
|
||||||
|
|
||||||
|
See [the official documentation about
|
||||||
|
sslmode](https://www.postgresql.org/docs/current/libpq-ssl.html).
|
||||||
|
Changes path of `root.crt`.
|
||||||
|
|
||||||
|
Defaults to unset, using the documented path in the home directory.
|
||||||
|
|
||||||
|
`PAPERLESS_DBSSLCERT=<client-cert-path>`
|
||||||
|
|
||||||
|
: SSL client certificate path
|
||||||
|
|
||||||
|
See [the official documentation about
|
||||||
|
sslmode](https://www.postgresql.org/docs/current/libpq-ssl.html).
|
||||||
|
Changes path of `postgresql.crt`.
|
||||||
|
|
||||||
|
Defaults to unset, using the documented path in the home directory.
|
||||||
|
|
||||||
|
`PAPERLESS_DBSSLKEY=<client-cert-key>`
|
||||||
|
|
||||||
|
: SSL client key path
|
||||||
|
|
||||||
|
See [the official documentation about
|
||||||
|
sslmode](https://www.postgresql.org/docs/current/libpq-ssl.html).
|
||||||
|
Changes path of `postgresql.key`.
|
||||||
|
|
||||||
|
Defaults to unset, using the documented path in the home directory.
|
||||||
|
|
||||||
`PAPERLESS_DB_TIMEOUT=<float>`
|
`PAPERLESS_DB_TIMEOUT=<float>`
|
||||||
|
|
||||||
: Amount of time for a database connection to wait for the database to
|
: Amount of time for a database connection to wait for the database to
|
||||||
|
@ -509,7 +509,12 @@ if os.getenv("PAPERLESS_DBHOST"):
|
|||||||
|
|
||||||
else: # Default to PostgresDB
|
else: # Default to PostgresDB
|
||||||
engine = "django.db.backends.postgresql_psycopg2"
|
engine = "django.db.backends.postgresql_psycopg2"
|
||||||
options = {"sslmode": os.getenv("PAPERLESS_DBSSLMODE", "prefer")}
|
options = {
|
||||||
|
"sslmode": os.getenv("PAPERLESS_DBSSLMODE", "prefer"),
|
||||||
|
"sslrootcert": os.getenv("PAPERLESS_DBSSLROOTCERT", None),
|
||||||
|
"sslcert": os.getenv("PAPERLESS_DBSSLCERT", None),
|
||||||
|
"sslkey": os.getenv("PAPERLESS_DBSSLKEY", None),
|
||||||
|
}
|
||||||
|
|
||||||
DATABASES["default"]["ENGINE"] = engine
|
DATABASES["default"]["ENGINE"] = engine
|
||||||
DATABASES["default"]["OPTIONS"].update(options)
|
DATABASES["default"]["OPTIONS"].update(options)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user