From c1e597552faff87629e862face2da4d6476ee201 Mon Sep 17 00:00:00 2001 From: ThomasTJdev Date: Fri, 23 Feb 2024 11:06:28 +0100 Subject: [PATCH] minor --- src/web/web_utils.nim | 5 +++-- src/wg/wg_configs.nim | 1 + wireguardmanager.nimble | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/web/web_utils.nim b/src/web/web_utils.nim index f0a2ff3..dd9e4ca 100644 --- a/src/web/web_utils.nim +++ b/src/web/web_utils.nim @@ -4,7 +4,8 @@ import std/[ locks, md5, - os + os, + strutils ] @@ -41,7 +42,7 @@ proc getSalt(): string = proc adminKeyRawGet*(): string = if not fileExists(defaultKeyPath / "admin.txt"): return "" - return readFile(defaultKeyPath / "admin.txt") + return readFile(defaultKeyPath / "admin.txt").strip(chars = {'\n', ' '}) proc adminKeySet*(key: string) = diff --git a/src/wg/wg_configs.nim b/src/wg/wg_configs.nim index 98bf8bb..b83664a 100644 --- a/src/wg/wg_configs.nim +++ b/src/wg/wg_configs.nim @@ -19,6 +19,7 @@ PrivateKey = $1 Address = $2 ListenPort = $3 SaveConfig = false +PreUp = sysctl -w net.ipv4.ip_forward=1 PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o $4 -j MASQUERADE PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o $4 -j MASQUERADE""" diff --git a/wireguardmanager.nimble b/wireguardmanager.nimble index 729117d..909a213 100644 --- a/wireguardmanager.nimble +++ b/wireguardmanager.nimble @@ -1,6 +1,6 @@ # Package -version = "0.1.0" +version = "0.1.1" author = "ThomasTJdev" description = "Cli manager for wireguard" license = "MIT"