Compare commits

...

16 Commits

Author SHA1 Message Date
Dan Schaper
6ce527010b Initial work on stubbing for lua.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-06-21 10:49:46 -07:00
Adam Warner
761c1cd305 Merge pull request #4175 from ashuio/development
Added docker to README
2021-05-20 18:49:01 +01:00
Ashutosh Verma
6f60555f79 Added install Method 3
Signed-off-by: Ashutosh Verma <mail@ashu.io>
2021-05-20 22:34:19 +05:30
Adam Warner
a51be7d498 Merge pull request #4153 from MichaIng/patch-2
Re-remove wget from dependencies
2021-05-01 00:09:19 +01:00
MichaIng
f3ceebbe06 Re-remove wget from dependencies
The dependency has been removed here: https://github.com/pi-hole/pi-hole/pull/3185
But accidentally re-added here: 982c1b0059 (diff-595630a29a855f6d667a84ca0662042e826bf3ec56322ef61d4a6ef149147d23)

wget is still not used in any Pi-hole script, hence it can be removed safely from dependencies.

Signed-off-by: MichaIng <micha@dietpi.com>
2021-04-30 20:48:12 +02:00
Adam Warner
57d9b96b53 Merge pull request #4143 from pi-hole/version-fullstops
Cosmetic change to pihole -v -c output
2021-04-25 17:47:40 +01:00
Adam Warner
5895690b58 this has been annoying me for months
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-04-24 15:38:27 +01:00
DL6ER
d26f8dd665 Merge pull request #4135 from MichaIng/patch-1
Enable PHP8 support for Debian/Ubuntu
2021-04-21 20:19:25 +02:00
MichaIng
2ba350984f Enable PHP8 support for Debian/Ubuntu
Since PHP8.0, the JSON extension is a core PHP extension and hence the php8.0-json package does not exist and is not required:
- https://www.php.net/manual/json.installation.php
- https://packages.debian.org/php8.0-json

Solves: https://discourse.pi-hole.net/t/php-8-packages-not-found/46286

Signed-off-by: MichaIng <micha@dietpi.com>
2021-04-18 15:33:05 +02:00
Dan Schaper
1fb6366c41 Merge pull request #4123 from pi-hole/master
Master v5.3.1 to development
2021-04-14 14:30:30 -07:00
Dan Schaper
4736e03108 Merge pull request #4122 from pi-hole/release/v5.3.1
HotFix release v5.3.1
2021-04-14 14:10:21 -07:00
Dan Schaper
18bedc0493 Merge pull request #4121 from pi-hole/fix/port_hash
Fix port separator in IPv4 address validation code
2021-04-14 13:59:52 -07:00
DL6ER
74948ae5c1 The correct port separator is '#' not ':' in dnsmasq style. This should not have been changed in #4083 in the first place.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-04-14 22:53:12 +02:00
Dan Schaper
9b57f7fa33 Merge pull request #4120 from pi-hole/fix/splashPage
Add missing closing single quote
2021-04-14 13:50:45 -07:00
Dan Schaper
866045968d Add missing closing single quote
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-04-14 12:27:36 -07:00
Dan Schaper
f2e0cf8a92 Merge pull request #4117 from pi-hole/master
v5.8 master to dev
2021-04-14 12:24:08 -07:00
6 changed files with 93 additions and 49 deletions

View File

