You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1.2 KiB
25 lines
1.2 KiB
from dataclasses import dataclass
|
|
import os
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Settings:
|
|
database_url: str = os.getenv(
|
|
"DATABASE_URL",
|
|
"mysql+pymysql://root:password@127.0.0.1:3306/dating_app?charset=utf8mb4",
|
|
)
|
|
jwt_secret: str = os.getenv("JWT_SECRET", "change-this-in-production")
|
|
jwt_expire_minutes: int = int(os.getenv("ACCESS_TOKEN_EXPIRE_MINUTES", os.getenv("JWT_EXPIRE_MINUTES", "15")))
|
|
refresh_token_expire_days: int = int(os.getenv("REFRESH_TOKEN_EXPIRE_DAYS", "30"))
|
|
upload_dir: str = os.getenv("UPLOAD_DIR", "./uploads")
|
|
dev_return_codes: bool = os.getenv("DEV_RETURN_CODES", "true").lower() == "true"
|
|
oss_enabled: bool = os.getenv("OSS_ENABLED", "false").lower() == "true"
|
|
oss_endpoint: str = os.getenv("OSS_ENDPOINT", "https://oss-cn-shanghai.aliyuncs.com")
|
|
oss_access_key_id: str = os.getenv("OSS_ACCESS_KEY_ID", "")
|
|
oss_access_key_secret: str = os.getenv("OSS_ACCESS_KEY_SECRET", "")
|
|
oss_bucket_name: str = os.getenv("OSS_BUCKET_NAME", "bs-qinghe")
|
|
oss_base_prefix: str = os.getenv("OSS_BASE_PREFIX", "melove/")
|
|
oss_domain: str = os.getenv("OSS_DOMAIN", "https://oss.baskbuddy.com")
|
|
|
|
|
|
settings = Settings()
|
|
|