Commit graph

1372 commits

Author SHA1 Message Date
root
605bdf1f96 fix: correct Clash Verge Rev deep link parameter order to v1.8.0.7 2026-04-27 22:26:22 +08:00
root
2e067bf9c3 fix: correct error message and add type assertion guard in batch update 2026-04-27 10:14:06 +08:00
root
d2b35f9fc4 fix: add form tags to batch update request struct 2026-04-27 09:55:18 +08:00
root
7c2079f1ae fix: use ShouldBind instead of ShouldBindJSON in batch update handler 2026-04-27 09:45:12 +08:00
root
0145548095 feat: chinese localization for backup page 2026-04-26 21:16:31 +08:00
root
45c2c75c5c fix: use correct Go template name backup.html 2026-04-26 20:52:33 +08:00
root
ace8dc3ce0 fix: use HttpUtil with relative paths and remove authHeaders from backup UI 2026-04-26 20:18:37 +08:00
root
64e8f18997 feat: add backup/restore to x-ui.sh and update assets 2026-04-26 19:53:15 +08:00
root
8a861894c9 feat: add backup UI page and frontend model fields 2026-04-26 19:46:16 +08:00
root
50d3b2cd7e feat: add BackupJob and wire up routes and scheduling 2026-04-26 19:40:13 +08:00
root
3181d5805d fix: add filename validation to downloadBackup endpoint 2026-04-26 19:37:31 +08:00
root
b84390904e feat: add BackupController API endpoints 2026-04-26 19:33:50 +08:00
root
7f3855eb9a fix: add filename validation, error handling, and safety backup visibility 2026-04-26 19:31:49 +08:00
root
5b2946a46d feat: add BackupService with dump, archive, restore logic 2026-04-26 19:22:06 +08:00
root
4da2346c62 style: fix backup getter method format to match project convention 2026-04-26 19:17:33 +08:00
root
92b297251a feat: add backup config fields to entity and setting service 2026-04-26 19:10:25 +08:00
root
1a6f7c6e53 fix: dark theme nested td visibility in selected rows, adjust batch bar margin 2026-04-26 18:11:33 +08:00
root
47b734ef2d fix: dark mode selected row background and batch toolbar layout
- Override Ant Design default selected row background in dark mode with theme color
- Restructure batch action toolbar with nested flex containers for better spacing and wrapping
- Bump version to v1.7.3.2
2026-04-26 17:40:08 +08:00
root
18bdc2baa5 feat: add batch select and batch edit for inbound clients 2026-04-26 17:11:58 +08:00
root
7ff73313a9 fix: auto-fill flow for registration-created eligible clients 2026-04-26 01:08:22 +08:00
root
b47bac3dc6 fix: default flow to vision in client add modals 2026-04-26 01:05:09 +08:00
root
e3d84b38ca fix: auto-fill vision flow for eligible new clients 2026-04-26 00:53:11 +08:00
root
d6de00cd00 fix: repair clash subscription toggle and separate clash path settings 2026-04-26 00:43:09 +08:00
root
18bba12ef1 fix: replace user quick import dropdown with direct action buttons 2026-04-26 00:26:20 +08:00
root
22d518b5c9 fix: show user quick import dropdown 2026-04-26 00:09:37 +08:00
root
3ba7e43bc3 feat: add URL Schemes for Quick Import buttons (Android/iOS/Desktop)
- Android: clash://install-config (Clash Meta for Android)
- iOS: shadowrocket://add/sub/ (Shadowrocket)
- Desktop: clash-verge://install-config (Clash Verge)
- Extended API to return subEnable/subUrl for standard subscription
2026-04-25 22:46:35 +08:00
root
aa775a111f feat: add Clash link and Quick Import button to user panel
- New API endpoint /panel/api/inbounds/userSubscriptions for non-admin users
- Redesigned /panel/user with Clash link card (copy button) and Quick Import dropdown (Android/iOS/Desktop with icons)
- Added i18n keys for en_US and zh_CN
- Bumped version to v1.7.2.5
2026-04-25 21:31:02 +08:00
root
ef9e123fcc style: gofmt web/service/setting.go 2026-04-25 20:35:10 +08:00
root
25cf22d161 feat: support full mihomo template and multi-server for Clash Link
- Add splitTemplate() to split at proxies:/proxy-groups: markers (like mihomo-gen)
- Store clash_template.yaml and servers.yaml as files alongside x-ui.json
- Add Clash/Servers editors in Xray advanced config page
- Support multi-server proxy generation (each server × each client)
- Remove inline template editor from Clash settings panel
- Bump version to v1.7.2.1
2026-04-25 18:23:42 +08:00
root
67c4f6a1ad fix: update rate limit tests to use CF-Connecting-IP header
The middleware was changed to trust CF-Connecting-IP instead of
X-Real-IP/X-Forwarded-For, but the tests still used the old headers.
TestRateLimitMiddleware_DifferentIPsIndependent was failing because
all requests fell back to the same httptest RemoteAddr.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-25 15:14:02 +08:00
root
e035fb07a9 fix: trust Cloudflare CF-Connecting-IP for IP extraction
When behind Cloudflare CDN, RemoteAddr shows CF's IP, breaking rate
limiting and logging. Trust CF-Connecting-IP (set by CF, cannot be
spoofed by clients) and fall back to RemoteAddr for direct connections.
2026-04-25 11:45:07 +08:00
root
77d276da04 fix: add login rate limiting and prevent IP spoofing via headers
- Add RateLimitMiddleware(10/min) to POST /login (previously unprotected)
- Use RemoteAddr instead of X-Real-IP/X-Forwarded-For in getRemoteIp() and rate limiter
- Prevents brute-force login and rate-limit bypass via spoofed headers
2026-04-25 11:43:03 +08:00
root
61f7956af4 fix: unify master/worker connected nodes to single a-table
Replace worker's plain HTML table with the same a-table used by master,
fixing inconsistencies: missing role column, no error ellipsis, dead-code
empty state ternary, and duplicate a-empty elements.
2026-04-25 11:14:57 +08:00
root
5ce18ebfc1 fix: use explicit closing tags for a-empty components
Self-closing custom elements (<a-empty />) are invalid in HTML5
in-DOM templates. The browser treats them as opening tags, causing
subsequent sibling elements to become children. This made the
worker's node info table a child of the hidden <a-empty>, so it
never rendered when nodes.length > 0.
2026-04-25 10:45:23 +08:00
root
66de42f21b fix: node config save, dbType mismatch, and dark theme support
- ShouldBindJSON → ShouldBind with form tags (axios sends url-encoded)
- dbType dropdown value "mysql" → "mariadb" to match backend
- Replace inline styles with theme-aware CSS classes for dark mode
2026-04-25 10:19:41 +08:00
root
5bf2b5ef88 fix: replace v-else with v-if on node info table
v-else on <table> element was not recognized by Vue template compiler,
causing the worker node info table to never render. Use v-if="nodes.length > 0"
instead to ensure the table renders when data is available.
2026-04-25 09:49:32 +08:00
root
4e49f8c072 fix: replace a-descriptions with HTML table and fix ensureDefaultNodeSettings
- Replace a-descriptions/a-descriptions-item with plain HTML table in
  nodes.html — the components were missing from the antd.min.js bundle
  due to tree-shaking, causing the worker node view to render empty
