Commit graph

1372 commits

Author SHA1 Message Date
root
582037ae70 fix: settings save button and multiple UI bugs
- Fix duplicate :min attributes on a-input-number (webPort, subPort, tgCpu)
- Fix mismatched closing tags (a-input/a-switch instead of a-input-number)
- Fix twoFactorEnable toggle receiving MouseEvent instead of boolean
- Fix noise input handlers referencing undefined global `event`
- Add error handling to settings change detection polling loop
- Bump version to v1.5.4-beta
2026-04-24 15:44:48 +08:00
root
aadd8fdd89 style: apply gofmt formatting 2026-04-24 14:43:44 +08:00
root
288635adfc fix: Clash YAML injection, path validation, and default template
- Quote all YAML string values with %q to prevent injection
- Remove unused host parameter from GetClash
- Add backend path normalization for SubClashPath
- Log StreamSettings JSON unmarshal errors
- Expand template panel by default and provide default template
2026-04-24 14:35:28 +08:00
root
11cdb07e89 feat: add Clash YAML subscription endpoint with template injection
Add /clash/:subid endpoint that returns complete Clash YAML config.
User provides full template (DNS, routing, proxy-groups, rules) in
settings, panel generates proxies from inbound/client data and injects
via proxies: [] placeholder replacement.

- New SubClashService reads template, generates vmess/vless/trojan/ss
  proxy entries with transport (ws/grpc/h2/tcp/httpupgrade), TLS, and
  Reality support
- Settings: subClashEnable, subClashPath, subClashURI, subClashTemplate
- UI: Clash settings tab, QR code on subpage, Desktop dropdown with
  clash-verge:// deep link preferring Clash URL
- Version bump to v1.5.2-beta
2026-04-24 11:25:10 +08:00
root
1a02ebb024 fix: MariaDB JSON_EACH compatibility for subscription and traffic queries
Replace SQLite-only JSON_EACH with DB-type branching (JSON_TABLE for
MariaDB) in subscription, client traffic, and migration queries.
Bump version to v1.5.1.
2026-04-24 10:16:48 +08:00
root
51f17922fa fix: resolve shared-mode traffic flush blocked by stale inboundId=0 delta
The traffic-pending.json file could contain a stale client traffic delta
with inboundId=0 (created before the InboundId resolution fix). When
flushToDatabase tried to INSERT this into client_traffics, it violated
the foreign key constraint fk_inbounds_client_stats, causing the entire
transaction to roll back and blocking ALL traffic from being written to
MariaDB.

- Skip deltas with InboundID==0 in flushToDatabase with a warning log
- Share a single TrafficPendingStore between XrayTrafficJob and the
  flush loop to eliminate a race condition from dual file instances
