-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Store domainlist IDs for blocked/permitted queries #1409
Conversation
Signed-off-by: DL6ER <[email protected]>
Do you also want to expose this in the web interface? Linking from query log / long term back to the domain table? |
Yeah, that's the idea. It should be fairly simply as the code already exists for black-regex'ed domains. |
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
98f65e4
to
ff30d4a
Compare
…hat don't have one Signed-off-by: DL6ER <[email protected]>
been running this FTL branch "since Sat 2022-08-20 17:47:07 CEST; 1 weeks 3 days", no problems detected query results are remarkable, provide a lot of additional information. |
DL6ER said, in reply to yubiuser: "Yeah, that's the idea. It should be fairly simply as the code already exists for black-regex'ed domains." I have been looking at this (/var/www/html/admin/scripts/pi-hole/js/queries.js) currently there are 3 lines of code for status 4 and status 10:
There are 2 options:
I tested option 2 (evaluate all), looked at some entries in my database, including cname entries (which is the only other status type (9) that would have a populated additional field entry), and found that the query page behaves as expected. edit I may be overlooking something, hence not a PR yet, just an informational note about my test. |
looking good so far... |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/cname-cant-explain-this/57457/21 |
Documentation will be needed here: https://docs.pi-hole.net/database/ftl/#additional_info_regex |
@yubiuser, informational only... you might want to know why this change is important to me (and other users). these sql queries (examples for whitelist - change the type to see other types) show the result of this PR, allowing users to obtain relevant info:
used exact whitelist entries:
unused exact whitelist entries:
|
Documentation change pi-hole/docs#774 |
This one is ready for review and I have no doubt we will merge this at some point. It would be nice if you could file a web interface PR. The details are up to you, I'd would prefere
|
second attempt: pi-hole/web#2341 |
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.
I found a case that is not covered yet:
If I have a blacklisted domain that is the target of a CNAME
, FTL will write the CNAME
domain to the addinfo
table. However, to in such a case two information needed to be stored: the domain and the responsible domain_id.
Do you mean that both the domain and the ID will be stored in the additional_field? In that case, the '!isNAN' function will never work, thus no link, and the displayed CNAME data will probably be corrupted (showing domain & ID) |
Yes. However, this will need a bigger database scheme change and we will see if DL6ER is going to implement this.
In case the database changes your PR will need adjustment. I'm sure we figure out a way to store both, domain and id, and have the link. |
But you can't tell which exact (could be regex as well) domain blocked |
The existing (current master) provides this functionality for regex blacklist only. This change is thus a great improvement, compared to master. There is a single case (deep CNAME inspection + domainlist entry) which doesn't provide a link. Anyway, it's up to DL6ER and you to decide which way to go, however, please don't drop this change, because things are getting to complex, the results I'm already able to get out of the database are valuable. edit |
The only solution to this would be adding another column. We would actually add two new columns: However, I'm aware that the current solution is suboptimal (we can store only of of the two information bits), however, in the exact example you discussed here there would actually be no difference as the blocked domain came from gravity and, thus, doesn't even have a domainlist ID. Of course, it's easy to craft another example where this isn't the case, though. |
I don't agree (but then again, who am I) The only time there isn't a link to the exact OR regex entry is the CNAME case. |
Co-authored-by: yubiuser <[email protected]> Signed-off-by: DL6ER <[email protected]>
@yubiuser Sorry, I didn't even see your review suggestions in hectic everyday life. I applied them just now. |
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.
After internal discussion we agreed to keep the PR the way it is now. Resolving the remaining limitation (no domainlist_id
is stored in case of a CNAME
reply) would currently be to time-consuming as it requires a more extensive database re-design.
@DL6ER you need / can delete the branch tweak/cnamea_and_regexes (switched to development branch, since it now contains both changes) |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/status-codes-in-ftl-database-for-whitelisted-entries/55099/5 |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-ftl-v5-18-web-v5-15-and-core-v5-12-1-released/57894/1 |
By submitting this pull request, I confirm the following:
How familiar are you with the codebase?:
10
Store
domainlist
IDs for blocked/permitted queries as requested on Discourse