diff --git a/docker/Dockerfile b/docker/Dockerfile index f1420549..04f26898 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -114,7 +114,8 @@ ENV TZ="Europe/Amsterdam" \ global_dns="9.9.9.9" \ wgd_port="10086" \ public_ip="" \ - WGDASH=/opt/wgdashboard + WGDASH=/opt/wgdashboard \ + dynamic_config="true" # Create directories needed for operation RUN mkdir /data /configs -p ${WGDASH}/src /etc/amnezia/amneziawg \ diff --git a/docker/README.md b/docker/README.md index f32e8f4f..b6966712 100644 --- a/docker/README.md +++ b/docker/README.md @@ -97,6 +97,7 @@ Updating the WGDashboard container should be through 'The Docker Way' - by pulli | Variable | Accepted Values | Default | Example | Description | | ------------------ | ---------------------------------------- | ----------------------- | --------------------- | ----------------------------------------------------------------------- | +| `dynamic_config` | true, yes, false, no | `true` | `true` or `no` | Turns on or off the dynamic configuration feature, on by default for Docker | | `tz` | Timezone | `Europe/Amsterdam` | `America/New_York` | Sets the container's timezone. Useful for accurate logs and scheduling. | | `global_dns` | IPv4 and IPv6 addresses | `9.9.9.9` | `8.8.8.8`, `1.1.1.1` | Default DNS for WireGuard clients. | | `public_ip` | Public IP address | Retrieved automatically | `253.162.134.73` | Used to generate accurate client configs. Needed if container is NAT’d. | diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index daef69ca..391a3bcb 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -85,8 +85,6 @@ echo "------------------------- START ----------------------------" echo "Starting the WGDashboard Docker container." ensure_installation() { - echo "Quick-installing..." - # Make the wgd.sh script executable. chmod +x "${WGDASH}"/src/wgd.sh cd "${WGDASH}"/src || exit @@ -170,6 +168,9 @@ set_envvars() { # Check if config file is empty if [ ! -s "${config_file}" ]; then echo "Config file is empty. Creating initial structure." + elif [[ ${dynamic_config,,} =~ ^(false|no)$ ]]; then + echo "Dynamic configuration feature turned off, not changing anything" + return fi echo "Checking basic configuration:"