1

settings: $STATE_DIRECTORY is not useful

Packages on "real servers" will set it in package params.
This commit is contained in:
Motiejus Jakštys 2024-01-15 10:24:49 +02:00
parent 2301cb2191
commit 95c67fc575

View File

@ -1,5 +1,5 @@
from pathlib import Path from pathlib import Path
from os import environ, path from os import environ
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
@ -11,9 +11,6 @@ _GEOIP_PATH = environ.get('GEOIP_PATH')
if db := environ.get('E11SYNC_DATABASE_PATH'): if db := environ.get('E11SYNC_DATABASE_PATH'):
_DATABASE_PATH = db _DATABASE_PATH = db
else: else:
if statedir := environ.get('STATE_DIRECTORY'):
_DATABASE_PATH = path.join(statedir, 'db.sqlite3')
else:
_DATABASE_PATH = BASE_DIR / 'db.sqlite3' _DATABASE_PATH = BASE_DIR / 'db.sqlite3'
if secret_path := environ.get("E11SYNC_SECRET_KEY_PATH"): if secret_path := environ.get("E11SYNC_SECRET_KEY_PATH"):