Stage 04.1 - storage foundation (PostgreSQL) and system dashboard UI

This commit is contained in:
2026-04-14 21:38:52 +03:00
parent 1deb676585
commit c2ed535d56
16 changed files with 563 additions and 80 deletions

View File

@@ -21,6 +21,11 @@ class Settings:
exchange_timeout_sec: int
exchange_testnet: bool
default_symbol: str
db_host: str
db_port: int
db_name: str
db_user: str
db_password: str
def _parse_bool(raw_value: str, default: bool = False) -> bool:
value = (raw_value or "").strip().lower()
if not value:
@@ -49,4 +54,9 @@ def load_settings() -> Settings:
exchange_timeout_sec=_parse_int(os.getenv("EXCHANGE_TIMEOUT_SEC", "10"), 10),
exchange_testnet=_parse_bool(os.getenv("EXCHANGE_TESTNET", "false")),
default_symbol=os.getenv("DEFAULT_SYMBOL", "BTC/USD_LEVERAGE").strip() or "BTC/USD_LEVERAGE",
db_host=os.getenv("DB_HOST", "localhost").strip() or "localhost",
db_port=_parse_int(os.getenv("DB_PORT", "5432"), 5432),
db_name=os.getenv("DB_NAME", "dzentra_bot").strip() or "dzentra_bot",
db_user=os.getenv("DB_USER", "dzentra_bot").strip() or "dzentra_bot",
db_password=os.getenv("DB_PASSWORD", "").strip(),
)