Merge branch 'dev'

This commit is contained in:
Adam Warner 2021-08-05 13:05:48 +01:00
commit eb36372dea
No known key found for this signature in database
GPG Key ID: 872950F3ECF2B173
5 changed files with 18 additions and 1 deletions

View File

@ -46,6 +46,9 @@ ARG PIHOLE_VERSION
ENV VERSION "${PIHOLE_VERSION}"
ENV PATH /opt/pihole:${PATH}
ARG PIHOLE_TAG
ENV PIHOLE_TAG "${PIHOLE_TAG}"
ARG NAME
LABEL image="${NAME}:${PIHOLE_VERSION}_${PIHOLE_ARCH}"
ARG MAINTAINER

View File

@ -71,6 +71,7 @@ def build(docker_repo: str, arch: str, debian_version: str, hub_tag: str, show_t
build_env = os.environ.copy()
build_env['PIHOLE_VERSION'] = FTL_VERSION
build_env['DEBIAN_VERSION'] = debian_version
build_env['PIHOLE_TAG'] = hub_tag
build_command = f'{time_arg} docker-compose -f build.yml build {cache_arg} --pull {arch}'
print(f' ::: Building {arch} into {create_tag}')
success = run_and_stream_command_output(build_command, build_env, verbose)

View File

@ -3,6 +3,7 @@ version: "3.7"
x-common-args: &common-args
PIHOLE_VERSION: ${PIHOLE_VERSION}
PIHOLE_TAG: ${PIHOLE_TAG}
NAME: pihole/pihole
MAINTAINER: adam@diginc.us
S6_VERSION: v2.1.0.2

View File

@ -76,10 +76,20 @@ apt-get install -y --force-yes netcat-openbsd
sed -i 's/readonly //g' /opt/pihole/webpage.sh
sed -i '/^WEBPASSWORD/d' /etc/pihole/setupVars.conf
# Replace the call to `updatePiholeFunc` in arg parse with new `unsupportedFunc`
# sed a new function into the `pihole` script just above the `helpFunc()` function for later use.
sed -i $'s/helpFunc() {/unsupportedFunc() {\\\n echo "Function not supported in Docker images"\\\n exit 0\\\n}\\\n\\\nhelpFunc() {/g' /usr/local/bin/pihole
# Replace a few of the `pihole` options with calls to `unsupportedFunc`:
# pihole -up / pihole updatePihole
sed -i $'s/)\s*updatePiholeFunc/) unsupportedFunc/g' /usr/local/bin/pihole
# pihole checkout
sed -i $'s/)\s*piholeCheckoutFunc/) unsupportedFunc/g' /usr/local/bin/pihole
# pihole -r / pihole reconfigure
sed -i $'s/)\s*reconfigurePiholeFunc/) unsupportedFunc/g' /usr/local/bin/pihole
# pihole uninstall
sed -i $'s/)\s*uninstallFunc/) unsupportedFunc/g' /usr/local/bin/pihole
# Inject a message into the debug scripts Operating System section to indicate that the debug log comes from a Docker system.
sed -i $'s/echo_current_diagnostic "Operating system"/echo_current_diagnostic "Operating system"\\\n log_write "${INFO} Pi-hole Docker Container: ${PIHOLE_TAG:-PIHOLE_TAG is unset}"/g' /opt/pihole/piholeDebug.sh
touch /.piholeFirstBoot

View File

@ -35,3 +35,5 @@ else
fi
pihole -v
echo " Container tag is: ${PIHOLE_TAG}"