- Add test for zero InboundID skip behavior
2026-04-24 02:56:23 +08:00
root
99e2e6c2e2 fix: resolve client traffic InboundId from DB in shared mode, set online clients
In shared mode the Xray API returns InboundId=0 for client traffic.
Collect() now looks up the real InboundId from the client_traffics table
by email, and skips unknown emails with a warning. Also computes and
sets online clients in XrayTrafficJob since addClientTraffic is bypassed.
2026-04-24 02:29:02 +08:00
Sora39831
e50b2f471d feat: improve mariadb flow, db settings init, and traffic flush 2026-04-15 16:58:49 +08:00
Sora39831
87282dde33 feat: add durable traffic deltas and shared flush loop 2026-04-10 15:25:16 +08:00
Sora39831
3cfa554786 feat: add cache-backed worker sync and heartbeat loops 2026-04-10 15:15:42 +08:00
Sora39831
34b9f01d0a feat: guard shared writes and bump version transactionally 2026-04-10 11:22:49 +08:00
Sora39831
135ef32477 Add panel domain persistence 2026-04-09 21:39:39 +08:00
Sora39831
8e9e36e1b8 Fix turnstile tab re-render and bump version 2026-04-08 15:34:50 +08:00
Sora39831
8a43a516ac Fix turnstile reload after auth tab switch 2026-04-08 15:18:00 +08:00
Sora39831
ae08f4a50f fix: separate register turnstile layout 2026-04-07 17:32:57 +08:00
Sora39831
b921ed740c chore: add generated fingerprinted assets 2026-04-07 17:17:41 +08:00
Sora39831
5ad2203f24 build: generate fingerprinted assets before compile 2026-04-07 16:43:18 +08:00
Sora39831
cfb169d2fb refactor: resolve template assets through manifest helper 2026-04-07 16:41:55 +08:00
Sora39831
e6752e04db feat: load fingerprinted asset manifest 2026-04-07 12:24:33 +08:00
Sora39831
faeb8dd244 feat: add asset generation command 2026-04-07 12:08:10 +08:00
Sora39831
05ece0bd8e feat: add fingerprinted asset generator 2026-04-07 11:59:25 +08:00
Sora39831
cc6d3daa3a fix: harden migration and setting writes 2026-04-07 02:12:02 +08:00
Sora39831
e298996d77 Harden admin access for panel APIs 2026-04-06 22:12:38 +08:00
Sora39831
6131c55882 fix dashboard and inbounds load failure states 2026-04-06 21:51:33 +08:00
Sora39831
537c73c1b2 fix settings and xray load failure regressions 2026-04-06 21:22:33 +08:00
Sora39831
266f368b07 fix remaining modal state leaks 2026-04-06 21:03:50 +08:00
Sora39831
6564cf8202 fix settings and xray page state leaks 2026-04-06 21:02:58 +08:00
Sora39831
3e1b6ed76f fix frontend loading and client modal bugs 2026-04-06 21:00:02 +08:00
Sora39831
39ba517d9f Fix inbound email options on add modal 2026-04-06 17:14:12 +08:00
Sora39831
2fad726ee1 Change IP limit to 3-minute temporary disable 2026-04-06 16:58:43 +08:00
Sora39831
e468a08a54 Fix IP limit fallback Xray API port resolution 2026-04-06 16:31:39 +08:00
Sora39831
9864224897 fix(iplimit): enforce limit without fail2ban via xray api fallback 2026-04-06 16:04:27 +08:00
Sora39831
2008ae6dc3 style(go): gofmt check_client_ip_job 2026-04-06 15:52:25 +08:00
Sora39831
c085fc3814 fix(iplimit): keep IP records working without fail2ban 2026-04-06 15:45:55 +08:00
Sora39831
03144a16ca fix(mariadb): quote settings key column in xray template queries 2026-04-06 11:04:43 +08:00
Sora39831
15144e199d test(limit): add regression tests for reentry and disabled-limit unban
- inject lightweight hooks in CheckDeviceLimitJob for deterministic tests

- add tests for run re-entrancy, disabled enforcement unban, and stale ban cleanup
2026-04-06 10:49:11 +08:00
Sora39831
83b61d9da4 feat(limit): add inbound device-limit enforcement with safe unban flow
- add inbound deviceLimit model/frontend fields and translations

- add CheckDeviceLimitJob with observation window and xray API ban/unban

- prevent job re-entrancy and restore users when limit is disabled

