Skip to content
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

Show DNSSEC status icon (if applicable) #3185

Open
wants to merge 5 commits into
base: development
Choose a base branch
from
Open

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Dec 18, 2024

What does this implement/fix?

This PR adds colored DNSSEC status icons if DNSSEC is enabled inside Pi-hole. It tries to solve the issue that queries which are BOGUS are not immediately visible to the user: Their background color may still be green when they haven't been blocked by Pi-hole.

Example (https://wander.science/projects/dns/dnssec-resolver-test/):

image
image

Green closed lock: DNSSEC enabled for this site, verification successful
Orange open lock: DNSSEC not enabled for this site, check not possible
Red triangle: DNSSEC enabled for this side but verification failed
No icon: DNSSEC validation not possible or not enabled for this record, e.g., domain blocked by Pi-hole or DS query for a site having no DS.


Related issue or feature (if applicable): N/A

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

@DL6ER DL6ER requested a review from a team December 18, 2024 10:43
scripts/js/queries.js Outdated Show resolved Hide resolved
Co-authored-by: RD WebDesign <[email protected]>
Signed-off-by: Dominik <[email protected]>
@DL6ER DL6ER requested a review from rdwebdesign December 18, 2024 20:39
rdwebdesign
rdwebdesign previously approved these changes Dec 18, 2024
@rdwebdesign rdwebdesign dismissed their stale review December 18, 2024 21:07

Wait... I have a suggestion.

@@ -321,13 +332,13 @@ function formatInfo(data) {

// Show DNSSEC status if applicable
var dnssecInfo = "";
if (dnssecClass !== false) {
if (dnssec.color !== "") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (dnssec.color !== "") {
if (dnssec.text !== "N/A") {

While being logical equivalent, it feels strange to base the decision on the color status.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually dnssec.icon and dnssec.color store strings containing CSS classes for the icon shape and icon color.

No color means no icon and text = N/A. No icon means no color and text = N/A. Text=N/A means no icon and no color.

The 3 tests are 100% equivalent:

  • if (dnssec.color !== "");
  • if (dnssec.icon !== "");
  • if (dnssec.text !== "N/A");

scripts/js/queries.js Outdated Show resolved Hide resolved
Co-authored-by: yubiuser <[email protected]>
Signed-off-by: RD WebDesign <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants