fix(fam-core): 修复 /api/status 和 /api/ss/status 500(移除 Webhook 重构遗留死引用)
上次"移除 SS Webhook 可选路径"重构(cf3d145)删掉了 MotionNotifier 的 camera_name_to_id/_ss_name_to_id/_camera_loaded 三个属性初始化,但 status() 方法忘记同步删除对它们的引用,导致任何调用 status() 的地方 (/api/status、/api/ss/status)直接抛 AttributeError 500——这两个端点 自那次重构部署后就一直是坏的,服务状态页无法访问。 顺带修 test_auth.py 里断言 /api/ss/webhook 应该被鉴权白名单放行的过时 测试——这个端点本身已经在同一次重构里被彻底删除(motion_bp.py 不再 注册该路由),白名单移除是对的,是测试没跟上。 已在 NAS 上部署验证:登录后 /api/status 恢复正常返回。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -360,8 +360,6 @@ class MotionNotifier:
|
||||
"running": self.is_alive(),
|
||||
"enabled": self.enabled,
|
||||
"poll_enabled": self.poll_enabled,
|
||||
"camera_map": {**self.camera_name_to_id, **self._ss_name_to_id},
|
||||
"camera_loaded": self._camera_loaded,
|
||||
"last_event_id": self._last_event_id,
|
||||
"zero_dur_pending": len(self._zero_dur_ids),
|
||||
"last_poll_at": self._last_poll_at.isoformat() if self._last_poll_at else None,
|
||||
|
||||
@@ -93,7 +93,7 @@ def test_is_authed_false_without_cookie():
|
||||
|
||||
def test_whitelist_exact_paths():
|
||||
for path in ('/login', '/api/login', '/api/logout', '/api/auth/check',
|
||||
'/health', '/favicon.ico', '/api/ss/webhook'):
|
||||
'/health', '/favicon.ico'):
|
||||
assert auth._is_whitelisted(path) is True
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user