43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
|
|
app_name: str = "ConnectHub"
|
|
data_dir: str = "/data"
|
|
db_url: str = "postgresql+psycopg://connecthub:connecthub_pwd_change_me@postgres:5432/connecthub"
|
|
redis_url: str = "redis://redis:6379/0"
|
|
fernet_key_path: str = "/data/fernet.key"
|
|
dev_mode: bool = False
|
|
log_dir: str | None = "/data/logs"
|
|
|
|
# Auth / session
|
|
auth_enabled: bool = True
|
|
session_secret: str = "change_me_session_secret"
|
|
session_expiry_minutes: int = 1440
|
|
password_hash_algo: str = "bcrypt"
|
|
|
|
# Bootstrap admin
|
|
bootstrap_admin_username: str = "admin"
|
|
bootstrap_admin_generate: bool = True
|
|
bootstrap_admin_pass_path: str = "/data/admin.pass"
|
|
|
|
# LDAP
|
|
ldap_uri: str = "ldap://localhost:389"
|
|
ldap_bind_dn: str = ""
|
|
ldap_bind_password: str = ""
|
|
ldap_base_dn: str = ""
|
|
ldap_user_filter: str = "(uid={username})"
|
|
ldap_group_filter: str = "(member={user_dn})"
|
|
ldap_use_starttls: bool = False
|
|
ldap_verify_tls: bool = True
|
|
ldap_sync_interval_minutes: int = 5
|
|
|
|
|
|
settings = Settings()
|
|
|
|
|