- Fix ensureDefaultNodeSettings to write defaults to both "node" and
  "other" groups for backward compatibility (tests were failing)
2026-04-25 09:36:21 +08:00
root
db2c78d0bb fix: add error logging for node state writes and queries
Silent error swallowing made it impossible to diagnose why worker
couldn't see master's heartbeat. Now logs errors from:
- updateNodeState upsert failures
- writeStateToSharedMariaDB connection/write failures
- getNodeStatesShared query failures
- list endpoint shows state count in logs

Also improved First() call to not overwrite state on error.

Bump version to v1.6.5.
2026-04-24 22:08:00 +08:00
root
226bae2b2f fix: master heartbeat not visible to workers in shared MariaDB mode
When master uses SQLite locally, updateNodeState only wrote to local DB.
Workers querying shared MariaDB never saw the master's heartbeat.

Now master also writes its heartbeat to the shared MariaDB via a
temporary connection when MariaDB connection settings are configured.

Bump version to v1.6.4.
2026-04-24 21:29:57 +08:00
root
d733ff2af1 fix: add node settings to defaultValueMap and settingGroups
Node settings (nodeRole, nodeId, syncInterval, trafficFlushInterval)
now have defaults in the settings system. On fresh install, they are
automatically created in x-ui.json under the 'node' group. The
settingGroupAliases now look in 'node' first, then 'other' for
backward compatibility.
2026-04-24 20:57:12 +08:00
root
d5bf2858ce fix: query shared MariaDB for node states instead of local DB
In shared mode, the master may use SQLite locally while workers
write heartbeats to the shared MariaDB. The /list endpoint now
opens a temporary MariaDB connection to query node_states when
the local DB is not MariaDB.
2026-04-24 18:01:59 +08:00
root
a3d8e9c55c style: apply gofmt formatting 2026-04-24 17:44:02 +08:00
root
07fecdbf86 fix: add component includes and fix API paths in nodes page 2026-04-24 17:39:01 +08:00
root
678d35d303 fix: correct divider text and worker empty message in nodes page 2026-04-24 17:19:50 +08:00
root
7d75d02c1e feat: add nodes.html page with node list and config form 2026-04-24 17:13:35 +08:00
root
c09c618207 feat: add nodes menu item to sidebar 2026-04-24 17:10:46 +08:00
root
fc77154c8b feat: add i18n translations for node management 2026-04-24 17:10:42 +08:00
root
cb4b1eba85 feat: register NodeController routes and nodes page
- Add nodeController field and route group in api.go
- Add /panel/nodes page route in xui.go
- Verified node.go does not add duplicate checkAdmin middleware
2026-04-24 17:08:52 +08:00
root
16eb179eaf feat: add NodeController with list, getConfig, and updateConfig endpoints
Expose node management API endpoints for the cluster feature:
- GET /node/list — returns connected nodes with online status
- GET /node/config — returns current node + DB configuration
- POST /node/config — validates and persists node settings to x-ui.json
2026-04-24 17:06:11 +08:00
root
f5862abc2e feat: add CodeMirror YAML editor for Clash template and fix settings save button bug
- Replace plain textarea with CodeMirror editor (YAML syntax highlighting, line numbers, auto-indent) for Clash subscription template
- Fix confAlerts crash when subClashURI/subURI/subJsonURI is null/undefined (prevented save button from enabling)
- Add yaml.js CodeMirror mode asset
- Include docs and .gitignore cleanup
2026-04-24 16:15:22 +08:00