Commit Graph

12 Commits

Author SHA1 Message Date
dekun db251c39bf fix: stop panel stats from hanging on Clash /traffic WebSocket
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 10:59:45 +08:00
dekun d75193d527 fix: resolve stuck detecting state for panel stats on subpath deploy
Always inject panel_base from PANEL_PATH for static/API URLs and set
SCRIPT_NAME in middleware so /api/stats works behind nginx subpaths.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 10:31:58 +08:00
dekun ba361eb5b8 fix: prevent [No Host] panel errors behind CDN or missing Host header
Force nginx to pass the domain as Host, add PANEL_DOMAIN fallback in Flask,
and document that the admin panel must be accessed over HTTP not HTTPS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 10:28:00 +08:00
dekun 6d82c7eb07 fix: improve online detection when Clash API omits user metadata
Match connections by multiple auth keys, fall back to global traffic for
single-node setups, and document offline-status troubleshooting.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 10:22:13 +08:00
dekun 9ebab211dd fix: make copy buttons work on HTTP panel pages
Read share links from input fields and fall back to execCommand when
Clipboard API is unavailable outside secure contexts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 10:17:04 +08:00
dekun d339fbd917 fix: prefix panel API requests with subpath for nginx proxy
Stats and node API calls were hitting /api/* at the site root instead of
the hidden PANEL_PATH, causing stats to show unavailable behind nginx.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 10:06:10 +08:00
dekun 6edba863b5 fix: use Clash API only for traffic stats on stock sing-box builds
Official sing-box binaries lack v2ray_api, so drop that config and grpcio
and track per-node traffic from Clash connection stats instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 10:02:41 +08:00
dekun ccf7e2a4c7 feat: show node connection status and traffic stats in admin panel
Enable sing-box Clash/V2Ray APIs for per-user metrics, persist cumulative
traffic in SQLite, and refresh the dashboard every five seconds.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 09:57:16 +08:00
dekun f0a3317e8b feat: proxy admin panel via nginx port 80 to avoid exposing 8444
Route the panel through a secret subpath on port 80, remove the separate
8444 listener, and document common troubleshooting in docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 09:45:26 +08:00
dekun 59a88a9afe fix: panel init without werkzeug; stop tracking .env
Use stdlib pbkdf2 for admin passwords so init_db works reliably.
Remove .env from git to avoid pull conflicts on VPS.
Verify flask install before database init.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 09:17:43 +08:00
dekun 042ae5a422 fix: run init_db with panel venv python
Use venv interpreter so werkzeug is available; sync admin user from .env on init.
Set default panel username to dekun.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 09:14:12 +08:00
dekun bccf6cfdce feat: add web admin panel for node management
Add Flask panel with login, add/delete nodes, and share link copy.
Generate sing-box config from SQLite; add uninstall script and clean install flow.
Panel served at https://DOMAIN:8444 via nginx.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 09:10:19 +08:00