1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +00:00

Merge dev > FTLDNS fix merge conflicts

Signed-off-by: Adam Warner <adamw@rner.email>
This commit is contained in:
Adam Warner 2018-04-13 17:01:54 +01:00
commit 310d33b8ee
No known key found for this signature in database
GPG Key ID: F5410858022DA5EB
9 changed files with 34 additions and 68 deletions

2
.github/dco.yml vendored Normal file
View File

@ -0,0 +1,2 @@
require:
members: false

View File

@ -1,38 +0,0 @@
version: 2
always_pending:
title_regex: '(WIP|wip)'
labels:
- wip
explanation: 'This PR is a work in progress...'
group_defaults:
reset_on_push:
enabled: true
reject_value: -2
approve_regex: '^(Approved|:shipit:|:\+1:|Engage|:taco:)'
reject_regex: '^(Rejected|:-1:|Borg)'
author_approval:
auto: true
groups:
development:
approve_by_comment:
enabled: true
conditions:
branches:
- development
required: 2
teams:
- approvers
master:
approve_by_comment:
enabled: true
conditions:
branches:
- master
required: 4
teams:
- approvers

View File

@ -1,5 +1,3 @@
_This template was created based on the work of [`udemy-dl`](https://github.com/nishad/udemy-dl/blob/master/LICENSE)._
# Contributors Guide # Contributors Guide
Please read and understand the contribution guide before creating an issue or pull request. Please read and understand the contribution guide before creating an issue or pull request.

View File

@ -179,6 +179,7 @@ get_init_stats() {
90009[2-3]|920093) sys_model=" Zero";; # 512MB 90009[2-3]|920093) sys_model=" Zero";; # 512MB
9000c1) sys_model=" Zero W";; # 512MB 9000c1) sys_model=" Zero W";; # 512MB
a02082|a[2-3]2082) sys_model=" 3, Model B";; # 1GB a02082|a[2-3]2082) sys_model=" 3, Model B";; # 1GB
a020d3) sys_model=" 3, Model B+";; # 1GB
*) sys_model="";; *) sys_model="";;
esac esac
sys_type="Raspberry Pi$sys_model" sys_type="Raspberry Pi$sys_model"

View File

@ -465,15 +465,15 @@ processor_check() {
else else
# Check if the architecture is currently supported for FTL # Check if the architecture is currently supported for FTL
case "${PROCESSOR}" in case "${PROCESSOR}" in
"amd64") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" "amd64") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
;; ;;
"armv6l") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" "armv6l") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
;; ;;
"armv6") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" "armv6") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
;; ;;
"armv7l") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" "armv7l") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
;; ;;
"aarch64") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" "aarch64") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
;; ;;
# Otherwise, show the processor type # Otherwise, show the processor type
*) log_write "${INFO} ${PROCESSOR}"; *) log_write "${INFO} ${PROCESSOR}";
@ -712,20 +712,20 @@ check_x_headers() {
# If the X-header found by curl matches what is should be, # If the X-header found by curl matches what is should be,
if [[ $block_page == "$block_page_working" ]]; then if [[ $block_page == "$block_page_working" ]]; then
# display a success message # display a success message
log_write "$TICK ${COL_GREEN}${block_page}${COL_NC}" log_write "$TICK Block page X-Header: ${COL_GREEN}${block_page}${COL_NC}"
else else
# Otherwise, show an error # Otherwise, show an error
log_write "$CROSS ${COL_RED}X-Header does not match or could not be retrieved.${COL_NC}" log_write "$CROSS Block page X-Header: ${COL_RED}X-Header does not match or could not be retrieved.${COL_NC}"
log_write "${COL_RED}${full_curl_output_block_page}${COL_NC}" log_write "${COL_RED}${full_curl_output_block_page}${COL_NC}"
fi fi
# Same logic applies to the dashbord as above, if the X-Header matches what a working system shoud have, # Same logic applies to the dashbord as above, if the X-Header matches what a working system shoud have,
if [[ $dashboard == "$dashboard_working" ]]; then if [[ $dashboard == "$dashboard_working" ]]; then
# then we can show a success # then we can show a success
log_write "$TICK ${COL_GREEN}${dashboard}${COL_NC}" log_write "$TICK Web interface X-Header: ${COL_GREEN}${dashboard}${COL_NC}"
else else
# Othewise, it's a failure since the X-Headers either don't exist or have been modified in some way # Othewise, it's a failure since the X-Headers either don't exist or have been modified in some way
log_write "$CROSS ${COL_RED}X-Header does not match or could not be retrieved.${COL_NC}" log_write "$CROSS Web interface X-Header: ${COL_RED}X-Header does not match or could not be retrieved.${COL_NC}"
log_write "${COL_RED}${full_curl_output_dashboard}${COL_NC}" log_write "${COL_RED}${full_curl_output_dashboard}${COL_NC}"
fi fi
} }

View File

@ -20,6 +20,11 @@ FTLconf="/etc/pihole/pihole-FTL.conf"
if [ -e "$FTLconf" ]; then if [ -e "$FTLconf" ]; then
DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' ${FTLconf})" DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' ${FTLconf})"
fi fi
# Test for empty string. Use standard path in this case.
if [ -z "$DBFILE" ]; then
DBFILE="/etc/pihole/pihole-FTL.db"
fi
if [[ "$@" != *"quiet"* ]]; then if [[ "$@" != *"quiet"* ]]; then
echo -ne " ${INFO} Flushing /var/log/pihole.log ..." echo -ne " ${INFO} Flushing /var/log/pihole.log ..."
fi fi

