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:
parent
2e9ac00a42
commit
e3771a1c53
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user