Fixed addressing (otherwise doesn't work on phones)

master
Keith Irwin 2021-12-29 13:30:39 -07:00
parent 012814f521
commit c445d98d59
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
2 changed files with 10 additions and 2 deletions

View File

@ -98,8 +98,14 @@ module.exports = async (req, res) => {
}
// Add server to user config as [Peer]
const allowed_ipv4s = `${server.ipv4}/${(server.host===env.LOCAL_SERVER)?env.IPV4_CIDR:'32'}`
const allowed_ipv6s = `${server.ipv6}/${(server.host===env.LOCAL_SERVER)?env.IPV6_CIDR:'128'}`
let allowed_ipv4s, allowed_ipv6s
if (server.host===env.LOCAL_SERVER) {
allowed_ipv4s = `${env.IPV4_CIDR_NET}/${env.IPV4_CIDR}`
allowed_ipv6s = `${env.IPV6_CIDR_NET}/${env.IPV6_CIDR}`
} else {
allowed_ipv4s = `${server.ipv4}/32`
allowed_ipv6s = `${server.ipv4}/128`
}
client_peers.push(`
[Peer] # ${server.host}.${env.TLD}
PublicKey = ${server.pubkey}

View File

@ -2,8 +2,10 @@
"ENV": "dev",
"PORT": 8080,
"ADMIN_PORT": 8081,
"IPV4_CIDR_NET": "10.72.0.0",
"IPV4_CIDR": 16,
"IPV4_NET": "10.72",
"IPV6_CIDR_NET": "fd69:1337:0:420:f4::",
"IPV6_CIDR": 80,
"IPV6_NET": "fd69:1337:0:420:f4:abc2",
"TEST_REQUESTER": "10.72.1.1",