219 Commits
Author SHA1 Message Date
Codex 5655cff964 fix: cancel HTTP latency checks on core control and page exit 2026-11-19 00:12:19 +03:00
Markson Hon f2681e2696 Merge pull request #2130 from wywywywycloud/feat/global-node-probe
feat: add global node check mode and custom target URL
2026-11-18 19:42:03 +08:00
Markson Hon ff59fc8757 Merge branch 'main' into feat/subscription-node-dns
Signed-off-by: Markson Hon <50002150+MarksonHon@users.noreply.github.com>
2026-11-18 19:29:42 +08:00
2436378140@qq.com 8fee133019 feat(subscription): resolve node domains with a per-subscription DNS 2026-11-17 11:54:14 +08:00
Mikhail Levin 9c7b87fba6 feat: expose native group strategies with group-scoped fallback 2026-11-15 23:16:39 +03:00
Mikhail Levin aab11c05a5 feat: add per-subscription update policies and explicit recovery consent 2026-11-15 14:56:04 +03:00
Mikhail Levin 5360713484 feat: add global node check mode and custom target URL 2026-11-15 07:04:53 +03:00
ILIKEFUTANARI 6d6c1c117f feat: separate DNS service and interception modes 2026-10-09 17:43:48 +08:00
Mikhail Levin 324351f78d Add RoutingA rule import and scheduled updates from URL 2026-10-01 03:54:50 +03:00
Mikhail Levin cef8fbc939 fix: bind dashboard probes to TUN egress on macOS and Windows 2026-09-25 21:34:00 +03:00
Mikhail Levin fd7a587dc2 fix: keep interception during dashboard TCP probes 2026-09-25 16:12:43 +03:00
Mio 060baa4337 fix: preserve subscription servers sharing an endpoint 2026-09-21 13:51:46 +08:00
RocketDev 0104fa8405 feat: display geosite date if gfwlist absent
Currently, if system /usr/share/v2raya/geosite.dat is used, v2raya will
not post error, but will display "none" for local GFWList date.
Since v2rayA reads this compatible file, we should display a date for
it, so that user is not confused.

Assisted-by: GPT-5.6-terra
2026-09-21 03:29:57 +08:00
Zakk c1e65ca44a fix(dns): refuse DoH and DoQ upstreams on save instead of failing every query
The DNS form's placeholder offered https://dns.google/dns-query, the
service turned https:// into protocol "https" and quic:// into "quic",
and the DNS module handed those to a miekg/dns client, which speaks udp,
tcp and tcp-tls only. Saving succeeded and every query on that rule then
failed, visible only in the log.

CheckDnsUpstream in kernel/v2ray accepts an address, tcp://, udp:// and
tls:// (DNS over TLS, which the module does support) and rejects https://
and quic:// with a message that names the alternatives; PutDnsRules
returns it as a 400 before anything is stored. The placeholder in the six
locales shows the supported forms and the docs say which schemes work.

Verified on the VM: https:// and quic:// rules come back BAD_REQUEST with
the message, tls://1.1.1.1 saves and the module logs
addr=1.1.1.1:853 protocol=tcp-tls; the previous rules restore unchanged.
2026-09-20 18:44:58 +10:00
Zakk 3364953513 feat(gui): documentation inside the app
The documentation site's domain has expired and its pages described a
2021 v2rayA. The page now carries its own docs, written against the
current code and shipped with the build, so what a user reads matches the
binary they run: quick start, transparent proxy, routing rules, inbounds
and sharing, flags and environment, troubleshooting. English and
Simplified Chinese; the other locales read the English text and say so.

The sections are Markdown under gui/src/docs/<locale>/, compiled to HTML
at build time by a small vite plugin around marked (a devDependency; the
bundle carries no parser) and loaded on demand, so the first load does not
grow. Headings get ids from their text. The flag table is not written by
hand: GET /api/params reads conf.Params' struct tags (id, short, default,
desc) through reflection, the same tags gonfig parses, and the page renders
it, so a new flag documents itself.

