adding some missing files from merger mistakes
This commit is contained in:
parent
b4a929f050
commit
c341e0316f
|
@ -3,4 +3,4 @@
|
||||||
url = https://github.com/pi-hole/pi-hole.git
|
url = https://github.com/pi-hole/pi-hole.git
|
||||||
[submodule "AdminLTE"]
|
[submodule "AdminLTE"]
|
||||||
path = AdminLTE
|
path = AdminLTE
|
||||||
url = https://github.com/diginc/AdminLTE.git
|
url = https://github.com/pi-hole/AdminLTE.git
|
||||||
|
|
14
.travis.yml
14
.travis.yml
|
@ -1,12 +1,10 @@
|
||||||
sudo: required
|
sudo: required
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
language: python
|
||||||
|
python:
|
||||||
|
- "2.7"
|
||||||
|
install:
|
||||||
|
- pip install -r requirements.txt
|
||||||
|
|
||||||
before_install:
|
script: py.test -v
|
||||||
- docker pull diginc/pi-hole:alpine
|
|
||||||
- docker pull diginc/pi-hole:debian
|
|
||||||
|
|
||||||
script:
|
|
||||||
- docker build -f alpine.docker .
|
|
||||||
- docker build -f debian.docker .
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ COPY ./pi-hole/advanced/Scripts/* /usr/local/bin/
|
||||||
RUN mkdir -p /opt/ && ln -s /usr/local/bin /opt/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/dnsmasq.conf.original /etc/dnsmasq.conf
|
||||||
COPY ./pi-hole/advanced/01-pihole.conf /etc/dnsmasq.d/
|
COPY ./pi-hole/advanced/01-pihole.conf /etc/dnsmasq.d/
|
||||||
COPY ./pi-hole/advanced/index.html /var/www/html/pihole/index.html
|
COPY ./pi-hole/advanced/index* /var/www/html/pihole/
|
||||||
COPY ./pi-hole/advanced/pihole.sudo /etc/sudoers.d/pihole
|
COPY ./pi-hole/advanced/pihole.sudo /etc/sudoers.d/pihole
|
||||||
COPY ./AdminLTE /var/www/html/admin
|
COPY ./AdminLTE /var/www/html/admin
|
||||||
COPY ./AdminLTE_version.txt /etc/
|
COPY ./AdminLTE_version.txt /etc/
|
||||||
|
|
|
@ -29,6 +29,11 @@ http {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /*.js {
|
||||||
|
index pihole/index.js
|
||||||
|
error_page 404 =200 /pihole/index.js;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
add_header X-Pi-hole "A black hole for Internet advertisements." always;
|
add_header X-Pi-hole "A black hole for Internet advertisements." always;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ echo "env[ServerIP] = ${ServerIP}" >> $PHP_ENV_CONFIG;
|
||||||
|
|
||||||
if [ -n "$VIRTUAL_HOST" ] ; then
|
if [ -n "$VIRTUAL_HOST" ] ; then
|
||||||
echo "env[VIRTUAL_HOST] = ${VIRTUAL_HOST}" >> $PHP_ENV_CONFIG;
|
echo "env[VIRTUAL_HOST] = ${VIRTUAL_HOST}" >> $PHP_ENV_CONFIG;
|
||||||
else
|
else
|
||||||
echo "env[VIRTUAL_HOST] = ${ServerIP}" >> $PHP_ENV_CONFIG;
|
echo "env[VIRTUAL_HOST] = ${ServerIP}" >> $PHP_ENV_CONFIG;
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ cat $PHP_ENV_CONFIG
|
||||||
dnsType='default'
|
dnsType='default'
|
||||||
DNS1=${DNS1:-'8.8.8.8'}
|
DNS1=${DNS1:-'8.8.8.8'}
|
||||||
DNS2=${DNS2:-'8.8.4.4'}
|
DNS2=${DNS2:-'8.8.4.4'}
|
||||||
if [ "$DNS1" != '8.8.8.8' ] || [ "$DNS2" != '8.8.4.4' ] ; then
|
if [ "$DNS1" != '8.8.8.8' ] || [ "$DNS2" != '8.8.4.4' ] ; then
|
||||||
dnsType='custom'
|
dnsType='custom'
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
@ -34,7 +34,9 @@ sed -i "s/@DNS2@/$DNS2/" /etc/dnsmasq.d/01-pihole.conf && \
|
||||||
dnsmasq --test -7 /etc/dnsmasq.d || exit 1
|
dnsmasq --test -7 /etc/dnsmasq.d || exit 1
|
||||||
php-fpm -t || exit 1
|
php-fpm -t || exit 1
|
||||||
nginx -t || exit 1
|
nginx -t || exit 1
|
||||||
|
echo " :: All config checks passed, starting ..."
|
||||||
|
|
||||||
|
if [ -n "$PYTEST" ] ; then sed -i 's/^gravity_spinup/#donotcurl/g' `which gravity.sh`; fi;
|
||||||
gravity.sh
|
gravity.sh
|
||||||
dnsmasq -7 /etc/dnsmasq.d
|
dnsmasq -7 /etc/dnsmasq.d
|
||||||
php-fpm
|
php-fpm
|
||||||
|
|
|
@ -26,7 +26,8 @@ RUN mkdir -p /opt/ && ln -s /usr/local/bin /opt/pihole
|
||||||
COPY ./pi-hole/advanced/lighttpd.conf.debian /etc/lighttpd/lighttpd.conf
|
COPY ./pi-hole/advanced/lighttpd.conf.debian /etc/lighttpd/lighttpd.conf
|
||||||
COPY ./pi-hole/advanced/dnsmasq.conf.original /etc/dnsmasq.conf
|
COPY ./pi-hole/advanced/dnsmasq.conf.original /etc/dnsmasq.conf
|
||||||
COPY ./pi-hole/advanced/01-pihole.conf /etc/dnsmasq.d/
|
COPY ./pi-hole/advanced/01-pihole.conf /etc/dnsmasq.d/
|
||||||
COPY ./pi-hole/advanced/index.html /var/www/html/pihole/index.html
|
COPY ./pi-hole/advanced/index* /var/www/html/pihole/
|
||||||
|
RUN rm /var/www/html/index.lighttpd.html
|
||||||
COPY ./pi-hole/advanced/pihole.sudo /etc/sudoers.d/pihole
|
COPY ./pi-hole/advanced/pihole.sudo /etc/sudoers.d/pihole
|
||||||
COPY ./AdminLTE /var/www/html/admin
|
COPY ./AdminLTE /var/www/html/admin
|
||||||
COPY ./AdminLTE_version.txt /etc/
|
COPY ./AdminLTE_version.txt /etc/
|
||||||
|
|
|
@ -11,7 +11,7 @@ sed -i "/bin-environment/ a\\\t\t\t\"PHP_ERROR_LOG\" => \"${PHP_ERROR_LOG}\"," $
|
||||||
|
|
||||||
if [ -n "$VIRTUAL_HOST" ] ; then
|
if [ -n "$VIRTUAL_HOST" ] ; then
|
||||||
sed -i "/bin-environment/ a\\\t\t\t\"VIRTUAL_HOST\" => \"${VIRTUAL_HOST}\"," $PHP_ENV_CONFIG
|
sed -i "/bin-environment/ a\\\t\t\t\"VIRTUAL_HOST\" => \"${VIRTUAL_HOST}\"," $PHP_ENV_CONFIG
|
||||||
else
|
else
|
||||||
sed -i "/bin-environment/ a\\\t\t\t\"VIRTUAL_HOST\" => \"${ServerIP}\"," $PHP_ENV_CONFIG
|
sed -i "/bin-environment/ a\\\t\t\t\"VIRTUAL_HOST\" => \"${ServerIP}\"," $PHP_ENV_CONFIG
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ grep -E '(VIRTUAL_HOST|ServerIP)' $PHP_ENV_CONFIG
|
||||||
dnsType='default'
|
dnsType='default'
|
||||||
DNS1=${DNS1:-'8.8.8.8'}
|
DNS1=${DNS1:-'8.8.8.8'}
|
||||||
DNS2=${DNS2:-'8.8.4.4'}
|
DNS2=${DNS2:-'8.8.4.4'}
|
||||||
if [ "$DNS1" != '8.8.8.8' ] || [ "$DNS2" != '8.8.4.4' ] ; then
|
if [ "$DNS1" != '8.8.8.8' ] || [ "$DNS2" != '8.8.4.4' ] ; then
|
||||||
dnsType='custom'
|
dnsType='custom'
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
@ -31,7 +31,9 @@ sed -i "s/@DNS2@/$DNS2/" /etc/dnsmasq.d/01-pihole.conf && \
|
||||||
|
|
||||||
dnsmasq --test -7 /etc/dnsmasq.d || exit 1
|
dnsmasq --test -7 /etc/dnsmasq.d || exit 1
|
||||||
lighttpd -t -f /etc/lighttpd/lighttpd.conf || exit 1
|
lighttpd -t -f /etc/lighttpd/lighttpd.conf || exit 1
|
||||||
|
echo " :: All config checks passed, starting ..."
|
||||||
|
|
||||||
|
if [ -n "$PYTEST" ] ; then sed -i 's/^gravity_spinup/#donotcurl/g' `which gravity.sh`; fi;
|
||||||
gravity.sh # dnsmasq start included
|
gravity.sh # dnsmasq start included
|
||||||
service lighttpd start
|
service lighttpd start
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
''' This file starts with 000 to make it run first '''
|
||||||
|
import pytest
|
||||||
|
import testinfra
|
||||||
|
|
||||||
|
run_local = testinfra.get_backend(
|
||||||
|
"local://"
|
||||||
|
).get_module("Command").run
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("image,tag", [
|
||||||
|
( 'alpine.docker', 'diginc/pi-hole:alpine' ),
|
||||||
|
( 'debian.docker', 'diginc/pi-hole:debian' ),
|
||||||
|
])
|
||||||
|
def test_build_pihole_image(image, tag):
|
||||||
|
build_cmd = run_local('docker build -f {} -t {} .'.format(image, tag))
|
||||||
|
if build_cmd.rc != 0:
|
||||||
|
print build_cmd.stdout
|
||||||
|
print build_cmd.stderr
|
||||||
|
assert build_cmd.rc == 0
|
Loading…
Reference in New Issue