mirror of
https://github.com/pi-hole/docker-pi-hole.git
synced 2025-12-20 02:18:51 +00:00
Fixes to the startup, services, and dnsmasq references
This commit is contained in:
@@ -14,7 +14,7 @@ ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
|||||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/{{ pihole.s6_version }}/s6-overlay-{{ pihole.arch }}.tar.gz
|
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/{{ pihole.s6_version }}/s6-overlay-{{ pihole.arch }}.tar.gz
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y curl && \
|
apt-get install -y curl procps && \
|
||||||
curl -L -s $S6OVERLAY_RELEASE | tar xvzf - -C / && \
|
curl -L -s $S6OVERLAY_RELEASE | tar xvzf - -C / && \
|
||||||
rm -rf /var/cache/apt/archives /var/lib/apt/lists/* && \
|
rm -rf /var/cache/apt/archives /var/lib/apt/lists/* && \
|
||||||
mv /init /s6-init
|
mv /init /s6-init
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
|||||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.4.0/s6-overlay-aarch64.tar.gz
|
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.4.0/s6-overlay-aarch64.tar.gz
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y curl && \
|
apt-get install -y curl procps && \
|
||||||
curl -L -s $S6OVERLAY_RELEASE | tar xvzf - -C / && \
|
curl -L -s $S6OVERLAY_RELEASE | tar xvzf - -C / && \
|
||||||
rm -rf /var/cache/apt/archives /var/lib/apt/lists/* && \
|
rm -rf /var/cache/apt/archives /var/lib/apt/lists/* && \
|
||||||
mv /init /s6-init
|
mv /init /s6-init
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
|||||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.4.0/s6-overlay-amd64.tar.gz
|
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.4.0/s6-overlay-amd64.tar.gz
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y curl && \
|
apt-get install -y curl procps && \
|
||||||
curl -L -s $S6OVERLAY_RELEASE | tar xvzf - -C / && \
|
curl -L -s $S6OVERLAY_RELEASE | tar xvzf - -C / && \
|
||||||
rm -rf /var/cache/apt/archives /var/lib/apt/lists/* && \
|
rm -rf /var/cache/apt/archives /var/lib/apt/lists/* && \
|
||||||
mv /init /s6-init
|
mv /init /s6-init
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
|||||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.4.0/s6-overlay-armhf.tar.gz
|
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.4.0/s6-overlay-armhf.tar.gz
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y curl && \
|
apt-get install -y curl procps && \
|
||||||
curl -L -s $S6OVERLAY_RELEASE | tar xvzf - -C / && \
|
curl -L -s $S6OVERLAY_RELEASE | tar xvzf - -C / && \
|
||||||
rm -rf /var/cache/apt/archives /var/lib/apt/lists/* && \
|
rm -rf /var/cache/apt/archives /var/lib/apt/lists/* && \
|
||||||
mv /init /s6-init
|
mv /init /s6-init
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ setup_dnsmasq() {
|
|||||||
setup_dnsmasq_dns "$DNS1" "$DNS2"
|
setup_dnsmasq_dns "$DNS1" "$DNS2"
|
||||||
setup_dnsmasq_interface "$INTERFACE"
|
setup_dnsmasq_interface "$INTERFACE"
|
||||||
ProcessDNSSettings
|
ProcessDNSSettings
|
||||||
# dnsmasq -7 /etc/dnsmasq.d --interface="${INTERFACE:-eth0}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_dnsmasq_hostnames() {
|
setup_dnsmasq_hostnames() {
|
||||||
@@ -228,7 +227,7 @@ test_configs() {
|
|||||||
test_configs_debian() {
|
test_configs_debian() {
|
||||||
set -e
|
set -e
|
||||||
echo -n '::: Testing DNSmasq config: '
|
echo -n '::: Testing DNSmasq config: '
|
||||||
dnsmasq --test -7 /etc/dnsmasq.d || exit 1
|
pihole-FTL --test -7 /etc/dnsmasq.d || exit 1
|
||||||
echo -n '::: Testing lighttpd config: '
|
echo -n '::: Testing lighttpd config: '
|
||||||
lighttpd -t -f /etc/lighttpd/lighttpd.conf || exit 1
|
lighttpd -t -f /etc/lighttpd/lighttpd.conf || exit 1
|
||||||
set +e
|
set +e
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ if [ "${PH_VERBOSE:-0}" -gt 0 ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Start dnsmasq for validate_env and gravity.sh
|
# Start dnsmasq for validate_env and gravity.sh
|
||||||
dnsmasq -7 /etc/dnsmasq.d
|
pihole-FTL
|
||||||
|
|
||||||
$bashCmd /start.sh
|
$bashCmd /start.sh
|
||||||
gravity.sh
|
gravity.sh
|
||||||
|
|
||||||
# Kill dnsmasq because s6 won't like it if it's running when s6 services start
|
# Kill dnsmasq because s6 won't like it if it's running when s6 services start
|
||||||
kill -9 $(pgrep dnsmasq) || true
|
kill -9 $(pgrep pihole-FTL) || true
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
s6-echo "Starting pihole-FTL ($FTL_CMD)"
|
s6-echo "Starting pihole-FTL ($FTL_CMD)"
|
||||||
pihole-FTL ${FTL_CMD}
|
s6-setuidgid root pihole-FTL $FTL_CMD
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ def cmd(request):
|
|||||||
|
|
||||||
@pytest.fixture(scope='module', params=['amd64'])
|
@pytest.fixture(scope='module', params=['amd64'])
|
||||||
def persist_arch(request):
|
def persist_arch(request):
|
||||||
'''amd64 only, dnsmasq will not start under qemu-user-static :('''
|
'''amd64 only, dnsmasq/pihole-FTL(?untested?) will not start under qemu-user-static :('''
|
||||||
return request.param
|
return request.param
|
||||||
|
|
||||||
@pytest.fixture(scope='module', params=['debian'])
|
@pytest.fixture(scope='module', params=['debian'])
|
||||||
@@ -157,6 +157,6 @@ Persistent Docker container for testing service post start.sh
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def RunningPiHole(DockerPersist, Slow, persist_webserver):
|
def RunningPiHole(DockerPersist, Slow, persist_webserver):
|
||||||
''' Persist a fully started docker-pi-hole to help speed up subsequent tests '''
|
''' Persist a fully started docker-pi-hole to help speed up subsequent tests '''
|
||||||
Slow(lambda: DockerPersist.run('pgrep dnsmasq').rc == 0)
|
Slow(lambda: DockerPersist.run('pgrep pihole-FTL').rc == 0)
|
||||||
Slow(lambda: DockerPersist.run('pgrep {}'.format(persist_webserver) ).rc == 0)
|
Slow(lambda: DockerPersist.run('pgrep {}'.format(persist_webserver) ).rc == 0)
|
||||||
return DockerPersist
|
return DockerPersist
|
||||||
|
|||||||
@@ -8,18 +8,18 @@ def start_cmd():
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def RunningPiHole(DockerPersist, Slow, persist_webserver, persist_tag, start_cmd):
|
def RunningPiHole(DockerPersist, Slow, persist_webserver, persist_tag, start_cmd):
|
||||||
''' Override the RunningPiHole to run and check for success of a
|
''' Override the RunningPiHole to run and check for success of a
|
||||||
dnsmasq start based `pihole` script command '''
|
pihole-FTL start based `pihole` script command '''
|
||||||
#print DockerPersist.run('ps -ef').stdout
|
#print DockerPersist.run('ps -ef').stdout
|
||||||
assert DockerPersist.dig.run('ping -c 1 test_pihole').rc == 0
|
assert DockerPersist.dig.run('ping -c 1 test_pihole').rc == 0
|
||||||
Slow(lambda: DockerPersist.run('pgrep dnsmasq').rc == 0)
|
Slow(lambda: DockerPersist.run('pgrep pihole-FTL').rc == 0)
|
||||||
Slow(lambda: DockerPersist.run('pgrep {}'.format(persist_webserver)).rc == 0)
|
Slow(lambda: DockerPersist.run('pgrep {}'.format(persist_webserver)).rc == 0)
|
||||||
oldpid = DockerPersist.run('pidof dnsmasq')
|
oldpid = DockerPersist.run('pidof pihole-FTL')
|
||||||
cmd = DockerPersist.run('pihole {}'.format(start_cmd))
|
cmd = DockerPersist.run('pihole {}'.format(start_cmd))
|
||||||
Slow(lambda: DockerPersist.run('pgrep dnsmasq').rc == 0)
|
Slow(lambda: DockerPersist.run('pgrep pihole-FTL').rc == 0)
|
||||||
newpid = DockerPersist.run('pidof dnsmasq')
|
newpid = DockerPersist.run('pidof pihole-FTL')
|
||||||
for pid in [oldpid, newpid]:
|
for pid in [oldpid, newpid]:
|
||||||
assert pid != ''
|
assert pid != ''
|
||||||
# ensure a new pid for dnsmasq appeared due to service restart
|
# ensure a new pid for pihole-FTL appeared due to service restart
|
||||||
assert oldpid != newpid
|
assert oldpid != newpid
|
||||||
assert cmd.rc == 0
|
assert cmd.rc == 0
|
||||||
# Save out cmd result to check different stdout of start/enable/disable
|
# Save out cmd result to check different stdout of start/enable/disable
|
||||||
|
|||||||
Reference in New Issue
Block a user