mirror of
https://github.com/h44z/wg-portal.git
synced 2026-12-05 19:56:06 +01:00
feat: add support for AmneziaWG (#649)
This commit is contained in:
@@ -40,6 +40,10 @@ func (c *ControllerManager) init() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := c.registerAmneziaWGController(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := c.registerMikrotikControllers(); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -136,6 +140,26 @@ func (c *ControllerManager) registerOpnsenseControllers() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *ControllerManager) registerAmneziaWGController() error {
|
||||
if !c.cfg.Backend.AmneziaWG.Enabled {
|
||||
return nil
|
||||
}
|
||||
controller, err := wgcontroller.NewAmneziaWGController(c.cfg)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create AmneziaWG controller: %w", err)
|
||||
}
|
||||
c.controllers[config.AmneziaWGBackendName] = backendInstance{
|
||||
Config: config.BackendBase{
|
||||
Id: config.AmneziaWGBackendName,
|
||||
DisplayName: "AmneziaWG",
|
||||
Type: "amneziawg",
|
||||
IgnoredInterfaces: c.cfg.Backend.AmneziaWG.IgnoredInterfaces,
|
||||
},
|
||||
Implementation: controller,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *ControllerManager) logRegisteredControllers() {
|
||||
for backend, controller := range c.controllers {
|
||||
slog.Debug("backend controller registered",
|
||||
|
||||
Reference in New Issue
Block a user