forked from mtusi2026/mtusi2026lab5
29 lines
1.2 KiB
Python
29 lines
1.2 KiB
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"
|
|
|
|
RABBITMQ_URL: str = os.getenv("RABBITMQ_URL", "amqp://messenger:messenger@rabbitmq:5672/")
|
|
RABBITMQ_QUEUE: str = os.getenv("RABBITMQ_QUEUE", "attachment.process.v1")
|
|
MAX_ATTEMPTS: int = int(os.getenv("MAX_ATTEMPTS", "5"))
|
|
|
|
|
|
config = Config() |