How lotovich/amnezia-vpn-manager works
AmneziaWG VPN Manager is an admin-operated Telegram bot for provisioning and managing VPN clients, tracking traffic, and monitoring server health. Administrators issue commands; handlers coordinate client records and AmneziaWG configuration, then deliver client connection material. Background tasks collect peer traffic and server metrics for statistics and alerts. The graph reflects README-described QR/config delivery and bot capabilities, but their full implementations were not sampled; relationships are included only where excerpts, the source index, or README support them.
Main entry points: bot_handlers.py Command handlers · database.py Data access · main.py Application runtime · vpn_manager.py VPN manager
Components 14
Bot control
- Application runtime
src/main.py - Command handlers
src/bot_handlers.py
VPN operations
- Client config and QR
src/bot_handlers.py - VPN manager
src/vpn_manager.py - AmneziaWG interface
Persistence and statistics
- Traffic collector
src/main.py - Data access
src/database.py - SQLite database
- Statistics charts
src/stats_viz.py
Server monitoring
- Server stats collector
src/main.py - Server monitor
src/server_monitor.py
Other components
- Administrator
- Telegram
- Host metrics
Connections 20
- Administrator → Telegram: issues commands
README.md - Telegram → Command handlers: routes commands
README.md - Application runtime → Command handlers: registers router
src/main.py - Command handlers → Data access: manages clients
src/bot_handlers.py - Command handlers → VPN manager: provisions peers
src/bot_handlers.py - Command handlers → Client config and QR: creates materials
README.md - Client config and QR → Telegram: delivers config and QR
README.md - VPN manager → AmneziaWG interface: configures interface
src/vpn_manager.py - Application runtime → VPN manager: initializes and syncs
src/main.py - Application runtime → Traffic collector: starts task
src/main.py - Traffic collector → VPN manager: reads peer counters
src/main.py - Traffic collector → Data access: records traffic and sessions
src/main.py - Command handlers → Statistics charts: renders statistics
src/bot_handlers.py - Command handlers → Data access: reads statistics
src/bot_handlers.py - Data access → SQLite database: reads and writes
src/database.py - Application runtime → Server stats collector: starts task
src/main.py - Server stats collector → Server monitor: collects and checks metrics
src/main.py - Server monitor → Host metrics: samples system
src/server_monitor.py - Server stats collector → Data access: records metrics and events
src/main.py - Server stats collector → Telegram: sends alerts
src/main.py