-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pi-hole core v3.2 #1776
Pi-hole core v3.2 #1776
Conversation
Install Script: Add comments for nearly every line of code
Update README with ® and several other improvements to better describe v3.2
Some images are jpg and not png.
… and the sha1sum matches the remote This will probably break some tests. I'll work that out in a bit Signed-off-by: Adam Warner <adamw@rner.email> Signed-off-by: Adam Warner <adamw@rner.email>
Signed-off-by: Adam Warner <adamw@rner.email>
Fix extentions of the JPG images
when there is a querystring Pi-hole sometimes parsed a wrong extension
* check for CIDR notation when comparing IPv6 address to that found in setupVars.conf * highlight bad address entries in pihole.log and reference a corresponding FAQ * show header output if Pi-holes x-header does not match * fix automated mode when running from the dashboard. It would previously not automatically upload and generate a token. * show disclaimer message * undocumented feature for now: obfuscate domains in pihole.log so they are not visible when sent to the Pi-hole developers. We need to make an additonal flag for this in the pihole command. if the variable OBFUSCATE has a value, it will replace the domain in the log with a placeholder value * fix small typo in the disclaimer
…nto developmentNew
Signed-off-by: Adam Warner <adamw@rner.email>
* Prevent Web Admin from printing unnecessary msgs * Make DNS restart behaviour consistent
* User-friendly queryFunc() output * Silence grep errors * Provide 'pihole -q -h' help output * Rewrite option handling * Loop through grep stdout to make query output user friendly * Add -adlist option to show block list URL instead of internal file name * Limit general searches to 10 matches per block list * Add -all option to override 10 match limit * Fixed 'pihole -h' wording * Further query optimisations * Optimised scanList() output by switching folder * Re-added processWildcards() function * Added "-bp" exact matching option for use with block page * Standardised query output * Separated wildcard search from blacklist/whitelist search * Optimised sorting by sorting glob output and not scanList() output * Fixed result skipping * Add text for wildcard result on exact query * Fix wildcard result output * Multiple wildcard matches on exact query could cause unexpected output * Remove unnecessary replacement * Make grep only output matching text * HOSTS format lists will also output the IP address * That substitution was necessary * Remove IP address from HOSTS format lists * Filter unwanted content * Add /dev/null to grep, to always print file name (even when searching only one block list) * Use three seds to remove unwanted content from block lists * Merge with development * Simplify queryFunc code
Signed-off-by: Adam Warner <adamw@rner.email> # Conflicts: # advanced/Scripts/piholeCheckout.sh
* Removed useless echo * Quoted and braced conditionals * Explicit escaping of newline * Fixed arrays implicitly concatenating (SC2199) * Fixed incorrect variable used in checkout web
* Only attempt to install FTL if branch was found * ~~corebranches~~ webbranches (web branches now actually listed) Signed-off-by: Adam Warner <adamw@rner.email>
… into tweak/checkout_FTL Signed-off-by: Adam Warner <adamw@rner.email> # Conflicts: # advanced/Scripts/piholeCheckout.sh
Signed-off-by: Adam Warner <adamw@rner.email>
* Do not activate disabled lighttpd upon update * Fixes #1362 * Use systemctl when available * Move `finalexports` to the very end of the install script set value of LIGHTTPD_ENABLED to 1 or 0 depending on whether or not lighttpd is enabled or disabled. actually save LIGHTTPD_ENABLED value to setupvars.conf Signed-off-by: Adam Warner <adamw@rner.email> * add [[ -z "${LIGHTTPD_ENABLED}" ]] back in! Signed-off-by: Adam Warner <adamw@rner.email> * Ensure "Loaded:" is the line being checked * Colourise disabled lighttpd message * Prevent disabled lighttpd triggering error * change of plan, don't need that [[ -z "${LIGHTTPD_ENABLED}" ]] Signed-off-by: Adam Warner <adamw@rner.email>
Add pihole checkout ftl
Sort out Merge conflicts with master
Signed-off-by: WaLLy3K <wally3k@pi-hole.net>
* Use a more relevant link when explaining debug * Re-add feature request note
* Shellcheck validation * Made variable names, function names, comments and output clearer to understand * Quoted and braced variables and conditionals * Fix adlists.list handling logic, and remove any CR line endings * Make CP/MV/RM provide user-friendly output upon failure * Change adlists.list retrieval logic * Moved and fixed adlists.list domain parsing logic * Create gravity_ParseFileAsDomains() function to handle parsing of source files * If no changes to a list is detected, print no output * Ensure each source blocklist has a final newline * Format number output as currency * Make array of adlists domain sources unique to prevent redundant whitelisting * Merged bash IPv4/IPv6 hosts formatting IF statement into an awk one-liner * Trap Ctrl-C cancellations and run gravity_Cleanup() * Use new gravity_Cleanup() function on errors and script completion * Ensure that dnsmasq uses force-reload when gravity is invoked * Add --wildcard option to ensure dnsmasq is restarted upon b/wlisting of a wildcard Signed-off-by: WaLLy3K <wally3k@pi-hole.net>
* Add "--blacklist-only" to only run essential gravity functions * Pass "--wildcard" option to `gravity.sh` to ensure dnsmasq is restarted Signed-off-by: WaLLy3K <wally3k@pi-hole.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Fedora 27 Cloud Base.
automated install/basic-install.sh
Outdated
UPDATE_PKG_CACHE=":" | ||
PKG_INSTALL=(${PKG_MANAGER} install -y) | ||
PKG_COUNT="${PKG_MANAGER} check-update | egrep '(.i686|.x86|.noarch|.arm|.src)' | wc -l" | ||
INSTALLER_DEPS=(dialog git iproute net-tools newt procps-ng) | ||
PIHOLE_DEPS=(bc bind-utils cronie curl dnsmasq findutils nmap-ncat sudo unzip wget) | ||
PIHOLE_WEB_DEPS=(lighttpd lighttpd-fastcgi php php-common php-cli) | ||
PIHOLE_DEPS=(bc bind-utils cronie curl dnsmasq findutils nmap-ncat sudo unzip wget idn2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
idn2
should be changed tolibidn2
for CentOS & Fedora. - add package
psmisc
to fix the missingkillall
command
[✗] /usr/local/bin/pihole: line 353: killall: command not found
/usr/local/bin/pihole: line 364: killall: command not found
# Value will either be 1, if true, or 0 | ||
LIGHTTPD_ENABLED=$(service lighttpd status | awk '/Loaded:/ {print $0}' | grep -c 'enabled' || true) | ||
fi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 2037 - 2043 is duplicate of 2009 - 2015.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate on purpose as it's in two different branches of an it's in the else
branch of if [[ "${userUpdateVars}" == false ]]
.
else | ||
# Value will either be 1, if true, or 0 | ||
LIGHTTPD_ENABLED=$(service lighttpd status | awk '/Loaded:/ {print $0}' | grep -c 'enabled' || true) | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a clean install:
LIGHTTPD_ENABLED
defaults to 0
due to the service being disabled and stopped by default.
This results in lighttpd
not being enabled and started upon a clean install.
|
||
runGravity | ||
if [[ "${LIGHTTPD_ENABLED}" == "1" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defaults to 0
as lighttpd
is stopped and disabled by default. (ref line 2011)
automated install/basic-install.sh
Outdated
#If the installed version matches the latest version, then check the installed sha1sum of the binary vs the remote sha1sum. If they do not match, then download | ||
echo -e " ${INFO} Checking for existing FTL binary..." | ||
|
||
local ftlLoc=$(which pihole-FTL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should hide the following stdout:
[i] Checking for existing FTL binary...
which: no pihole-FTL in (/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[✓] Downloading and Installing FTL
automated install/basic-install.sh
Outdated
echo " done!" | ||
# don't do anything | ||
echo -e "${OVER} ${CROSS} ${str} | ||
No default index.lighttpd.html file found... not backing up" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent 2 spaces:
[✓] Creating directory for blocking page, and copying files
[✗] Backing up index.lighttpd.html
No default index.lighttpd.html file found... not backing up
Signed-off-by: Adam Warner <adamw@rner.email>
Signed-off-by: Adam Warner <adamw@rner.email>
Signed-off-by: Adam Warner <adamw@rner.email>
…ent) Signed-off-by: Adam Warner <adamw@rner.email>
Add in an extra check to enable lighttpd.
9642cda
Signed-off-by: Adam Warner <adamw@rner.email>
…eList` Signed-off-by: Adam Warner <adamw@rner.email>
Signed-off-by: Adam Warner <adamw@rner.email>
Signed-off-by: Adam Warner <adamw@rner.email>
Ugh/codacy
Release