View File

@ -64,7 +64,7 @@ if ($serverName === "pi.hole") {
<html><head> <html><head>
$viewPort $viewPort
<link rel='stylesheet' href='/pihole/blockingpage.css' type='text/css'/> <link rel='stylesheet' href='/pihole/blockingpage.css' type='text/css'/>
</head><body id='splashpage'><img src='/admin/img/logo.svg'/><br/>Pi-<b>hole</b>: Your black hole for Internet advertisements</body></html> </head><body id='splashpage'><img src='/admin/img/logo.svg'/><br/>Pi-<b>hole</b>: Your black hole for Internet advertisements<br><a href='/admin'>Did you mean to go to the admin panel?</a></body></html>
"; ";
// Set splash/landing page based off presence of $landPage // Set splash/landing page based off presence of $landPage

View File

@ -687,13 +687,13 @@ setStaticIPv4() {
elif [[ -f "/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE}" ]];then elif [[ -f "/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE}" ]];then
# If it exists, # If it exists,
IFCFG_FILE=/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE} IFCFG_FILE=/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE}
IPADDR=$(echo "${IPV4_ADDRESS}" | cut -f1 -d/)
# check if the desired IP is already set # check if the desired IP is already set
if grep -q "${IPV4_ADDRESS}" "${IFCFG_FILE}"; then if grep -q "${IPADDR}" "${IFCFG_FILE}"; then
echo -e " ${INFO} Static IP already configured" echo -e " ${INFO} Static IP already configured"
# Otherwise, # Otherwise,
else else
# Put the IP in variables without the CIDR notation # Put the IP in variables without the CIDR notation
IPADDR=$(echo "${IPV4_ADDRESS}" | cut -f1 -d/)
CIDR=$(echo "${IPV4_ADDRESS}" | cut -f2 -d/) CIDR=$(echo "${IPV4_ADDRESS}" | cut -f2 -d/)
# Backup existing interface configuration: # Backup existing interface configuration:
cp "${IFCFG_FILE}" "${IFCFG_FILE}".pihole.orig cp "${IFCFG_FILE}" "${IFCFG_FILE}".pihole.orig
@ -768,6 +768,8 @@ setDNS() {
Comodo "" Comodo ""
DNSWatch "" DNSWatch ""
Quad9 "" Quad9 ""
FamilyShield ""
Cloudflare ""
Custom "") Custom "")
# In a whiptail dialog, show the options # In a whiptail dialog, show the options
DNSchoices=$(whiptail --separate-output --menu "Select Upstream DNS Provider. To use your own, select Custom." ${r} ${c} 7 \ DNSchoices=$(whiptail --separate-output --menu "Select Upstream DNS Provider. To use your own, select Custom." ${r} ${c} 7 \
@ -814,6 +816,16 @@ setDNS() {
PIHOLE_DNS_1="9.9.9.9" PIHOLE_DNS_1="9.9.9.9"
PIHOLE_DNS_2="149.112.112.112" PIHOLE_DNS_2="149.112.112.112"
;; ;;
FamilyShield)
echo "FamilyShield servers"
PIHOLE_DNS_1="208.67.222.123"
PIHOLE_DNS_2="208.67.220.123"
;;
Cloudflare)
echo "Cloudflare servers"
PIHOLE_DNS_1="1.1.1.1"
PIHOLE_DNS_2="1.0.0.1"
;;
Custom) Custom)
# Until the DNS settings are selected, # Until the DNS settings are selected,
until [[ "${DNSSettingsCorrect}" = True ]]; do until [[ "${DNSSettingsCorrect}" = True ]]; do
@ -1384,22 +1396,8 @@ installCron() {
# Gravity is a very important script as it aggregates all of the domains into a single HOSTS formatted list, # Gravity is a very important script as it aggregates all of the domains into a single HOSTS formatted list,
# which is what Pi-hole needs to begin blocking ads # which is what Pi-hole needs to begin blocking ads
runGravity() { runGravity() {
echo ""
echo -e " ${INFO} Preparing to run gravity.sh to refresh hosts..."
# If cached lists exist,
if ls /etc/pihole/list* 1> /dev/null 2>&1; then
echo -e " ${INFO} Cleaning up previous install (preserving whitelist/blacklist)"
# remove them
rm /etc/pihole/list.*
fi
# If the default ad lists file exists,
if [[ ! -e /etc/pihole/adlists.default ]]; then
# copy it over from the local repo
cp ${PI_HOLE_LOCAL_REPO}/adlists.default /etc/pihole/adlists.default
fi
echo -e " ${INFO} Running gravity.sh"
# Run gravity in the current shell # Run gravity in the current shell
{ /opt/pihole/gravity.sh; } { /opt/pihole/gravity.sh --force; }
} }
# Check if the pihole user exists and create if it does not # Check if the pihole user exists and create if it does not

2
pihole
View File

@ -475,7 +475,7 @@ statusFunc() {
local addnConfigs local addnConfigs
# Determine if service is running on port 53 (Cr: https://superuser.com/a/806331) # Determine if service is running on port 53 (Cr: https://superuser.com/a/806331)
if (echo > /dev/tcp/localhost/53) >/dev/null 2>&1; then if (echo > /dev/tcp/127.0.0.1/53) >/dev/null 2>&1; then
if [[ "${1}" != "web" ]]; then if [[ "${1}" != "web" ]]; then
echo -e " ${TICK} DNS service is running" echo -e " ${TICK} DNS service is running"
fi fi