- reduce lock scope via snapshots to avoid blocking log parsing
2026-04-06 10:46:48 +08:00
Sora39831
4a1dac89b6 fix(inbounds): avoid undefined filterEmailOption in client form 2026-04-05 04:40:24 +08:00
Sora39831
67d24ca0e6 fix(user): sync-remove inbound clients when deleting managed user 2026-04-05 03:52:41 +08:00
Sora39831
dfbe02c2b8 feat(user): delete all user inbounds when deleting user 2026-04-05 03:40:32 +08:00
Sora39831
7db5b9e214 fix(login): reliably render turnstile on register tab 2026-04-05 02:55:28 +08:00
Sora39831
78767c082e feat(users): cascade delete user-owned inbounds when deleting user 2026-04-04 22:35:33 +08:00
Sora39831
0775c5f10d fix(panel): correct user.html i18n quoting to avoid template parse failure 2026-04-04 22:16:34 +08:00
Sora39831
b03bb96899 fix(panel): resolve blank /panel/user caused by invalid i18n template quotes 2026-04-04 20:04:38 +08:00
Sora39831
ec70c4ce07 feat: add user email dropdown for inbound clients 2026-04-04 15:05:37 +08:00
Sora39831
2a9d9a0a6b feat: add admin user management 2026-04-04 14:59:40 +08:00
Sora39831
b0ce1a7ace refactor(settings): organize x-ui.json by module and purpose 2026-04-04 14:46:24 +08:00
Sora39831
4a5d8aa702 fix(settings): preserve turnstile and omitted config fields 2026-04-04 14:45:31 +08:00
Sora39831
37c184aa45 Fix shared-email client traffic deletion scope 2026-04-04 14:29:37 +08:00
Sora39831
c94372a22c fix: address all code review issues for MariaDB support
- Prevent DBPassword from leaking to frontend (json:"-")
- Make migration direction explicit via --direction flag, set dbType only after success
- Use driver-appropriate DROP INDEX IF EXISTS for SQLite vs MariaDB
- Build DSN with mysql.Config.FormatDSN() to prevent injection with special chars
- Close DB before re-initialization in InitDB
- Add migration tests (5 tests using SQLite in-memory DBs)
- Parse JSON once in GetDBConfigFromJSON instead of 7 times
- Use Go binary for dbType in shell script instead of fragile grep
- Add rollback on failure in db_switch_to_sqlite
- Validate DB settings in CheckValid
2026-04-03 09:53:20 +08:00
Sora39831
7f015ad27b fix: address code review issues for MariaDB support
- Close migration DB connections with defer to prevent leaks
- Truncate destination tables before migration to avoid duplicates
- Wrap migration in transaction for atomicity
- Pass DB password via env var instead of CLI args to avoid process list exposure
- Improve error messages for MariaDB export/import with alternatives
- Update package doc to reflect dual DB support
- DRY migration logic with shared migrateAllTables function
2026-04-03 09:39:53 +08:00
Sora39831
d0592a1be8 feat: add DB fields to AllSetting struct for web panel API 2026-04-03 09:30:26 +08:00
Sora39831
8a20cbd5c2 feat: guard GetDb/ImportDB for MariaDB (unsupported SQLite-specific operations) 2026-04-03 09:29:53 +08:00
Sora39831
2647c2c2ce refactor: update InitDB callers to use new parameterless signature 2026-04-03 09:27:10 +08:00
Sora39831
5ed8037464 feat: add MariaDB settings to SettingService 2026-04-03 09:24:18 +08:00
Sora39831
09f84782b0 test: add unit tests for critical modules and fix flaky redirect middleware
- Add tests for config, database, model, util/common, util/crypto,
  util/random, web/middleware, web/service, and xray packages
- Fix redirect middleware using slice instead of map to guarantee
  deterministic longest-prefix-first matching order
