47 Commits
Author SHA1 Message Date
Zakk 0872d7db62 chore: remove what nothing uses any more
copyfile, the empty ports/ss.go stub, parseDnsAddr and DnsRouting (the DNS
config is generated for the core's module now), the Inter font and the
switch-menu icon of the old GUI, the docs-site dispatch workflow (the site is
retired; the docs are in the app), the unused v2ray_arch in the docker helper,
the root .gitignore rule for a web directory that moved, and the .dockerignore
patterns for binary and test names that no longer exist. The skipped
TestFillEmpty asserts what FillEmpty does instead of what it once did.
2026-09-21 12:44:14 +10:00
Zakk 833af7dc74 refactor: use what the dependencies already provide
A read of the tree for home-grown code that a dependency or the platform
covers. Each item names what replaces it.

- IPv4 CIDR membership was a binary-string trie (infra/dataStructure/trie)
  fed with CIDRs rendered as bit strings; net.IPNet.Contains, which the
  same file already used for IPv6, does it. The trie package is gone.
- The response replay cache was an LRU with its own linked list, indexes
  and timeout strategy (infra/dataStructure/lru), of which one fixed-size
  instance existed; hashicorp/golang-lru/v2, already in go.mod, is that
  cache, typed. go mod tidy also dropped go-nanoid, which nothing imported.
- The HTTP client for subscription updates through the local proxy carried
  a CONNECT dialer of its own (pkg/util/proxyWithHttp); http.Transport's
  Proxy handles socks5:// and http:// URLs, resolves hostnames on the
  SOCKS proxy and uses CONNECT for https. Verified on the VM: a
  subscription update succeeds in both "pac" and "proxy" modes.
- core/dns/qtype.go listed nine type names in two switches before falling
  back to miekg/dns tables that contain the same names; dns.Type.String
  and dns.StringToType are the tables.
- The GUI tracked prefers-color-scheme with its own media query and
  toggled a theme-dark class nothing reads any more; Vuetify's "system"
  theme follows the OS itself. Verified in headless Chrome: auto follows
  the OS in both directions, an explicit choice overrides it.
- The AUR packages carried .INSTALL hooks whose only content was a
  coloured "Completed!" banner, duplicated in the deb/rpm after-install
  scripts; pacman and apt report that themselves. The hooks are gone, the
  release workflow stops copying them, and after_install/after_upgrade
  keep only daemon-reload and the restart.
- The tap release job downloaded eight artifacts in eight steps;
  actions/download-artifact takes a pattern with merge-multiple.
2026-09-20 16:40:34 +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 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 b232abde47 fix(reqCache): a request id's lock is dropped once its last user leaves
The map gained one mutex per request id and never shrank; the GUI sends
a fresh id per request.
2026-09-19 22:04:12 +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
Zakk e8a57cb629 test(gopeed): stop the package's tests from failing everywhere
TestDown passed a directory where Down expects the destination file path and
then read the result from the working directory, so it could not pass; TestTemp
was a leftover scratch benchmark that wrote a 512 MiB file to a hard-coded
Windows path and called log.Fatal, which killed the whole test binary. Both
tests also fetch a file from GitHub and compare it with a fixed checksum.

Remove TestTemp, fix the destination, and run the two network tests only when
V2RAYA_NETWORK_TESTS=1. go test ./... is green now.
2026-09-18 05:34:00 +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 fea9effeb4 fix(jwt): persist a random session secret
The signing secret was the hash of the subscription addresses, or of the
server hostnames when there was no subscription, so importing, editing or
deleting a server changed the secret and signed every session out mid-use.

Generate 32 random bytes on first use and keep them in the database.
2026-09-18 04:54:20 +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 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 262c56009e fix(service): guard crashes and silent data loss found in the sweep
- time.Ticker.Reset panics on a non-positive duration; a stored auto-update
  interval of 0 crashed every start (pre_update.go) and every settings
  save. Route both tickers through configure.IntervalHours, which falls
  back to one hour.
- The auto-updater indexes a startup snapshot; a subscription deleted
  while it runs panicked out of range in a goroutine and took the daemon
  down. UpdateSubscription now refuses an index that no longer exists.
- ResolveSubscriptionWithClient applied its 30 s timeout floor to a copy
  it never used, accepted HTTP error pages as an empty node list, and
  returned zero nodes without error, so UpdateSubscription replaced the
  stored list with nothing on a provider 403/5xx. Use the copy, reject
  status >= 400 and empty results.
- PutOutbound wrote an error response and then fell through to the
  success response, producing two JSON bodies.
- TestHttpLatency passed nil entries (servers it could not locate) to
  addHosts, which dereferenced them; skip them.
- ReqCache read the per-request mutex map after releasing the lock that
  guards writes to it (a fatal concurrent map access under load).
- The websocket writer ran one goroutine per message box on a single
  gorilla connection, which forbids concurrent writes; serialize them.
2026-09-18 02:53:31 +10:00
Markson Hon fd7162e88f feat(service): add custom inbound APIs and strengthen outbound/account flows 2026-05-04 19:07:22 +08:00
Markson Hon 0baefc4530 feat(core): mix-up v2ray and xray and anytls and juicity 2026-05-03 15:55:13 +08:00
Markson Hon 3467428871 fix shadowsocks 2022 2026-04-19 18:37:51 +08:00
Markson Pigeonzilla d783af0d9f plugins: better log outputs 2026-02-16 15:17:15 +08:00
Markson Pigeonzilla 7ea3024c95 gui: better log 2026-02-14 22:25:31 +08:00
Markson Pigeonzilla 0c2628cdde service: better user account check under Windows 2026-02-12 20:19:58 +08:00
Markson Pigeonzilla 2734544002 ci: fix Windows installer uninstallation 2026-02-06 08:57:26 +08:00
Markson Hon 6c9737f334 fix UDP based connections 2026-02-04 21:29:07 +08:00
Markson Hon aad7e17195 update daeuniverse/outbound 2026-02-04 21:11:26 +08:00
LouisKamsky 660b59d8b1 Added support to protocol: 2022-blake3-aes-128-gcm and 2 more. Fixed bug while using xray-core. 2024-10-10 07:50:36 +08:00
mzz2017 f820d7cd42 fix: tuic/juicity not work #1069 2023-09-03 13:57:02 +08:00
mzz 698c2f5f65 fix: plugin (tuic/juicity/ssr/...) with tproxy not work (#1059) 2023-08-30 20:32:31 +08:00
mzz2017 b9b305ce7a fix: broken ssr 2023-08-19 21:18:16 +08:00
mzz2017 b5efed2332 feat(protocol): support juicity 2023-08-12 13:32:10 +08:00
mzz2017 199a9ab759 fix: simple-obfs 2023-02-13 14:42:07 +08:00
mzz2017 2445181f64 fix: compilation problem on freebsd, openbsd, dragonfly 2022-12-09 20:50:57 +08:00
mzz2017 ea4e505c79 fix: simple-obfs didn't work in some cases 2022-06-22 23:10:34 +08:00
mzz2017 3e08639bd9 fix: http proxy auth 2021-10-25 15:40:02 +08:00
mzz2017 60a226e0df fix: replace all path with filepath 2021-10-04 12:53:18 +08:00
mzz2017 403402f0d8 optimize: replace nutsdb with more stable boltdb 2021-10-01 23:56:41 +08:00
mzz2017 a69e0fa255 chore: remove pingtunnel 2021-09-30 19:18:40 +08:00
mzz2017 e1cb97cb32 chore: safer jwt 2021-09-27 23:46:18 +08:00
mzz2017 958cbee014 fix: failed latency test if plugin is needed 2021-09-15 00:39:30 +08:00
mzz2017 0b3beb7f98 fix(trojan-go): a problem that sni did not work 2021-09-15 00:12:31 +08:00
mzz2017 73f4c45c9c feat: disable timestamp in systemd 2021-09-11 20:31:39 +08:00
mzz2017 69b2f8833f fix: http latency test would fail when v2ray with tproxy is running 2021-09-08 14:33:30 +08:00
mzz2017 159c542272 fix(transparent proxy): conflict mark 2021-09-07 22:21:37 +08:00
mzz2017 e4dd0eaa76 refactor: server, subscription, api, plugin 2021-09-06 12:32:47 +08:00
mzz2017 604805e82c fix: print to log 2021-09-06 11:45:08 +08:00
mzz2017 553b291133 chore: organize code 2021-09-04 18:06:12 +08:00
mzz2017 d7552786ee fix: cannot remove temp file after downloading 2021-09-04 17:55:29 +08:00
mzz2017 8070183fed fix: use os.Tempdir instead of /tmp 2021-09-03 13:48:58 +08:00
mzz2017 66f8cd1a20 feat: better v2ray-core log writer and newer beego/logger 2021-09-03 13:48:58 +08:00
mzz2017 bd284584b4 feat: try supporting all platforms 2021-08-29 18:02:14 +08:00
mzz2017 0d16bd32a7 feat: organize project structure, change log package to beego log and remove v2ray/log package 2021-08-27 14:09:08 +08:00