"#docs" and "#docs/<section>" open the page; the RoutingA dialog's help
button, the About page and small book icons in the settings sections and
the inbound dialogs point there instead of at the dead site or the wiki.
The navigation gains a fifth destination.
2026-09-20 14:45:55 +10:00
Zakk 2d16a92bbb fix(service): the findings of a cold read of the refactor and the scan fixes
Deleting nodes stored the renumbered connections, the subscriptions and
the servers in three commits; they are one transaction. Without a
catch-all DNS rule the module keeps its own fallback, as every earlier
release did. The login body is capped at 4 KiB, since it is now read
before the one-at-a-time semaphore. The apply-config error names a
failed restore, so every handler's message says whether the previous
value came back. The Windows system proxy reuses a snapshot pending
from an earlier run instead of refusing to start.
2026-09-20 09:59:29 +10:00
Zakk b1ca0c6edc fix(service): every state-changing handler takes the mutation turn; a truncated link cannot panic the parser
PostImport, PutPorts, PutDnsRules, PutRoutingA, PutGFWList,
DeleteGFWList, PutDomainsExcluded, PutTproxyWhiteIpGroups, PostOutbound
and PutOutbound wrote the store and regenerated the core outside the
mutation turn, so two of them could interleave core restarts with each
other or with a latency test. They take it like the rest.

ParseSSURL and ParseVmessURL sliced past the end of a link shorter than
its scheme prefix ("ss:", "vmess:x"), a panic reachable from a
subscription line.
2026-09-20 09:59:29 +10:00
Zakk 9cae52b9d1 feat!: ShadowsocksR is no longer supported
The core has no ShadowsocksR outbound and the plugin that once served
one was removed in May, so every SSR node has been dead since. Instead
of keeping a protocol that cannot connect: an ssr:// link is refused at
import with "ShadowsocksR is not supported" and the Clash converter
skips ssr entries. A node stored by an earlier release still decodes so
it keeps its place in the list and its group ordinal; it shows as
"SSR (unsupported)", cannot be configured and can be deleted. Both
READMEs list the protocols the current core actually speaks. The GUI
side of the removal is in the GUI change that follows.
2026-09-20 09:59:29 +10:00
Zakk ad509ce51b fix(service): the confirmed findings of four independent backend scans
A custom latency test URL that http.NewRequest rejects made a spawned
goroutine dereference nil and exit the process; the URL is validated
before any goroutine starts and the request error is handled. A
Shadowsocks link whose plugin field has no ";" panicked the parser, and
from the automatic subscription update that goroutine was unrecovered;
the parser accepts it and each updater recovers and logs.

The DNS module took the last non-bootstrap upstream as the fallback
while the template emitted upstreams in rule order with deduplication,
so a catch-all rule anywhere but last, or one whose upstream was
deduplicated, was not the fallback. The template names the fallback in
a new default_upstream field and the module honours it.

PUT /routingA stored the rules without regenerating the running core.
It goes through ApplyCoreConfig like the other config writers, with
restore on failure. UpdateSubscription logged a failed core reload and
answered success; it returns the error. PATCH /subscription joins the
mutation turn.

Subscription fetching retried through a direct connection when the
selected proxy failed, leaking the subscription URL; it returns the
error. Subscription documents are capped at 32 MiB and downloaded
assets at 256 MiB. PUT /gfwList validates the downloaded file as a
geosite list before replacing the working one.

The login handler took its one-at-a-time semaphore before reading the
body, so a client sending headers and no body blocked every login; the
body is read first and the HTTP server has header and idle timeouts.

Share links: a VLESS or VMess link without a numeric port is rejected
at parse time instead of producing port 0; an SSR link with a password
that is not base64 is rejected instead of importing empty; the SIP003
path gets its leading slash prepended, not a trailing one appended.

