Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v4.0 #300

Merged
merged 48 commits into from
Aug 6, 2018
Merged

Release/v4.0 #300

merged 48 commits into from
Aug 6, 2018

Conversation

diginc
Copy link
Collaborator

@diginc diginc commented Aug 4, 2018

All changes related to v4.0 upgrade, replacing prerelease branch #289

A few of the bigger recently commited changes:

  • setup_config function should address some permission problems previously had by people using volumes
  • setup_config setupVars file re-writing should handle upgrading from old data by writing required new variables
  • reduce pytest concurrency to 2 to avoid a race condition in fixture/docker spinup (still not 100% gone but retains a bit of concurrency speed up)
  • Stop using the pihole-FTL init.d 'stop' command as it may go away in future
  • probably a bunch of other stuff I missed

diginc added 19 commits June 30, 2018 11:38
Signed-off-by: Adam Hill <adam@diginc.us>
* Removed some old switch statements from alpine no longer required
* Limit parallel tests to 2 to help prevent test failure caused by race condition starting parallel tests/containers
* Began introducing a new ENV NO_SETUP to skip the majority of startup script 'setup' functions eventually

Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
@diginc diginc mentioned this pull request Aug 4, 2018
3 tasks
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
…ast, starting on new deploy

Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
…t works

Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
…mments)

Signed-off-by: Adam Hill <adam@diginc.us>
Signed-off-by: Adam Hill <adam@diginc.us>
@nightah
Copy link

nightah commented Aug 5, 2018

@diginc I notice there hasn't been a push to Docker Hub yet, if you plan to release an alternate tag to test prior to pushing across to the latest branch please let me know, happy to give it a try and report any issues back.

@diginc
Copy link
Collaborator Author

diginc commented Aug 5, 2018

@nightah The new image is pihole/pihole https://hub.docker.com/r/pihole/pihole/ (maintained by myself and the Pi-hole team)

I will get the old image pushed with an update as well, after the new one is released. This maybe it's last update just to let people know to change their image name to the new official image which will get on going updates.

@dschaper
Copy link
Member

dschaper commented Aug 6, 2018

Does this need an approval?

@nightah
Copy link

nightah commented Aug 6, 2018

@diginc thanks for the heads up.

I've re-tested and found a small problem with populating the DNS server(s).

I have the following configuration set at the moment:

  pihole:
    image: pihole/pihole
    container_name: pihole
    volumes:
      - /srv/docker/.pihole:/etc/pihole
      - /srv/docker/.pihole/dnsmasq:/etc/dnsmasq.d
    networks:
      - nerv-net
    dns: 127.0.0.1
    ports:
      - 53:53/tcp
      - 53:53/udp
    expose:
      - 80
    hostname: pihole.tokyo-3
    restart: unless-stopped
    environment:
      - ServerIP=123.123.123.123
      - DNS1=10.10.10.254
      - DNS2=no
      - TZ=Australia/Melbourne
      - WEBPASSWORD=somepasswordhere
      - VIRTUAL_HOST=pihole.example.com

When I use the latest version provided it will work on first boot with the migrated config, however, from there on out if I issue a docker restart pihole the DNS server is removed and will remain blank.

Here's what the startup log looks like on the first boot:

[cont-init.d] executing container initialization scripts...
[cont-init.d] 20-start.sh: executing...
 ::: Starting docker specific setup for docker pihole/pihole
  [i] Existing PHP installation detected : PHP version 7.0.30-0+deb9u1

  [i] Installing configs from /etc/.pihole...
  [i] Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!
  [✓] Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf
chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory
+ [[ somepasswordhere == '' ]]
+ pihole -a -p 'somepasswordhere' 'somepasswordhere'
  [✓] New password set
+ '[' 0 -gt 0 ']'
+ setup_dnsmasq 10.10.10.254 no ''
+ local dns1=10.10.10.254
+ local dns2=no
+ local interface=
+ setup_dnsmasq_config_if_missing
+ '[' '!' -f /etc/dnsmasq.d/01-pihole.conf ']'
+ setup_dnsmasq_dns 10.10.10.254 no
+ . /opt/pihole/webpage.sh
++ setupVars=/etc/pihole/setupVars.conf
++ dnsmasqconfig=/etc/dnsmasq.d/01-pihole.conf
++ dhcpconfig=/etc/dnsmasq.d/02-pihole-dhcp.conf
++ FTLconf=/etc/pihole/pihole-FTL.conf
++ dhcpstaticconfig=/etc/dnsmasq.d/04-pihole-static-dhcp.conf
++ coltable=/opt/pihole/COL_TABLE
++ [[ -f /opt/pihole/COL_TABLE ]]
++ source /opt/pihole/COL_TABLE
+++ [[ -t 1 ]]
+++ COL_BOLD=
+++ COL_ULINE=
+++ COL_NC=
+++ COL_GRAY=
+++ COL_RED=
+++ COL_GREEN=
+++ COL_YELLOW=
+++ COL_BLUE=
+++ COL_PURPLE=
+++ COL_CYAN=
+++ COL_WHITE=
+++ COL_BLACK=
+++ COL_LIGHT_BLUE=
+++ COL_LIGHT_GREEN=
+++ COL_LIGHT_CYAN=
+++ COL_LIGHT_RED=
+++ COL_URG_RED=
+++ COL_LIGHT_PURPLE=
+++ COL_BROWN=
+++ COL_LIGHT_GRAY=
+++ COL_DARK_GRAY=
+++ TICK='[✓]'
+++ CROSS='[✗]'
+++ INFO='[i]'
+++ QST='[?]'
+++ DONE=' done!'
+++ OVER='\r'
+ local DNS1=10.10.10.254
+ local DNS2=no
+ local dnsType=default
+ '[' 10.10.10.254 '!=' 8.8.8.8 ']'
+ dnsType=custom
+ '[' '!' -f /.piholeFirstBoot ']'
+ echo 'Using custom DNS servers: 10.10.10.254 & no'
+ [[ -n 10.10.10.254 ]]
+ [[ -z '' ]]
+ change_setting PIHOLE_DNS_1 10.10.10.254
+ delete_setting PIHOLE_DNS_1
+ sed -i /PIHOLE_DNS_1/d /etc/pihole/setupVars.conf
Using custom DNS servers: 10.10.10.254 & no
+ add_setting PIHOLE_DNS_1 10.10.10.254
+ echo PIHOLE_DNS_1=10.10.10.254
+ [[ -n no ]]
+ [[ -z '' ]]
+ '[' no = no ']'
+ delete_setting PIHOLE_DNS_2
+ sed -i /PIHOLE_DNS_2/d /etc/pihole/setupVars.conf
+ setup_dnsmasq_interface ''
+ local interface=eth0
+ local interfaceType=default
+ '[' eth0 '!=' eth0 ']'
+ echo 'DNSMasq binding to default interface: eth0'
+ '[' -n eth0 ']'
+ change_setting PIHOLE_INTERFACE eth0
+ delete_setting PIHOLE_INTERFACE
+ sed -i /PIHOLE_INTERFACE/d /etc/pihole/setupVars.conf
DNSMasq binding to default interface: eth0
+ add_setting PIHOLE_INTERFACE eth0
+ echo PIHOLE_INTERFACE=eth0
+ ProcessDNSSettings
+ source /etc/pihole/setupVars.conf
++ API_EXCLUDE_DOMAINS=nerv,nerv.tokyo-3,wpad.tokyo-3,wpad.tokyo-3.wlan,wpad.guest,wpad.cygnus,wpad.goomba
++ API_EXCLUDE_CLIENTS=172.18.0.1
++ API_QUERY_LOG_SHOW=all
++ API_PRIVACY_MODE=false
++ TEMPERATUREUNIT=C
++ WEBUIBOXEDLAYOUT=boxed
++ DNSMASQ_LISTENING=single
++ DNS_FQDN_REQUIRED=true
++ DNS_BOGUS_PRIV=false
++ DNSSEC=false
++ CONDITIONAL_FORWARDING=false
++ QUERY_LOGGING=true
++ INSTALL_WEB_SERVER=true
++ INSTALL_WEB_INTERFACE=true
++ LIGHTTPD_ENABLED=
++ IPV4_ADDRESS=123.123.123.123
++ IPV6_ADDRESS=
++ WEBPASSWORD=a4bb0d91a1a96f97bae52f00befde3f2d37d2920f333f2da536bd518a07b2ec0
++ PIHOLE_DNS_1=10.10.10.254
++ PIHOLE_INTERFACE=eth0
+ delete_dnsmasq_setting server
+ sed -i /server/d /etc/dnsmasq.d/01-pihole.conf
+ COUNTER=1
+ [[ -n 1 ]]
+ var=PIHOLE_DNS_1
+ '[' -z 10.10.10.254 ']'
+ add_dnsmasq_setting server 10.10.10.254
+ [[ 10.10.10.254 != '' ]]
+ echo server=10.10.10.254
+ let COUNTER=COUNTER+1
+ [[ -n 1 ]]
+ var=PIHOLE_DNS_2
+ '[' -z '' ']'
+ break
+ '[' '!' -z '' ']'
+ delete_dnsmasq_setting domain-needed
+ sed -i /domain-needed/d /etc/dnsmasq.d/01-pihole.conf
+ [[ true == true ]]
+ add_dnsmasq_setting domain-needed
+ [[ '' != '' ]]
+ echo domain-needed
+ delete_dnsmasq_setting bogus-priv
+ sed -i /bogus-priv/d /etc/dnsmasq.d/01-pihole.conf
+ [[ false == true ]]
+ delete_dnsmasq_setting dnssec
+ sed -i /dnssec/d /etc/dnsmasq.d/01-pihole.conf
+ delete_dnsmasq_setting trust-anchor=
+ sed -i /trust-anchor=/d /etc/dnsmasq.d/01-pihole.conf
+ [[ false == true ]]
+ delete_dnsmasq_setting host-record
+ sed -i /host-record/d /etc/dnsmasq.d/01-pihole.conf
+ '[' '!' -z '' ']'
+ delete_dnsmasq_setting interface
+ sed -i /interface/d /etc/dnsmasq.d/01-pihole.conf
+ delete_dnsmasq_setting local-service
+ sed -i /local-service/d /etc/dnsmasq.d/01-pihole.conf
+ [[ single == \a\l\l ]]
+ [[ single == \l\o\c\a\l ]]
+ '[' -z eth0 ']'
+ add_dnsmasq_setting interface eth0
+ [[ eth0 != '' ]]
+ echo interface=eth0
+ [[ false == true ]]
+ setup_php_env
+ '[' -z pihole.example.com ']'
+ local 'vhost_line=\t\t\t"VIRTUAL_HOST" => "pihole.example.com",'
+ local 'serverip_line=\t\t\t"ServerIP" => "123.123.123.123",'
+ local 'php_error_line=\t\t\t"PHP_ERROR_LOG" => "/var/log/lighttpd/error.log",'
+ grep -qP '\t\t\t"VIRTUAL_HOST" => "pihole.example.com",' /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
+ sed -i '/bin-environment/ a\\t\t\t"VIRTUAL_HOST" => "pihole.example.com",' /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
+ grep -qP '\t\t\t"ServerIP" => "123.123.123.123",' /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
+ sed -i '/bin-environment/ a\\t\t\t"ServerIP" => "123.123.123.123",' /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
+ grep -qP '\t\t\t"PHP_ERROR_LOG" => "/var/log/lighttpd/error.log",' /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
+ sed -i '/bin-environment/ a\\t\t\t"PHP_ERROR_LOG" => "/var/log/lighttpd/error.log",' /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
Added ENV to php:
+ echo 'Added ENV to php:'
+ grep -E '(VIRTUAL_HOST|ServerIP|PHP_ERROR_LOG)' /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
                        "PHP_ERROR_LOG" => "/var/log/lighttpd/error.log",
                        "ServerIP" => "123.123.123.123",
                        "VIRTUAL_HOST" => "pihole.example.com",
+ setup_dnsmasq_hostnames 123.123.123.123 '' pihole.tokyo-3
+ local IPV4_ADDRESS=123.123.123.123
+ local IPV6_ADDRESS=
+ local hostname=pihole.tokyo-3
+ local dnsmasq_pihole_01_location=/etc/dnsmasq.d/01-pihole.conf
+ '[' -z pihole.tokyo-3 ']'
+ [[ 123.123.123.123 != '' ]]
+ tmp=123.123.123.123
+ sed -i s/@IPV4@/123.123.123.123/ /etc/dnsmasq.d/01-pihole.conf
+ [[ '' != '' ]]
+ sed -i '/^address=\/pi.hole\/@IPv6@/d' /etc/dnsmasq.d/01-pihole.conf
+ sed -i '/^address=\/@HOSTNAME@\/@IPv6@/d' /etc/dnsmasq.d/01-pihole.conf
+ [[ pihole.tokyo-3 != '' ]]
+ sed -i s/@HOSTNAME@/pihole.tokyo-3/ /etc/dnsmasq.d/01-pihole.conf
Using IPv4 and IPv6
+ setup_ipv4_ipv6
+ local 'ip_versions=IPv4 and IPv6'
+ '[' True '!=' True ']'
+ echo 'Using IPv4 and IPv6'
+ setup_lighttpd_bind 123.123.123.123
+ local serverip=123.123.123.123
+ grep -q docker /proc/net/dev
::: Preexisting ad list /etc/pihole/adlists.list detected ((exiting setup_blocklists early))
+ setup_blocklists
+ local blocklists=
+ exit_string='(exiting setup_blocklists early)'
+ '[' -n '' ']'
+ '[' -f /etc/pihole/adlists.list ']'
+ echo '::: Preexisting ad list /etc/pihole/adlists.list detected ((exiting setup_blocklists early))'
+ cat /etc/pihole/adlists.list
# The below list amalgamates several lists we used previously.
# See `https://github.com/StevenBlack/hosts` for details
##StevenBlack's list
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts

##MalwareDomains
https://mirror1.malwaredomains.com/files/justdomains

##Cameleon
http://sysctl.org/cameleon/hosts

##Zeustracker
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist

##Disconnect.me Tracking
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt

##Disconnect.me Ads
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt

##Hosts-file.net
https://hosts-file.net/ad_servers.txt

https://api.hackertarget.com/hostsearch/?q=googlevideo.com
https://tspprs.com/dl/cl1
+ return
+ test_configs
+ set -e
+ echo -n '::: Testing pihole-FTL DNS: '
+ pihole-FTL test
::: Testing pihole-FTL DNS: FTL started!
+ echo -n '::: Testing lighttpd config: '
+ lighttpd -t -f /etc/lighttpd/lighttpd.conf
::: Testing lighttpd config: Syntax OK
+ set +e
+ echo '::: All config checks passed, cleared for startup ...'
+ '[' -f /.piholeFirstBoot ']'
+ rm /.piholeFirstBoot
::: All config checks passed, cleared for startup ...
+ echo ' ::: Docker start setup complete'
+ echo '
:: ::: ::: ::: ::: ::: ::: ::: ::: :::
:: Image moved / deprecation notice
::    OLD IMAGE : diginc/pi-hole
::    NEW IMAGE : pihole/pihole
:: In order to get the latest updates
:: please update your image references
:: ::: ::: ::: ::: ::: ::: ::: ::: :::
'
 ::: Docker start setup complete

:: ::: ::: ::: ::: ::: ::: ::: ::: :::
:: Image moved / deprecation notice
::    OLD IMAGE : diginc/pi-hole
::    NEW IMAGE : pihole/pihole
:: In order to get the latest updates
:: please update your image references
:: ::: ::: ::: ::: ::: ::: ::: ::: :::

  [i] Neutrino emissions detected...
  [✓] Pulling blocklist source list into range

  [i] Target: raw.githubusercontent.com (hosts)
  [✓] Status: Retrieval successful

  [i] Target: mirror1.malwaredomains.com (justdomains)
  [✓] Status: No changes detected

  [i] Target: sysctl.org (hosts)
  [✓] Status: No changes detected

  [i] Target: zeustracker.abuse.ch (blocklist.php?download=domainblocklist)
  [✓] Status: No changes detected

  [i] Target: s3.amazonaws.com (simple_tracking.txt)
  [✓] Status: No changes detected

  [i] Target: s3.amazonaws.com (simple_ad.txt)
  [✓] Status: No changes detected

  [i] Target: hosts-file.net (ad_servers.txt)
  [✓] Status: No changes detected

  [i] Target: api.hackertarget.com (?q=googlevideo.com)
  [✓] Status: Retrieval successful

  [i] Target: tspprs.com (cl1)
  [✓] Status: No changes detected

  [✓] Consolidating blocklists
  [✓] Extracting domains from blocklists
  [i] Number of domains being pulled in by gravity: 1308641
  [✓] Removing duplicate domains
  [i] Number of unique domains trapped in the Event Horizon: 1144565
  [i] Number of whitelisted domains: 218
  [i] Number of blacklisted domains: 0
  [i] Number of regex filters: 0
  [✓] Parsing domains into hosts format
  [✓] Cleaning up stray matter

  [✓] DNS service is running
  [✓] Pi-hole blocking is Enabled
[cont-init.d] 20-start.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
Starting lighttpd
Starting pihole-FTL (no-daemon)
Starting crond
[services.d] done.

And the subsequent log after another restart where it fails:

[cont-init.d] executing container initialization scripts...
[cont-init.d] 20-start.sh: executing...
 ::: Starting docker specific setup for docker pihole/pihole
  [i] Existing PHP installation detected : PHP version 7.0.30-0+deb9u1

  [i] Installing configs from /etc/.pihole...
  [i] Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!
  [✓] Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf
chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory
+ [[ somepasswordhere == '' ]]
+ pihole -a -p 'somepasswordhere' 'somepasswordhere'
  [✓] New password set
+ '[' 0 -gt 0 ']'
+ setup_dnsmasq 10.10.10.254 no ''
+ local dns1=10.10.10.254
+ local dns2=no
+ local interface=
+ setup_dnsmasq_config_if_missing
+ '[' '!' -f /etc/dnsmasq.d/01-pihole.conf ']'
+ setup_dnsmasq_dns 10.10.10.254 no
+ . /opt/pihole/webpage.sh
++ setupVars=/etc/pihole/setupVars.conf
++ dnsmasqconfig=/etc/dnsmasq.d/01-pihole.conf
++ dhcpconfig=/etc/dnsmasq.d/02-pihole-dhcp.conf
++ FTLconf=/etc/pihole/pihole-FTL.conf
++ dhcpstaticconfig=/etc/dnsmasq.d/04-pihole-static-dhcp.conf
++ coltable=/opt/pihole/COL_TABLE
++ [[ -f /opt/pihole/COL_TABLE ]]
++ source /opt/pihole/COL_TABLE
+++ [[ -t 1 ]]
+++ COL_BOLD=
+++ COL_ULINE=
+++ COL_NC=
+++ COL_GRAY=
+++ COL_RED=
+++ COL_GREEN=
+++ COL_YELLOW=
+++ COL_BLUE=
+++ COL_PURPLE=
+++ COL_CYAN=
+++ COL_WHITE=
+++ COL_BLACK=
+++ COL_LIGHT_BLUE=
+++ COL_LIGHT_GREEN=
+++ COL_LIGHT_CYAN=
+++ COL_LIGHT_RED=
+++ COL_URG_RED=
+++ COL_LIGHT_PURPLE=
+++ COL_BROWN=
+++ COL_LIGHT_GRAY=
+++ COL_DARK_GRAY=
+++ TICK='[✓]'
+++ CROSS='[✗]'
+++ INFO='[i]'
+++ QST='[?]'
+++ DONE=' done!'
+++ OVER='\r'
+ local DNS1=10.10.10.254
+ local DNS2=no
+ local dnsType=default
+ '[' 10.10.10.254 '!=' 8.8.8.8 ']'
+ dnsType=custom
+ '[' '!' -f /.piholeFirstBoot ']'
++ grep PIHOLE_DNS_1 /etc/pihole/setupVars.conf
+ local setupDNS1=PIHOLE_DNS_1=
++ grep PIHOLE_DNS_2 /etc/pihole/setupVars.conf
+ local setupDNS2=PIHOLE_DNS_2=
+ [[ -n 10.10.10.254 ]]
+ [[ -n PIHOLE_DNS_1= ]]
+ echo 'Docker DNS variables not used'
+ echo 'Existing DNS servers used'
+ return
+ setup_dnsmasq_interface ''
Docker DNS variables not used
Existing DNS servers used
DNSMasq binding to default interface: eth0
+ local interface=eth0
+ local interfaceType=default
+ '[' eth0 '!=' eth0 ']'
+ echo 'DNSMasq binding to default interface: eth0'
+ '[' -n eth0 ']'
+ change_setting PIHOLE_INTERFACE eth0
+ delete_setting PIHOLE_INTERFACE
+ sed -i /PIHOLE_INTERFACE/d /etc/pihole/setupVars.conf
+ add_setting PIHOLE_INTERFACE eth0
+ echo PIHOLE_INTERFACE=eth0
+ ProcessDNSSettings
+ source /etc/pihole/setupVars.conf
++ API_EXCLUDE_DOMAINS=nerv,nerv.tokyo-3,wpad.tokyo-3,wpad.tokyo-3.wlan,wpad.guest,wpad.cygnus,wpad.goomba
++ API_EXCLUDE_CLIENTS=172.18.0.1
++ API_QUERY_LOG_SHOW=all
++ API_PRIVACY_MODE=false
++ TEMPERATUREUNIT=C
++ WEBUIBOXEDLAYOUT=boxed
++ DNSMASQ_LISTENING=single
++ DNS_FQDN_REQUIRED=true
++ DNS_BOGUS_PRIV=false
++ DNSSEC=false
++ CONDITIONAL_FORWARDING=false
++ PIHOLE_DNS_1=
++ PIHOLE_DNS_2=
++ QUERY_LOGGING=true
++ INSTALL_WEB_SERVER=true
++ INSTALL_WEB_INTERFACE=true
++ LIGHTTPD_ENABLED=
++ IPV4_ADDRESS=123.123.123.123
++ IPV6_ADDRESS=
++ WEBPASSWORD=a4bb0d91a1a96f97bae52f00befde3f2d37d2920f333f2da536bd518a07b2ec0
++ PIHOLE_INTERFACE=eth0
+ delete_dnsmasq_setting server
+ sed -i /server/d /etc/dnsmasq.d/01-pihole.conf
+ COUNTER=1
+ [[ -n 1 ]]
+ var=PIHOLE_DNS_1
+ '[' -z '' ']'
+ break
+ '[' '!' -z '' ']'
+ delete_dnsmasq_setting domain-needed
+ sed -i /domain-needed/d /etc/dnsmasq.d/01-pihole.conf
+ [[ true == true ]]
+ add_dnsmasq_setting domain-needed
+ [[ '' != '' ]]
+ echo domain-needed
+ delete_dnsmasq_setting bogus-priv
+ sed -i /bogus-priv/d /etc/dnsmasq.d/01-pihole.conf
+ [[ false == true ]]
+ delete_dnsmasq_setting dnssec
+ sed -i /dnssec/d /etc/dnsmasq.d/01-pihole.conf
+ delete_dnsmasq_setting trust-anchor=
+ sed -i /trust-anchor=/d /etc/dnsmasq.d/01-pihole.conf
+ [[ false == true ]]
+ delete_dnsmasq_setting host-record
+ sed -i /host-record/d /etc/dnsmasq.d/01-pihole.conf
+ '[' '!' -z '' ']'
+ delete_dnsmasq_setting interface
+ sed -i /interface/d /etc/dnsmasq.d/01-pihole.conf
+ delete_dnsmasq_setting local-service
+ sed -i /local-service/d /etc/dnsmasq.d/01-pihole.conf
+ [[ single == \a\l\l ]]
+ [[ single == \l\o\c\a\l ]]
+ '[' -z eth0 ']'
+ add_dnsmasq_setting interface eth0
+ [[ eth0 != '' ]]
+ echo interface=eth0
+ [[ false == true ]]
+ setup_php_env
+ '[' -z pihole.example.com']'
+ local 'vhost_line=\t\t\t"VIRTUAL_HOST" => "pihole.example.com",'
+ local 'serverip_line=\t\t\t"ServerIP" => "123.123.123.123",'
+ local 'php_error_line=\t\t\t"PHP_ERROR_LOG" => "/var/log/lighttpd/error.log",'
+ grep -qP '\t\t\t"VIRTUAL_HOST" => "pihole.example.com",' /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
+ grep -qP '\t\t\t"ServerIP" => "123.123.123.123",' /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
+ grep -qP '\t\t\t"PHP_ERROR_LOG" => "/var/log/lighttpd/error.log",' /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
Added ENV to php:
+ echo 'Added ENV to php:'
+ grep -E '(VIRTUAL_HOST|ServerIP|PHP_ERROR_LOG)' /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
                        "PHP_ERROR_LOG" => "/var/log/lighttpd/error.log",
                        "ServerIP" => "123.123.123.123",
                        "VIRTUAL_HOST" => "pihole.example.com",
+ setup_dnsmasq_hostnames 123.123.123.123 '' pihole.tokyo-3
+ local IPV4_ADDRESS=123.123.123.123
+ local IPV6_ADDRESS=
+ local hostname=pihole.tokyo-3
+ local dnsmasq_pihole_01_location=/etc/dnsmasq.d/01-pihole.conf
+ '[' -z pihole.tokyo-3 ']'
+ [[ 123.123.123.123 != '' ]]
+ tmp=123.123.123.123
+ sed -i s/@IPV4@/123.123.123.123/ /etc/dnsmasq.d/01-pihole.conf
+ [[ '' != '' ]]
+ sed -i '/^address=\/pi.hole\/@IPv6@/d' /etc/dnsmasq.d/01-pihole.conf
+ sed -i '/^address=\/@HOSTNAME@\/@IPv6@/d' /etc/dnsmasq.d/01-pihole.conf
+ [[ pihole.tokyo-3 != '' ]]
+ sed -i s/@HOSTNAME@/pihole.tokyo-3/ /etc/dnsmasq.d/01-pihole.conf
Using IPv4 and IPv6
+ setup_ipv4_ipv6
+ local 'ip_versions=IPv4 and IPv6'
+ '[' True '!=' True ']'
+ echo 'Using IPv4 and IPv6'
+ setup_lighttpd_bind 123.123.123.123
+ local serverip=123.123.123.123
+ grep -q docker /proc/net/dev
::: Preexisting ad list /etc/pihole/adlists.list detected ((exiting setup_blocklists early))
+ setup_blocklists
+ local blocklists=
+ exit_string='(exiting setup_blocklists early)'
+ '[' -n '' ']'
+ '[' -f /etc/pihole/adlists.list ']'
+ echo '::: Preexisting ad list /etc/pihole/adlists.list detected ((exiting setup_blocklists early))'
+ cat /etc/pihole/adlists.list
# The below list amalgamates several lists we used previously.
# See `https://github.com/StevenBlack/hosts` for details
##StevenBlack's list
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts

##MalwareDomains
https://mirror1.malwaredomains.com/files/justdomains

##Cameleon
http://sysctl.org/cameleon/hosts

##Zeustracker
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist

##Disconnect.me Tracking
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt

##Disconnect.me Ads
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt

##Hosts-file.net
https://hosts-file.net/ad_servers.txt

https://api.hackertarget.com/hostsearch/?q=googlevideo.com
https://tspprs.com/dl/cl1
+ return
+ test_configs
+ set -e
+ echo -n '::: Testing pihole-FTL DNS: '
+ pihole-FTL test
::: Testing pihole-FTL DNS: FTL started!
+ echo -n '::: Testing lighttpd config: '
+ lighttpd -t -f /etc/lighttpd/lighttpd.conf
::: Testing lighttpd config: Syntax OK
::: All config checks passed, cleared for startup ...
+ set +e
+ echo '::: All config checks passed, cleared for startup ...'
+ '[' -f /.piholeFirstBoot ']'
+ echo ' ::: Docker start setup complete'
+ echo '
:: ::: ::: ::: ::: ::: ::: ::: ::: :::
:: Image moved / deprecation notice
::    OLD IMAGE : diginc/pi-hole
::    NEW IMAGE : pihole/pihole
:: In order to get the latest updates
:: please update your image references
:: ::: ::: ::: ::: ::: ::: ::: ::: :::
'
 ::: Docker start setup complete

