fix: autosave wireguard conf files (#303)

* fix: autosave wireguard conf files

- Fix subscription to Interface and Peer updates topics
- Remove admin permissions validation
- Update file on peer deletion
- Change save condition to configured storage path only, as initialized interface is not nil

* Added  comment to peer config for prometheus exporter
This commit is contained in:
Dmytro Bondar
2024-09-22 11:53:42 +02:00
committed by GitHub
parent 605841f2a0
commit 2428dedc42
3 changed files with 27 additions and 34 deletions

View File

@@ -60,6 +60,8 @@ PostDown = {{ .Interface.PostDown }}
{{range .Peers}}
{{- if not .IsDisabled}}
[Peer]
{{/* `friendly_name` used by https://github.com/MindFlavor/prometheus_wireguard_exporter */ -}}
# friendly_name = {{ .DisplayName }}
# -WGP- Peer: {{.Identifier}}
# -WGP- Created: {{.CreatedAt}}
# -WGP- Updated: {{.UpdatedAt}}
@@ -86,4 +88,4 @@ Endpoint = {{ .Endpoint.GetValue }}
PersistentKeepalive = {{ .PersistentKeepalive.GetValue }}
{{- end}}
{{- end}}
{{end}}
{{end}}