mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-10 16:46:50 +01:00
Add SSL Support for MariaDB (#3444)
* Add ssl options for mariadb * Add ssl mode for mariadb Add ssl mode as documented in https://mysqlclient.readthedocs.io/user_guide.html#functions-and-attributes * run linting over settings.py * Add docs for SSL mode with MariaDB --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
parent
07e07fc7e8
commit
30f73f39a0
2 changed files with 32 additions and 7 deletions
|
|
@ -506,7 +506,16 @@ if os.getenv("PAPERLESS_DBHOST"):
|
|||
# Leave room for future extensibility
|
||||
if os.getenv("PAPERLESS_DBENGINE") == "mariadb":
|
||||
engine = "django.db.backends.mysql"
|
||||
options = {"read_default_file": "/etc/mysql/my.cnf", "charset": "utf8mb4"}
|
||||
options = {
|
||||
"read_default_file": "/etc/mysql/my.cnf",
|
||||
"charset": "utf8mb4",
|
||||
"ssl": {
|
||||
"ssl_mode": os.getenv("PAPERLESS_DBSSLMODE", "PREFERRED"),
|
||||
"ca": os.getenv("PAPERLESS_DBSSLROOTCERT", None),
|
||||
"cert": os.getenv("PAPERLESS_DBSSLCERT", None),
|
||||
"key": os.getenv("PAPERLESS_DBSSLKEY", None),
|
||||
},
|
||||
}
|
||||
|
||||
# Silence Django error on old MariaDB versions.
|
||||
# VARCHAR can support > 255 in modern versions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue