-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from diginc/v2.11.1
V2.11.1+ update - from github official repo & installer rather than sub modules.
- Loading branch information
Showing
24 changed files
with
279 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +0,0 @@ | ||
[submodule "pi-hole"] | ||
path = pi-hole | ||
url = https://github.com/pi-hole/pi-hole.git | ||
[submodule "AdminLTE"] | ||
path = AdminLTE | ||
url = https://github.com/pi-hole/AdminLTE.git | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ python: | |
install: | ||
- pip install -r requirements.txt | ||
|
||
script: py.test -vv | ||
script: py.test -vv test/ |
Submodule AdminLTE
deleted from
3e6955
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,42 +2,29 @@ FROM alpine:edge | |
MAINTAINER [email protected] <[email protected]> | ||
|
||
ENV IMAGE alpine | ||
|
||
RUN apk add --update \ | ||
dnsmasq \ | ||
nginx \ | ||
ca-certificates \ | ||
php5-fpm php5-json php5-openssl libxml2 \ | ||
bc bash curl perl sudo && \ | ||
apk add --update --repository http://dl-1.alpinelinux.org/alpine/edge/testing/ tini && \ | ||
ENV PATH /opt/pihole:${PATH} | ||
|
||
COPY install.sh /install.sh | ||
COPY ./alpine/service /usr/local/bin/service | ||
ENV setupVars /etc/pihole/setupVars.conf | ||
ENV PIHOLE_INSTALL /tmp/ph_install.sh | ||
|
||
ENV TINI_VERSION v0.13.0 | ||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini | ||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static.asc /tini.asc | ||
|
||
# Tini and package requirements | ||
RUN apk add --update 'gnupg<2.1.17-r0' && \ | ||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0527A9B7 && \ | ||
gpg --verify /tini.asc && \ | ||
chmod +x /tini && \ | ||
apk add wget bash && \ | ||
/install.sh && \ | ||
rm -rf /var/cache/apk/* | ||
|
||
# Customized from submodules | ||
COPY ./pi-hole/gravity.sh /usr/local/bin/ | ||
COPY ./pi-hole/advanced/Scripts/* /usr/local/bin/ | ||
COPY ./pi-hole/pihole /usr/local/bin/ | ||
RUN sed -i 's|service dnsmasq restart|kill -9 $(pidof dnsmasq); dnsmasq -7 /etc/dnsmasq.d|g' \ | ||
/usr/local/bin/pihole \ | ||
/usr/local/bin/gravity.sh \ | ||
/usr/local/bin/list.sh | ||
RUN sed -i 's|service dnsmasq start|dnsmasq -7 /etc/dnsmasq.d|g' \ | ||
/usr/local/bin/pihole \ | ||
/usr/local/bin/gravity.sh \ | ||
/usr/local/bin/list.sh | ||
COPY ./alpine/nginx.conf /etc/nginx/nginx.conf | ||
|
||
# Original upstream pihole code being used | ||
COPY ./pi-hole/adlists.default /etc/pihole/ | ||
COPY ./pi-hole/adlists.default /etc/.pihole/ | ||
RUN mkdir -p /opt/ && ln -s /usr/local/bin /opt/pihole | ||
COPY ./pi-hole/advanced/dnsmasq.conf.original /etc/dnsmasq.conf | ||
COPY ./pi-hole/advanced/01-pihole.conf /etc/dnsmasq.d/ | ||
COPY ./pi-hole/advanced/index* /var/www/html/pihole/ | ||
COPY ./pi-hole/advanced/pihole.sudo /etc/sudoers.d/pihole | ||
COPY ./AdminLTE /var/www/html/admin | ||
COPY ./AdminLTE_version.txt /etc/ | ||
COPY ./pi-hole_version.txt /etc/ | ||
|
||
# Things installer did and fix alpine+nginx differences | ||
ENV WEBLOGDIR /var/log/nginx | ||
ENV PHP_CONFIG '/etc/php5/php-fpm.conf' | ||
|
@@ -53,16 +40,11 @@ RUN mkdir -p /etc/pihole/ && \ | |
chmod 644 /var/log/pihole.log && \ | ||
chown dnsmasq:root /var/log/pihole.log && \ | ||
sed -i "s/@INT@/eth0/" /etc/dnsmasq.d/01-pihole.conf && \ | ||
sed -i 's|"cd /etc/.pihole/ && git describe --tags --abbrev=0"|"cat /etc/pi-hole_version.txt"|g' /var/www/html/admin/footer.php && \ | ||
sed -i 's|"git describe --tags --abbrev=0"|"cat /etc/AdminLTE_version.txt"|g' /var/www/html/admin/footer.php && \ | ||
sed -i 's|www-data|nginx|g' /etc/sudoers.d/pihole && \ | ||
/bin/true # placeholder | ||
|
||
# This chould be eliminated if all (upstream) files were +x in git | ||
RUN chmod +x /usr/local/bin/*.sh | ||
echo 'Done!' | ||
|
||
# Fix dnsmasq in docker | ||
RUN grep -q '^user=root' || echo 'user=root' >> /etc/dnsmasq.conf | ||
#sed -i 's|"cd /etc/.pihole/ && git describe --tags --abbrev=0"|"cat /etc/pi-hole_version.txt"|g' /var/www/html/admin/footer.php && \ | ||
#sed -i 's|"git describe --tags --abbrev=0"|"cat /etc/AdminLTE_version.txt"|g' /var/www/html/admin/footer.php && \ | ||
#sed -i 's|www-data|nginx|g' /etc/sudoers.d/pihole && \ | ||
|
||
# php config start passes special ENVs into | ||
ENV PHP_ENV_CONFIG '/etc/php5/fpm.d/envs.conf' | ||
|
@@ -76,5 +58,6 @@ ENV IPv6 True | |
EXPOSE 53 53/udp | ||
EXPOSE 80 | ||
|
||
ENTRYPOINT ["tini", "--"] | ||
CMD /start.sh | ||
SHELL ["/bin/bash", "-c"] | ||
ENTRYPOINT ["/tini", "--"] | ||
CMD [ "/start.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
# lazy cheap service script patch for alpine | ||
dnsmasq_start() { | ||
dnsmasq -7 /etc/dnsmasq.d | ||
} | ||
|
||
dnsmasq_stop() { | ||
kill -9 $(pidof dnsmasq) | ||
} | ||
|
||
dnsmasq_restart() { | ||
dnsmasq_stop; dnsmasq_start; | ||
} | ||
|
||
status() { | ||
if pidof $service 2&>1 > /dev/null ; then | ||
echo "$service running" | ||
else | ||
echo "$service not running" | ||
fi; | ||
} | ||
|
||
nginx_start() { | ||
nginx -t && \ | ||
nginx | ||
} | ||
nginx_stop() { | ||
nginx -t && \ | ||
kill -9 $(pidof nginx) | ||
} | ||
nginx_restart() { | ||
nginx_stop | ||
nginx_start | ||
} | ||
dnsmasq_status() { | ||
status | ||
} | ||
nginx_status() { | ||
status | ||
} | ||
|
||
service="$1" | ||
command="$2" | ||
if [[ "$service" == 'lighttpd' ]] ; then | ||
echo -e "Lighttpd replaced by nginx in diginc/pi-hole:alpine\nrunning service nginx $command instead"; | ||
service='nginx' | ||
fi; | ||
|
||
|
||
if [[ "$service" == 'dnsmasq' ]] || [[ "$service" == 'nginx' ]] ; then | ||
${service}_${command} || echo "Unknown option $command" | ||
else | ||
echo "$service service wrapper not patched into alpine container" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.