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>
23 lines
984 B
Python
23 lines
984 B
Python
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",
|
||
)
|