feat(server): patch VPN settings

- `PUT` at `/v1/vpn/settings`
- Undocumented, experimental for now
This commit is contained in:
Quentin McGaw
2022-08-21 23:36:48 +00:00
parent d685d78e74
commit 0bb320065e
8 changed files with 60 additions and 18 deletions

View File

@@ -46,7 +46,7 @@ func (s *Settings) Validate(storage Storage) (err error) {
"version": s.Version.validate,
// Pprof validation done in pprof constructor
"VPN": func() error {
return s.VPN.validate(storage)
return s.VPN.Validate(storage)
},
}
@@ -73,7 +73,7 @@ func (s *Settings) copy() (copied Settings) {
System: s.System.copy(),
Updater: s.Updater.copy(),
Version: s.Version.copy(),
VPN: s.VPN.copy(),
VPN: s.VPN.Copy(),
Pprof: s.Pprof.Copy(),
}
}
@@ -108,7 +108,7 @@ func (s *Settings) OverrideWith(other Settings,
patchedSettings.System.overrideWith(other.System)
patchedSettings.Updater.overrideWith(other.Updater)
patchedSettings.Version.overrideWith(other.Version)
patchedSettings.VPN.overrideWith(other.VPN)
patchedSettings.VPN.OverrideWith(other.VPN)
patchedSettings.Pprof.OverrideWith(other.Pprof)
err = patchedSettings.Validate(storage)
if err != nil {