generate interface and peer configuration filenames in backend only (#395)

This commit is contained in:
Christoph
2025-04-19 13:12:31 +02:00
parent a60feb7fc9
commit 6681dfa96f
14 changed files with 91 additions and 20 deletions

View File

@@ -47,8 +47,9 @@ type Interface struct {
// Calculated values
EnabledPeers int `json:"EnabledPeers"`
TotalPeers int `json:"TotalPeers"`
EnabledPeers int `json:"EnabledPeers"`
TotalPeers int `json:"TotalPeers"`
Filename string `json:"Filename"` // the filename of the config file, for example: wg0.conf
}
func NewInterface(src *domain.Interface, peers []domain.Peer) *Interface {
@@ -88,6 +89,7 @@ func NewInterface(src *domain.Interface, peers []domain.Peer) *Interface {
EnabledPeers: 0,
TotalPeers: 0,
Filename: src.GetConfigFileName(),
}
if len(peers) > 0 {