How hatemosphere/protonvpn-wg-confgen works
This CLI authenticates to ProtonVPN, selects a suitable server, requests or manages a WireGuard certificate, and writes a usable tunnel configuration. It also supports server/config listing, renewal, revocation, and session-only certificates. The graph combines explicit README workflows with the shown calls; several command setup and VPN request details are excerpted incompletely, so uncertain internal links are omitted.
Main entry points: main.go Command modes · client.go VPN API client · servers.go Server filtering · auth.go SRP and 2FA login
Components 15
Command line
- Command modes
cmd/protonvpn-wg/main.go - Flags and validation
internal/config/flags.go
Authentication
- SRP and 2FA login
internal/auth/auth.go - Session persistence
internal/auth/session.go - Private file writes
internal/securefile/write.go
VPN services
- VPN API client
internal/vpn/client.go - Server filtering
internal/vpn/servers.go - V2 server scoring
internal/serverstatus/serverstatus.go
Configuration output
- WireGuard config
internal/wireguard/config.go
API protocol
- Wire transport
internal/api/wire.go - HTTP API helpers
internal/api/transport.go - API data types
internal/api/types.go
Other components
- CLI user
- ProtonVPN API
- WireGuard profile
Connections 17
- CLI user → Command modes: runs commands
README.md - Command modes → Flags and validation: parses flags
cmd/protonvpn-wg/main.go - Command modes → VPN API client: applies plan
cmd/protonvpn-wg/main.go - Command modes → Server filtering: filters servers
cmd/protonvpn-wg/main.go - Command modes → WireGuard config: generates profile
cmd/protonvpn-wg/main.go - Command modes → ProtonVPN API: supports list, renew, revoke
README.md - SRP and 2FA login → ProtonVPN API: authenticates
README.md - SRP and 2FA login → Session persistence: persists session
README.md - Session persistence → Private file writes: writes session
internal/auth/session.go - VPN API client → ProtonVPN API: requests VPN data
README.md - VPN API client → Server filtering: fetches server list
internal/vpn/client.go - Server filtering → V2 server scoring: ranks v2 servers
README.md - WireGuard config → WireGuard profile: writes profile
README.md - Wire transport → ProtonVPN API: sends HTTP requests
internal/api/wire.go - HTTP API helpers → Wire transport: uses transport
- VPN API client → HTTP API helpers: uses API helpers
- VPN API client → API data types: decodes responses