From d4819b13eb383b4856e50a9bbcd82cc10b77e485 Mon Sep 17 00:00:00 2001 From: Dselen Date: Thu, 3 Oct 2024 08:11:21 -0500 Subject: [PATCH] working tests --- Dockerfile | 8 ++------ entrypoint.sh | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index d8e725b..e74f075 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,3 @@ -# Pull from small Debian stable image. FROM alpine:latest AS build LABEL maintainer="dselen@nerthus.nl" @@ -27,7 +26,6 @@ ENV WGDASH=/opt/wireguarddashboard # Doing WireGuard Dashboard installation measures. Modify the git clone command to get the preferred version, with a specific branch for example. RUN mkdir -p /setup/conf && mkdir /setup/app && mkdir ${WGDASH} COPY ./src /setup/app/src -#COPY src /setup/app/src # Set the volume to be used for WireGuard configuration persistency. VOLUME /etc/wireguard @@ -46,15 +44,13 @@ 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}" > /setup/conf/wg0.conf - - +DNS = ${global_dns}" > /setup/conf/wg0.conf \ + && chmod 600 /setup/conf/wg0.conf # 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 \ CMD sh -c 'pgrep gunicorn > /dev/null && pgrep tail > /dev/null' || exit 1 - # Copy the basic entrypoint.sh script. COPY entrypoint.sh /entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index 7f42b52..e9e6afa 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -31,8 +31,8 @@ ensure_installation() { # This first step is to ensure the wg0.conf file exists, and if not, then its copied over from the ephemeral container storage. if [ ! -f "/etc/wireguard/wg0.conf" ]; then - echo "Standard wg0 Configuration file not found, grabbing template." - cp "/setup/conf/wg0.conf" "/etc/wireguard/wg0.conf" + echo "Standard wg0 Configuration file not found, grabbing template. And adjusting permissions." + cp -a "/setup/conf/wg0.conf" "/etc/wireguard/wg0.conf" echo "Setting a secure private key."