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:
ericwyuan
2026-08-28 09:29:09 +08:00
parent cf3d145c57
commit 09708bd9a4
2 changed files with 1 additions and 3 deletions

View File

@@ -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