fix: Docker autostart issue due to invalid resolvectl (#1053)

* Update funding information in FUNDING.yml

* Update README.md

* refac: refactor the logic with which the Docker container links its files to the volume

* fix: 1032 docker autostart issue

---------

Co-authored-by: Donald Zou <donaldzou@live.hk>
Co-authored-by: DaanSelen <dselen@systemec.nl>
This commit is contained in:
DaanSelen
2025-12-30 19:19:20 +01:00
committed by GitHub
parent c8967b449b
commit 5486b3aaf6
5 changed files with 30 additions and 12 deletions

View File

@@ -3,3 +3,5 @@
*.md *.md
tests/ tests/
docs/ docs/
src/db
src/wg-dashboard.ini

4
.github/FUNDING.yml vendored
View File

@@ -1,4 +1,4 @@
# These are supported funding model platforms # These are supported funding model platforms
github: [donaldzou] github: [WGDashboard]
patreon: DonaldDonnyZou open_collective: wgdashboard

View File

@@ -51,7 +51,7 @@
You can support via <br> You can support via <br>
</p> </p>
<p align="center"> <p align="center">
<a align="center" href="https://github.com/sponsors/donaldzou" target="_blank"><img src="https://img.shields.io/badge/GitHub%20Sponsor-2e9a40?style=for-the-badge&logo=github"></a> <a align="center" href="https://github.com/sponsors/WGDashboard" target="_blank"><img src="https://img.shields.io/badge/GitHub%20Sponsor-2e9a40?style=for-the-badge&logo=github"></a>
<a align="center" href="https://buymeacoffee.com/donaldzou" target="_blank"><img src="https://img.shields.io/badge/Buy%20me%20a%20coffee-ffdd00?style=for-the-badge&logo=buymeacoffee&logoColor=000000"></a> <a align="center" href="https://buymeacoffee.com/donaldzou" target="_blank"><img src="https://img.shields.io/badge/Buy%20me%20a%20coffee-ffdd00?style=for-the-badge&logo=buymeacoffee&logoColor=000000"></a>
<a align="center" href="https://patreon.com/c/DonaldDonnyZou/membership" target="_blank"><img src="https://img.shields.io/badge/Patreon-000000?style=for-the-badge&logo=patreon&logoColor=ffffff"></a> <a align="center" href="https://patreon.com/c/DonaldDonnyZou/membership" target="_blank"><img src="https://img.shields.io/badge/Patreon-000000?style=for-the-badge&logo=patreon&logoColor=ffffff"></a>
</p> </p>

View File

@@ -13,6 +13,7 @@ services:
# By default its all disabled, but uncomment the following lines to apply these. (uncommenting is removing the # character) # By default its all disabled, but uncomment the following lines to apply these. (uncommenting is removing the # character)
# Refer to the documentation on https://wgdashboard.dev/ for more info on what everything means. # Refer to the documentation on https://wgdashboard.dev/ for more info on what everything means.
#environment: #environment:
#- wg_autostart=wg0
#- tz= # <--- Set container timezone, default: Europe/Amsterdam. #- tz= # <--- Set container timezone, default: Europe/Amsterdam.
#- public_ip= # <--- Set public IP to ensure the correct one is chosen, defaulting to the IP give by ifconfig.me. #- public_ip= # <--- Set public IP to ensure the correct one is chosen, defaulting to the IP give by ifconfig.me.
#- wgd_port= # <--- Set the port WGDashboard will use for its web-server. #- wgd_port= # <--- Set the port WGDashboard will use for its web-server.

View File

@@ -108,17 +108,31 @@ ensure_installation() {
mkdir -p /data/db mkdir -p /data/db
fi fi
if [ ! -d "${WGDASH}/src/db" ]; then
ln -s /data/db "${WGDASH}/src/db"
fi
if [ ! -f "${config_file}" ]; then if [ ! -f "${config_file}" ]; then
echo "Creating wg-dashboard.ini file" echo "Creating wg-dashboard.ini file"
touch "${config_file}" touch "${config_file}"
fi fi
if [ ! -f "${WGDASH}/src/wg-dashboard.ini" ]; then if [[ ! -L "${WGDASH}/src/db" ]] && [[ -d "${WGDASH}/src/db" ]]; then
ln -s "${config_file}" "${WGDASH}/src/wg-dashboard.ini" echo "Removing ${WGDASH}/src/db since its not a symbolic link."
rm -rfv "${WGDASH}/src/db"
fi
if [[ -L "${WGDASH}/src/db" ]]; then
echo "${WGDASH}/src/db is a symbolic link."
else
ln -sv /data/db "${WGDASH}/src/db"
fi
if [[ ! -L "${WGDASH}/src/wg-dashboard.ini" ]] && [[ -f "${WGDASH}/src/wg-dashboard.ini" ]]; then
echo "Removing ${WGDASH}/src/wg-dashboard.ini since its not a symbolic link."
rm -fv "${WGDASH}/src/wg-dashboard.ini"
fi
if [[ -L "${WGDASH}/src/wg-dashboard.ini" ]]; then
echo "${WGDASH}/src/wg-dashboard.ini is a symbolic link."
else
ln -sv "${config_file}" "${WGDASH}/src/wg-dashboard.ini"
fi fi
# Setup WireGuard if needed # Setup WireGuard if needed
@@ -207,6 +221,9 @@ set_envvars() {
start_and_monitor() { start_and_monitor() {
printf "\n---------------------- STARTING CORE -----------------------\n" printf "\n---------------------- STARTING CORE -----------------------\n"
# Regenerate the resolvconf
/usr/sbin/resolvconf -u
# Due to some instances complaining about this, making sure its there every time. # Due to some instances complaining about this, making sure its there every time.
mkdir -p /dev/net mkdir -p /dev/net
mknod /dev/net/tun c 10 200 mknod /dev/net/tun c 10 200
@@ -220,8 +237,6 @@ start_and_monitor() {
${WGDASH}/src/venv/bin/gunicorn --config ${WGDASH}/src/gunicorn.conf.py ${WGDASH}/src/venv/bin/gunicorn --config ${WGDASH}/src/gunicorn.conf.py
/usr/sbin/resolvconf -u
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Loading WGDashboard failed... Look above for details." echo "Loading WGDashboard failed... Look above for details."
fi fi