From 5ad9c0e77a839211462a63f83f1febafc515d02d Mon Sep 17 00:00:00 2001 From: Daan Date: Thu, 24 Oct 2024 00:23:12 +0200 Subject: [PATCH] Fixed issue where the wg0.conf template got obliterated. Moved it to a safe spot. --- Dockerfile | 7 ++++--- entrypoint.sh | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8f4a152..5f37723 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,8 @@ ENV WGDASH=/opt/wireguarddashboard # Removing the Linux Image package to preserve space on the image, for this reason also deleting apt lists, to be able to install packages: run apt update. # Doing WireGuard Dashboard installation measures. Modify the git clone command to get the preferred version, with a specific branch for example. -RUN mkdir -p /data/conf \ +RUN mkdir /data \ + && mkdir /configs \ && mkdir -p ${WGDASH}/src COPY ./src ${WGDASH}/src @@ -45,8 +46,8 @@ PreDown = iptables -t nat -D POSTROUTING -s ${wg_net}/24 -o ${out_adapt} -j MASQ PreDown = iptables -D FORWARD -i wg0 -o wg0 -j DROP\n\ ListenPort = ${wg_port}\n\ SaveConfig = true\n\ -DNS = ${global_dns}" > /data/conf/wg0.conf \ - && chmod 600 /data/conf/wg0.conf +DNS = ${global_dns}" > /configs/wg0.conf.template \ + && chmod 600 /configs/wg0.conf.template # Defining a way for Docker to check the health of the container. In this case: checking the login URL. HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ diff --git a/entrypoint.sh b/entrypoint.sh index c33e382..e64e8dc 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -30,7 +30,7 @@ ensure_installation() { if [ ! -f "/etc/wireguard/wg0.conf" ]; then echo "Standard wg0 Configuration file not found, grabbing template." - cp -a "/data/conf/wg0.conf" "/etc/wireguard/wg0.conf" + cp -a "/configs/wg0.conf.template" "/etc/wireguard/wg0.conf" echo "Setting a secure private key." # SORRY 4 BE4 - Daan