1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-22 07:10:09 +01:00

Refined logging output a bit.

This commit is contained in:
Dselen 2024-08-22 16:58:29 -05:00
parent 2e9ac00a42
commit e3771a1c53
2 changed files with 8 additions and 3 deletions

View File

@ -59,7 +59,7 @@ RUN echo "[Interface]" > /setup/conf/wg0.conf \
&& echo "DNS = ${global_dns}" >> /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. # 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 CMD [ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:10086/)" -eq "200" ] || exit 1

View File

@ -67,7 +67,8 @@ clean_up() {
local logdir="${WGDASH}/src/log" local logdir="${WGDASH}/src/log"
echo "Cleaning log directory." 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!" echo "Removed unneeded logs!"
} }
@ -92,6 +93,8 @@ set_envvars() {
ln -sf /usr/share/zoneinfo/"${tz}" /etc/localtime ln -sf /usr/share/zoneinfo/"${tz}" /etc/localtime
echo "${tz}" > /etc/timezone echo "${tz}" > /etc/timezone
else
echo "Timezone is set correctly."
fi fi
# Changing the DNS used for clients and the dashboard itself. # 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/^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 sed -i "s/^peer_global_dns = .*/peer_global_dns = ${global_dns}/" /opt/wireguarddashboard/src/wg-dashboard.ini
else
echo "DNS is set correctly."
fi 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. # 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 ensure_installation
clean_up clean_up
#update_checker #update_checker
set_envvars
start_core start_core
set_envvars
ensure_blocking ensure_blocking