resolving alpine+nginx issues

This commit is contained in:
diginc
2017-01-08 23:43:12 -06:00
parent dc83502ed1
commit cc1c7a745d
5 changed files with 19 additions and 16 deletions

View File

@@ -15,11 +15,17 @@ http {
listen 80;
listen [::]:80;
root /var/www/html;
index index.php pihole/index.html;
error_page 404 =200 /pihole/index.html;
index pihole/index.php;
error_page 404 =200 /pihole/index.php;
location /*.js {
index pihole/index.js
error_page 404 =200 /pihole/index.js;
}
location ~ ^/admin/ {
add_header X-Pi-hole "The Pi-hole Web interface is working!";
index index.php;
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
@@ -29,11 +35,6 @@ http {
}
}
location /*.js {
index pihole/index.js
error_page 404 =200 /pihole/index.js;
}
location / {
add_header X-Pi-hole "A black hole for Internet advertisements." always;
}

View File

@@ -20,7 +20,8 @@ if [[ "$IMAGE" == 'alpine' ]] ; then
sed -i '/etc\/cron.d\//d' "${PIHOLE_INSTALL}"
LIGHTTPD_USER="nginx"
LIGHTTPD_GROUP="nginx"
LIGHTTPD_CFG="lighttpd.conf.debian"
DNSMASQ_USER="dnsmasq"
fi
PH_TEST=true . "${PIHOLE_INSTALL}"
@@ -37,8 +38,8 @@ elif [[ "$IMAGE" == 'alpine' ]] ; then
php5-fpm php5-json php5-openssl libxml2 \
bc bash curl perl sudo git
fi
git clone --depth 1 ${piholeGitUrl} ${PI_HOLE_LOCAL_REPO}
git clone --depth 1 ${webInterfaceGitUrl} ${webInterfaceDir}
git clone --depth 1 "${piholeGitUrl}" "${PI_HOLE_LOCAL_REPO}"
git clone --depth 1 "${webInterfaceGitUrl}" "${webInterfaceDir}"
export PIHOLE_INTERFACE=eth0
export IPV4_ADDRESS=0.0.0.0
@@ -52,4 +53,4 @@ mv "${tmpLog}" "${instalLogLoc}"
# Fix dnsmasq in docker
grep -q '^user=root' || echo -e '\nuser=root' >> /etc/dnsmasq.conf
echo done
echo 'done'

Submodule pi-hole updated: a2bc86fbcb...47196d86ad

View File

@@ -1 +1 @@
v2.11.1
v2.11.2

View File

@@ -43,7 +43,7 @@ def test_indecies_are_present(RunningPiHole):
def test_html_index_requests_load_as_expected(RunningPiHole, ip, url):
command = 'curl -s -o /tmp/curled_file -w "%{{http_code}}" http://{}{}'.format(ip, url)
http_rc = RunningPiHole.run(command)
assert RunningPiHole.run('md5sum /tmp/curled_file /var/www/html/pihole/index.html').rc == 0
assert RunningPiHole.run('grep -q "Access to the following site has been blocked" /tmp/curled_file ').rc == 0
assert int(http_rc.stdout) == 200
@pytest.mark.parametrize('ip', [ '127.0.0.1', '[::]' ] )
@@ -54,7 +54,8 @@ def test_javascript_requests_load_as_expected(RunningPiHole, ip, url):
assert RunningPiHole.run('md5sum /tmp/curled_file /var/www/html/pihole/index.js').rc == 0
assert int(http_rc.stdout) == 200
@pytest.mark.parametrize('ip', [ '127.0.0.1', '[::]' ] )
# 127.0.0.1 fails host check now :(
@pytest.mark.parametrize('ip', [ 'localhost', '[::]' ] )
@pytest.mark.parametrize('url', [ '/admin/', '/admin/index.php' ] )
def test_admin_requests_load_as_expected(RunningPiHole, ip, url):
command = 'curl -s -o /tmp/curled_file -w "%{{http_code}}" http://{}{}'.format(ip, url)
@@ -62,5 +63,5 @@ def test_admin_requests_load_as_expected(RunningPiHole, ip, url):
assert int(http_rc.stdout) == 200
assert RunningPiHole.run('wc -l /tmp/curled_file ') > 10
assert RunningPiHole.run('grep -q "Content-Security-Policy" /tmp/curled_file ').rc == 0
assert RunningPiHole.run('grep -q "js/pihole/footer.js" /tmp/curled_file ').rc == 0
assert RunningPiHole.run('grep -q "scripts/pi-hole/js/footer.js" /tmp/curled_file ').rc == 0