[deploy] PyMySQL 替换 + Tailscale 组网 + config.yaml + 路径修复

- db_layer.py: mysql-connector-python(19MB) → PyMySQL(45KB), 去掉连接池
- config_loader.py: 修复路径解析 (2级→3级 dirname), FAM-Core + FAM-Edge 均修复
- Tailscale 组网完成: Oracle=100.74.137.126, NAS=100.70.234.39, 互通验证通过
- NAS Python 依赖: flask/gunicorn/pymysql/PyYAML 全部安装成功
- NAS 代码部署: /volume1/web/sentinel-home-ai/, FAM-Core 7 模块导入 PASS
- NAS DB 连接验证: PyMySQL → MariaDB 10.11.11, 6 张表可见, PASS
- config.yaml 创建: FAM-Core + FAM-Edge + FAM-UI (Tailscale IP + 密码)
- requirements.txt: mysql-connector-python → PyMySQL
This commit is contained in:
ericwyuan
2026-08-19 23:27:28 +08:00
parent e5ac667586
commit 47658fa068
8 changed files with 149 additions and 53 deletions

View File

@@ -0,0 +1,54 @@
# FAM-Edge 配置文件 (Oracle 端) - 实际部署配置
# Tailscale: Oracle=100.74.137.126, NAS=100.70.234.39
# NAS 端回调地址
nas:
webhook_url: "http://100.70.234.39:8000/api/core/callback/event"
media_base_url: "http://100.70.234.39:8000/media"
media_token: "sentinel-media-2026"
# Oracle 端服务
server:
host: "0.0.0.0"
port: 5000
max_concurrent_tasks: 1
# 关键帧筛选参数
video:
candidate_frames: 30
min_key_frames: 5
max_key_frames: 8
mse_threshold: 500
jpeg_quality: 80
max_long_edge: 1024
# 超时(秒)
timeout:
download: 60
vlm_visual: 240
vlm_fusion: 120
callback: 30
overall: 600
# 模型清单
models:
- provider: "ollama"
enabled: true
model_name: "llava-phi3"
base_url: "http://localhost:11434"
timeout: 240
num_predict: 500
circuit_breaker:
enabled: false
threshold: 5
cooldown: 900
- provider: "gemini"
enabled: false
model_name: "gemini-1.5-flash"
api_key: ""
timeout: 8
circuit_breaker:
enabled: true
threshold: 5
cooldown: 900

View File

@@ -22,7 +22,7 @@ def _resolve_env_vars(value):
def load_config(config_path=None):
if config_path is None:
config_path = os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))),
'config', 'config.yaml'
)
with open(config_path, 'r', encoding='utf-8') as f: