chriscrowe / docker-pihole-unbound

Run Pi-Hole + Unbound on Docker
1.07k stars 279 forks source link

Does not respect certain environment settings #172

Open istvnurbn opened 2 years ago

istvnurbn commented 2 years ago

Hi All,

I found that pihole-unbound does not respect the QUERY_LOGGING and all the REV_SERVER* environment settings.

I have not exposed the web port because I use multiple we services on that machine and they are handled by nginx (same internal docker network).

I do not know whether is it a configuration issue on my end or some kind of a weird behavior.

I have the following config for reference:

version: "3"
services:

  pihole:
    image: 'cbcrowe/pihole-unbound:latest'
    container_name: pihole
    hostname: pihole
    domainname: pihole.local
    restart: unless-stopped

    environment:
      - QUERY_LOGGING="false"
      - DNSSEC="true"
      - DNSMASQ_LISTENING=all
      - DNS_BOGUS_PRIV="true"
      - DNS_FQDN_REQUIRED="true"
      - FTLCONF_LOCAL_IPV4=10.0.0.10
      - TZ=Europe/Budapest
      - WEBPASSWORD=XXXXXX
      - REV_SERVER="true"
      - REV_SERVER_DOMAIN=local
      - REV_SERVER_TARGET=10.0.0.1
      - REV_SERVER_CIDR=10.0.0.0/24
      - HOSTNAME=nas
      - DOMAIN_NAME=pihole.local
      - PIHOLE_WEBPORT=80
      - WEBTHEME=default-light
      - PIHOLE_DNS_=127.0.0.1#5335
    volumes:
      - YYYYYY/appdata/pihole/:/etc/pihole:rw
      - YYYYYY/pihole-dnsmasq/:/etc/dnsmasq.d:rw
    ports:
      - '53:53/tcp'
      - '53:53/udp'

networks:
  default:
    name: nas
pluim003 commented 2 years ago

Did you try REV_SERVER=true (without the double quotes)? As that is how I have it in my config. If I start a console to the container then it also shows all REV_SERVER-environment variables.

AFAIK and can find is QUERY_LOGGING not an environment variable to pass on. I notice it's in /etc/pihole/setupVars.conf and shows true (in my case) and when 'Disabling query logging' in the webgui it will show QUERY_LOGGING=false.

I guess it's a one time manual action. In setupVars.conf the line is shown also without the double quotes around the value.

istvnurbn commented 2 years ago

You were right about the double quotes.

On the QUERY_LOGGING feature. This image is building on the official pi-hole one, that has this environment variable. I can see it in the setupVars.conf file as false (that is the desired outcome) however it is not respected.

pluim003 commented 2 years ago

Aha. About the QUERY_LOGGING-thing. It was also mentioned last year. Don't know if it's now completely solved: https://github.com/pi-hole/docker-pi-hole/pull/754 but it should be I guess. What happens if you use the official pihole-image (without the unbound-stuff).

istvnurbn commented 2 years ago

It is working, I just switched to that image and started to use some upstream DNS instead of unbound.

pluim003 commented 2 years ago

Hmm.. what will be the differences then? Except for the unbound-stuff. I’ll check it out later with my fork (which uses the latest Unbound-version but is basically the same as Chris’s image).