nomadweb/backend/app/config.py
eric 96fa96c61e Migrate auth/community/social to PocketBase and wire SeaweedFS S3 uploads.
Keep FastAPI as the only backend; add media upload, ntfy hook, and PB collection bootstrap for production.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-30 11:19:30 -05:00

42 lines
1.3 KiB
Python

from pydantic_settings import BaseSettings
class Settings(BaseSettings):
pocketbase_url: str = "http://127.0.0.1:8090"
pocketbase_admin_email: str = "admin@nomadro.com"
pocketbase_admin_password: str = "Xiao4669805"
api_host: str = "0.0.0.0"
api_port: int = 8000
cors_origins: str = "http://localhost:3000,http://127.0.0.1:3000"
site_base_url: str = "https://nomadweb.nomadro.com"
# SeaweedFS S3 (s3.nomadro.com → 127.0.0.1:8333)
s3_enabled: bool = True
s3_endpoint: str = "http://127.0.0.1:8333"
s3_public_url: str = "https://s3.nomadro.com"
s3_access_key: str = "nomadweb"
s3_secret_key: str = ""
s3_bucket: str = "nomadweb"
s3_region: str = "us-east-1"
s3_upload_prefix: str = "nomadweb"
# ntfy (127.0.0.1:2586 on production server)
ntfy_enabled: bool = False
ntfy_url: str = "http://127.0.0.1:2586"
# Payment (from env on server)
dev_auto_pay: bool = False
payment_provider: str = "zpay"
mirotalk_url: str = "https://mirotalk.nomadro.com"
lounge_url: str = "https://lounge.nomadro.com"
@property
def cors_origin_list(self) -> list[str]:
return [o.strip() for o in self.cors_origins.split(",") if o.strip()]
class Config:
env_file = ".env"
settings = Settings()