10 Commits
Author SHA1 Message Date
Evgen f3a50eed6c Заменил ссылки на свой Gitea 2026-08-21 19:41:55 +08:00
Evgen 7effdd6c7c Заменил ссылки на свой Gitea 2026-08-21 19:27:38 +08:00
Ivan RazinandClaude Fable 5 eaf1a53d2a feat(installer): default -install to y
Running without parameters previously skipped package install and
failed at certbot on a clean server. Packages now install by default;
use -install n to skip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 08:45:56 +03:00
Ivan RazinandClaude Fable 5 6d0876fd19 feat(installer): add -version flag to pin 3x-ui release
Accepts 3.4.2 or v3.4.2; validates the tag exists on GitHub before
download, falls back to latest when omitted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 16:03:13 +03:00
Ivan RazinandClaude Fable 5 d10a16a1a2 Add x-ui-adguard.sh: AdGuard Home on panel domain via nginx paths
DoH at /dns-query, admin UI at random /adg-<rand>/ path. AGH binds
localhost only (web UI + plain DNS on random ports); nginx bridges both
paths on the existing panel vhost, so no new domain, cert, or open port.
Config pre-seeded (no wizard), bcrypt password via htpasswd, re-run
safe, -uninstall y supported.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 09:39:44 +03:00
Ivan RazinandClaude Fable 5 ba6d9ca1d2 Add h2/http1.1 ALPN to tls hosts; make raw diag link self-authorize
Host ALPN: ws/xhttp/trojan hosts now advertise ["h2","http/1.1"];
reality host gets [] (its ALPN comes from the reality stream).

Diagnostics access: opening the diag path directly without the
diag_key cookie previously 404'd, so a bookmarked link only worked
after manually visiting /<panel_path>/diag. Now the diag page
302-bounces unauthenticated hits through the SSO bridge, which
validates the 3x-ui panel session and mints the cookie, then redirects
back - so the link works once you're logged into the panel. API and
asset sub-locations still 404 without the cookie (only the HTML page
redirects, never XHR/asset requests).

Verified end to end with nginx + the auth semantics of the installed
3x-ui v3.4.2: logged-in raw hit resolves to the page with no loop,
anonymous hit lands on the panel login.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 15:54:56 +03:00
Ivan RazinandClaude Fable 5 716840a691 Replace externalProxy arrays with hosts table entries
3x-ui now renders share-link endpoints from the hosts table, which
supersedes the legacy externalProxy arrays in stream_settings. Remove
those arrays from all four inbounds and insert one host per inbound
instead (inbound_id resolved by tag):

- REALITY: panel domain, 443, security=same (inherits reality params)
- ws / xhttp / trojan-grpc: panel domain, 443, security=tls,
  fingerprint firefox

Also switch the REALITY inbound uTLS fingerprint from chrome to
firefox to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 15:26:47 +03:00
Ivan RazinandClaude Fable 5 d816b5edcc Gate diagnostics behind 3x-ui panel login via nginx SSO bridge
The 3x-ui session cookie is Path-scoped to the panel base path, so the
diag vhost locations can never see it directly. Instead a bridge
location under the panel path (/<panel_path>/diag) validates the
session with auth_request against GET <basePath>/panel/ (sent with
X-Requested-With: XMLHttpRequest so 3x-ui answers 401 instead of a
login redirect), then issues a path-scoped diag_key cookie and
redirects to the diagnostics page. All diag locations return 404
without that cookie.

auth_request runs in the access phase while "return" runs in the
rewrite phase, so the success path hops through try_files to a named
location; the cookie is set only there, never on the 401 redirect.

Replaces the previous ?key= token link, which is removed entirely.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 15:05:29 +03:00
Ivan RazinandClaude Fable 5 bd2c47753e Fix installer bugs, version-aware http2 directive, cleaner results screen
Bug fixes:
- Root check: exit with message instead of "sudo su -" (which continued
  the script as non-root after the shell exited)
- Move destructive cleanup into clean_previous_install(), called after
  domain validation - wrong args no longer wipe a working install
- x25519 keygen: use xray-linux-$(_arch) instead of hardcoded amd64,
  with fallback for renamed ARM binaries
- Cert renewal: certs are standalone-issued, so renew with pre/post
  hooks stopping nginx instead of --nginx (which could not bind :80)
- Drop ngx_stream_geoip2 load_module insertion: module was never
  installed or used and broke nginx -t when the .so was absent
- emoji_flag: 10s curl timeout + fallback when ipwho.is unavailable
- Uninstall: rm -f /usr/bin/x-ui (trailing slash made rm fail on file)

nginx >= 1.25.1 deprecates "listen ... http2"; emit "http2 on;" there
and keep the old syntax on older versions (Debian 12, Ubuntu 24.04).

Results screen: drop certbot/ssl cert dumps and Clash sub links, keep
panel URL + credentials + diagnostics. Update CLAUDE.md to current
repo state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:29:46 +03:00
Ivan RazinandClaude Sonnet 4.6 411490ab82 Initial commit: modular single-file 3x-ui installer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 10:33:07 +03:00