This change makes pihole more friendly to the non-existence of the pihole.log file. This can help with systems that are configured to mount /var/log as a tmpfs volume. It may also help with systems where the pihole.log file is accidentally/unintentionally removed.
Further discussion around the details of this change are in https://github.com/pi-hole/pi-hole/issues/1798
* Round $cpu_mhz to 1 decimal place
* Remove ".0" from $cpu_freq
* Silence non-numeric domains_being_blocked output
* Use "Core" and "Web" as appropriate
Signed off by WaLLy3K <wally3k@pi-hole.net>
* Use inverse if statement, instead of IF/ELSE when checking setupVars.conf
* Remove $svFQDN
* Add or elaborate on more comments
* Add $serverName to $authorizedHosts if admin has specified `setenv.add-environment = ("fqdn" => "true")` within lighttpd's external.conf
* e.g: `$HTTP["host"] == "pihole.domain.com" { setenv.add-environment = ("fqdn" => "true") }`
* Move "No exact results" check to top of exception handling
* Remove unnecessary IF/ELSE when handling $queryAds error
Signed off by WaLLy3K <wally3k@pi-hole.net>
If Pi-Hole is behind a reverse proxy that uses SSL, then the block page will not load resources such as `blockingpage.css` and `jquery.min.js` as the insecure `http://` is hard coded. Browsers will block attempts to load insecure resources if the page is loaded of SSL.
The fix is acheived by checking `$_SERVER['HTTPS']` and setting the variable `$proto` to either `http` or `https`. The harcoded `http` is replaced by the contents of this variable.
* Comment file for review-ability
* Add BOLD and UNDERLINE options
* Select most readable colours out of LIGHT/DARK options
* Provide empty variables for `set -u`
* Deprecate unnecessary variables
* Correct colours for TICK/CROSS/DONE
* Escape r twice and add ESC to OVER
* Optimise $validDomain function by using bashism and `grep`
* Add black/white/wildcard variables to pass to Reload()
* Revert reload variable behaviour
* Ensure Reload() function passes correct options to gravity.sh
Signed-off-by: WaLLy3K <wally3k@pi-hole.net>
* Print newline on error message
* Output last three lines of error if update fails
* Consistent error messages & housekeeping
* Add shellcheck directive to ignore COL_TABLE
* Quoted and braced variables for codebase consistency
* Escaped newlines correctly
* Made error messages consistent (indenting and wording)
* Removed consecutive echos
* Conditional formatting consistency
* Braced, quoted and used [[ on conditionals
* Fix specific ShellCheck issues
* Fixed issues that could be safely changed without extensive testing
* Update SELinux whiptail behaviour & more
* Colourised some strings
* Fixed multiple line string indenting
* Made output consistent with existing codebase
* Removed sequential echos
* Make SELinux whiptail use "--defaultno", and change text wording
* Add help text for hostrecord, and colourise output
* this should fix the tests...
Signed-off-by: Adam Warner <adamw@rner.email>
* revert changes to `update_package_cache()` to prove tests
Signed-off-by: Adam Warner <adamw@rner.email>
* Always process DNS and DHCP settings in installer
* Make sure dnsmasq config exists before modifying it
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
* Make sure the dnsmasq config directory exists
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
* Only remove the DHCP config if it exists (fixes tests, hopefully)
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
* Provide correct FTL stats
* Use the correct lines in the array when displaying FTL stats
* Treat ads_blocked_today/dns_queries_today as currency, like domains_being_blocked is on large screens
* Chronometer Shellcheck validation
* Remove unnecessary \ from CPU usage readout
* 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>
* Only attempt to install FTL if branch was found
* ~~corebranches~~ webbranches (web branches now actually listed)
Signed-off-by: Adam Warner <adamw@rner.email>
* 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