The macOS system proxy quoted shell arguments with strconv.Quote,
which leaves $(...) live; values are single-quoted. The Windows system
proxy snapshot includes AutoConfigURL, which teardown deleted and never
restored. Latency test responses with a non-2xx status are closed. The
version response carries the docker flag the GUI's port hints read.
2026-09-20 09:59:29 +10:00
Zakk ccfc5ca096 refactor(service): one apply-config path, NodeRef as a node's identity, typed SQLite stores
Three structural changes that share files, so one commit:

Settings, ports, DNS rules and custom inbounds each carried their own
copy of "store the new value, regenerate the core config, put the old
value back when that fails", and the outbound setting path had no
restore at all. ApplyCoreConfig takes a snapshot function and a store
function and does the sequence once for all five callers; the outbound
setting path restores like the others, and the error names which of
the three steps failed.

configure.Which was the persisted discriminator, the key that locates a
node, and the response row with its latency, link and selected flag at
once. NodeRef {type, id, sub, outbound} is the identity used by the
locator, EqualTo, the connected lists and the group operations; Which
embeds it and keeps the status fields. The JSON stays byte for byte
what it was (a test marshals a fixture before and after), stored
connected lists decode unchanged, and deduplication keys by identity
instead of by the whole row.

db.List* dispatched on "bucket/key" string literals to reach the
servers and subscriptions tables. The bodies are now Servers* and
Subscriptions* functions that configure calls directly; the List*
wrappers remain for the migration.
2026-09-20 09:59:29 +10:00
Zakk e24f102dc7 fix(db): an upgrade from BoltDB keeps its groups and can always restart
The migration wrote each outbound's connected servers and setting into
the outbound_connections and outbound_settings tables, while the runtime
reads both from system_config under outbound.<name>:connectedServers and
outbound.<name>:setting. Every upgrade from a BoltDB release therefore
came up with no group members and default outbound settings. The
migration now stores the Bolt values under the keys the runtime reads
(the ordinals are the ones configure.Which resolves at runtime) and the
verification checks those keys. The two tables are gone from the schema;
a database that still has them is left alone.

The migration also built v2raya.db in place, so an error before the
rename left a partial database that made the next start skip the
migration and then fail on the remaining bolt.db. It builds a temporary
file and renames it in after verification; a bolt.db found next to an
existing v2raya.db is moved to a numbered backup instead of blocking
every start. The v4 import no longer copies boltv4.db to bolt.db, which
produced exactly that pair.

A subscription update rewrote the connected ordinals and then replaced
the subscription in two commits; they are one transaction.
2026-09-20 09:17:11 +10:00
Zakk ae8e5a5047 chore: drop what nothing reaches
Three service packages outside the executable's dependency graph
(common/antiPollution, pkg/util/gopeed, kernel/vmessInfo), a blank
import of miekg/dns the core already imports, the --core-type flag no
code read, the PutAccount handler whose route was commented out, two GUI
API wrappers without a caller, two .SRCINFO files the release regenerates
and an unreferenced runit sample. The workflow path filters watched a
root go.mod that does not exist and the PR build skipped core/.
2026-09-20 09:17:11 +10:00
Zakk 90825094f8 fix(service): hook deadline, gated inbound writes, cleanup on a failed bind, atomic resolv backup
The core hooks ran under exec.Command with no deadline while Start held
the manager's lock, so a hook that never returned left the proxy stopped
and every status read blocked. They now run with the startup timeout as
their deadline in their own process group.

The custom-inbound POST and DELETE handlers did not take the mutation
turn; two concurrent additions read the same list and the last write
won. They take it like every other state-changing handler.

A failed HTTP bind ended in log.Fatal before the deferred cleanup, so
the core and the transparent-proxy rules stayed behind; run() now
returns the error through the same cleanup the shutdown path uses.

