How rakasatria/ovpn-radius works
Project type and purpose
• This is a Go‑based OpenVPN server plugin that provides RADIUS authentication and accounting by wrapping FreeRADIUS’s RadClient.
• It is primarily an “open‑source tool”/plugin designed to be invoked by OpenVPN to delegate user authentication and session accounting to a RADIUS server, while also maintaining a local SQLite session log and writing diagnostic logs.
File structure
• Top‑level files:
– README.md, LICENSE, .gitignore, .vscode (editor settings).
• src/ directory:
– main.go: plugin entrypoint, parses commands (“auth”, “acct”, “stop”) from OpenVPN.
– config.go + config.json: defines and holds plugin settings (RADIUS server addresses, secrets, OpenVPN server info, log file path).
– database.go: encapsulates SQLite storage for session/accounting data.
– go.mod, go.sum: Go module metadata.
• No separate frontend/backend—this is a single binary invoked by the OpenVPN server.
README for additional insights
• README outlines installation and integration steps—copying binary and config.json into /etc/openvpn/plugin, creating an SQLite database folder, and log file placement.
• It shows the OpenVPN server.conf hooks (auth-user-pass-verify, client-connect, client-disconnect).