1
0
mirror of https://github.com/etesync/server synced 2024-11-22 08:48:07 +00:00

feat(config): allow specifying engine-specific database options (#135)

These are required to e.g. use PostgreSQL client certificates using
sslcert=/sslkey=.
This commit is contained in:
Xiretza 2022-05-09 16:32:35 +02:00 committed by GitHub
parent c6b1b855df
commit 04ca0ae5db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -18,3 +18,6 @@ allowed_host1 = example.com
[database]
engine = django.db.backends.sqlite3
name = db.sqlite3
[database-options]
; Add engine-specific options here, such as postgresql parameter key words

View File

@ -164,6 +164,9 @@ if any(os.path.isfile(x) for x in config_locations):
if "database" in config:
DATABASES = {"default": {x.upper(): y for x, y in config.items("database")}}
if "database-options" in config:
DATABASES["default"]["OPTIONS"] = config["database-options"]
ETEBASE_CREATE_USER_FUNC = "django_etebase.utils.create_user_blocked"
# Efficient file streaming (for large files)