Skip to content

Commit

Permalink
ns-api: ns.ovpntunnel, fix client export
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchietti committed Nov 8, 2023
1 parent 57c88cf commit d418495
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ns-api/files/ns.ovpntunnel
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ def setup_server(u, iname, tunnel):
# generate only on create
if not os.path.exists(f"{cert_dir}issued/server.crt"):
try:
subprocess.run(["/usr/sbin/ns-openvpnrw-init-pki", iname])
subprocess.run(["/usr/sbin/ns-openvpntunnel-add-client", iname])
subprocess.run(["/usr/sbin/ns-openvpnrw-init-pki", iname], check=True)
subprocess.run(["/usr/sbin/ns-openvpntunnel-add-client", iname], check=True)
except:
utils.generic_error("pki_not_initialized")
u.set("openvpn", iname, "dh", f"{cert_dir}dh.pem")
Expand Down Expand Up @@ -318,7 +318,7 @@ def export_client(name):
"status": "enabled",
"Compression": u.get("openvpn", name, "compress", default=""),
"RemotePort": u.get("openvpn", name, "lport", default=""),
"RemoteHost": u.get("openvpn", name, "public_ip", default=""),
"RemoteHost": u.get("openvpn", name, "ns_public_ip", default=""),
"Digest": u.get("openvpn", name, "digest", default=""),
"Cipher": u.get("openvpn", name, "cipher", default=""),
"Topology": u.get("openvpn", name, "topology", default=""),
Expand Down

0 comments on commit d418495

Please sign in to comment.