user can manage own peers on default device (#82)

Co-authored-by: GitHubActionRunner <knm@knm.io>
This commit is contained in:
Alexander Beck
2022-05-26 23:10:17 +02:00
committed by GitHub
parent b34d2e1174
commit 2f194884d3
9 changed files with 251 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ type Config struct {
DefaultDeviceName string `yaml:"defaultDevice" envconfig:"WG_DEFAULT_DEVICE"` // this device is used for auto-created peers, use GetDefaultDeviceName() to access this field
ConfigDirectoryPath string `yaml:"configDirectory" envconfig:"WG_CONFIG_PATH"` // optional, if set, updates will be written to this path, filename: <devicename>.conf
ManageIPAddresses bool `yaml:"manageIPAddresses" envconfig:"MANAGE_IPS"` // handle ip-address setup of interface
UserManagePeers bool `yaml:"userManagePeers" envconfig:"USER_MANAGE_PEERS"` // user can manage own peers
}
func (c Config) GetDefaultDeviceName() string {

View File

@@ -5,7 +5,8 @@
[Interface]
# Core settings
PrivateKey = {{ .Peer.PrivateKey }}
PrivateKey = {{or .Peer.PrivateKey "<please-insert-your-private-key>" }}
Address = {{ .Peer.IPsStr }}
# Misc. settings (optional)