How abbas-gheydi/radotp works
RadOTP is a RADIUS server that provides VPN authentication with password, OTP, or combined modes, alongside an administrator web interface and REST API. The main runtime loads configuration and initializes storage, then starts the web and RADIUS services; optional Prometheus metrics are started when enabled. RADIUS challenges can request an OTP, which is checked against stored secrets, while LDAP supports directory credential checks. The README also documents user administration, logs, and monitoring. Some subsystem links rely on README statements because their implementation was not sampled.
Main entry points: router.go Web router · storage.go Storage interface · main.go Server entrypoint · rad Auth and challenge
Components 20
Runtime and configuration
- Server entrypoint
cmd/server/main.go - Configuration
pkgs/confs
RADIUS authentication
- RADIUS server
pkgs/rad/Start.go - Auth and challenge
pkgs/rad - RADIUS responses
pkgs/rad/actions.go - Vendor attributes
pkgs/rad/vendors
Identity and secrets
- LDAP authentication
pkgs/authentiate/ldap.go - OTP validation
pkgs/authentiate/otp.go - Storage interface
pkgs/storage/storage.go - OTP records
pkgs/storage/postgres_otp.go - Admin credentials
pkgs/storage/postgres_webadmin.go
Administration API
- Web router
pkgs/web/router.go - Web user management
pkgs/web/web.go - REST API
pkgs/web/api.go - Activity logs
pkgs/web/weblog.go
Monitoring
- Prometheus metrics
pkgs/monitoring
Other components
- VPN firewall
- Administrator
- Prometheus
- Directory service
Connections 24
- Server entrypoint → Configuration: loads
cmd/server/main.go - Server entrypoint → RADIUS server: starts
cmd/server/main.go - Server entrypoint → Web router: starts
cmd/server/main.go - Server entrypoint → Prometheus metrics: starts optionally
cmd/server/main.go - Configuration → RADIUS server: configures
pkgs/confs/load.go - Configuration → Prometheus metrics: configures
pkgs/confs/load.go - VPN firewall → RADIUS server: authenticates via RADIUS
README.md - RADIUS server → Auth and challenge: dispatches requests
- Auth and challenge → LDAP authentication: checks credentials
README.md - Auth and challenge → OTP validation: validates OTP
pkgs/rad/otp.go - Auth and challenge → RADIUS responses: sends challenge or result
pkgs/rad/otp.go - RADIUS responses → Vendor attributes: adds group attributes
pkgs/rad/actions.go - OTP validation → Storage interface: reads secret
pkgs/authentiate/otp.go - Storage interface → OTP records: uses OTP storage
pkgs/storage/storage.go - LDAP authentication → Directory service: checks directory
README.md - Web router → Web user management: routes requests
pkgs/web/router.go - Web router → REST API: routes API
README.md - Web router → Activity logs: serves logs
README.md - Administrator → Web router: manages users
README.md - Web user management → Storage interface: creates and edits OTPs
pkgs/web/web.go - Web user management → Storage interface: checks admin credentials
- Storage interface → Admin credentials: uses admin storage
pkgs/storage/storage.go - RADIUS responses → Prometheus metrics: records outcomes
pkgs/rad/actions.go - Prometheus metrics → Prometheus: exposes metrics
README.md