@@ -50,6 +50,8 @@ sudo bash basic-install.sh
wget -O basic-install.sh https://install.pi-hole.net
sudo bash basic-install.sh
```
### Method 3: Using Docker to deploy Pi-hole
Please refer to the [Pi-hole docker repo](https://github.com/pi-hole/docker-pi-hole) to use the Official Docker Images.
## [Post-install: Make your network take advantage of Pi-hole](https://docs.pi-hole.net/main/post-install/)

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# (c) 2021 Pi-hole (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Generates pihole_debug.log to be used for troubleshooting.
@@ -198,6 +198,33 @@ show_disclaimer(){
log_write "${DISCLAIMER}"
}
check_for_ftl(){
echo_current_diagnostic "Checking for pihole-FTL binary"
declare -g FTL_PATH
read -r FTL_PATH < <(which pihole-FTL)
if [ -z "${FTL_PATH}" ]; then
log_write "${CROSS} ${COL_RED} Unable to find pihole-FTL binary.${COL_NC}"
# Non-zero return value
return 2
else
log_write "${TICK} pihole-FTL: ${COL_GREEN}${FTL_PATH}${COL_NC}"
fi
}
check_for_lua(){
echo_current_diagnostic "Checking for lua capabilities"
if ! (${FTL_PATH} lua -v &>/dev/null); then
log_write "${CROSS} ${COL_RED} pihole-FTL binary does not have lua capabilites.${COL_NC}"
# Non-zero return value
return
else
log_write "${TICK} pihole-FTL: ${COL_GREEN}lua found!${COL_NC}"
fi
}
source_setup_variables() {
# Display the current test that is running
log_write "\\n${COL_PURPLE}*** [ INITIALIZING ]${COL_NC} Sourcing setup variables"
@@ -1421,28 +1448,40 @@ make_temporary_log
initialize_debug
# setupVars.conf needs to be sourced before the networking so the values are
# available to the other functions
source_setup_variables
check_component_versions
check_critical_program_versions
diagnose_operating_system
check_selinux
check_firewalld
processor_check
check_networking
check_name_resolution
check_dhcp_servers
process_status
ftl_full_status
parse_setup_vars
check_x_headers
analyze_gravity_list
show_groups
show_domainlist
show_clients
show_adlists
show_content_of_pihole_files
show_messages
parse_locale
analyze_pihole_log
copy_to_debug_log
upload_to_tricorder
if ! check_for_ftl; then
log_write "${COL_RED}Unable to complete debug run. Please contact support for assistance."
log_write "Please note the error that is displayed above.${COL_NC}"
#Non-zero return value
exit 2
fi
if ! check_for_lua; then
log_write "${COL_RED}Unable to complete debug run. Please contact support for assistance."
log_write "Please note the error that is displayed above.${COL_NC}"
#Non-zero return value
exit 2
fi
# source_setup_variables
# check_component_versions
# check_critical_program_versions
# diagnose_operating_system
# check_selinux
# check_firewalld
# processor_check
# check_networking
# check_name_resolution
# check_dhcp_servers
# process_status
# ftl_full_status
# parse_setup_vars
# check_x_headers
# analyze_gravity_list
# show_groups
# show_domainlist
# show_clients
# show_adlists
# show_content_of_pihole_files
# show_messages
# parse_locale
# analyze_pihole_log
# copy_to_debug_log
# upload_to_tricorder

View File

@@ -153,7 +153,7 @@ versionOutput() {
if [[ -n "$current" ]] && [[ -n "$latest" ]]; then
output="${1^} version is $branch$current (Latest: $latest)"
elif [[ -n "$current" ]] && [[ -z "$latest" ]]; then
output="Current ${1^} version is $branch$current."
output="Current ${1^} version is $branch$current"
elif [[ -z "$current" ]] && [[ -n "$latest" ]]; then
output="Latest ${1^} version is $latest"
elif [[ "$curHash" == "N/A" ]] || [[ "$latHash" == "N/A" ]]; then

View File

@@ -78,7 +78,7 @@ if ($serverName === "pi.hole"
</head>
<body id='splashpage'>
<div id="pihole_card">
<img src='admin/img/logo.svg' alt='Pi-hole logo id="pihole_logo_splash" />
<img src='admin/img/logo.svg' alt='Pi-hole logo' id="pihole_logo_splash" />
<p>Pi-<strong>hole</strong>: Your black hole for Internet advertisements</p>
<a href='/admin'>Did you mean to go to the admin panel?</a>
</div>

View File

@@ -357,10 +357,14 @@ if is_command apt-get ; then
# Packages required to run this install script (stored as an array)
INSTALLER_DEPS=(dhcpcd5 git "${iproute_pkg}" whiptail dnsutils)
# Packages required to run Pi-hole (stored as an array)
PIHOLE_DEPS=(cron curl iputils-ping lsof netcat psmisc sudo unzip wget idn2 sqlite3 libcap2-bin dns-root-data libcap2)
PIHOLE_DEPS=(cron curl iputils-ping lsof netcat psmisc sudo unzip idn2 sqlite3 libcap2-bin dns-root-data libcap2)
# Packages required for the Web admin interface (stored as an array)
# It's useful to separate this from Pi-hole, since the two repos are also setup separately
PIHOLE_WEB_DEPS=(lighttpd "${phpVer}-common" "${phpVer}-cgi" "${phpVer}-${phpSqlite}" "${phpVer}-xml" "${phpVer}-json" "${phpVer}-intl")
PIHOLE_WEB_DEPS=(lighttpd "${phpVer}-common" "${phpVer}-cgi" "${phpVer}-${phpSqlite}" "${phpVer}-xml" "${phpVer}-intl")
# Prior to PHP8.0, JSON functionality is provided as dedicated module, required by Pi-hole AdminLTE: https://www.php.net/manual/json.installation.php
if [[ "${phpInsNewer}" != true || "${phpInsMajor}" -lt 8 ]]; then
PIHOLE_WEB_DEPS+=("${phpVer}-json")
fi
# The Web server user,
LIGHTTPD_USER="www-data"
# group,
@@ -1025,9 +1029,8 @@ valid_ip() {
# Regex matching one IPv4 component, i.e. an integer from 0 to 255.
# See https://tools.ietf.org/html/rfc1340
local ipv4elem="(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)";
# Regex matching an optional port beginning with : from 0 to 65535
# See https://tools.ietf.org/html/rfc1340#page-33
local portelem="(:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))?";
# Regex matching an optional port (starting with '#') range of 1-65536
local portelem="(#(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))?";
# Build a full IPv4 regex from the above subexpressions
local regex="^${ipv4elem}\.${ipv4elem}\.${ipv4elem}\.${ipv4elem}${portelem}$"
@@ -1046,8 +1049,8 @@ valid_ip6() {
local ipv6elem="[0-9a-fA-F]{1,4}"
# Regex matching an IPv6 CIDR, i.e. 1 to 128
local v6cidr="(\\/([1-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])){0,1}"
# Regex matching an optional port beginning with # matching optional port number starting '#' with range of 1-65536
local portelem="(#([1-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-6]))?"
# Regex matching an optional port (starting with '#') range of 1-65536
local portelem="(#(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))?";
# Build a full IPv6 regex from the above subexpressions
local regex="^(((${ipv6elem}))*((:${ipv6elem}))*::((${ipv6elem}))*((:${ipv6elem}))*|((${ipv6elem}))((:${ipv6elem})){7})${v6cidr}${portelem}$"

View File

@@ -546,23 +546,23 @@ def test_validate_ip(Pihole):
test_address('256.255.255.255', False)
test_address('1092.168.1.1', False)
test_address('not an IP', False)
test_address('8.8.8.8:', False)
test_address('8.8.8.8:0')
test_address('8.8.8.8:1')
test_address('8.8.8.8:42')
test_address('8.8.8.8:888')
test_address('8.8.8.8:1337')
test_address('8.8.8.8:65535')
test_address('8.8.8.8:65536', False)
test_address('8.8.8.8:-1', False)
test_address('8.8.8.8#', False)
test_address('8.8.8.8#0')
test_address('8.8.8.8#1')
test_address('8.8.8.8#42')
test_address('8.8.8.8#888')
test_address('8.8.8.8#1337')
test_address('8.8.8.8#65535')
test_address('8.8.8.8#65536', False)
test_address('8.8.8.8#-1', False)
test_address('00.0.0.0', False)
test_address('010.0.0.0', False)
test_address('001.0.0.0', False)
test_address('0.0.0.0:00', False)
test_address('0.0.0.0:01', False)
test_address('0.0.0.0:001', False)
test_address('0.0.0.0:0001', False)
test_address('0.0.0.0:00001', False)
test_address('0.0.0.0#00', False)
test_address('0.0.0.0#01', False)
test_address('0.0.0.0#001', False)
test_address('0.0.0.0#0001', False)
test_address('0.0.0.0#00001', False)
def test_os_check_fails(Pihole):