Add flexible IP access control to WebUI config

Replaces the 'disableNonLANAccess' option with a more flexible access control system supporting 'none', 'whitelist', and 'blacklist' modes, along with IP list and X-Forwarded-For support. Updates backend API, config schema, middleware, and frontend UI to allow configuration of access control mode, IP whitelist/blacklist, and X-Forwarded-For handling. Removes legacy LAN-only access logic and updates types accordingly.
This commit is contained in:
手瓜一十雪 committed 2026-01-26 19:46:15 +08:00
1 parent 0d4ff2abe4
commit 5bc8d5ad68
9 files changed
+489 -107

No files matched your search

@@ -3,9 +3,8 @@ import {
GetWebUIConfigHandler,
GetDisableWebUIHandler,
UpdateDisableWebUIHandler,
GetDisableNonLANAccessHandler,
UpdateDisableNonLANAccessHandler,
UpdateWebUIConfigHandler,
GetClientIPHandler,
} from '@/napcat-webui-backend/src/api/WebUIConfig';
const router: Router = Router();
@@ -22,10 +21,7 @@ router.get('/GetDisableWebUI', GetDisableWebUIHandler);
// 更新是否禁用WebUI
router.post('/UpdateDisableWebUI', UpdateDisableWebUIHandler);
// 获取是否禁用非局域网访问
router.get('/GetDisableNonLANAccess', GetDisableNonLANAccessHandler);
// 更新是否禁用非局域网访问
router.post('/UpdateDisableNonLANAccess', UpdateDisableNonLANAccessHandler);
// 获取当前客户端IP
router.get('/GetClientIP', GetClientIPHandler);
export { router as WebUIConfigRouter };