The resolv.conf backup was written in place; a crash mid-write left a
truncated file that the next start restored as the original. It is
written to a temporary file, synced and renamed, and an empty backup is
ignored on restore.
2026-09-20 09:17:11 +10:00
Zakk 98c7b0838e Merge branch 'busy-guard' into service-hardening 2026-09-20 05:19:24 +10:00
Zakk 6e6a7deed9 fix(controller): reads no longer wait for a mutation, writes wait for their turn
One `updating` flag guarded thirteen handlers, reads included: while a
subscription update or a latency test ran, GET /touch answered
REQUEST_IN_PROGRESS, so refreshing the page during a test failed at
random. A touch is a database read and needs no turn.

The flag becomes a turn that only the state-changing handlers take, and
a handler that finds it taken waits up to five seconds before answering
REQUEST_IN_PROGRESS instead of refusing at once; a client that leaves
while waiting is not answered.
2026-09-20 04:47:30 +10:00
Zakk 723630f4fd fix(service): stop the API producers of a template the core never ran
SetAPI starts the traffic and observatory producers together with the
template, and only a running process closes them. A start that failed
before the process existed — the config write, the inbound port check or
the missing GFWList — returned without closing the template, and the
latency test returned early on port exhaustion the same way. Each such
failure left goroutines dialling a port nothing listens on and logging a
warning every second for the rest of the service's life.

NewProcess closes the template on every error path, the GFWList check
closes it before returning, and the latency test closes its template
until the process manager owns it.
2026-09-20 00:32:37 +10:00
Zakk 1d27db3d34 perf(service): auto-select connects a subscription in one replacement
SelectServersFromSubscription called Connect once per node, and Connect
regenerates the config and restarts the core each time: a subscription
of n nodes restarted the core n times at every automatic update. The
support check built a throwaway template with SetAPI, whose traffic
producer nothing closed, so each node also left a goroutine polling an
unused port and logging a warning every second.

The members are now collected once and handed to
ReplaceOutboundConnections, which stores the group with one write
instead of a clear followed by one append per member (a concurrent
reader saw an empty or partial group) and regenerates the config once.
What Connect did per node stays, once: the asset check, the ip forward
reconciliation, starting a stopped core, and dropping the selection when
that start fails. The support check keeps the template without SetAPI.
2026-09-20 00:32:37 +10:00
Zakk 8e948dbf2d perf(service): locate connected servers with one read of the lists
Which.LocateServerRaw read and parsed every stored node for each lookup,
so a loop over n whiches cost n reads: the latency test, the config
generation for a group, the touch and the subscription update each
scaled with the square of the node count. A Locator reads each list on
first use and resolves every which of the loop against it; the single
lookups keep LocateServerRaw. Resolving 1000 subscription nodes drops
from 1.1 s to 1.6 ms (BenchmarkLocateAll vs BenchmarkLocatorAll).
2026-09-20 00:24:54 +10:00
Zakk d41ebec2d6 feat(service): /version reports the core's own version 2026-09-19 23:17:05 +10:00
Zakk 868497a0e9 feat(service): a group may route through one selected member
An outbound group with several members is balanced by the observatory
(least ping). The group's setting now also names one member's share
link as Selected: the core template then keeps only that member, the
touch flags it on the connected entry, and PUT /outboundSelection sets
or clears it. A selection that matches no member is ignored, so a node
removed or renamed by a subscription update returns the group to
balancing instead of breaking it.
2026-09-19 23:17:05 +10:00
Zakk 6f7895f477 fix(jwt): read the uname claim the login issues
The middleware looked up name, so the request's identity was always
empty.
2026-09-19 22:04:12 +10:00
Zakk d66c3927a5 fix(server): requests that change state apply or restore; requests that fetch have deadlines
PUT /dnsRules regenerates the running core's config and restores the
previous rules when that fails; SetPorts restores the previous ports
when the restart fails. The HTTP latency test drops subscription
entries as intended. The remote GFWList version request has a deadline
and its cache a one-hour TTL. CheckUpdate picks the index of the running
architecture and closes the body on every path.
2026-09-19 22:04:11 +10:00
Zakk d30f94cc38 fix(configure): reverse every type group when deleting; a refused ping is not a latency
SortSameTypeReverse only reversed the first type group, so DeleteWhich
processed subscriptions front to back and its index shifting pointed
later connected entries at the wrong subscription. Ping treated a
connection refusal as a measured latency. GetLenSubscriptionServers
exited the process on a lookup error where its siblings panic and the
handler recovers.
2026-09-19 22:04:03 +10:00
Zakk 1dd2bf28ad feat(service): the tun transparent proxy is the core's own device
transparentType=tun no longer starts the TinyTun process. The template
emits a tun-mips inbound tagged transparent — device name, address, MTU,
the DNS module's address as the relay target, the user's exclusion list
plus v2rayA and the core by name and v2rayA by PID — and the service does
what the operating system needs once the core has the device up.

