3x-ui/internal/web/controller
DuQi 47d2303334
fix(inbounds): reject missing TLS certificates before saving (#6429)
An inbound could be saved with security "tls" and a certificate row carrying
neither a file path nor inline content. Nothing rejected it, so the row reached
xray-core, whose readFileOrString fails with "both file and bytes are empty"
and takes the whole config build down with it — every other inbound included.

Validate the credentials on both sides of the wire. validateInboundTLSCertificates
follows xray's file-over-inline precedence, requires a private key for every
non-verify certificate and insists on at least one server certificate, so a
verify-only CA list no longer passes as a server config. The inbound form's Zod
schema enforces the same rules per field and serializes only the editor mode the
operator actually used, and a failed save jumps to the Security tab naming the
certificate row that broke.

On update the guard is scoped to a real TLS edit. A row already stored
incomplete is grandfathered: it stays editable, and only a save that breaks a
previously valid block is refused.

A sub-node stores whatever the master pushes, and Remote.UpdateInbound falls
back to AddInbound when the node does not yet hold the tag, so a grandfathered
row could otherwise never be deployed or re-seeded — the rejection is swallowed
to a logger.Debug line and the node stays on a stale config while the panel
shows the client as cut off. The controller now marks a node-sync request (mTLS
or a node-sync token) on a per-request copy of InboundService, and the guard
steps aside for it on both add and update: the row was judged where the
operator acted, and a node that refuses it only falls out of sync. Operator and
admin-token saves are held to the guard as before.

The security union is parameterised on its tlsSettings branch instead of copied,
and tlsCertUsesFiles is the one file-vs-inline inference shared by the form
schema and the adapter, so the mode the editor opens in and the pair of fields
the save serializes cannot drift apart.
2026-09-08 18:08:24 +02:00
..
api.go feat(sub): client-side balancers for the JSON subscription (#6243) 2026-08-23 22:34:20 +02:00
api_auth_test.go feat(api): scoped, optionally expiring API tokens (#6201) 2026-08-15 15:31:49 +02:00
base.go
client.go fix(clients): flag the restart a partly-applied edit or delete still needs 2026-09-07 01:51:01 +02:00
client_partial_apply_test.go fix(clients): flag the restart a partly-applied edit or delete still needs 2026-09-07 01:51:01 +02:00
dist.go feat(web): add network-only PWA installability (#6190) 2026-08-18 15:33:20 +02:00
dist_test.go feat(web): add network-only PWA installability (#6190) 2026-08-18 15:33:20 +02:00
geodata_test.go feat(xray): browse geosite/geoip categories from routing rules (#6165) 2026-08-15 17:12:59 +02:00
group.go fix(groups): report changed bulk moves without restarting xray (#6199) 2026-08-14 19:50:06 +02:00
host.go
host_test.go
inbound.go fix(inbounds): reject missing TLS certificates before saving (#6429) 2026-09-08 18:08:24 +02:00
inbound_node_sync_test.go fix(inbounds): reject missing TLS certificates before saving (#6429) 2026-09-08 18:08:24 +02:00
index.go fix: do not type successfull login twice (#6374) 2026-09-03 17:00:25 +02:00
login_limiter.go Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
login_limiter_test.go chore: refresh dependencies, fix Linux tool tasks, modernize Go idioms 2026-07-25 16:08:09 +02:00
node.go fix(nodes): apply a rotated master mTLS certificate without restarting the panel (#6194) 2026-08-15 16:03:42 +02:00
node_credentials_writeonly_test.go fix(nodes): report probe heartbeat persistence failures (#6207) 2026-08-13 12:34:37 +02:00
panel_update_test.go
pwa.go feat(web): add network-only PWA installability (#6190) 2026-08-18 15:33:20 +02:00
pwa_test.go feat(web): add network-only PWA installability (#6190) 2026-08-18 15:33:20 +02:00
server.go feat(amneziawg): add native AmneziaWG protocol support (#6105) 2026-08-24 02:41:15 +02:00
setting.go fix(security): require a 2FA code to replace the stored TOTP secret 2026-08-19 19:54:15 +02:00
setting_test.go fix(security): require a 2FA code to replace the stored TOTP secret 2026-08-19 19:54:15 +02:00
spa.go
spa_test.go
sub_balancer.go feat(sub): leastLoad member weights for subscription balancers (#6304) 2026-09-02 20:21:27 +02:00
sub_balancer_test.go feat(sub): client-side balancers for the JSON subscription (#6243) 2026-08-23 22:34:20 +02:00
util.go fix(sub): honor trustedProxyCIDRs before forwarded URLs (#6135) 2026-07-29 21:01:59 +02:00
util_test.go
websocket.go
xray_setting.go feat(pia): add PIA login-and-add WireGuard outbounds (#6272) 2026-08-22 23:11:06 +02:00
xray_setting_warp_test.go fix(warp): surface update-clock persistence failures (#6209) 2026-08-13 12:31:05 +02:00