Commit Graph

4063 Commits

Author SHA1 Message Date
Sepehr Radmard ac31455d99 feat(mcp): add a built-in MCP server at /panel/api/mcp (#6956)
AI agents (Claude, Cursor, VS Code) can manage the panel through a stateless streamable-HTTP MCP endpoint. Every tool re-enters the router with the caller's credentials, so authentication, token scopes, CSRF and runtime.Runtime dispatch apply exactly as for the REST API; a restricted token scope is refused, log text is fenced as untrusted data, and each tool call is written to the panel log.

The endpoint hands an API token's whole reach to the agent that holds it, so it is off by default: a panel answers 404 until the MCP server is enabled under Settings -> Security -> API Token (the mcpEnable setting).
2026-11-25 00:32:22 +03:30
Sanaei 3f2a2195a8 fix(wireguard): apply a peer change pushed to a node at once
The previous commit applied a device write at once, but only on the panel
that received the request. A node takes the same change as an inbound update
from its master, and that path still flagged the 30 s reconcile: a device
disabled on the master kept its tunnel on the node until the node's next tick.

ReconcileNow is the one place both paths go through. It applies when the core
runs and only flags when it is down, so a device write never starts a core the
tick has not started.

Measured with a real master and node panel (Xray 26.11.9, kernel WireGuard
clients): a device disabled on the master is cut on the node after 5 s instead
of 11-30 s, and a new one connects 7 s after it is added. No unit test reaches
it, a test process is never running; the scenario is the proof.
2026-11-25 00:13:21 +03:30
Sanaei c1cf280055 fix(wireguard): apply a device change at once
A device write only flagged the next reconcile, which runs every 30 s. Until
then a disabled or deleted device kept its tunnel, and a new one could not
connect: 12-24 s measured on a running panel, under 1 s now.

The handler applies the change through the same non-forced path the reconcile
uses, and falls back to the flag when that fails. No unit test reaches it: the
controller tests run without a core. The Docker timeline shows it (toggle a
device, read `wg show` on the client and the peer list of the core).
2026-11-24 23:52:09 +03:30
Sanaei eccf2e71bd fix(wireguard): change one peer without disturbing the others
A client's devices all carry the client's email, and the core removes a
WireGuard user by email, one peer at a time. The hot diff therefore removed
every peer of the email and added the survivors back, and a client that left
for good counted as a user whose sessions had to be dropped.

Measured on a running panel (Xray 26.11.9, kernel WireGuard clients):
- disabling or deleting one device cut the client's other devices for about
  15 s, the time a client waits before it handshakes again with a peer the
  server forgot;
- disabling or deleting a connected WireGuard client restarted the whole core
  with the default restartXrayOnClientDisable, taking every inbound down.

The diff is now per public key: a peer that stays is never touched, a changed
peer is updated in place, and a removed one goes through RemoveWireguardPeer,
which relabels that single peer and removes the label. A WireGuard session
ends with its peer, so its removal no longer asks for the restart.

After the change the other devices and other clients of the inbound keep
their tunnels with no gap, and the core keeps its pid.
2026-11-24 23:52:09 +03:30
Artem K f25cecfb40 feat(wireguard): support multiple devices per client (#7143)
A WireGuard client had one key pair and one tunnel address, so an operator who gave the same config to a phone and a laptop saw the two fight over the peer endpoint.

One client can now own extra devices, up to a per-client limit: each has its own keys and address, shares the client's quota, expiry and switch, and gets its own config, QR code and subscription. Devices become extra peers under the client's email, built by the same core-user map the other paths use, and a device change is applied to the running inbound in place instead of rebuilding it.

Nodes advertise a wg-devices capability; the master refuses a device for a node that would ignore it, before storing it and again when pushing the inbound.
2026-11-24 22:16:16 +03:30
17 3cb5bb7187 feat(wechat): add WeCom and webhook notifications (#7086)
Panel alerts and the scheduled status report could go to Telegram, Discord or email, but not to a WeCom group robot or a generic webhook.

Add a WeChat channel, off by default, with two modes: a WeCom group robot, or a webhook that receives a small signed-free JSON envelope with an optional bearer token. It carries the same events as the other channels (logins, CPU and memory, Xray crash, node and outbound state) and a scheduled text report. Delivery goes through the SSRF-guarded dialer, follows no redirects, and the URL and token are stored and redacted like the other notification secrets.
2026-11-24 21:54:39 +03:30
pcxzs d15b72a11a feat(tgbot): add Get one, a links header and setup guides to the screen bot (#6952)
A customer whose links ran past one Telegram caption could not turn the page, and one holding several configs was shown a client-card button the bot then ignored.

Customers can now page long screens and only admins see the card. "Get one" lists a config's links and opens the chosen one alone with its own QR code, naming VMess links by their remark; the links pages open with the config's expiry and remaining traffic; and setup guides for five platforms are reached from the customer's home. The new per-client callbacks pass the same ownership check as the existing link screens.
2026-11-24 21:39:42 +03:30
animesha3 6bc7e81c90 feat(clients): add per-subscription HWID device bans (#7133)
An operator could remove a device from a subscription, but it simply registered again on its next refresh; there was no way to keep one device out.

Add Block and Unblock to the device list. A banned device is refused on every subscription route whether or not the client has a device limit, does not hold a registration slot, and survives trimming and clearing the list. Unblocking needs a free slot, so registered devices never exceed the limit, and a banned device whose configs are replaced is told it is blocked.
2026-11-24 21:26:44 +03:30
animesha3 77719154f6 feat(sub): optionally replace configs rejected by HWID limits (#7106)
When a device is removed and the device limit lowered, its next subscription refresh gets an empty 404, and most apps keep the working nodes they downloaded earlier.

Add a setting, off by default: a refresh the device limit rejects, or one that arrives with no HWID, gets a normal response holding a single dead node in the format that was asked for, so an app that accepts the update replaces its saved nodes. The dead node comes from the same status-node builder the expired and depleted cases use, with no subscriber credentials and no local fallback.
2026-11-24 21:15:23 +03:30
Gleb Kochergin 6f162d03a1 feat(xhttp): configure a separate download endpoint and preserve it in subscriptions (#7187)
An operator who wanted XHTTP downloads to go through another endpoint, such as a relay or a CDN, had no field for it, and downloadSettings typed into the advanced JSON editor was dropped the next time the inbound was saved (#6307).

Add a separate-download switch to the inbound and outbound XHTTP forms, keep the download stream through save, share links, JSON and Clash output, and validate it before it is stored: transport, address, port, REALITY key and short id, and a uTLS fingerprint the core accepts. Saving an inbound re-applies its own session, sequence and padding rules to the download leg, since the listener checks the download request against them.
2026-11-24 21:04:55 +03:30
amirim f9e15a6b9b feat(sub): opt-in per-client rate limit for the subscription server (#6966)
A loop probing subscription ids, or one misbehaving app, could turn the subscription server into a database load generator, and there was nothing to cap it.

Add a setting, off by default, that limits how many subscription fetches one client address may make per minute (60 by default, 1 to 1000); requests over it get 429 with Retry-After. Static assets stay outside the guard. The client address comes from the same resolution the panel's login limiter uses, now shared in internal/util/clientip, so trustedProxyCIDRs decides it in one place for the panel and the subscription server.
2026-11-24 20:51:32 +03:30
Sanaei dd46ab8e8b fix(test): keep the network traffic test from starting a real IP lookup
The test added with #6972 built its ServerService with no public IP
state, so GetStatus started the background lookup against the real
IP-echo services and left it running after the test. Under the race
job's shuffle, a public IP test that ran next replaced
http.DefaultTransport while that goroutine was still reading it: DATA
RACE in TestPublicIPRefreshIsSingleFlightAndKeepsCachedReadsAvailable
(race on #6966, run 45442523620).

Build the service the way the container-scope test does, with a cached
address and no lookup due. A probe on GetStatus showed the lookup
starting before and not after.
2026-11-24 20:38:38 +03:30
Sanaei 5b34ae6309 fix(test): end the silent node's reset delivery with its test
The silent-node test returns after the one-second inline wait, while
its delivery goroutine keeps the node's delivery lock until the push
context times out three seconds later. The lock is keyed by node id,
and every test's fresh database starts its nodes at id 1, so under
-shuffle=on a test that ran next and expected a reset to arrive at once
waited behind that lock and failed (go-test on #6966, run 45439392969;
reproduced with -shuffle=1 on the two tests).

The stalled runtime is now released when the test ends, and the
cleanup waits for the delivery to let go of the lock.
2026-11-24 20:23:28 +03:30
Bazil Bazikov e65b5cbd65 feat(nodes): show per-client live speed for clients served by nodes (#7100)
The clients page showed live upload/download speed only for clients the master's own Xray or TUIC served; a client connected through a managed node showed none, although the master already polls that node's counters.

Derive per-client deltas from each node snapshot in the traffic sync job and broadcast them as their own speed source, so they add to local speed instead of overwriting it. A client's diverging per-inbound counter copies fold to the per-field max, the rule the traffic merge applies (#5274).
2026-11-24 20:07:14 +03:30
Hamed e0c01942ec feat(monitoring): allow selecting the network interface for traffic statistics (#6972)
The panel's network totals and speed add up every interface that is not on a fixed list of virtual names. On hosts where a second interface carries the same traffic, such as an SR-IOV function beside eth0, the dashboard and the bot reports counted it twice (#6906).

Add a traffic mode to General settings: legacy keeps today's sum, auto follows the default-route interface, manual names one. An interface that is not available shows as unavailable in the dashboard and in the Telegram and Discord reports instead of 0 B, and a saved manual choice is only re-checked when it changes.
2026-11-24 19:55:55 +03:30
Hamed 447b2d036a feat(clients): append external links in bulk adjustments (#6948)
The Links tab of the client editor was the only way to give a client external share links or subscriptions, and it replaces the whole list, one client at a time (#6816).

Add an "Append external links" tab to Bulk Adjust: the same links are appended to every selected client, existing ones stay, and a link a client already has is skipped. The request is exclusive with the other adjustments. clientRecordsByEmail no longer accumulates WHERE clauses across chunks, which reported clients past the first 400 as not found. Share links are validated with the now-async link parser.
2026-11-24 17:51:49 +03:30
Hamed e409ed7244 feat(nodes): add remote Xray and panel restart actions (#6970)
An operator running a master with sub-nodes could probe or update a node from the Nodes page but had to log in to the node, or SSH into it, to restart Xray or the panel (#6937).

Add Restart Xray and Restart panel to the node actions, behind a confirmation. Xray restarts through the node runtime; the panel restart is a new Remote call that the node accepts with node-admin credentials, the authority that already covers updatePanel. Both are refused for a disabled node.
2026-11-24 16:55:08 +03:30
Hamed a07ed97aa1 feat(scripts): allow a random or custom Web Base Path from the menu (#6994)
Option 8 of the x-ui menu could only generate a random web base path, and it reported success and restarted the panel even when the write had failed.

Offer a random or a typed path, validate it, show it before applying, and restart only after the CLI reports success and a second read returns the same path. The confirmation prompt uses no bash 4 expansion, so the menu test also runs under bash 3.2.
2026-11-24 16:43:56 +03:30
dkgks 5d76c0a1c6 fix(traffic): preserve client usage on scheduled inbound resets (#7136)
A client attached to several inbounds shares one usage counter. When any one of those inbounds reached its scheduled reset, the job zeroed the client's whole usage, across inbounds and nodes, although the client's own cycle resets on another day (#7135).

Add a per-inbound "Keep client usage" switch, off by default: with it on, the scheduled reset clears only the inbound's own counters. The setting is pushed to nodes and read back from their snapshots. A node that does not advertise the capability is refused when the switch is saved, not later at push time, so an older node never ends up with a config it cannot apply.
2026-11-24 16:32:13 +03:30
Mikail Katsiev ccdda6f728 docs(config): add a routing guide for Happ, Clash/Mihomo and Incy (#7183)
Explain, in English and Russian, how the subscription settings feed routing profiles to Happ, Clash/Mihomo and Incy: inline values and remote HTTPS sources, how the panel caches and validates a remote file, the size limits, and what each client receives.

The guide states the limits and checks the code applies: the 8 KiB Happ value after Base64 encoding, remote Clash files validated on their own, Incy URLs handed to the app without being fetched, and the log line each source writes.
2026-11-24 16:10:48 +03:30
Nikan Zeyaei e7bef4813d feat(outbound): import AmneziaWG vpn:// links and subscriptions as outbounds (#7097)
An AmneziaWG outbound could only be set up by copying keys and obfuscation values from a .conf into the form by hand (#7056).

Parse vpn:// links, from another panel or an AmneziaVPN app key, in the Go link parser and in the outbound form, and keep AmneziaWG outbounds that arrive through an outbound subscription running. Inflation is capped per key and per subscription, absent S3/S4 stay 0, a ranged keepalive keeps its lower bound, and the identity includes the client key so two clients of one server do not collide.
2026-11-24 16:07:37 +03:30
ridersaying 2bfcda96f4 feat(frontend): add a follow-system theme mode (#7026)
The theme had three settings, light, dark and ultra dark, so anyone whose desktop switches appearance on a schedule had to change the panel by hand.

Add a System step to the theme button on the sidebar, the login page, the command palette and the subscription page. In that mode the panel follows the OS light/dark setting and repaints when it changes, without a reload. The stored preference moves to theme-mode; the legacy dark-mode boolean is still read on first load and still written, so existing users keep their theme.
2026-11-24 15:44:25 +03:30
Justin 809b7c5501 feat(sub): allow switching the inline QR code format on the subscription page (#7157)
The large QR card on the subscription page always encoded the raw link, so a Clash/Mihomo or JSON user who scanned it got a profile their client could not parse.

Add a SUB / JSON / CLASH switch under the card for the enabled formats. The card starts on the format of the route the page was opened through: the server puts subFormat into the page data, so the /mihomo/ and /clash-legacy/ aliases start on CLASH as well.
2026-11-24 15:06:56 +03:30
Hamed 4b36cc1635 perf(traffic): find globally depleted clients with one set query (#7021)
On a node that a master pushes cross-panel usage to, the 5-second traffic job looked up client_global_traffics once per enabled client to decide who to disable, and its freshness probe counted every fresh row (#7008).

The scan of all enabled clients now builds the over-quota ids once and matches them with IN, and the probe is an EXISTS that stops at the first fresh row. Who gets disabled is unchanged: same 24-hour window, one master must reach the quota, masters are never summed. The email-scoped callers keep the correlated predicate. The Postgres job runs the four semantic tests.
2026-11-24 14:52:53 +03:30
Eugene Stsefankou 3a27c1c169 feat(sub): serve Clash/Mihomo YAML to the Rabbit-Hole client (#7063)
RabbitHole runs a Mihomo core and sends a Rabbit-Hole/ User-Agent. The default matcher only knew clash and mihomo, so with automatic format detection on it received the raw link list.

Add rabbit-hole to the default Clash/Mihomo User-Agent regex. A panel with its own regex is unaffected. The client's User-Agent joins the auto-serve test table, and the settings placeholder and subscription docs show the new default.
2026-11-24 14:40:23 +03:30
Nikan Zeyaei b39ac90f1e feat(settings): configurable public IP refresh, IPv6 detection and override (#7189)
Since 3.11.0 the panel asks outside IP-echo services for its public address every five minutes, and on a server with no IPv6 it retried the IPv6 services forever. Operators with static addresses had no way to stop it (#7176).

Add four General settings: the refresh interval (0 keeps the first answer), a switch for IPv6 detection, and a fixed IPv4 and IPv6 address that replace the lookup. The defaults keep today's behaviour. Clearing an override forgets the earlier success, so the next lookup is not timed from before the pin.
2026-11-24 14:29:32 +03:30
Mohammad 5b71e534d2 feat(clients): let the admin choose which table columns to show (#7080)
On a laptop-width screen the Clients table is wider than the window, and columns such as Speed or Attached inbounds take width even when they show nothing useful.

Add a Columns menu beside Filter that hides any column except the client itself. The choice is kept in localStorage, the menu stays open while several columns are ticked, and the table sizes to its visible columns instead of a fixed 1200px.
2026-11-24 14:17:28 +03:30
mjbe71 84d04c2d92 feat(xray): warn when a Dialer Proxy tag matches no outbound (#7099)
An outbound whose Dialer Proxy names a tag that no longer exists was shown like any other choice, and Xray then failed the dial with no outbound handler for it.

Show a warning under the field in the outbound form when the tag is not among the available outbounds. The host form stays silent: its Dialer Proxy resolves inside the subscriber's client config, so the server's outbound list cannot judge it.
2026-11-24 13:59:28 +03:30
Mohammad 9d6b79c821 feat(clients): tint rows and cards of depleting and ended clients (#7084)
An operator scanning a long client list for renewals had only a small tag in one column to go by.

Tint the table row and the mobile card amber when the client is about to run out of time or traffic and red once it has, using the theme's warning and error tokens so all three themes follow. A selected row keeps its selection colour.
2026-11-24 13:48:05 +03:30
Sanaei 811701cdf4 fix(ci): stop actionlint failing on the review workflow's allow_fork_prs
The shell-lint job runs actionlint v1.7.12, the newest release, whose
bundled metadata for claude-code-action predates v1.0.288 and does not
know the allow_fork_prs input efee93ef added. The job has been red on
every pull request since, although the input is valid.

Ignore that one message for that one workflow. Any other unknown input
is still reported: renaming the key locally makes the job fail again.
2026-11-24 13:31:03 +03:30
Nikita Akhnin da8008fce8 docs(readme): add 3x-ui-exporter to Community Tools (#7066)
List the community Prometheus exporter and Grafana dashboard for 3x-ui in the Community Tools section of the English README and the six translations, beside the Terraform provider and the Android manager.
2026-11-24 13:30:11 +03:30
Mohammad bfb3e2f52f fix(clients): keep the mobile search/filter bar in view while scrolling (#7085)
With 100 or 200 clients per page the mobile card list is several screens long, and the search box, filter button and sort selector scrolled away with it.

Make the mobile filter bar sticky just below the fixed drawer handle, with the card background so cards do not show through and the same padding stuck or not so the list never jumps.
2026-11-24 13:29:47 +03:30
Sanaei efee93efc4 fix(ci): let the PR review run on pull requests from forks
claude-code-action v1.0.288 changed allow_fork_prs to default to false,
and the workflow follows the floating v1 tag. Every review of a fork pull
request has been skipped since: the action step ends without writing a
review and the post job fails with nothing posted on the pull request.

Opt back in. The workflow already reads the fork's code only from
pr-head/ at a pinned SHA, with a read-only token and no command that runs
code from the checkout.
2026-11-24 09:36:36 +03:30
Sanaei f0de77f20d chore(deps): update gorilla/websocket for GO-2026-6278
govulncheck reports GO-2026-6278 for github.com/gorilla/websocket v1.5.3:
the client's frame mask key came from a cryptographically weak PRNG. The
panel reaches it through the Discord gateway client, the panel WebSocket
and the release lookup. v1.5.3 is the newest tag, so this moves to the
untagged upstream commit the advisory names as fixed,
v1.5.4-0.20240701034025-d67f41855da4.

No module xray-core pins to an untagged commit moved, and no code change
was needed.
2026-11-24 09:04:09 +03:30
TingChieh 3f7e77e6f8 fix(sub): give Shadowrocket a base64url userinfo for Shadowsocks 2022 links (#7148)
For a 2022-blake3 method the raw subscription percent-encodes the
userinfo, as SIP022 requires. Shadowrocket copies the %2B, %2F and %3D
escapes into the node password as they are, so authentication fails for
every key that contains +, / or =.

A request whose User-Agent is Shadowrocket now gets the userinfo as
base64url, the form the other Shadowsocks methods already use and that
Shadowrocket reads. Every other client keeps the SIP022 form.

Closes #7146
2026-11-24 03:51:32 +03:30
mjbe71 7db85005b4 fix(sub): let balancers select inbounds that are hidden from the subscription (#7098)
An inbound marked Exclude from subscriptions was skipped before its
configs were built, and a balancer only reads the entries that reach the
output. A hidden inbound could therefore never be a balancer member,
although the balancer form lists it, and a balancer of only hidden
inbounds never reached the subscriber.

A hidden inbound that an enabled balancer selects is now rendered into a
list that never reaches the output, and balancers draw members from both
lists. It still gets no document of its own, its clients still count in
the usage header, and rendering it spends neither the response budget nor
the first-link remark tokens.

An inbound that is already hidden and already selected in a balancer
appears inside that balancer after the upgrade.
2026-11-24 03:48:41 +03:30
SepehrSDQ d04dbbe834 fix(outbound): let the probe resolve with the panel dns config (#7144)
The HTTP-mode outbound test builds a throwaway Xray instance whose
config carried no dns section, so an outbound whose server name only the
panel's configured resolvers know (a split-DNS name, a hosts entry)
failed the test with a lookup against the OS resolver, while the same
outbound worked through the running core.

The test endpoints now pass the stored template's dns section to the
probe instance. Its tag, which names routing the probe config does not
have, and its script are left out; every resolution setting rides along.

Fixes #7131
2026-11-24 03:48:17 +03:30
二次元糕手 0444c1f4f7 fix(outbounds): enforce tagPrefix on refresh and deduplicate outbound tags (#7111)
Two outbound subscriptions with overlapping tag prefixes, or a template
outbound with the same tag, put duplicate tags into the generated config
and Xray refused to start with "existing tag found". A changed prefix
also never took effect: every refresh reused the stored tags.

A refresh now reuses a stored tag only when it carries the current
prefix, and an edit of the prefix rewrites the stored tags at once. Tags
are disambiguated with a -N suffix against the template and the other
subscriptions when they are stored, and again when the config is built,
so the panel lists the same tags the core runs.

Routing rules and balancers that name a tag by its old prefix stop
matching after the prefix changes.

Fixes #7110
2026-11-24 03:33:44 +03:30
Aleksey Fedorov d2d4a3270d fix(clients): re-add WireGuard peers with their keys instead of restarting Xray (#7088)
Three paths re-added a client to the running core with an account map
the WireGuard builder refuses, and each failed add fell back to a full
Xray restart that drops every connected user: a traffic reset of a
quota-disabled client and bulk enable built the map by hand without
publicKey and allowedIPs, and auto-renew passed keepAlive as a number
where the builder takes a string.

The map is now built in one place, coreUserFromClient, which the single
add and update paths use too. On MTProto, AmneziaWG and TUIC inbounds,
where AddUser changes nothing, the reset and the bulk toggle go through
the inbound reconcile, after the traffic rows have flipped.

/inbounds/add and /inbounds/import also refuse client emails and subIds
the client API refuses; a master's push to a node is exempt.
2026-11-24 03:32:23 +03:30
mjbe71 5ebc8adb19 fix(sub): render nothing when every host of an inbound is excluded from a format (#7096)
hostEndpoints and subscriptionHostVariants returned the same empty result
for an inbound with no enabled hosts and for one whose enabled hosts are
all excluded from the requested format. The second case therefore fell
back to the inbound's bare address, the address the operator had hidden.

The all-excluded case is now reported separately and renders nothing in
raw, json and clash, in both sort modes, in the link export and in the
panel's own host selection. Traffic accounting and the usage header are
kept. Inbounds with no hosts, or only disabled ones, render as before.
2026-11-24 03:30:02 +03:30
二次元糕手 04be3da8fc fix(clients): sync client_traffics lifecycle when updating a client with no inbounds (#7173)
Updating a client whose last inbound was detached rewrote the clients
record but, in client_traffics, only re-asserted enable in the true
direction. The auto-disable and renewal loops read expiry, quota and the
reset schedule from that row, so they kept acting on the stale values and
never disabled an expired client.

The no-inbound branch now goes through UpdateClientStat, the helper every
attached-inbound update already uses, so the whole enforcement row
follows the edit and the usage counters are left alone.

Fixes #7160
2026-11-24 03:15:27 +03:30
Aleksey Fedorov 5b0cbe6473 fix(backup): give up on a pg_dump that does not finish within an hour (#7089)
exportPostgresDB started pg_dump with context.Background(), so a
PostgreSQL server that accepted the connection and then stopped answering
hung the database download and the scheduled Telegram and Discord
backups forever; SkipIfStillRunning then silently skipped every later
backup run.

pg_dump now runs under a one-hour deadline and the caller gets an error
that names the timeout.
2026-11-24 01:35:53 +03:30
Oleg Shevchenko e38ad52d3c fix(amneziawg): stop TCP downloads freezing for seconds after a burst of loss (#7180)
With gVisor's RACK loss detection on, a TCP download through an AmneziaWG
inbound froze for seconds after a short contiguous loss. After the RTO,
RACK marks the old flight lost and enters recovery, but the pipe estimate
still counts every un-SACKed lost segment as in flight, so the sender
resends about two segments per RTO.

The embedded netstack now disables RACK and falls back to RFC 6675 SACK
recovery, which resends the tail after a single RTO. The option can be
reverted once the pinned gVisor carries an upstream fix.

Closes #7177
2026-11-24 00:47:47 +03:30
Benjamin Mitchell aadaca3d18 fix(settings): preserve notification intervals in Custom mode (#7082)
Switching a Telegram or Discord schedule to Custom seeded the editor with
a crontab translation of the interval. A cron step repeats within its
field, so @every 45m became 0 */45 * * * *, which fires at :00 and :45 of
each hour: alternating 45- and 15-minute gaps.

The Custom draft now starts from the original @every descriptor; the
calendar presets still seed their six-field expression.

Fixes #7081
2026-11-24 00:38:58 +03:30
小卡塔克 ca5d578416 fix(amneziawg): persist the kernel module load across reboots (#7194)
x-ui install-awg-kernel loaded the module with modprobe and recorded it
nowhere, so after a reboot the panel reported the module as not installed
and turned Kernel mode off, although DKMS had rebuilt it. The panel
cannot load it itself: x-ui.service sets ProtectKernelModules=yes.

The installer now writes /etc/modules-load.d/amneziawg.conf, after the
module has loaded, so a module that cannot load leaves no boot entry.

Refs #7186
2026-11-23 23:39:26 +03:30
owltrainer 477fbdf96e fix(kcp): allow MTU below 576 for xdns finalmask (#7132)
The inbound mKCP form and its schema refused an MTU below 576, but
Xray-core only requires at least 21. An XDNS finalmask with A/AAAA
record types needs a much smaller MTU, so the panel could not save a
configuration the core accepts.
2026-11-23 23:38:44 +03:30
Nikan Zeyaei 5414381bf1 fix(sub): carry finalmask in WireGuard share links and JSON outbounds (#7188)
The WireGuard link builders (Go and frontend) and the JSON subscription
outbound never read streamSettings.finalmask, so a WireGuard inbound with
a UDP mask produced a client config the server rejects.

The link now carries the mask as fm=<json>, the way vless, trojan and
shadowsocks already do, a Host's own mask is merged into its subscription
link, and the JSON outbound gets streamSettings.finalmask.

Closes #7185
2026-11-23 23:37:19 +03:30
Abol f0d48afe6f fix(hosts): apply a changed Port field to every address in the form (#7178)
The Address list shows each entry as address:port, and on save a port
inside an address wins over the Port field. After editing Port, the old
port stayed in every address and the field snapped back to its previous
value; the only way to change it was to retype every address.

Changing Port now rewrites the port of every address in the form before
saving, so what is shown is what gets saved. Port 0 leaves the addresses
bare, which inherits the inbound's port.
2026-11-23 23:36:42 +03:30
Aleksey Fedorov 83535c74e6 fix(amneziawg): check forwarded ports against the port the panel listens on (#7090)
The web server listens on XUI_PORT when it is set and valid, but the
AmneziaWG forwardedPorts conflict check read only the stored webPort.
With XUI_PORT set, a forward on the real panel port passed the check and
could never bind, while a forward on the unused stored port was refused.

The XUI_PORT-over-webPort rule now lives in SettingService.GetListenPort,
which both the web server and the conflict check use.
2026-11-23 23:36:13 +03:30
Aleksey Fedorov 1e4282bd23 fix(domain): compare panel and subscription domains case-insensitively (#7181)
DomainValidatorMiddleware compared the saved domain with the request
host byte for byte. Host names are case-insensitive and may end with the
root's dot, so a domain saved as Panel.Example.com, with a stray space,
or a Host header like panel.example.com. answered every request with
403, the settings page included, and the admin could not undo it from
the UI.

Both sides are now normalized before the comparison. Saving the settings
stores the domain in that form and refuses a scheme, port or path, which
could never equal the port-stripped host and locked the panel the same
way.
2026-11-23 23:34:53 +03:30