All checks were successful
Deploy / deploy (push) Successful in 30s
- Full FastAPI sync engine: master→replica document sync via paperless REST API - Web UI: dashboard, replicas, logs, settings (Jinja2 + HTMX + Pico CSS) - APScheduler background sync, SSE live log stream, Prometheus metrics - Fernet encryption for API tokens at rest - pngx.env credential file: written on save, pre-fills forms on load - Dockerfile with layer-cached uv build, Python healthcheck - docker-compose with host networking for Tailscale access - Gitea Actions workflow: version bump, secret injection, docker compose deploy Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25 lines
719 B
Python
25 lines
719 B
Python
import os
|
|
from functools import lru_cache
|
|
|
|
|
|
class Config:
|
|
def __init__(self) -> None:
|
|
self.secret_key: str = os.environ.get("SECRET_KEY", "")
|
|
self.database_url: str = os.environ.get("DATABASE_URL", "sqlite:////data/db.sqlite3")
|
|
self.master_url: str | None = os.environ.get("MASTER_URL")
|
|
self.master_token: str | None = os.environ.get("MASTER_TOKEN")
|
|
|
|
@property
|
|
def db_path(self) -> str:
|
|
url = self.database_url
|
|
if url.startswith("sqlite:////"):
|
|
return "/" + url[len("sqlite:////"):]
|
|
if url.startswith("sqlite:///"):
|
|
return url[len("sqlite:///"):]
|
|
return url
|
|
|
|
|
|
@lru_cache
|
|
def get_config() -> Config:
|
|
return Config()
|