feat: add naive client and panel integration - #5962
Conversation
|
Summary: This PR adds a substantial new subsystem: a panel-managed Naive proxy client with lifecycle management, a local-SOCKS5 runtime bridge into Xray, panel UI, and 13-locale i18n, plus a credential double-encoding fix for outbound probes. The backend design is generally careful (transactional DB sync, tag/proxy-URL validation, graceful process shutdown) and the new Go tests follow repo conventions. However the PR currently ships an 84 MB compiled binary and an out-of-sync frontend lockfile that will break CI, plus violations of this repo's hard rules and some duplicated logic. These need fixing before merge. Critical / High / Repository hygiene Critical / High / Build High / High / Convention and formatting Medium / High / Maintainability Medium / Medium / Security (input validation) Medium / High / Documentation (hard rule) Medium / Medium / Correctness Low / High / i18n; Low / Medium / Reliability Positive observations: The new Go tests follow repo stdlib-testing conventions well (t.Helper, t.TempDir, t.Cleanup), and syncNaiveOutboundsTx correctly wraps the DB sync in a transaction with process start/stop deferred until after commit. Tag/proxy-URL validation is consistently applied where outbounds are created or started, aside from the logs endpoint above. Verdict: Request changes. The committed binary and the broken npm lockfile are independently blocking (the latter fails CI outright); combined with the hard-rule violations and duplicated logic, this needs another pass before merge. @MHSanaei This review was generated automatically. A maintainer may follow up. |
57bcf67 to
a1d60d5
Compare
Add a full naive proxy sidecar lifecycle and panel integration: - internal/naive/: process manager, config builder, downloader, log writer, input validators, xray config injector - internal/web/controller/naive.go: REST endpoints for status, install, restart-all, stop-all, logs, binary delete - internal/web/service/xray_naive.go: xray config injection - frontend: NaiveStatusCard, NaiveVersionModal, naive outbound form, Zod schema, outbound-form-adapter round-trip, API docs entries Compliance fixes: - No // line comments (repo rule) - gofmt clean - All 8 naive routes documented in endpoints.ts - NaiveOutbound added to migrationModels() for cross-DB parity - Tag validation in logs handler (path traversal guard) - Credential encoding uses direct encodeURIComponent (no double-encode) - i18n keys replace hardcoded titles - waitDone helper makes Stop() await process exit on all platforms
a1d60d5 to
f0e2744
Compare
|
All review findings have been addressed in the latest push. P0 — CI blockers
P1 — Repository rules
P2 — Security / correctness
P3 — Maintainability
Sequential stop/restart hardening (nice-to-have)
Tests added
All of |
Summary
This PR adds Naive client integration to 3x-ui with panel-managed lifecycle, UI actions, and runtime wiring for outbound usage through local SOCKS5.
Why
This implements the functionality discussed in #5961 and provides actual code for review instead of an architecture-only proposal.
Use case enabled:
Refs #5961
Type of change
Areas affected
generate_204via Naive SOCKS5)