Collect official crypto and US policy documents with deterministic screening, full bodies and attachments, bounded retries, and durable history cursors. Preserve publication precision and source identity while keeping new collectors disabled. Add real Congress, GovInfo, DOJ and Federal Register fixtures, offline capture replay, isolated database validation, and rollout instructions. Validate 982 backend tests, frontend checks, and 57 deployment control tests.
28 lines
731 B
Python
28 lines
731 B
Python
from functools import lru_cache
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# 容器内由 compose 的 env_file 注入;只有一套配置,见仓库根目录 .env
|
|
model_config = SettingsConfigDict(extra="ignore")
|
|
|
|
congress_api_key: str = ""
|
|
crawler_contact_email: str = ""
|
|
|
|
searxng_url: str = "http://searxng:8080"
|
|
database_url: str
|
|
redis_url: str
|
|
jwt_secret: str
|
|
admin_username: str
|
|
admin_password_hash: str = ""
|
|
login_captcha_enabled: bool = False
|
|
jwt_expire_days: int = 7
|
|
# Fernet 密钥,加密存库的第三方 API key
|
|
secret_encryption_key: str
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|