On Linux that is one table and four policy rules: table 2020 holds the
default route into tun0; marked packets (0x80: the core's sockets, the
direct outbound, the DNS module's upstreams) look up main in full and
leave through the physical interface, or fail with ENETUNREACH when main
has no route for their family rather than fall into the TUN; unmarked
packets take main with its default route suppressed, so LAN and static
routes stay physical, and everything else goes to table 2020. The main
table is never edited, so stopping restores egress by itself. A rule in
our preference range or a route in our table that is not ours is reported
and left alone; our own leftovers from a crash are removed first. Every
command that succeeded is recorded and undone in reverse on stop.

Three things the TinyTun path never hit are now on tun's path, so they
are fixed here: the DNS module is generated in tun mode (TinyTun did DNS
itself); its 127.2.0.17:53 listener is only added when port 53 is free,
instead of making the core exit on a host running another resolver; its
primary listener stays on loopback unless port sharing is on or the user
chose an address, and the DNS REDIRECT rules and their cleanup follow the
module's port instead of a hard-coded 52353, and a ::1 listener is added
when IPv6 is supported, because ip6tables REDIRECT delivers an
application's IPv6 query to ::1 which the IPv4 listener never saw. The
tun branch no longer
skips those rules: they are what catches queries to a LAN resolver, which
the routing keeps off the TUN.

The connectivity monitor probes the core's API port; the TinyTun socks
loop-back port it used is gone. Removed with TinyTun: --tinytun-bin, the
tunProcessBackend (eBPF) and tunBypassInterfaces settings (connected and
static routes bypass the TUN unconditionally now), the /networkInterfaces
endpoint that only served the latter, and the build tag. The version
endpoint reports tunSupported instead of tinytunSupported.

Tests cover the generated inbound and DNS module, the listen-address
rules, the redirect port, and — with V2RAYA_CORE_BIN set — that the
generated document loads in the real core. Windows and macOS route
handling follows in a separate commit; until then those builds report
the TUN as unsupported.
2026-09-19 10:34:55 +10:00
Zakk 9915531f38 fix(subscription): show the usage once
The list header printed the Subscription-Userinfo header as
"download: 0 GB; upload: 0 GB; total: 107 GB; expire: 2026-10-04 18:59 UTC"
and then, after a "|", the provider's own STATUS= line with the same numbers
in GiB and a Go-formatted timestamp. The header is the standard form: when it
is present it is rendered alone as "Used 1.78 GiB / 100.00 GiB · Expires
2026-10-04" (GiB throughout, the day in local time); the STATUS= text is used
only when the provider sends no header.
2026-09-18 15:55:15 +10:00
Zakk 15c727e1e1 fix(log): show the log in the web viewer without --log-file, keep the footer on screen
Without --log-file the viewer said "log printed to console, please see log in
console", which the Windows service, the launchd job and every "log to
console" setup cannot do. The logger now also keeps its last 4 MiB in memory
and the viewer reads that tail when there is no file; the lines carry the
same timestamp and level prefix as the file adapter's.

The log area also gave way to nothing: at 50vh a short window pushed the
filters and the export button below the fold with only a scrollbar to hint at
them. It now shrinks so the footer stays visible.
2026-09-18 15:29:18 +10:00
Markson Hon 62114510d5 Merge pull request #1961 from Zakkaus/clash-subscription
feat(subscription): import Clash/mihomo YAML subscriptions
2026-09-18 07:20:01 +08:00
Zakk 5f51d588df refactor(connect): drop the dead v2fly-only branch
checkSupport stopped returning that error when the load-balancing restriction
was removed, so the branch that cleared the connections could not run.
2026-09-18 06:42:00 +10:00
Zakk bb1f79bb87 fix(api): stop reporting results as failures
Three endpoints answered FAIL for something the caller asked for and got:

- an up-to-date GFWList came back as "could not update GFWList: latest version
  is …. GFWList is up to date", because the check returned an error;
- deleting the GFWList when it was already gone returned the raw
  "remove …: no such file or directory";
- the update check said "failed to get latest version from Package file: 1".

The up-to-date case is now a sentinel error the controller turns into a
success carrying alreadyUpToDate, deleting what is already gone succeeds, and
the two package-index messages say what was missing. "which can not be nil"
also became a sentence about the request.
2026-09-18 06:38:52 +10:00
Zakk fac66e45c7 style(router): drop a stray blank line 2026-09-18 06:03:53 +10:00
Zakk 86e01d6176 feat(inbound): let a custom inbound require a username and password
A custom inbound port was open to anyone who could reach it, and older v2rayA
versions did offer authenticated inbounds, so users who relied on them had no
replacement (v2rayA/v2rayA discussions #1894, #1907).

CustomInbound carries optional credentials, which become the inbound's account
list. Half a credential pair is rejected: it would silently leave the port open.
2026-09-18 05:57:08 +10:00
Zakk 1ea77f236a fix(import): keep bare http proxy links importable without a kind field
A client that predates the kind field sends only the URL, so an http(s) link
had to be guessed. Guessing "subscription" is right for every address a
provider hands out, but it took away the bare proxy link 3fd0e882 had added:
credentials, host, port and nothing else cannot be a subscription address, so
that one shape goes back to the server importer.

Also let the config loader ignore every -test.* flag instead of only -test.v,
so the packages that reach it can run their tests at all.
2026-09-18 05:11:17 +10:00
Zakk 280710a319 fix(service): roll back custom inbounds, ip forwarding and report what was restored
Three gaps the settings rollback left open:

- adding or deleting a custom inbound stored the new list and then reloaded the
  core; a core that refused the list stayed stopped with the rejected inbound
  stored, so every later start failed too;
- a settings save that flipped ip forwarding left the kernel flag on the new
  value after the setting itself was rolled back, so the stored setting and the
  host disagreed;
- the rollback reported "the previous ones are back" even when restoring the
  setting or restarting the core had failed as well.

The session secret now retries persistence instead of accepting a failed store
for the life of the process, and an unreadable secret row is no longer
overwritten with a fresh one, which would have signed out every session.
2026-09-18 05:09:36 +10:00
Zakk 0005649661 fix(setting): keep the working setting and the core when a save is rejected
UpdateSetting stored the new setting before asking the core to reload it. When
the core refused the new config, the controller stopped the core and left the
rejected setting in the database, so the proxy was down and the next save
reported success while nothing was running.

Snapshot the setting before storing it, and on a reload failure put it back and
restart the core with it. The response now carries INVALID_CONFIG and the
reason the core gave.
2026-09-18 04:54:19 +10:00
Zakk aaeeb9307b feat(api): attach a machine-readable errorCode and params to FAIL responses
The GUI shows backend error text as is, so errors were never localized.
common.Coded wraps an error with a stable code and scalar parameters;
ResponseError adds "errorCode" and "params" next to the unchanged English
"message" when the chain carries one. Thirty-two user-facing errors are
coded (no server selected, core start failure, port occupied, malformed
link with protocol and detail, subscription fetch failure with host,
server/subscription not found with ids, bad request with the field,
credentials, session, admin, request in progress, GFW list missing,
invalid config, asset download, transparent setup, mux range, custom
inbound fields). logError now keeps the error chain instead of
flattening it. Messages, status codes and control flow are unchanged; the
two strings the GUI matches on stay as they are.

tools_test.go becomes an external test package so the common tests
compile again; its FillEmpty equality assertion, which never ran before,
is skipped with the reason.
2026-09-18 03:52:59 +10:00
Zakk a935c35304 fix(router): serve index.html with Cache-Control: no-cache
The entry page names hashed assets that disappear on every upgrade. It
was served with "public, must-revalidate" and no max-age, which browsers
may treat as heuristically fresh, so a cached copy loaded a bundle that no
longer existed and the GUI came up blank until a hard refresh. no-cache
forces revalidation; the ETag keeps it a 304.
2026-09-18 03:06:43 +10:00
Zakk ac79c92d6c fix(service): make API error messages say what was rejected and why
Errors that reach the GUI were written for the log: "ResolveURL failed:
invalid parameters", "httpGetUsingSpecificClient: response is nil",
"LocateServerRaw: invalid TYPE", "bad request", "illegal base64 data at
input byte 18". Reword the messages that can reach a user so each names
the input that was rejected (link scheme, missing password, port, server
id, request field), states the expected form for malformed input, drops
Go function names, keeps the %w chain so errors.Is/As still work, and
never echoes passwords, tokens or full share links (hosts only).
Messages the GUI string-matches ("invalid config", "the last request is
being processed") are unchanged.
2026-09-18 02:53:32 +10:00
Zakk 4ec09ea381 fix(service): subscription update, auto-select, latency test and port checks
UpdateSubscription snapshotted the whole subscription list before the
network fetch and wrote the stale struct back by index, reverting edits
made during the fetch; re-read the subscription afterwards and replace
only Servers, Status and Info. SelectServersFromSubscription disconnected
with clearOutbound=true per node, wiping every connection of the proxy
group and restarting the core once per node; it now removes only this
subscription's nodes in one replacement. The HTTP latency test bound its
per-node SOCKS inbounds on 0.0.0.0 without auth; bind loopback unless
PortSharing is on, and restore the previous core when the test core fails
to start. SetPorts skipped the API port and never range-checked; check all
six ports. Connect and ReplaceOutboundConnections treated an existing but
empty previous list as something to restore, which OverwriteConnects
turns into a no-op, so a failed selection stayed persisted; clear the
group in that case.
2026-09-18 02:53:32 +10:00
Zakk ea21c45bae fix(controller): validate custom inbound ports and reload the core after changes
Adding or deleting a custom inbound only wrote the database: the running
core kept its old inbounds until the next unrelated restart, and a port
that collided with the configured socks5/http/pac/vmess/api ports was
accepted and broke the next core start. Reject out-of-range and colliding
ports with a message naming the port, and regenerate the config when the
core is running.
2026-09-18 02:53:31 +10:00
Zakk fc9907a6bf fix(serverObj): read the parameters the GUI emits for tuic and trojan links
ParseTuicURL read the certificate pin and name verification only as
pinnedPeerCertSha256/verifyPeerCertByName while the GUI form and other
clients emit pinned_peer_cert_sha256/verify_peer_cert_by_name, so a pin
typed into the form was dropped. ParseTrojanURL read host only for the
trojan-go scheme although ConfigurationMC uses it as the WebSocket Host
header for plain trojan as well.

ImportSubscription redeclared err with := inside the block, so a failure
of AppendSubscriptions was assigned to the shadow and the function
returned nil.
2026-09-18 02:53:31 +10:00