Fixing things
This commit is contained in:
parent
ae6e87aadc
commit
cb507c7710
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
config.json
|
config.json
|
||||||
out/
|
out/
|
||||||
|
wg_generate
|
||||||
|
4
gen.go
4
gen.go
@ -45,7 +45,7 @@ func generateConfigs(storage *Storage) {
|
|||||||
serverConfig := ""
|
serverConfig := ""
|
||||||
serverConfig += "[Interface]\n"
|
serverConfig += "[Interface]\n"
|
||||||
serverConfig += fmt.Sprintf("ListenPort = %d\n", storage.Port)
|
serverConfig += fmt.Sprintf("ListenPort = %d\n", storage.Port)
|
||||||
serverConfig += fmt.Sprintf("Address = %s1/32,%s1/128\n", storage.Subnet, storage.Subnet6)
|
serverConfig += fmt.Sprintf("Address = %s1/24,%s1/68\n", storage.Subnet, storage.Subnet6)
|
||||||
serverConfig += fmt.Sprintf("PrivateKey = %s\n", storage.Server.Private)
|
serverConfig += fmt.Sprintf("PrivateKey = %s\n", storage.Server.Private)
|
||||||
|
|
||||||
if len(storage.Server.IPTablesUp) > 0 {
|
if len(storage.Server.IPTablesUp) > 0 {
|
||||||
@ -78,7 +78,7 @@ func generateConfigs(storage *Storage) {
|
|||||||
peerConfig += fmt.Sprintf("[Peer] # Server\n")
|
peerConfig += fmt.Sprintf("[Peer] # Server\n")
|
||||||
peerConfig += fmt.Sprintf("PublicKey = %s\n", storage.Server.Public)
|
peerConfig += fmt.Sprintf("PublicKey = %s\n", storage.Server.Public)
|
||||||
if !peer.OnlySubnet {
|
if !peer.OnlySubnet {
|
||||||
peerConfig += fmt.Sprintf("AllowedIPs = 0.0.0.0/0, ::0/0\n")
|
peerConfig += fmt.Sprintf("AllowedIPs = 0.0.0.0/0, ::/0\n")
|
||||||
} else {
|
} else {
|
||||||
peerConfig += fmt.Sprintf("AllowedIPs = %s0/24, %s0/68\n", storage.Subnet, storage.Subnet6)
|
peerConfig += fmt.Sprintf("AllowedIPs = %s0/24, %s0/68\n", storage.Subnet, storage.Subnet6)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user