ugh
This commit is contained in:
parent
ce16761179
commit
df376a1284
@ -58,6 +58,13 @@ class Config:
|
||||
return val
|
||||
|
||||
def __init__(self):
|
||||
|
||||
self.vpnd_connection_name = os.environ.get("VPND_CONNECTION_NAME")
|
||||
self.vpnd_uplink_table_id = os.environ.get("VPND_UPLINK_TABLE")
|
||||
self.vpnd_enforce_split_tunnel = True # os.environ.get(
|
||||
# "VPND_ENFORCE_SPLIT_TUNNEL", "true"
|
||||
# ).lower() in {"yes", "true"}
|
||||
|
||||
self.reason = Reason(os.environ["reason"])
|
||||
self.vpn_gateway = ipaddress.ip_address(os.environ["VPNGATEWAY"])
|
||||
self.vpn_pid = int(os.environ["VPNPID"]) if "VPNPID" in os.environ else None
|
||||
@ -106,12 +113,6 @@ class Config:
|
||||
)
|
||||
)
|
||||
|
||||
self.vpnd_connection_name = os.environ.get("VPND_CONNECTION_NAME")
|
||||
self.vpnd_uplink_table_id = os.environ.get("VPND_UPLINK_TABLE")
|
||||
self.vpnd_enforce_split_tunnel = True # os.environ.get(
|
||||
# "VPND_ENFORCE_SPLIT_TUNNEL", "true"
|
||||
# ).lower() in {"yes", "true"}
|
||||
|
||||
def write_route(self, stream: TextIOBase, net: ipaddress.IPv4Network):
|
||||
"""Write a systemd-networkd route config for the given network to the given stream."""
|
||||
if self.vpnd_enforce_split_tunnel:
|
||||
@ -162,8 +163,8 @@ class Config:
|
||||
"Kind=tun\n",
|
||||
"[Network]\n",
|
||||
f"Address={self.internal_ipv4_address}\n",
|
||||
f"DNS={' '.join(str(self.internal_ipv4_dns))}\n",
|
||||
f"Domains={self.default_domain} {' '.join(str(self.search_domains))}\n",
|
||||
f"DNS={' '.join(str(dns) for dns in self.internal_ipv4_dns)}\n",
|
||||
f"Domains={self.default_domain} {' '.join(str(domain) for domain in self.search_domains)}\n",
|
||||
"[Route]\n",
|
||||
"Gateway=0.0.0.0\n",
|
||||
"GatewayOnLink=yes\n",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user