212d4df42f
Build and Push Reader API Image / docker (push) Successful in 38s
- Removed mongoose dependency from package-lock.json. - Deleted legacy import tables: ImportCandidateChapter, AssetNovelMapping, ImportJob, ImportSession, SourceAsset via new script `drop_legacy_import_tables.py`. - Added script `drop_series_table.py` to drop the Series table. Co-authored-by: Copilot <copilot@github.com>
49 lines
1.3 KiB
Python
49 lines
1.3 KiB
Python
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
|
|
|
|
app_name: str = "reader-api"
|
|
app_env: str = "development"
|
|
|
|
database_url: str
|
|
|
|
google_client_id: str = ""
|
|
nextauth_secret: str = ""
|
|
mobile_jwt_secret: str = ""
|
|
|
|
cors_origins: str = "*"
|
|
r2_account_id: str = ""
|
|
r2_access_key_id: str = ""
|
|
r2_secret_access_key: str = ""
|
|
r2_bucket_name: str = ""
|
|
r2_public_base_url: str = ""
|
|
nas_content_root: str = "./data/content"
|
|
epub_source_root: str = "./data/epub-source"
|
|
chapter_content_mode: str = "nas_first"
|
|
auto_schema_bootstrap: str = "false"
|
|
|
|
deepseek_key: str = ""
|
|
deepseek_model: str = "deepseek-chat"
|
|
openrouter_key: str = ""
|
|
openrouter_paused: str = "true"
|
|
|
|
@property
|
|
def google_client_id_list(self) -> list[str]:
|
|
raw = (self.google_client_id or "").strip()
|
|
if not raw:
|
|
return []
|
|
return [item.strip() for item in raw.split(",") if item.strip()]
|
|
|
|
|
|
@property
|
|
def cors_origin_list(self) -> list[str]:
|
|
raw = (self.cors_origins or "*").strip()
|
|
if raw == "*":
|
|
return ["*"]
|
|
return [item.strip() for item in raw.split(",") if item.strip()]
|
|
|
|
|
|
settings = Settings()
|