Commit graph

2316 commits

Author SHA1 Message Date
root
6156661a20 docs: update tasktracking with YAML indentation fix 2026-04-25 20:46:00 +08:00
root
d1e571adb7 fix: Clash proxy YAML indentation for Clash Verge compatibility
Proxy entry fields were at same indent level as list item marker,
causing "invalid yaml" in Clash Verge. Fixed to 4-space indent for
fields and 6-space for nested *-opts sub-fields.
2026-04-25 20:45:49 +08:00
root
e059425d92 chore: bump version to v1.7.2.2 2026-04-25 20:36:10 +08:00
root
ef9e123fcc style: gofmt web/service/setting.go 2026-04-25 20:35:10 +08:00
root
0366a21d6d fix: Clash proxy entries missing reality-opts, client-fingerprint, network
- Fix REALITY settings extraction: publicKey/shortIds/fingerprint are
  nested under realitySettings.settings, not directly under realitySettings
- Add network field to all proxy entries (default "tcp")
- Move non-REALITY fingerprint into else branch to avoid duplication
2026-04-25 20:32:30 +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
b53703f1a1 fix: add -settingStatus CLI flag to reduce DB inits during install/update
Worker nodes with remote MariaDB experienced slow configuration because
config_after_update() and config_after_install() made 5-8 separate
x-ui setting CLI calls, each spawning a new Go process and re-initing
the DB connection. Add a single -settingStatus flag that returns all
needed info in one call, reducing DB inits from 5-6 down to 2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-25 15:05:11 +08:00
root
88584a1f70 chore: bump version to v1.7.0.1 2026-04-25 11:46:40 +08:00
root
e29584258b docs: update tasktracking with CF-Connecting-IP trust 2026-04-25 11:45:22 +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
badbbf71f5 fix: add retry for release upload to handle API propagation delay
gh release upload can fail with "release not found" when called
immediately after gh release create due to GitHub API propagation
delay. Add a 5s sleep after create and retry the upload up to 3 times.
2026-04-25 10:54:34 +08:00
root
350a5733c3 chore: bump version to v1.6.6.2 2026-04-25 10:46:53 +08:00
root
a25a42fb9b docs: add tasktracking for self-closing tag fix 2026-04-25 10:46:00 +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
71f1de0b3d chore: bump version to v1.6.6 2026-04-25 09:38:49 +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
e4855447cc docs: update tasktracking with v1.6.5 2026-04-24 22:08: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
c74b1cfb0f docs: update node management tasktracking with v1.6.4 fix 2026-04-24 21:30:42 +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
8f540db399 docs: update node management sidebar tasktracking with v1.6.3 fixes 2026-04-24 20:59:01 +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
c1a9831e85 chore: bump version to v1.6.1 2026-04-24 17:44:17 +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
2721dd0f13 chore: bump version to v1.6.0-beta 2026-04-24 17:25:02 +08:00
root
678d35d303 fix: correct divider text and worker empty message in nodes page 2026-04-24 17:19:50 +08:00
root
8fadc148a2 docs: mark node management sidebar tasks 6-7 as done 2026-04-24 17:14:04 +08:00
root
7d75d02c1e feat: add nodes.html page with node list and config form 2026-04-24 17:13:35 +08:00
root
fe46db245e docs: update tasktracking for node management tasks 3-5 2026-04-24 17:11:13 +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
85c6b661ac feat: add GetNodeStates query for node management 2026-04-24 17:02:47 +08:00
root
67435b892b chore: bump version to v1.5.4.1-beta 2026-04-24 16:16:00 +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
root
582037ae70 fix: settings save button and multiple UI bugs
- Fix duplicate :min attributes on a-input-number (webPort, subPort, tgCpu)
- Fix mismatched closing tags (a-input/a-switch instead of a-input-number)
- Fix twoFactorEnable toggle receiving MouseEvent instead of boolean
- Fix noise input handlers referencing undefined global `event`
- Add error handling to settings change detection polling loop
- Bump version to v1.5.4-beta
2026-04-24 15:44:48 +08:00
root
5ec81ea3d0 fix: add error handling for Xray, geo, and toolchain downloads in CI 2026-04-24 15:09:24 +08:00
root
314c4e75d7 fix: use absolute path for toolchain find on cache miss 2026-04-24 15:05:23 +08:00
root
aadd8fdd89 style: apply gofmt formatting 2026-04-24 14:43:44 +08:00
root
96a1bc9f1f fix: resolve doubled toolchain path in CI build
The find command on cache hit returns an absolute path
(e.g., /tmp/toolchain/x86-64--musl--stable-2025.08-1),
but the PATH/CC lines were prepending /tmp/toolchain/ again,
causing /tmp/toolchain//tmp/toolchain/... to fail.
2026-04-24 14:40:58 +08:00
root
288635adfc fix: Clash YAML injection, path validation, and default template
- Quote all YAML string values with %q to prevent injection
- Remove unused host parameter from GetClash
- Add backend path normalization for SubClashPath
- Log StreamSettings JSON unmarshal errors
- Expand template panel by default and provide default template
2026-04-24 14:35:28 +08:00
root
11cdb07e89 feat: add Clash YAML subscription endpoint with template injection
Add /clash/:subid endpoint that returns complete Clash YAML config.
User provides full template (DNS, routing, proxy-groups, rules) in
settings, panel generates proxies from inbound/client data and injects
via proxies: [] placeholder replacement.

- New SubClashService reads template, generates vmess/vless/trojan/ss
  proxy entries with transport (ws/grpc/h2/tcp/httpupgrade), TLS, and
  Reality support
- Settings: subClashEnable, subClashPath, subClashURI, subClashTemplate
- UI: Clash settings tab, QR code on subpage, Desktop dropdown with
  clash-verge:// deep link preferring Clash URL
- Version bump to v1.5.2-beta
2026-04-24 11:25:10 +08:00