Closed adeepv closed 4 years ago
For first time I need PostUp and AllowedIPs. But add all features is a good idea :)
I have just updated the repo on https://github.com/k4yt3x/wireguard-mesh-configurator/tree/1.3.0. Take a look and see what you think of it?
Good work. But you missed the option, when server provides access to other subnets, for example:
[Peer]
# Alias: gw0
# Description: PoP gw0
PublicKey = AA4TplLZMjxTuYGM6iG2+MzKOST+KI70E8K0J/fhDkU=
AllowedIPs = 10.100.100.2/24,192.168.243.0/24
Endpoint = 176.x.x.x:51820
PersistentKeepalive = 25
AllowedIPs can contain comma separated CIDR, where first CIDR we can use as Peer local IP address. Once we consider the input data valid a priori.
With the current structure, if we want AllowIPs, then all we need to do is adding this line:
Should I add some validation for the input?
I think additional validation is currently meaningless. You can add default values, for example port number (51820 or copy last entered value), CIDR /32 for ipv4 in Address
It looks like AllowedIPs should have a client address in its list, so I propose change
peer_config['AllowedIPs'] = Avalon.gets('AllowedIPs (optional): ')
to
peer_config['AllowedIPs'] = peer_config['Address']+', '+Avalon.gets('AllowedIPs (optional): ')
with additional check for empy values
And error :)
Wrong generation of config. You need Endpoint in configuration file in this syntaxis:
Endpoint = <public ip>:<port>
Persistent keepalive interval is neither 0/off nor 1-65535: `True'
I just published 2.0.0, which should be way more modular. Check to see if it fits your taste
I add PostUP config line and allow AllowedIP cointain more ip/networks than one.