守住 compose 環境變數文件契約

This commit is contained in:
OoO
2026-05-13 13:01:26 +08:00
parent acef0fa6ff
commit ae1895ff4d
2 changed files with 29 additions and 0 deletions

View File

@@ -47,6 +47,14 @@ EMAIL_RECEIVER=receiver_email@gmail.com
PUBLIC_URL=http://your_server_ip:port
NGROK_AUTH_TOKEN=your_ngrok_auth_token
# ==========================================
# Image / Release Tagdocker-compose*.yml
# ==========================================
MOMO_IMAGE=registry.wooo.work/wooo/momo-pro-system
VERSION=stable
FRONTEND_IMAGE=registry.wooo.work/wooo/momo-frontend
FRONTEND_VERSION=stable
# ==========================================
# 市場情報模組設定(預設全部關閉)
# ==========================================
@@ -344,6 +352,10 @@ MCP_POSTGRES_URL=http://127.0.0.1:3001
MCP_FIRECRAWL_URL=http://127.0.0.1:3002
MCP_OMNISEARCH_URL=http://127.0.0.1:3003
MCP_FILESYSTEM_URL=http://127.0.0.1:3004
MCP_POSTGRES_PASSWORD=your_mcp_readonly_password_here
TAVILY_API_KEY=
EXA_API_KEY=
FIRECRAWL_AUTH_KEY=momo-internal-only
MCP_TIMEOUT_SEC=30
MCP_CACHE_TTL_SEC=3600
MCP_MAX_RESULT_BYTES=65536
@@ -374,6 +386,11 @@ PG_SYNC_INTERVAL=300
# [選填] 外部 BI 連結(模板全域變數)
METABASE_URL=https://mo.wooo.work/metabase
GRIST_URL=https://grist.wooo.work
MB_SITE_URL=https://mo.wooo.work/metabase
GRIST_ADMIN_EMAIL=admin@wooo.work
GRAFANA_PASSWORD=change-me
PGADMIN_EMAIL=admin@wooo.work
PGADMIN_PASSWORD=change-me
# ──────────────────────────────────────────────────────────────────────────
# n8n Workflow Automationmonitoring profile

View File

@@ -39,6 +39,14 @@ def _runtime_env_keys_from_code() -> set[str]:
return keys
def _compose_env_keys() -> set[str]:
pattern = re.compile(r"""\$\{([A-Z][A-Z0-9_]+)(?::-[^}]*)?\}""")
keys = set()
for path in ROOT.glob("docker-compose*.yml"):
keys.update(pattern.findall(path.read_text(encoding="utf-8", errors="ignore")))
return keys
def test_phase3f_orphan_ai_services_stay_removed():
orphan_services = [
"services/elephant_alpha_decision_router.py",
@@ -151,6 +159,10 @@ def test_env_example_documents_runtime_os_env_keys():
assert _runtime_env_keys_from_code() - internal_runtime_keys <= _env_example_keys()
def test_env_example_documents_docker_compose_variables():
assert _compose_env_keys() <= _env_example_keys()
def test_scheduler_does_not_silently_swallow_exceptions():
scheduler_source = (ROOT / "scheduler.py").read_text(encoding="utf-8")