Skip to content

Commit

Permalink
Merge branch 'reset_before_pull' of https://github.com/pi-hole/pi-hole
Browse files Browse the repository at this point in the history
…into reset_before_pull
  • Loading branch information
rdwebdesign committed Oct 8, 2022
2 parents 4546384 + e4e3914 commit 9697937
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
issues: write

steps:
- uses: actions/stale@v5.1.1
- uses: actions/stale@v5.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ jobs:
strategy:
fail-fast: false
matrix:
distro: [debian_10, debian_11, ubuntu_18, ubuntu_20, ubuntu_22, centos_8, fedora_34]
distro: [debian_10, debian_11, ubuntu_20, ubuntu_22, centos_8, fedora_34]
env:
DISTRO: ${{matrix.distro}}
steps:
-
name: Checkout repository
uses: actions/[email protected]
-
name: Set up Python 3.8
name: Set up Python 3.10
uses: actions/[email protected]
with:
python-version: 3.8
python-version: '3.10'
-
name: Install dependencies
run: pip install -r test/requirements.txt
Expand Down
26 changes: 9 additions & 17 deletions advanced/Scripts/piholeDebug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ else
#OVER="\r\033[K"
fi

# shellcheck disable=SC1091
. /etc/pihole/versions

OBFUSCATED_PLACEHOLDER="<DOMAIN OBFUSCATED>"

# FAQ URLs for use in showing the debug log
Expand All @@ -50,7 +53,6 @@ FAQ_HARDWARE_REQUIREMENTS="${COL_CYAN}https://docs.pi-hole.net/main/prerequisite
FAQ_HARDWARE_REQUIREMENTS_PORTS="${COL_CYAN}https://docs.pi-hole.net/main/prerequisites/#ports${COL_NC}"
FAQ_HARDWARE_REQUIREMENTS_FIREWALLD="${COL_CYAN}https://docs.pi-hole.net/main/prerequisites/#firewalld${COL_NC}"
FAQ_GATEWAY="${COL_CYAN}https://discourse.pi-hole.net/t/why-is-a-default-gateway-important-for-pi-hole/3546${COL_NC}"
FAQ_ULA="${COL_CYAN}https://discourse.pi-hole.net/t/use-ipv6-ula-addresses-for-pi-hole/2127${COL_NC}"
FAQ_FTL_COMPATIBILITY="${COL_CYAN}https://github.com/pi-hole/FTL#compatibility-list${COL_NC}"
FAQ_BAD_ADDRESS="${COL_CYAN}https://discourse.pi-hole.net/t/why-do-i-see-bad-address-at-in-pihole-log/3972${COL_NC}"

