How gaboei/watchdogvpn works
WatchdogVPN is a Linux network-control plane, not just a tunnel launcher. The main workflow is operator command → daemon IPC → runtime action → protocol driver and protected network state, with rotation and watchdog recovery preserving connectivity. Separate policy stages decide routes and DNS behavior; persistent profiles, providers and rules supply configuration. The README also documents diagnostics, backups, metrics and protocol integrations. The sampled sources establish several internals, but many feature links are supported only at the product/module level, so uncertain call relationships are omitted.
Main entry points: runtime_worker.py Runtime worker · cli/main.py CLI commands · daemon/main.py Daemon startup · ipc_server.py IPC server
Components 26
Operator interface
- CLI commands
cli/main.py - Terminal UI
tui/watchdogvpn - IPC client
cli/ipc/client.py
Daemon runtime
- Daemon startup
daemon/main.py - IPC server
daemon/ipc_server.py - Runtime worker
daemon/runtime_worker.py - Watchdog loop
daemon/watchdog_loop.py - Rotation loop
daemon/scheduled_rotation_loop.py - Rotation and recovery
rotation/rotation_engine.py - Protocol drivers
drivers
Traffic policy
- Rule evaluation
rules/rule_engine.py - App policy
app_policy - Node selection
node_groups - Route chains
route_chains/runtime.py
Network safety
- DNS policy
dns - Resolver state
dns/state_manager.py - Kill switch
core/kill_switch.py
Configuration and insight
- Profiles and providers
providers - Profile store
config/profile_store.py - Provider store
config/provider_store.py - Diagnostics
diagnostics - Backup and restore
config/backup_manager.py - Metrics
metrics - Runtime settings
config/state_manager.py
Other components
- Operator
- Linux networking
Connections 29
- Operator → CLI commands: runs commands
- Operator → Terminal UI: uses interface
- CLI commands → IPC client: sends requests
- IPC client → IPC server: IPC requests
- Daemon startup → IPC server: starts
- Daemon startup → Watchdog loop: starts
- Daemon startup → Rotation loop: starts
- IPC server → Runtime worker: dispatches
- Watchdog loop → Runtime worker: checks runtime
- Rotation loop → Rotation and recovery: schedules
- Rotation and recovery → Protocol drivers: tries profiles
- Runtime worker → Protocol drivers: controls tunnels
- Protocol drivers → Linux networking: configures tunnel
- Profiles and providers → Profile store: persists profiles
- Profiles and providers → Provider store: persists providers
- Runtime worker → Rule evaluation: evaluates traffic
- Runtime worker → App policy: applies policy
- Runtime worker → Node selection: selects nodes
- Runtime worker → Route chains: resolves chains
- Runtime worker → DNS policy: applies DNS policy
- DNS policy → Resolver state: changes resolver state
- Resolver state → Linux networking: updates resolvers
- Runtime worker → Kill switch: controls protection
- Kill switch → Linux networking: enforces traffic limits
- Runtime worker → Runtime settings: reads settings
- CLI commands → Diagnostics: requests reports
- CLI commands → Backup and restore: exports or restores
- Runtime worker → Metrics: records runtime
- CLI commands → Metrics: views status