:: ::: ::: ::: ::: ::: ::: ::: ::: :::
:: Image moved / deprecation notice
::    OLD IMAGE : diginc/pi-hole
::    NEW IMAGE : pihole/pihole
:: In order to get the latest updates
:: please update your image references
:: ::: ::: ::: ::: ::: ::: ::: ::: :::

  [i] Neutrino emissions detected...
  [✓] Pulling blocklist source list into range

  [i] Target: raw.githubusercontent.com (hosts)
  [✗] Status: Connection Refused
  [✗] List download failed: using previously cached list

  [i] Target: mirror1.malwaredomains.com (justdomains)
  [✗] Status: Connection Refused
  [✗] List download failed: using previously cached list

  [i] Target: sysctl.org (hosts)
  [✗] Status: Connection Refused
  [✗] List download failed: using previously cached list

  [i] Target: zeustracker.abuse.ch (blocklist.php?download=domainblocklist)
  [✗] Status: Connection Refused
  [✗] List download failed: using previously cached list

  [i] Target: s3.amazonaws.com (simple_tracking.txt)
  [✗] Status: Connection Refused
  [✗] List download failed: using previously cached list

  [i] Target: s3.amazonaws.com (simple_ad.txt)
  [✗] Status: Connection Refused
  [✗] List download failed: using previously cached list

  [i] Target: hosts-file.net (ad_servers.txt)
  [✗] Status: Connection Refused
  [✗] List download failed: using previously cached list

  [i] Target: api.hackertarget.com (?q=googlevideo.com)
  [✗] Status: Connection Refused
  [✗] List download failed: using previously cached list

  [i] Target: tspprs.com (cl1)
  [✗] Status: Connection Refused
  [✗] List download failed: using previously cached list

  [✓] Consolidating blocklists
  [✓] Extracting domains from blocklists
  [i] Number of domains being pulled in by gravity: 1308641
  [✓] Removing duplicate domains
  [i] Number of unique domains trapped in the Event Horizon: 1144565
  [i] Number of whitelisted domains: 218
  [i] Number of blacklisted domains: 0
  [i] Number of regex filters: 0
  [✓] Parsing domains into hosts format
  [✓] Cleaning up stray matter

  [✓] DNS service is running
  [✓] Pi-hole blocking is Enabled
[cont-init.d] 20-start.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
Starting pihole-FTL (no-daemon)
Starting lighttpd
Starting crond
[services.d] done.

Let me know if you want me to do a little more digging, if I can get you more information. I have overcome the issue for now by just setting PIHOLE_DNS_1 instead of DNS1 though I know you would probably prefer to fix the actual problem :).

@diginc
Copy link
Collaborator Author

diginc commented Aug 6, 2018

@nightah thanks for the report, I reproduced your problem and am pushing the fix right now.

Merging to master to get the README updated on the main repository page since v4.0 is announced to the public and there are some important updates in the readme for that.

@diginc diginc merged commit 625defb into master Aug 6, 2018
@diginc diginc deleted the release/v4.0 branch January 21, 2019 05:31
DistractionRectangle added a commit to DistractionRectangle/docker-pi-hole that referenced this pull request Jul 25, 2021
Since piholeFTL test properly spins down it's no longer
necessary to kill it. He's dead Jim

Merge pi-hole#300, added `piholeFTL test` to the startup sequence to
replace dnsmasq as a dependency for validate_env and gravity.sh.
kill -9 was kept as a work around to a standing issue that
`piholeFTL test` didn't spin down on it's own. This was fixed
in pi-hole/FTL#1067, landed on Apr 14 2021 and confirmed
working, as evinced by pi-hole#834 which was filed the same day it
that fix landed.

Signed-off-by: D.Rect <48034372+DistractionRectangle@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants