[功能] FAM-Core 登录校验 + frp 外网暴露 8000 - 新增 auth 模块(POST /api/login 校验 FAM_AUTH_USER/PASS 默认 ericwyuan/iLoveJava5, HttpOnly cookie 7天, 页面未登录 302 /login, /api/* 未登录 401; 白名单: /login /health /api/ss/webhook /assets/*); 内置深色登录页(SPA 零改动); frpc.toml 增加 fam-core 代理 外网8000->NAS8000

This commit is contained in:
ericwyuan
2026-08-22 14:19:54 +08:00
parent 1dd9df34c2
commit 9c51c65e62
2 changed files with 209 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ from .img_proxy import img_bp
from .motion_bp import motion_bp
from .ui_api import ui_bp
from .static_app import static_bp
from .auth import auth_bp, init_auth
logger = setup_logger('fam-core.app')
@@ -36,8 +37,12 @@ app.register_blueprint(member_bp)
app.register_blueprint(img_bp)
app.register_blueprint(motion_bp)
app.register_blueprint(ui_bp)
app.register_blueprint(auth_bp) # 登录页 /api/login 等static_bp 通配之前)
app.register_blueprint(static_bp)
# 登录校验全局拦截(页面未登录 302 /login/api/* 未登录 401
init_auth(app)
# 健康检查
@app.route('/health', methods=['GET'])
def health():