Documentation
¶
Index ¶
- func APIStatus(db store.IStore) echo.HandlerFunc
- func ApplyServerConfig(db store.IStore, tmplDir fs.FS) echo.HandlerFunc
- func ContentTypeJson(next echo.HandlerFunc) echo.HandlerFunc
- func CreateUser(db store.IStore) echo.HandlerFunc
- func DownloadClient(db store.IStore) echo.HandlerFunc
- func EmailClient(db store.IStore, mailer emailer.Emailer, emailSubject, emailContent string) echo.HandlerFunc
- func Favicon() echo.HandlerFunc
- func GetClient(db store.IStore) echo.HandlerFunc
- func GetClients(db store.IStore) echo.HandlerFunc
- func GetHashesChanges(db store.IStore) echo.HandlerFunc
- func GetOrderedSubnetRanges() echo.HandlerFunc
- func GetUser(db store.IStore) echo.HandlerFunc
- func GetUsers(db store.IStore) echo.HandlerFunc
- func GlobalSettingSubmit(db store.IStore) echo.HandlerFunc
- func GlobalSettings(db store.IStore) echo.HandlerFunc
- func Health() echo.HandlerFunc
- func LoadProfile() echo.HandlerFunc
- func Login(db store.IStore) echo.HandlerFunc
- func LoginPage() echo.HandlerFunc
- func Logout() echo.HandlerFunc
- func MachineIPAddresses() echo.HandlerFunc
- func NeedsAdmin(next echo.HandlerFunc) echo.HandlerFunc
- func NewClient(db store.IStore) echo.HandlerFunc
- func RefreshSession(next echo.HandlerFunc) echo.HandlerFunc
- func RemoveClient(db store.IStore) echo.HandlerFunc
- func RemoveUser(db store.IStore) echo.HandlerFunc
- func SetClientStatus(db store.IStore) echo.HandlerFunc
- func Status(db store.IStore) echo.HandlerFunc
- func SuggestIPAllocation(db store.IStore) echo.HandlerFunc
- func UpdateClient(db store.IStore) echo.HandlerFunc
- func UpdateUser(db store.IStore) echo.HandlerFunc
- func UsersSettings() echo.HandlerFunc
- func ValidSession(next echo.HandlerFunc) echo.HandlerFunc
- func WireGuardClients(db store.IStore) echo.HandlerFunc
- func WireGuardServer(db store.IStore) echo.HandlerFunc
- func WireGuardServerInterfaces(db store.IStore) echo.HandlerFunc
- func WireGuardServerKeyPair(db store.IStore) echo.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIStatus ¶
func APIStatus(db store.IStore) echo.HandlerFunc
APIStatus returns the current WireGuard status as JSON. This handler is intended to be polled via AJAX to update the VPN status table dynamically.
func ApplyServerConfig ¶
ApplyServerConfig handler writes the config file and restarts the WireGuard server.
func ContentTypeJson ¶
func ContentTypeJson(next echo.HandlerFunc) echo.HandlerFunc
ContentTypeJson is middleware that ensures the request's Content-Type header starts with "application/json". This helps mitigate CSRF attacks by rejecting requests that do not explicitly signal a JSON payload.
func CreateUser ¶
func CreateUser(db store.IStore) echo.HandlerFunc
CreateUser handler creates a new user.
func DownloadClient ¶
func DownloadClient(db store.IStore) echo.HandlerFunc
DownloadClient handler streams the client configuration for download.
func EmailClient ¶
func EmailClient(db store.IStore, mailer emailer.Emailer, emailSubject, emailContent string) echo.HandlerFunc
EmailClient handler sends the configuration via email.
func Favicon ¶
func Favicon() echo.HandlerFunc
func GetClient ¶
func GetClient(db store.IStore) echo.HandlerFunc
GetClient handler returns a JSON object of WireGuard client data.
func GetClients ¶
func GetClients(db store.IStore) echo.HandlerFunc
GetClients handler returns a JSON list of WireGuard client data.
func GetHashesChanges ¶
func GetHashesChanges(db store.IStore) echo.HandlerFunc
GetHashesChanges handler returns if database hashes have changed.
func GetOrderedSubnetRanges ¶
func GetOrderedSubnetRanges() echo.HandlerFunc
GetOrderedSubnetRanges handler returns the ordered list of subnet ranges.
func GetUser ¶
func GetUser(db store.IStore) echo.HandlerFunc
GetUser handler returns a JSON object of a single user.
func GetUsers ¶
func GetUsers(db store.IStore) echo.HandlerFunc
GetUsers handler returns a JSON list of all users.
func GlobalSettingSubmit ¶
func GlobalSettingSubmit(db store.IStore) echo.HandlerFunc
GlobalSettingSubmit handler updates the global settings.
func GlobalSettings ¶
func GlobalSettings(db store.IStore) echo.HandlerFunc
GlobalSettings handler renders the global settings page.
func LoadProfile ¶
func LoadProfile() echo.HandlerFunc
LoadProfile handler to load user profile information.
func MachineIPAddresses ¶
func MachineIPAddresses() echo.HandlerFunc
MachineIPAddresses handler returns local and public interface IP addresses.
func NeedsAdmin ¶
func NeedsAdmin(next echo.HandlerFunc) echo.HandlerFunc
NeedsAdmin middleware ensures that only admin users proceed.
func NewClient ¶
func NewClient(db store.IStore) echo.HandlerFunc
NewClient handler creates a new WireGuard client.
func RefreshSession ¶
func RefreshSession(next echo.HandlerFunc) echo.HandlerFunc
RefreshSession middleware refreshes a "remember me" session. This should be used after ValidSession has verified the session.
func RemoveClient ¶
func RemoveClient(db store.IStore) echo.HandlerFunc
RemoveClient handler deletes a WireGuard client.
func RemoveUser ¶
func RemoveUser(db store.IStore) echo.HandlerFunc
RemoveUser handler deletes a user.
func SetClientStatus ¶
func SetClientStatus(db store.IStore) echo.HandlerFunc
SetClientStatus handler enables/disables a client.
func Status ¶
func Status(db store.IStore) echo.HandlerFunc
Status renders the HTML page for VPN status.
func SuggestIPAllocation ¶
func SuggestIPAllocation(db store.IStore) echo.HandlerFunc
SuggestIPAllocation handler returns a list of suggested IP addresses.
func UpdateClient ¶
func UpdateClient(db store.IStore) echo.HandlerFunc
UpdateClient handler updates client information.
func UpdateUser ¶
func UpdateUser(db store.IStore) echo.HandlerFunc
UpdateUser handler updates user information.
func UsersSettings ¶
func UsersSettings() echo.HandlerFunc
UsersSettings handler renders the users settings page.
func ValidSession ¶
func ValidSession(next echo.HandlerFunc) echo.HandlerFunc
ValidSession is middleware that checks for a valid session. If the session is invalid, it redirects the user to the login page.
func WireGuardClients ¶
func WireGuardClients(db store.IStore) echo.HandlerFunc
WireGuardClients handler renders the WireGuard clients page.
func WireGuardServer ¶
func WireGuardServer(db store.IStore) echo.HandlerFunc
WireGuardServer handler renders the WireGuard server page.
func WireGuardServerInterfaces ¶
func WireGuardServerInterfaces(db store.IStore) echo.HandlerFunc
WireGuardServerInterfaces handler updates server interface settings.
func WireGuardServerKeyPair ¶
func WireGuardServerKeyPair(db store.IStore) echo.HandlerFunc
WireGuardServerKeyPair handler generates a new WireGuard key pair.
Types ¶
This section is empty.