mvp implementation
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""Runtime configuration for the officeconvert Connect server."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
import os
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class ServerConfig:
|
||||
"""Defines environment-driven settings for server orchestration."""
|
||||
|
||||
minio_endpoint: str
|
||||
minio_access_key: str
|
||||
minio_secret_key: str
|
||||
minio_secure: bool
|
||||
minio_public_endpoint: str
|
||||
minio_session_ttl_seconds: int
|
||||
conversion_cleanup_delay_seconds: int
|
||||
|
||||
|
||||
def load_server_config() -> ServerConfig:
|
||||
"""Load server configuration from environment variables."""
|
||||
return ServerConfig(
|
||||
minio_endpoint=os.getenv("MINIO_ENDPOINT", "localhost:9000"),
|
||||
minio_access_key=os.getenv("MINIO_ACCESS_KEY", "minioadmin"),
|
||||
minio_secret_key=os.getenv("MINIO_SECRET_KEY", "minioadmin"),
|
||||
minio_secure=os.getenv("MINIO_USE_SSL", "false").lower() == "true",
|
||||
minio_public_endpoint=os.getenv("MINIO_PUBLIC_ENDPOINT", "localhost:9000"),
|
||||
minio_session_ttl_seconds=int(os.getenv("MINIO_SESSION_TTL_SECONDS", "3600")),
|
||||
conversion_cleanup_delay_seconds=int(
|
||||
os.getenv("CONVERSION_CLEANUP_DELAY_SECONDS", "3600")
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user