nomadro/apps/api/services/social_svc/config.py
Eric 4789785f11 Ship remaining business changes across social API, miniprogram audit/book, VIP track, and deploy.
Includes social realtime entrypoints, weapp audit book surfaces, VIP analytics track routes, MiroTalk/Centrifugo deploy helpers, and related admin/config wiring. Excludes local DB dumps and .tmp probe scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-01 17:10:10 +08:00

23 lines
984 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from __future__ import annotations
import os
from pathlib import Path
# 默认写在仓库 data/social,与 PocketBase / community 目录分离
_ROOT = Path(__file__).resolve().parents[4] # nomadro/
_DEFAULT_DB = _ROOT / "data" / "social" / "social.db"
SOCIAL_DB_PATH = Path(os.getenv("SOCIAL_DB_PATH", str(_DEFAULT_DB))).resolve()
SOCIAL_ENABLED = os.getenv("SOCIAL_ENABLED", "true").lower() in {"1", "true", "yes", "on"}
# Centrifugo(实时层;缺省关,部署后用环境变量打开)
CENTRIFUGO_ENABLED = os.getenv("CENTRIFUGO_ENABLED", "false").lower() in {"1", "true", "yes", "on"}
CENTRIFUGO_API_URL = os.getenv("CENTRIFUGO_API_URL", "http://127.0.0.1:8008/api").rstrip("/")
CENTRIFUGO_API_KEY = os.getenv("CENTRIFUGO_API_KEY", "")
CENTRIFUGO_TOKEN_SECRET = os.getenv("CENTRIFUGO_TOKEN_SECRET", "")
# 浏览器 WebSocket(经 nginx 反代,与门户同域)
CENTRIFUGO_WS_URL = os.getenv(
"CENTRIFUGO_WS_URL",
"wss://nomadro.cn/rt/connection/websocket",
)