7 Commits
Author SHA1 Message Date
2436378140@qq.com 8fee133019 feat(subscription): resolve node domains with a per-subscription DNS 2026-11-17 11:54:14 +08:00
Mikhail Levin aab11c05a5 feat: add per-subscription update policies and explicit recovery consent 2026-11-15 14:56:04 +03:00
Zakk 8a5b3f3f99 fix(service): a subscription's update time carries its zone
NewUpdateStatus wrote the service's local time without a zone
("2006-1-2 15:04:05"); the browser read it as its own local time, so with the
service in UTC (a container, a router) and the browser in UTC+8 the dashboard
said "updated 8 hours ago" right after an update, as if the update had not
happened (#2046). The stamp is RFC 3339 now; dayjs reads the offset on both
pages, and stamps written before this keep reading as they did.
2026-09-22 18:25:03 +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 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 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
Markson Joe Hon 47f1462baf feat: init a new for v2raya core and fix a firewall mistake 2026-07-02 13:10:12 +08:00