Commit graph

44 commits

Author SHA1 Message Date
DL6ER
40e8657137
Please Mr. Stickler
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-12 11:18:46 +00:00
DL6ER
52dd72dfa5
Ensure output is always correct and also display if domain has been found but is disabled
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-12 11:08:19 +00:00
DL6ER
922ce7359c
pihole -q should also scan gravity table
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-12 10:58:41 +00:00
Adam Warner
61a40c1b43
merge devel into 4.3.2 And Resolve merge conflicts
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2019-09-22 01:16:44 +01:00
DL6ER
aed2e35bc0
Print messages only after removing possible matches in comments.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-02 22:39:28 +02:00
Niklas Elmose Andersen
a3e32d9a15 Properly escape domain regex
Dots in domain names should not match any character.

Signed-off-by: Niklas Elmose Andersen <mail@niklasea.dk>
2019-08-27 12:13:28 +02:00
Niklas Elmose Andersen
989d1aff60 Restore and improve 'pihole -q' matching
Removes regex lookaround which 'grep -E' does not support.
Restores support for blocklists in hosts format.
Simplifies domain match cleanup logic by eliminating an if-condition.
Improves domain matching by eliminating commented domain names,
eliminating false positives in a few edge cases.

Signed-off-by: Niklas Elmose Andersen <mail@niklasea.dk>
2019-08-26 20:39:56 +02:00
DL6ER
1820c2c598
Merge branch 'development' into new/whitelist-regex-support
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-22 14:19:51 +02:00
DL6ER
23b688287f
Fix indentation in query.sh. No functional change in this commit.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-22 14:12:58 +02:00
DL6ER
42ccc1ef24
Add support for regex whitelist in "pihole -q".
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-22 14:06:42 +02:00
DL6ER
054c7a2c05
Create new table + view regex_whitelist + rename old regex table to regex_blacklist. This updates the gravity.db version to 3.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-08 21:35:31 +02:00
Mcat12
8d9ff550d4
Fix blockpage error if whitelisted, blacklisted, or regex filtered
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-07-04 13:44:14 -07:00
DL6ER
7a1b6fd205
Merge branch 'development' into new/gravity.db_domain_groups 2019-07-03 19:21:55 +02:00
MMotti
04abcb71f6 Fix potential invalid result for pihole -q
Signed-off-by: MMotti <matthew.w.motti@gmail.com>
2019-07-03 13:04:57 +01:00
DL6ER
1fe3507bc5
Adlists table was renamed to Adlist. Adapt further places in the code to match the new name.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-03 07:56:10 +02:00
MMotti
bcf03647ef Add comment and remove blankspace
Signed-off-by: MMotti <matthew.w.motti@gmail.com>
2019-06-12 16:02:59 +01:00
MMotti
a9d0690f4d Change the case of some variables
Just for consistency

Signed-off-by: MMotti <matthew.w.motti@gmail.com>
2019-06-10 18:50:52 +01:00
MMotti
10fbed50f3 Shellcheck
Suggesting to use parameter expansion but we need to be able to identify the start of each line

Signed-off-by: MMotti <matthew.w.motti@gmail.com>
2019-06-10 18:10:25 +01:00
MMotti
785f1fedd9 Tidy regexp queries
Signed-off-by: MMotti <matthew.w.motti@gmail.com>
2019-06-10 17:52:58 +01:00
MMotti
cf21efa103 Minor grammar changes
Signed-off-by: MMotti <matthew.w.motti@gmail.com>
2019-06-05 14:36:43 +01:00
MMotti
7613e94ef6 Minor tweaks
Mainly for consistency

Signed-off-by: MMotti <matthew.w.motti@gmail.com>
2019-06-04 06:06:17 +01:00
MMotti
b49c702f33 Consistency tweak
Signed-off-by: MMotti <matthew.w.motti@gmail.com>
2019-06-04 00:03:37 +01:00
MMotti
09532638d5 Read from DB instead of regex.list
Signed-off-by: MMotti <matthew.w.motti@gmail.com>
2019-06-04 00:00:25 +01:00
MMotti
97df6d7415 Stickler fix
Signed-off-by: MMotti <matthew.w.motti@gmail.com>
2019-06-03 19:56:10 +01:00
MMotti
54bfaa28c1 Fix for regexp queries through pihole -q
Taking inspiration from: https://github.com/pi-hole/pi-hole/pull/2346

We will use awk to iterate through each regexp and print any that match the domain query.

Signed-off-by: MMotti <matthew.w.motti@gmail.com>
2019-06-03 19:32:59 +01:00
DL6ER
44f8fcb600
We can print the table name without any extra check as we already returned early in case there are no results.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-05-31 08:39:18 +02:00
DL6ER
5060605626
Print table name before entering the loop for the sake of simplicity
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-05-30 21:44:59 +02:00
DL6ER
a904c183df
Use printf to escape domain content. This prevents possible SQL injection issues
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-05-04 18:25:11 +02:00
DL6ER
5246b3e496
Explicitly escape backslash in ESCAPE clause. This has been suggested by Stickler bot.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-05-04 13:24:36 +02:00
DL6ER
f80fdd7e83
Improve comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-05-04 13:19:50 +02:00
DL6ER
6ba58896d2
Simplify code
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-05-04 13:15:30 +02:00
DL6ER
3aa838bbe4
Implement black- and whitelist searching with SQL statements. We use the ESCAPE clause in the LIKE query as the underscore "_" wildcard matches any single character but we want to suppress this behavior (underscores can be legitimate part of domains)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-05-04 13:02:14 +02:00
DL6ER
b372f808dd
Fix lint errors
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-05-01 17:06:14 +02:00
DL6ER
bc9b623638
Modify query.sh to use the gravity database
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-05-01 16:56:16 +02:00
Adam Warner
a7f6c9b3a0
Ignore matches that start # using negative lookbehind
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2019-03-29 00:08:04 +00:00
Dan Schaper
8f727c1f35
Space/Tab query.sh
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2018-07-20 13:13:42 -07:00
Mcat12
4763969c8f
Move processWildcards to query.sh
Closes #2255

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-06-30 22:03:53 -04:00
Mcat12
f868052062
Fix incorrect variable string substitution
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-06-30 15:50:43 -04:00
Rob Gill
23adbf9540
remove quotes
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2018-06-15 14:45:27 +10:00
Rob Gill
a7347238e6
$adListsList replace filename in text
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2018-06-15 14:42:30 +10:00
Rob Gill
bf55666492
Appease stickler.
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2018-06-13 16:29:07 +10:00
Rob Gill
8ab0b0e460
colfile
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2018-06-13 16:25:43 +10:00
Rob Gill
b8e1849cec
wildcardlist
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2018-06-13 16:19:07 +10:00
Rob Gill
45a8eda49b
Stop grep leak in query
Fix grep error leak from #1805

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2018-06-13 16:08:21 +10:00
Renamed from advanced/query.sh (Browse further)