diff --git a/CHANGELOG.md b/CHANGELOG.md index 009d9f6..1c40f6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ **Enhancements:** +* Added ability to provide persistent additional configuration to `dnsmasq` service (issue [#214](https://github.com/davidalger/warden/issues/214)) +* Added ability to easily specify alternate nameservers for `dnsmasq` to use (issue [#214](https://github.com/davidalger/warden/issues/214)) * Updated version of Portainer from 1.24.X to 2.0.X ([#245](https://github.com/davidalger/warden/pull/245) by @ragfire) ## Version [0.9.1](https://github.com/davidalger/warden/tree/0.9.1) (2020-08-25) diff --git a/commands/svc.cmd b/commands/svc.cmd index 0f8e84f..69ce218 100644 --- a/commands/svc.cmd +++ b/commands/svc.cmd @@ -34,7 +34,6 @@ if [[ "${WARDEN_PARAMS[0]}" == "up" ]]; then ## copy configuration files into location where they'll be mounted into containers from mkdir -p "${WARDEN_HOME_DIR}/etc/traefik" cp "${WARDEN_DIR}/config/traefik/traefik.yml" "${WARDEN_HOME_DIR}/etc/traefik/traefik.yml" - cp "${WARDEN_DIR}/config/dnsmasq.conf" "${WARDEN_HOME_DIR}/etc/dnsmasq.conf" ## generate dynamic traefik ssl termination configuration cat > "${WARDEN_HOME_DIR}/etc/traefik/dynamic.yml" <<-EOT diff --git a/config/dnsmasq.conf b/config/dnsmasq.conf deleted file mode 100644 index 64e12ad..0000000 --- a/config/dnsmasq.conf +++ /dev/null @@ -1,16 +0,0 @@ -#dnsmasq config, for a complete example, see: -# http://oss.segetech.com/intra/srv/dnsmasq.conf - -#log all dns queries (enable as-needed for debugging purposes) -# log-queries - -#dont use hosts nameservers -no-resolv - -#use cloudflare as default nameservers, prefer 1^4 -server=1.0.0.1 -server=1.1.1.1 -strict-order - -#explicitly define host-ip mappings -address=/.test/127.0.0.1 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 5b9d36e..d660563 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -36,8 +36,30 @@ services: image: jpillora/dnsmasq ports: - "127.0.0.1:53:53/udp" - volumes: - - ${WARDEN_HOME_DIR}/etc/dnsmasq.conf:/etc/dnsmasq.conf + environment: + WARDEN_DNSMASQ_CONF: |- + #dnsmasq config, for a complete example, see: + # http://oss.segetech.com/intra/srv/dnsmasq.conf + + #log all dns queries (enable as-needed for debugging purposes) + # log-queries + + #dont use hosts nameservers + no-resolv + + #use cloudflare as default nameservers, prefer 1^4 + server=${WARDEN_DNSMASQ_NS1:-1.0.0.1} + server=${WARDEN_DNSMASQ_NS2:-1.1.1.1} + strict-order + + #explicitly define host-ip mappings + address=/.test/127.0.0.1 + ${WARDEN_DNSMASQ_CONF_ADDITIONAL:-} + + entrypoint: ["/bin/sh", "-c", " + echo \"$$WARDEN_DNSMASQ_CONF\" > /etc/dnsmasq.conf; + webproc --config /etc/dnsmasq.conf -- dnsmasq --no-daemon; + "] labels: - traefik.enable=true - traefik.http.routers.dnsmasq.tls=true