From e3771a1c5336a9c025261fddfb5c98ebd6a553f5 Mon Sep 17 00:00:00 2001 From: Dselen Date: Thu, 22 Aug 2024 16:58:29 -0500 Subject: [PATCH] Refined logging output a bit. --- docker/Dockerfile | 2 +- docker/entrypoint.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index a52e29f..fe6a54d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -59,7 +59,7 @@ RUN echo "[Interface]" > /setup/conf/wg0.conf \ && echo "DNS = ${global_dns}" >> /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=2m --timeout=1m --start-period=5s --retries=3 \ +HEALTHCHECK --interval=2m --timeout=1m --start-period=20s --retries=3 \ CMD [ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:10086/)" -eq "200" ] || exit 1 diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 02e51c6..30fa9cc 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -67,7 +67,8 @@ clean_up() { local logdir="${WGDASH}/src/log" echo "Cleaning log directory." - rm ${logdir}/access_*.log ${logdir}/error_*.log + find /opt/wireguarddashboard/src/log -name 'access_*.log' -exec rm {} + + find /opt/wireguarddashboard/src/log -name 'error_*.log' -exec rm {} + echo "Removed unneeded logs!" } @@ -92,6 +93,8 @@ set_envvars() { ln -sf /usr/share/zoneinfo/"${tz}" /etc/localtime echo "${tz}" > /etc/timezone + else + echo "Timezone is set correctly." fi # Changing the DNS used for clients and the dashboard itself. @@ -100,6 +103,8 @@ set_envvars() { #sed -i "s/^DNS = .*/DNS = ${global_dns}/" /etc/wireguard/wg0.conf # Uncomment if you want to have DNS on server-level. sed -i "s/^peer_global_dns = .*/peer_global_dns = ${global_dns}/" /opt/wireguarddashboard/src/wg-dashboard.ini + else + echo "DNS is set correctly." fi # Setting the public IP of the WireGuard Dashboard container host. If not defined, it will trying fetching it using a curl to ifconfig.me. @@ -224,6 +229,6 @@ ensure_blocking() { ensure_installation clean_up #update_checker -set_envvars start_core +set_envvars ensure_blocking \ No newline at end of file