How tonulls/vpn-ui works
vpn-ui is an all-in-one VPN server panel built around an HTTP administration UI, persistent account/inbound configuration, and managed VPN/Xray processes. The main operator workflow is to sign in, configure accounts and inbounds, and have the panel manage services and expose client subscriptions; clients then connect using the configured protocols. The README documents broad daemon, kernel-tunnel, accounting, and Xray capabilities, while the supplied source excerpts only verify selected wiring. Edges for documented-but-unsampled integrations cite the README; other uncertain connections are omitted.
Main entry points: web.go HTTP server · service VPN protocol services · subService.go Subscription generation · job Scheduled monitoring
Components 19
Panel and administration
- HTTP server
web/web.go - Login and sessions
web/controller/index.go - Server controls
web/controller/server.go - Panel controllers
web/controller - Panel database
database/db.go
Accounts and subscriptions
- Account and inbound models
database/model/model.go - Account and inbound services
web/service - Subscription routes
sub/subController.go - Subscription generation
sub/subService.go - Clash output
sub/subClashService.go
VPN runtime
- VPN protocol services
web/service - VPN daemon management
backend/backend.go - Xray process and API
xray/process.go - AmneziaWG kernel module
awgsrc/src/main.c
Operations and security
- Scheduled monitoring
web/job - Certificate management
web/service/sslmanager.go
Other components
- Administrator
- VPN clients
- Internet services
Connections 24
- Administrator → HTTP server: uses panel
README.md - HTTP server → Login and sessions: routes requests
web/web.go - HTTP server → Panel controllers: registers routes
web/web.go - HTTP server → Scheduled monitoring: schedules jobs
web/web.go - Login and sessions → Panel database: authenticates users
- Server controls → HTTP server: registers routes
web/controller/server.go - Server controls → Account and inbound services: invokes services
web/controller/server.go - Panel controllers → Account and inbound services: uses services
web/controller/server.go - Panel database → Account and inbound models: persists records
database/db.go - Subscription routes → Subscription generation: builds responses
sub/subController.go - Subscription generation → Account and inbound models: reads account data
sub/subService.go - Subscription generation → Clash output: formats Clash
sub/subClashService.go - VPN clients → Subscription routes: fetches configuration
sub/subController.go - Administrator → Server controls: manages services
web/controller/server.go - Account and inbound services → VPN protocol services: configures protocols
- VPN protocol services → VPN daemon management: manages daemons
- VPN daemon management → VPN clients: serves VPN tunnels
README.md - VPN protocol services → AmneziaWG kernel module: sets up module
README.md - VPN protocol services → Xray process and API: configures core
README.md - Xray process and API → Internet services: routes traffic
README.md - Scheduled monitoring → Xray process and API: checks runtime
web/job/check_client_ip_job.go - Scheduled monitoring → Panel database: records client IPs
web/job/check_client_ip_job.go - Administrator → Certificate management: manages certificates
- Certificate management → Internet services: requests certificates
web/service/sslmanager.go