Compare commits

...

1 Commits

Author SHA1 Message Date
Erik Thuning
2a03b9b6c9 Stashing the function that inits routes on startup
in case we find out what was happening and it becomes useful again
2025-03-26 16:28:48 +01:00

@ -181,6 +181,7 @@ class WireGuard:
# Ensure a wg config exists on startup
self.update(force=True)
self.init_routes()
def log(self, context_id: str, message) -> None:
@ -228,6 +229,14 @@ class WireGuard:
def meta_filepath(self, config_id: str) -> Path:
return self.filepath(f'{config_id}{metasuffix}')
def init_routes(self) -> None:
config = ConfigParser(interpolation=None)
for conffile in self.configs_base.glob('*/*'+serversuffix):
config.read(conffile)
client_ip_str = config['peer']['allowedips']
client_ip = ipaddress(client_ip_str.split('/')[0])
create_route(client_ip)
def generate_server_config(self):
config = ConfigParser(interpolation=None)
config['Interface'] = {