This commit is contained in:
Бахрам
2026-10-29 17:16:55 +03:00
parent 65003b6119
commit c401ece9b1
30 changed files with 1459 additions and 18 deletions
+14
View File
@@ -0,0 +1,14 @@
"""Runtime configuration; secret values are read only from mounted files."""
import os
from pathlib import Path
APP_HOST = os.getenv('APP_HOST', '0.0.0.0')
APP_PORT = int(os.getenv('APP_PORT', '8080'))
SESSION_TTL_SECONDS = int(os.getenv('SESSION_TTL_SECONDS', '3600'))
POOL_SIZE = int(os.getenv('DB_POOL_SIZE', '8'))
if SESSION_TTL_SECONDS < 1 or not 1 <= POOL_SIZE <= 32:
raise ValueError('Invalid TTL or pool size')
def secret(name):
return Path(os.environ[name + '_FILE']).read_text().strip()