forked from mtusi2026/mtusi2026lab4
28 lines
1013 B
Python
28 lines
1013 B
Python
import os
|
|
import secrets
|
|
|
|
|
|
class Config:
|
|
DATABASE_URL: str = os.getenv(
|
|
"DATABASE_URL",
|
|
"postgresql://messenger:messenger@localhost:5432/messenger",
|
|
)
|
|
SESSION_TTL_SECONDS: int = int(os.getenv("SESSION_TTL_SECONDS", "3600"))
|
|
APP_HOST: str = os.getenv("APP_HOST", "0.0.0.0")
|
|
APP_PORT: int = int(os.getenv("APP_PORT", "8080"))
|
|
SESSION_STORE: str = os.getenv("SESSION_STORE", "postgres")
|
|
CACHE_URL: str = os.getenv(
|
|
"CACHE_URL",
|
|
"redis://valkey:6379/0",
|
|
)
|
|
INSTANCE_ID: str = os.getenv("INSTANCE_ID") or secrets.token_hex(6)
|
|
|
|
S3_ENDPOINT: str = os.getenv("S3_ENDPOINT", "minio:9000")
|
|
S3_PUBLIC_ENDPOINT: str = os.getenv("S3_PUBLIC_ENDPOINT", "localhost:9000")
|
|
S3_ACCESS_KEY: str = os.getenv("S3_ACCESS_KEY", "minioadmin")
|
|
S3_SECRET_KEY: str = os.getenv("S3_SECRET_KEY", "minioadmin")
|
|
S3_BUCKET: str = os.getenv("S3_BUCKET", "attachments")
|
|
S3_SECURE: bool = os.getenv("S3_SECURE", "false").lower() == "true"
|
|
|
|
|
|
config = Config() |