2026-04-03 08:44:51 +08:00
Sora39831
d43f8683b0 feat: enhance user dashboard, set default creds to admin, trim i18n to en/zh only
- install.sh: default username/password to admin on fresh install
- user.go: UpdateFirstUser resets Role to admin, preventing lockout
- user.html: show remaining traffic and last online time
- i18n: remove 11 translation files, keep only en_US and zh_CN
- LanguageManager: trim supportedLanguages to 2 entries, remove simularLangs
2026-04-03 08:13:27 +08:00
Sora39831
463b07db52 feat: add user dashboard with role-based access control
Add a simplified dashboard page for non-admin users showing username,
traffic usage, expiry time, and logout button. Implement role-based
routing so user-role accounts are redirected to their own dashboard
instead of the admin panel. Add getUserInfo API endpoint and i18n
translations across all 13 supported locales.
2026-04-03 03:29:51 +08:00
Sora39831
3045b630f0 fix: use render=explicit and HTMLElement for Turnstile to fix Rocket Loader conflict
- Add ?render=explicit to api.js URL to disable auto-initialization
- Pass HTMLElement (not selector string) to turnstile.render() and turnstile.reset()
- Prevents race condition where Turnstile auto-renders before body DOM is parsed
2026-04-03 03:01:18 +08:00
Sora39831
de6131aeac fix: fix Turnstile widget not rendering behind Cloudflare Rocket Loader
Load Turnstile api.js statically in <head> with data-cfasync="false"
to bypass Rocket Loader interference. Use turnstile.render() API to
manually render widget after site key is fetched, instead of relying
on dynamic script loading and Vue data-bind attributes.
2026-04-03 02:46:20 +08:00
Sora39831
f026afbc17 fix: comment out unused checkEmailsExistForClients to pass staticcheck 2026-04-03 02:12:54 +08:00
Sora39831
a7871a79a5 fix: correct gofmt formatting in inbound.go 2026-04-03 02:04:45 +08:00
Sora39831
90665c92f4 fix: harden registration with rate limiting, input validation, and security fixes
- Add per-IP rate limiter middleware (5 req/min) on /register endpoint
- Validate username (3-64 chars) and password (8-128 chars) with trim
- Use sentinel error ErrUsernameAlreadyExists instead of string matching
- Prevent TurnstileSecretKey exposure via admin settings API (json:"-")
- Skip json:"-" fields in UpdateAllSetting to avoid overwriting secrets
- Add SetTurnstileSecretKey setter for programmatic configuration
- Reuse package-level http.Client in Turnstile verification for connection pooling
- Add io.LimitReader to cap Turnstile response body size
- Log all Turnstile verification error paths for debugging
- Add invalidUsername/invalidPassword i18n keys to all 13 locales
2026-04-03 02:02:25 +08:00
Sora39831
b4047cee54 feat: allow same email across multiple inbounds and auto-add clients on registration
Remove global unique constraint on client_traffics.email, change email
duplication check to per-inbound scope, and automatically register new
users as disabled clients in all existing inbounds within a transaction.
2026-04-03 01:38:31 +08:00
Sora39831
87c94cb5b0 fix: make Turnstile widget responsive on narrow screens
Turnstile iframe (~300px min width) overflowed its container on mobile
due to large login card padding and no overflow handling. Reduce mobile
padding, center the widget wrapper, and use compact mode below 480px.
2026-04-03 00:30:55 +08:00
Sora39831
516d24c70a fix: correct gofmt formatting in setting.go 2026-04-03 00:01:07 +08:00
Sora39831
5f83415e95 feat: add user registration with role-based access
- Add Role field to User model (admin/user) with uniqueIndex on Username
- Add POST /register endpoint with optional Cloudflare Turnstile verification
- Add RegisterUser service with bcrypt password hashing and duplicate detection
- Set default admin user role to "admin", new registrations get "user"
- Add turnstileSecretKey setting and GetTurnstileSecretKey getter
- Add i18n keys (userExists, errorRegister) to all 13 translation files
2026-04-02 23:49:30 +08:00
Sora39831
5729cebb8e fix(setting): merge missing default keys into x-ui.json on load
New fields added after initial install are now automatically merged
into the existing x-ui.json file, so upgrades pick up defaults for
newly added settings without requiring manual intervention.
2026-04-02 22:25:50 +08:00
Sora39831
5103d57879 feat: add registration tab with Cloudflare Turnstile support
Add a register tab on the login page with username, password, confirm
password fields and Cloudflare Turnstile widget. The site key is
configurable via x-ui.json and exposed through a public endpoint.
2026-04-02 20:18:48 +08:00
Sora39831
30b27bf091 feat: migrate settings to JSON file, add Cloudflare SSL in installer
- config: add GetSettingPath for JSON-based settings storage
- setting.go: load/save settings from JSON file instead of DB;
  keep xrayTemplateConfig in DB; fix ResetSettings to not clear users
- xray_setting.go: save xray template config to DB directly
- install.sh: add Cloudflare SSL option (wildcard via DNS), allow
  user to input custom credentials on fresh install, fix existing
  install logic to preserve user config
2026-04-02 16:16:52 +08:00
Sora39831
286056ab03 feat: improve uninstall and reset_config behavior
- uninstall: add certificate revocation prompt before removing
- reset_config: fix misleading confirmation text, also reset cert
  config; remove user table deletion from Go ResetSettings
