Commit graph

3345 commits

Author SHA1 Message Date
WaLLy3K
47099e2855 Ensure resolver test occurs each second
* Ensure that gravity will run the second the resolver is available
* Increase timeout to 120s
2017-09-22 03:56:53 +10:00
WaLLy3K
2deb2bf03f Fix broken whitelist functionality 2017-09-22 02:23:43 +10:00
WaLLy3K
3bb05edb52 Merge pull request #1701 from pi-hole/fix/local-ttl
Decrease `local-ttl` to 2
2017-09-22 01:29:50 +10:00
DL6ER
ee2169dd13
Merge branch 'development' into tweak/gravity 2017-09-21 17:05:30 +02:00
WaLLy3K
11282aaca3 Decrease local-ttl to 2
* Decreasing value should benefit clients when whitelisting blocked sites, [as per this discussion](https://github.com/pi-hole/pi-hole/pull/1698#issuecomment-331134576).
2017-09-21 23:11:44 +10:00
WaLLy3K
909bc92c01 Tweak wording to fit on 80 character screen
* Also move colour after $INFO
2017-09-21 00:22:47 +10:00
WaLLy3K
a6f9272d4b Fix gravity from only parsing one adlist URL
* Redirect `grep` correctly to $sources (instead of using `awk`)
* Redirect $sourceDomains correctly
* Replace use of ${COL_LIGHT_BLUE}
* Add numeric count informing user of unique source domains being whitelisted
2017-09-20 22:25:33 +10:00
WaLLy3K
911596daf8 Start and enable FTL prior to running Gravity 2017-09-20 17:29:11 +10:00
Adam Warner
8d8482d60b
<<<$() back to < <()
Signed-off-by: Adam Warner <adamw@rner.email>
2017-09-19 19:02:50 +01:00
WaLLy3K
f3cc8c71c4 Merge pull request #1691 from pi-hole/new/adminemail
Add `pihole -a email` functionality for Block Page contact email
2017-09-19 18:39:37 +10:00
WaLLy3K
f6b3c62b06 Merge pull request #1696 from pi-hole/tweak/removeindexjs
Delete index.js
2017-09-19 18:00:48 +10:00
WaLLy3K
26afe04926 Remove index.js test 2017-09-19 01:04:04 +10:00
WaLLy3K
500a755250 Delete superseded file
* Functionality is reproduced from within the Block Page
2017-09-19 01:03:24 +10:00
WaLLy3K
d02bf258af Improve non-standard list parsing
* Add 504 status (Gateway connection timed out)
* Add text for non-standard list parsing
* Improve adblock parsing
* Ensure adblock exception rules are removed from file
* Ensure "www." is not treated as a URL-format list
* Corrected typo
* Ensure script does not fail if "-f" is used when there are no blocklists generated

Signed off by WaLLy3K <wally3k@pi-hole.net>
2017-09-18 17:36:03 +10:00
WaLLy3K
56990618e9 Prevent Block Page issue
* Block Page expects to see a full stop, otherwise it will throw an unhandled error
2017-09-18 01:12:19 +10:00
WaLLy3K
54a85d3a63 Fix invalid option case
* Ensure `pihole -q doubleclick.com asd` exits with error
2017-09-18 00:58:56 +10:00
WaLLy3K
d56beedd7a Add idn2 dependency 2017-09-18 00:41:53 +10:00
WaLLy3K
c2d3e99ddd Slow query fix & queryFunc optimisation
* Validate modified code using Shellcheck & Strict Bash
* Added and/or elaborated more comments

* scanlist() should exit if /etc/pihole is not available
* Add `export LC_CTYPE=C` to prevent extreme grep slowdown
* Consider "domain.com#comment" an exact match
* Add specialised wildcard searching grep

* Optimise and simplify queryFunc() for readability
* Replace IDN `python` parsing with `idn2`, as `python` is not guaranteed to be available
* Use ${COL_BOLD} when printing filenames
2017-09-18 00:41:26 +10:00
andofrjando
5e48b3f7f7
Fix one mistake where $proto would not be created if $_SERVER['HTTPS'] exists but is not set to on 2017-09-16 11:24:38 +08:00
andofrjando
00d62b3423
This fixes the following bug:
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.
2017-09-16 10:24:37 +08:00
WaLLy3K
c957124fad Optimised parsing of domains on IPv6 servers
* Remove WHITELIST_COMMAND
* Place IPv4/IPv6 availability test underneath setupVars.conf source
* Improved clarity on comments
* Define default lookupDomain on local line
* Use `getent hosts` instead of nslookup (faster)
* Make gravity_DNSLookup() function more readable
* Use bold on "Neutrino emissions detected"
* Swap conditionals around on adlists file handling
* Add comments to both gravity_Collapse() `awk`s
* Removed unnecessary "${str}" from gravity_Pull()
* Merge function variables into local line
* Place .phgbp suffice on mktemp, so patternbuffers can be cleaned up all at once in gravity_Cleanup()
* Removed success="false" from $httpCode case, placed empty success var in local
* Reordered $httpCode case numerically because I can
* Provide error if Dnsmasq format list is being parsed
* Remove IPv4 check when determining URL list (too slow on large lists)
* Check ${#sources[@]} to ensure we're checking the number of entries and not the character count
* Define empty plural in local line, removing unnecessary plural=;
* Optimised readability of gravity_Whitelist()
* Removed uninformative "Nothing to blacklist"/"No wildcards used" text
* Optimised parsing of domains into hosts format on IPv6 enabled servers
* Ensure /etc/hostname is non-zero
* Use `: >` instead of `rm` as consistent with the rest of the script
* Ensured that gravity_Cleanup() removes ${localList}.tmp
* Optimised readability of gravity_ParseUserDomains()
* Moved dnsRestart to ${var} case statement, renaming it to dnsRestartType for readability
* Set default $listType to ensure script passes "bash strict mode"
2017-09-15 22:39:17 +10:00
WaLLy3K
28063aa7f7 Add administrative contact address functionality
* Disable shellcheck for SC1090
2017-09-15 00:24:29 +10:00
WaLLy3K
c458e4a93b Merge pull request #1420 from WaLLy3K/new/https
Disable Let's Encrypt HTTPS & shift functions to block page
2017-09-14 20:40:20 +10:00
WaLLy3K
e7ae62ba76 Merge pull request #1416 from WaLLy3K/blockpage2
Block Page 2.0
2017-09-14 20:39:45 +10:00
WaLLy3K
ff5411a93a Add 'Connection Refused' for 000 status
* Shift default dnsRestart value into unset default parameter expansion value
* Change nslookup timeout to 5 seconds 
* Use &> instead of >
* Standardise plural code
* Update some comments
* Add "000" when connection is refused
* Condense adblock detection logic
* Add Dnsmasq format detection and parsing logic
* Removed unnecessary echo
* Add dnsWasOffline variable to ensure that if DNS service has been stopped, that it doesn't start and also get reloaded
2017-09-14 20:23:49 +10:00
WaLLy3K
d3073e5e23 Fix array of unique $sourceDomains 2017-09-14 17:09:52 +10:00
WaLLy3K
34ae4844fa Merge branch 'development' into tweak/gravity 2017-09-14 16:44:14 +10:00
WaLLy3K
8191ec01e5 Gravity Bugfixes
* Merge development OpenVPN code
* Determine which domain to resolve depending on existence of $localList
* Re-add code to remove $localList, preventing duplicate local entries
* Minor shellcheck validation fix
2017-09-14 16:39:30 +10:00
WaLLy3K
4d39ab9753 Allow force-reload to be used when restarting DNS
* Remove duplicate coltable variable definition and source
* Minor comment modifications
* Add "$2" to restartdns
2017-09-14 16:39:25 +10:00
Adam Warner
7a1df15724 Merge pull request #1688 from pi-hole/tweak/customBlockPage
Allow for Custom block page
2017-09-13 18:22:38 +01:00
Adam Warner
42b5574f9b
remove no longer needed tests
Signed-off-by: Adam Warner <adamw@rner.email>
2017-09-09 19:41:05 +01:00
Adam Warner
5f4be0de35
adjust lighttpd config depending on whether or not custom.php exists
Signed-off-by: Adam Warner <adamw@rner.email>
2017-09-09 19:30:53 +01:00
Adam Warner
6c605f55f9
always overwrite default blockpage, so that changes can be rolled out
Signed-off-by: Adam Warner <adamw@rner.email>
2017-09-09 19:07:48 +01:00
Adam Warner
774c6e8ac0
Merge branch 'development' into new/UninstallCleanup
Signed-off-by: Adam Warner <adamw@rner.email>

# Conflicts:
#	automated install/uninstall.sh
2017-09-09 18:56:17 +01:00
DL6ER
17be6b860e Merge pull request #1682 from pi-hole/tweak/VPN_hostnames
Add VPN host names to local.list
2017-09-08 22:42:58 +02:00
Adam Warner
474ac4a15d Merge pull request #1581 from pi-hole/sqlite-dependency
Add "php5-sqlite" to dependencies
2017-09-08 21:28:16 +01:00
DL6ER
b8fedf76cd Merge pull request #1572 from pi-hole/gedetil-development
Add web frontend shutdown command
2017-09-08 20:21:20 +02:00
DL6ER
ca88c59d4e Merge pull request #1687 from spacedingo/patch-2
Add ignore-case switch to sort (domains)
2017-09-08 20:17:38 +02:00
Mcat12
d69e62589a Merge branch 'development' into sqlite-dependency 2017-09-08 13:43:26 -04:00
DL6ER
c9d4995900
Update to comply with current development code
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-09-08 19:35:05 +02:00
DL6ER
279e809aaf
Use poweroff instead of halt
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-09-08 19:33:06 +02:00
Mcat12
d61857efae Merge branch 'development' into patch-2 2017-09-08 13:32:51 -04:00
DL6ER
0d037e96fb
Merge branch 'development' into gedetil-development
Signed-off-by: DL6ER <dl6er@dl6er.de>

Conflicts:
	advanced/Scripts/webpage.sh
2017-09-08 19:32:38 +02:00
Mcat12
6376f9aef4 Merge pull request #1680 from pi-hole/colour-consistency
Colour output consistency
2017-09-08 13:29:55 -04:00
spacedingo
f5a1fa21f7 Add ignore-case switch to sort (domains)
Domains with caps pass off as unique. It is necessary for proper duplicate removal.
Example:
::: /etc/pihole/list.preEventHorizon (2 results)
adsatt.abcnews.starwave.com
Adsatt.ABCNews.starwave.com
2017-09-08 20:36:14 +04:00
DL6ER
4a90dac68e
Simplify awk code as the format of ipp.txt is actually fixed (only one entry per line is allowed)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-09-07 19:42:00 +02:00
DL6ER
2624e56de5
Parse /etc/openvpn/ipp.txt (if existing) and add entries to local.list.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-09-06 16:54:41 +02:00
Adam Warner
aef54d6694 Merge branch 'development' into new/UninstallCleanup 2017-09-05 20:41:13 +01:00
Adam Warner
e839a7784c Merge branch 'development' into sqlite-dependency 2017-09-05 20:39:45 +01:00
WaLLy3K
bea99abd8d Ensure colour consistency between terminal themes
* 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
2017-09-05 23:28:33 +10:00