Expand Down Expand Up @@ -465,8 +467,8 @@ diagnose_operating_system() {
# Display the current test that is running
echo_current_diagnostic "Operating system"

# If the PIHOLE_DOCKER_TAG variable is set, include this information in the debug output
[ -n "${PIHOLE_DOCKER_TAG}" ] && log_write "${INFO} Pi-hole Docker Container: ${PIHOLE_DOCKER_TAG}"
# If DOCKER_VERSION is set (Sourced from /etc/pihole/versions at start of script), include this information in the debug output
[ -n "${DOCKER_VERSION}" ] && log_write "${INFO} Pi-hole Docker Container: ${DOCKER_VERSION}"

# If there is a /etc/*release file, it's probably a supported operating system, so we can
if ls /etc/*release 1> /dev/null 2>&1; then
Expand Down Expand Up @@ -802,7 +804,7 @@ check_networking() {
ping_gateway "6"
# Skip the following check if installed in docker container. Unpriv'ed containers do not have access to the information required
# to resolve the service name listening - and the container should not start if there was a port conflict anyway
[ -z "${PIHOLE_DOCKER_TAG}" ] && check_required_ports
[ -z "${DOCKER_VERSION}" ] && check_required_ports
}

check_x_headers() {
Expand All @@ -812,7 +814,7 @@ check_x_headers() {
# Similarly, it will show "X-Pi-hole: The Pi-hole Web interface is working!" if you view the header returned
# when accessing the dashboard (i.e curl -I pi.hole/admin/)
# server is operating correctly
echo_current_diagnostic "Dashboard and block page"
echo_current_diagnostic "Dashboard headers"
# Use curl -I to get the header and parse out just the X-Pi-hole one
local full_curl_output_dashboard
local dashboard
Expand All @@ -822,7 +824,7 @@ check_x_headers() {
local dashboard_working
dashboard_working="X-Pi-hole: The Pi-hole Web interface is working!"

# Same logic applies to the dashboard as above, if the X-Header matches what a working system should have,
# If the X-Header matches what a working system should have,
if [[ $dashboard == "$dashboard_working" ]]; then
# then we can show a success
log_write "$TICK Web interface X-Header: ${COL_GREEN}${dashboard}${COL_NC}"
Expand Down Expand Up @@ -1274,7 +1276,7 @@ analyze_gravity_list() {

# if users want to check database integrity
if [[ "${CHECK_DATABASE}" = true ]]; then
database_integrity_check "${PIHOLE_FTL_DB_FILE}"
database_integrity_check "${PIHOLE_GRAVITY_DB_FILE}"
fi

show_db_entries "Info table" "SELECT property,value FROM info" "20 40"
Expand Down Expand Up @@ -1337,16 +1339,6 @@ database_integrity_check(){

}

check_database_integrity() {
echo_current_diagnostic "Gravity Database"
database_permissions "${PIHOLE_GRAVITY_DB_FILE}"
database_integrity_check "${PIHOLE_GRAVITY_DB_FILE}"

echo_current_diagnostic "Pi-hole FTL Query Database"
database_permissions "${PIHOLE_FTL_DB_FILE}"
database_integrity_check "${PIHOLE_FTL_DB_FILE}"
}

# Show a text spinner during a long process run
spinner(){
# Show the spinner only if there is a tty
Expand Down
5 changes: 5 additions & 0 deletions advanced/Scripts/updatecheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,9 @@ else
FTL_VERSION="$(pihole-FTL version)"
addOrEditKeyValPair "${VERSION_FILE}" "FTL_VERSION" "${FTL_VERSION}"

# PIHOLE_DOCKER_TAG is set as env variable only on docker installations
if [[ "${PIHOLE_DOCKER_TAG}" ]]; then
addOrEditKeyValPair "${VERSION_FILE}" "DOCKER_VERSION" "${PIHOLE_DOCKER_TAG}"
fi

fi
2 changes: 2 additions & 0 deletions advanced/lighttpd.conf.debian
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ server.errorlog = "/var/log/lighttpd/error-pihole.log"
server.pid-file = "/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
# For lighttpd version 1.4.46 or above, the port can be overwritten in `/etc/lighttpd/external.conf` using the := operator
# e.g. server.port := 8000
server.port = 80
accesslog.filename = "/var/log/lighttpd/access-pihole.log"
accesslog.format = "%{%s}t|%V|%r|%s|%b"
Expand Down
2 changes: 2 additions & 0 deletions advanced/lighttpd.conf.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ server.errorlog = "/var/log/lighttpd/error-pihole.log"
server.pid-file = "/run/lighttpd.pid"
server.username = "lighttpd"
server.groupname = "lighttpd"
# For lighttpd version 1.4.46 or above, the port can be overwritten in `/etc/lighttpd/external.conf` using the := operator
# e.g. server.port := 8000
server.port = 80
accesslog.filename = "/var/log/lighttpd/access-pihole.log"
accesslog.format = "%{%s}t|%V|%r|%s|%b"
Expand Down
6 changes: 3 additions & 3 deletions pihole
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ restartDNS() {
local svcOption svc str output status pid icon FTL_PID_FILE
svcOption="${1:-restart}"

# get the current path to the pihole-FTL.pid
FTL_PID_FILE="$(getFTLPIDFile)"

# Determine if we should reload or restart
if [[ "${svcOption}" =~ "reload-lists" ]]; then
# Reloading of the lists has been requested
# Note 1: This will NOT re-read any *.conf files
# Note 2: We cannot use killall here as it does
# not know about real-time signals

# get the current path to the pihole-FTL.pid
FTL_PID_FILE="$(getFTLPIDFile)"

pid="$(getFTLPID ${FTL_PID_FILE})"
if [[ "$pid" -eq "-1" ]]; then
svc="true"
Expand Down
17 changes: 0 additions & 17 deletions test/_ubuntu_18.Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions test/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from setuptools import setup

setup(
py_modules=[],
setup_requires=['pytest-runner'],
tests_require=['pytest'],
)
8 changes: 6 additions & 2 deletions test/test_any_automated_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,13 +880,17 @@ def test_FTL_binary_installed_and_responsive_no_errors(host):
source /opt/pihole/basic-install.sh
create_pihole_user
funcOutput=$(get_binary_name)
echo "development" > /etc/pihole/ftlbranch
binary="pihole-FTL${funcOutput##*pihole-FTL}"
theRest="${funcOutput%pihole-FTL*}"
FTLdetect "${binary}" "${theRest}"
pihole-FTL version
''')
version_check = host.run('''
VERSION=$(pihole-FTL version)
echo ${VERSION:0:1}
''')
expected_stdout = 'v'
assert expected_stdout in installed_binary.stdout
assert expected_stdout in version_check.stdout


def test_IPv6_only_link_local(host):
Expand Down
2 changes: 1 addition & 1 deletion test/tox.centos_8.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38
envlist = py3

[testenv]
whitelist_externals = docker
Expand Down
2 changes: 1 addition & 1 deletion test/tox.debian_10.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38
envlist = py3

[testenv]
whitelist_externals = docker
Expand Down
2 changes: 1 addition & 1 deletion test/tox.debian_11.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38
envlist = py3

[testenv]
whitelist_externals = docker
Expand Down
2 changes: 1 addition & 1 deletion test/tox.fedora_34.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38
envlist = py3

[testenv]
whitelist_externals = docker
Expand Down
8 changes: 0 additions & 8 deletions test/tox.ubuntu_18.ini

This file was deleted.

2 changes: 1 addition & 1 deletion test/tox.ubuntu_20.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38
envlist = py3

[testenv]
whitelist_externals = docker
Expand Down
2 changes: 1 addition & 1 deletion test/tox.ubuntu_22.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38
envlist = py3

[testenv]
whitelist_externals = docker
Expand Down

0 comments on commit 9697937

Please sign in to comment.