2026-04-02 16:15:07 +08:00
root
af7ed2a38f chore: update GitHub links to fork repository Sora39831/3x-ui
Replace all MHSanaei/3x-ui references in shell scripts, README files,
HTML, and CI config with Sora39831/3x-ui. Go import paths unchanged
to maintain upstream compatibility.
2026-04-02 09:49:12 +08:00
MHSanaei
f0f98c7122
Add Go code analyzer workflow
Some checks are pending
Release 3X-UI / Analyze Go code (push) Waiting to run
Release 3X-UI / build (386) (push) Blocked by required conditions
Release 3X-UI / build (amd64) (push) Blocked by required conditions
Release 3X-UI / build (arm64) (push) Blocked by required conditions
Release 3X-UI / build (armv5) (push) Blocked by required conditions
Release 3X-UI / build (armv6) (push) Blocked by required conditions
Release 3X-UI / build (armv7) (push) Blocked by required conditions
Release 3X-UI / build (s390x) (push) Blocked by required conditions
Release 3X-UI / Build for Windows (push) Blocked by required conditions
2026-03-17 23:01:15 +01:00
Abdalrahman
554981d9d3
feat(tgbot): send connection links and qrs on client creation (closes #3320)\n\n- Refactored inline keyboards into getCommonClientButtons to respect DRY\n- Extended SubmitAddClient callback handlers to dispatch individual links and QR codes to the bot chat on success. (#3888) 2026-03-17 22:09:49 +01:00
Nikolay
a08f1c6c13
Update translate.ru_RU.toml (#3889)
Change to plural (geofiles, not geofile)
2026-03-17 21:24:09 +01:00
Alimpo
7f7ae0c547
fix: stop overwriting client_traffics.enable with JSON enable in GetClientTrafficByEmail (#3931)
When a client hit traffic/expiry limit, disableInvalidClients sets
client_traffics.enable=false and removes the user from Xray. GetClientTrafficByEmail
was overwriting that with settings.clients[].enable (admin config), so
ResetClientTraffic never saw the client as disabled and did not re-add
the user. Clients could not connect until manually disabled/re-enabled.
Now the DB runtime enable flag is preserved; reset correctly re-adds
the user to Xray.
2026-03-17 21:20:24 +01:00
HamidReza Sadeghzadeh
60abeaad66
fix: Ban new IPs with fail2ban instead of disconnected the client. (#3919)
* fix: Ban new IPs with fail2ban  instead of disconnected the client.

* fix: Remove unused strconv import

* fix: Revert log fail2ban format
2026-03-17 21:18:10 +01:00
Aleksei Sidorenko
a2097ad062
feat: mask password in telegram notification on 2FA failure (#3884)
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (push) Has been cancelled
2026-03-04 18:26:53 +01:00
MHSanaei
34d8885075
Adjust KCP MTU when selecting xDNS mask 2026-03-04 13:39:14 +01:00
MHSanaei
5740996436
update dependencies 2026-03-04 13:05:29 +01:00
Happ-dev
ccd223aeea
Fix DeepLink for Happ, remove encoding URL (#3863)
Co-authored-by: y.sivushkin <y.sivushkin@corp.101xp.com>
2026-03-04 12:29:46 +01:00
Aleksei Sidorenko
96b8fe472c
Fix: escape HTML characters in tgbot start command (#3883) 2026-03-04 11:35:24 +01:00
Nabi KaramAliZadeh
59b695ba83
fix: remove excluded paths from gzip middleware in router initialization (#3860)
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (push) Has been cancelled
2026-03-01 15:18:16 +01:00
Alireza Ahmadi
2b1d3e7347 [feat] restart xray-core from cli #3825 2026-02-20 00:03:16 +01:00
MHSanaei
5b796672e9
Improve telego client robustness and retries
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (push) Has been cancelled
Add a createRobustFastHTTPClient helper to configure fasthttp.Client with better timeouts, connection limits, retries and optional SOCKS5 proxy dialing. Validate and sanitize proxy and API server URLs instead of returning early on invalid values, and build telego.Bot options dynamically. Reduce long-polling timeout to detect connection issues faster and adjust update retrieval comments. Implement exponential-backoff retry logic for SendMessage calls to handle transient connection/timeouts and improve delivery reliability; also reduce inter-message delay for better throughput.
2026-02-14 22:49:19 +01:00
MHSanaei
3fa0da38c9
Add timeouts and delays to backup sends
Add rate-limit friendly delays and context timeouts when sending backups via Telegram. Iterate admin IDs with index to sleep 1s between sends; add 30s context.WithTimeout for each SendDocument call and defer file.Close() for opened files; insert a 500ms pause between sending DB and config files. These changes improve resource cleanup and reduce chance of Telegram rate-limit/timeout failures.
2026-02-14 22:31:41 +01:00
MHSanaei
8eb1225734
translate bug fix #3789 2026-02-14 21:41:20 +01:00
MHSanaei
e5c0fe3edf
bug fix #3785
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (push) Has been cancelled
2026-02-11 22:21:09 +01:00
MHSanaei
84013b0b3f
v2.8.10 2026-02-11 18:21:43 +01:00
MHSanaei
511adffc5b
Remove allowInsecure
Remove the deprecated `allowInsecure`
2026-02-11 18:21:23 +01:00
bakatrouble
fc6344b840
Fix ipv6 hostname parsing for subscriptions (#3782) 2026-02-11 15:33:53 +01:00
emirjorge
b3555ce1b8
Update translate.es_ES.toml (#3766)
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (push) Has been cancelled
Fix some trasnslations :)
2026-02-09 23:40:03 +01:00
MHSanaei
c2f409c3c4
fix security issue 2026-02-09 23:36:10 +01:00
surbiks
4779939424
Add url speed test for outbound (#3767)
* add outbound testing functionality with configurable test URL

* use no kernel tun for conflict errors
2026-02-09 21:43:17 +01:00
Sanaei
5bb87fd3d4
fix : Uncontrolled data used in path expression
Co-Authored-By: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-07 22:54:40 +01:00
Aung Ye Zaw
d8fb09faae
feat: implement 'last IP wins' policy for IP limitation (#3735)
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (push) Has been cancelled
- Add timestamp tracking for each client IP address
- Sort IPs by connection time (newest first) instead of alphabetically
- Automatically disconnect old connections when IP limit exceeded
- Keep only the most recent N IPs based on LimitIP setting
- Force disconnection via Xray API (RemoveUser + AddUser)
- Prevents account sharing while allowing legitimate network switching
- Log format: [LIMIT_IP] Email = user@example.com || Disconnecting OLD IP = 1.2.3.4 || Timestamp = 1738521234

This ensures users can seamlessly switch between networks (mobile/WiFi)
and the system maintains connections from their most recent IPs only.

Fixes account sharing prevention for VPN providers selling per-IP licenses.

Co-authored-by: Aung Ye Zaw <zaw.a.y@phluid.world>
2026-02-04 00:38:11 +01:00
MHSanaei
f87c68ea68
Add workflow to clean old GitHub Actions caches
Some checks are pending
Release 3X-UI / build (386) (push) Waiting to run
Release 3X-UI / build (amd64) (push) Waiting to run
Release 3X-UI / build (arm64) (push) Waiting to run
Release 3X-UI / build (armv5) (push) Waiting to run
Release 3X-UI / build (armv6) (push) Waiting to run
Release 3X-UI / build (armv7) (push) Waiting to run
Release 3X-UI / build (s390x) (push) Waiting to run
Release 3X-UI / Build for Windows (push) Waiting to run
Adds a scheduled GitHub Actions workflow (.github/workflows/cleanup_caches.yml) that runs weekly (and via workflow_dispatch) to delete Actions caches not accessed in the last 3 days. The job uses the gh CLI with the repository token and actions: write permission to list caches, filter by last_accessed_at against a 3-day cutoff, and delete matching cache IDs.
2026-02-03 00:19:44 +01:00
Nebulosa
03f04194f2
Update geofiles according 304 http respond (#3690)
* feat: enhance geofile update process with conditional GET and modification time handling

* style: improve formatting in UpdateGeofile function
2026-02-02 23:20:57 +01:00
Alimpo
248700a8a3
fix: trim whitespace from comma-separated list values in routing rules (#3734) 2026-02-02 23:19:30 +01:00
MHSanaei
e8d2973be7
Finalmask: Add XICMP 2026-02-02 17:50:30 +01:00