Brain Service: - Playwright stealth crawler replacing browserless (og:image, Readability, Reddit JSON API) - AI classification with tag definitions and folder assignment - YouTube video download via yt-dlp - Karakeep migration complete (96 items) - Taxonomy management (folders with icons/colors, tags) - Discovery shuffle, sort options, search (Meilisearch + pgvector) - Item tag/folder editing, card color accents RSS Reader Service: - Custom FastAPI reader replacing Miniflux - Feed management (add/delete/refresh), category support - Full article extraction via Readability - Background content fetching for new entries - Mark all read with confirmation - Infinite scroll, retention cleanup (30/60 day) - 17 feeds migrated from Miniflux iOS App (SwiftUI): - Native iOS 17+ app with @Observable architecture - Cookie-based auth, configurable gateway URL - Dashboard with custom background photo + frosted glass widgets - Full fitness module (today/templates/goals/food library) - AI assistant chat (fitness + brain, raw JSON state management) - 120fps ProMotion support AI Assistants (Gateway): - Unified dispatcher with fitness/brain domain detection - Fitness: natural language food logging, photo analysis, multi-item splitting - Brain: save/append/update/delete notes, search & answer, undo support - Madiha user gets fitness-only (brain disabled) Firefox Extension: - One-click save to Brain from any page - Login with platform credentials - Right-click context menu (save page/link/image) - Notes field for URL saves - Signed and published on AMO Other: - Reader bookmark button routes to Brain (was Karakeep) - Fitness food library with "Add" button + add-to-meal popup - Kindle send file size check (25MB SMTP2GO limit) - Atelier UI as default (useAtelierShell=true) - Mobile upload box in nav drawer Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
74 lines
3.4 KiB
Python
74 lines
3.4 KiB
Python
"""
|
|
Platform Gateway — Configuration constants and environment variables.
|
|
"""
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
# ── Server ──
|
|
PORT = int(os.environ.get("PORT", 8100))
|
|
DATA_DIR = Path(os.environ.get("DATA_DIR", "/app/data"))
|
|
DB_PATH = DATA_DIR / "platform.db"
|
|
|
|
# ── Service backends ──
|
|
TRIPS_URL = os.environ.get("TRIPS_BACKEND_URL", "http://localhost:8087")
|
|
FITNESS_URL = os.environ.get("FITNESS_BACKEND_URL", "http://localhost:8095")
|
|
INVENTORY_URL = os.environ.get("INVENTORY_BACKEND_URL", "http://localhost:4499")
|
|
NOCODB_API_TOKEN = os.environ.get("NOCODB_API_TOKEN", "")
|
|
MINIFLUX_URL = os.environ.get("MINIFLUX_URL", "http://localhost:8767")
|
|
MINIFLUX_API_KEY = os.environ.get("MINIFLUX_API_KEY", "")
|
|
READER_URL = os.environ.get("READER_BACKEND_URL", "http://reader-api:8300")
|
|
TRIPS_API_TOKEN = os.environ.get("TRIPS_API_TOKEN", "")
|
|
SHELFMARK_URL = os.environ.get("SHELFMARK_URL", "http://shelfmark:8084")
|
|
SPOTIZERR_URL = os.environ.get("SPOTIZERR_URL", "http://spotizerr-app:7171")
|
|
BUDGET_URL = os.environ.get("BUDGET_BACKEND_URL", "http://localhost:3001")
|
|
TASKS_URL = os.environ.get("TASKS_BACKEND_URL", "http://tasks-service:8098")
|
|
BRAIN_URL = os.environ.get("BRAIN_BACKEND_URL", "http://brain-api:8200")
|
|
|
|
# ── Service API keys (for internal service auth) ──
|
|
INVENTORY_SERVICE_API_KEY = os.environ.get("INVENTORY_SERVICE_API_KEY", "")
|
|
BUDGET_SERVICE_API_KEY = os.environ.get("BUDGET_SERVICE_API_KEY", "")
|
|
TASKS_SERVICE_API_KEY = os.environ.get("TASKS_SERVICE_API_KEY", "")
|
|
|
|
# ── Booklore (book library manager) ──
|
|
BOOKLORE_URL = os.environ.get("BOOKLORE_URL", "http://booklore:6060")
|
|
BOOKLORE_USER = os.environ.get("BOOKLORE_USER", "")
|
|
BOOKLORE_PASS = os.environ.get("BOOKLORE_PASS", "")
|
|
BOOKLORE_BOOKS_DIR = Path("/booklore-books")
|
|
BOOKDROP_DIR = Path("/bookdrop")
|
|
|
|
# ── SMTP2GO (email / Send to Kindle) ──
|
|
SMTP2GO_API_KEY = os.environ.get("SMTP2GO_API_KEY", "")
|
|
SMTP2GO_FROM_EMAIL = os.environ.get("SMTP2GO_FROM_EMAIL", "")
|
|
SMTP2GO_FROM_NAME = os.environ.get("SMTP2GO_FROM_NAME", "Platform")
|
|
KINDLE_EMAIL_1 = os.environ.get("KINDLE_EMAIL_1", "")
|
|
KINDLE_EMAIL_2 = os.environ.get("KINDLE_EMAIL_2", "")
|
|
KINDLE_LABELS = os.environ.get("KINDLE_LABELS", "Kindle 1,Kindle 2")
|
|
|
|
# ── Karakeep (bookmarking) ──
|
|
KARAKEEP_URL = os.environ.get("KARAKEEP_URL", "http://192.168.1.42:3005")
|
|
KARAKEEP_API_KEY = os.environ.get("KARAKEEP_API_KEY", "")
|
|
|
|
# ── qBittorrent ──
|
|
QBITTORRENT_HOST = os.environ.get("QBITTORRENT_HOST", "192.168.1.42")
|
|
QBITTORRENT_PORT = os.environ.get("QBITTORRENT_PORT", "8080")
|
|
QBITTORRENT_USERNAME = os.environ.get("QBITTORRENT_USERNAME", "admin")
|
|
QBITTORRENT_PASSWORD = os.environ.get("QBITTORRENT_PASSWORD", "")
|
|
|
|
# ── AI ──
|
|
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY", "")
|
|
OPENAI_MODEL = os.environ.get("OPENAI_MODEL", "gpt-5.2")
|
|
|
|
# ── Session config ──
|
|
SESSION_MAX_AGE = int(os.environ.get("SESSION_MAX_AGE", 30 * 86400)) # 30 days
|
|
DEV_AUTO_LOGIN = os.environ.get("DEV_AUTO_LOGIN", "").lower() in {"1", "true", "yes", "on"}
|
|
DEV_AUTO_LOGIN_USERNAME = os.environ.get("DEV_AUTO_LOGIN_USERNAME", "dev")
|
|
DEV_AUTO_LOGIN_DISPLAY_NAME = os.environ.get("DEV_AUTO_LOGIN_DISPLAY_NAME", "Dev User")
|
|
|
|
# ── Ensure data dir exists ──
|
|
DATA_DIR.mkdir(parents=True, exist_ok=True)
|
|
|
|
# Note: All internal services use plain HTTP (Docker network).
|
|
# No custom SSL context needed. External calls (OpenAI, SMTP2GO, Open Library)
|
|
# use default TLS verification.
|