Skip to content

Comments

[pihole] Integration of API v6#19350

Merged
magx2 merged 5 commits intoopenhab:mainfrom
clinique:Issue_16852_v6
Nov 1, 2025
Merged

[pihole] Integration of API v6#19350
magx2 merged 5 commits intoopenhab:mainfrom
clinique:Issue_16852_v6

Conversation

@clinique
Copy link
Contributor

@clinique clinique commented Sep 18, 2025

Early push to inform that work has started
Resolves issue #16852

Signed-off-by: clinique <gael@lhopital.org>
@clinique clinique requested a review from magx2 as a code owner September 18, 2025 12:46
@magx2
Copy link
Contributor

magx2 commented Sep 18, 2025

Hey, thanks for the implementation of v6. I had a quick look on my cellphone, tommorow I will take a deeper look at it (using my pc and IDE).

@clinique
Copy link
Contributor Author

Thanks for you insights @magx2 . This is very early dev stage. My main concern is to find the equivalences between old API and the new one (I'm a recent user of Pi-hole). If there are not much, maybe I'll introduce a new Thing with a distinct channel set. Let me know your thoughts.

Signed-off-by: clinique <gael@lhopital.org>
Signed-off-by: clinique <gael@lhopital.org>
@clinique clinique added the work in progress A PR that is not yet ready to be merged label Sep 18, 2025
@clinique clinique self-assigned this Sep 18, 2025
@clinique
Copy link
Contributor Author

@magx2 : I'm on a good track. Still searching equivalencies for some of the channel contents (null values line 88 of bundles/org.openhab.binding.pihole/src/main/java/org/openhab/binding/pihole/internal/rest/JettyAdminServiceV6.java).
After that, I'll have to take care of 'sid' refresh and some code cleansing.

Code review corrections.

Signed-off-by: gael@lhopital.org <gael@lhopital.org>
Signed-off-by: gael@lhopital.org <gael@lhopital.org>
@lolodomo lolodomo added the enhancement An enhancement or new feature for an existing add-on label Oct 4, 2025
@miloit
Copy link
Contributor

miloit commented Oct 16, 2025

Any updates? @clinique

@clinique
Copy link
Contributor Author

Hello @miloit , this PR is ready for review

@magx2
Copy link
Contributor

magx2 commented Oct 17, 2025

Hello @miloit , this PR is ready for review

OH, I thought you are still working on it. Will take a look on it later this week

@magx2
Copy link
Contributor

magx2 commented Oct 26, 2025

@clinique Looks fine for me. I did not run it with PiHole v6, but I assume that you did it and you can confirm it's working E2E

@clinique
Copy link
Contributor Author

Yes, I do

@magx2
Copy link
Contributor

magx2 commented Oct 26, 2025

LGTM

@magx2
Copy link
Contributor

magx2 commented Oct 27, 2025

@lsiepel can you merge it? I do not have option to approve

@lsiepel
Copy link
Contributor

lsiepel commented Oct 28, 2025

@lsiepel can you merge it? I do not have option to approve

You can;t merge, but you should be able to approve when finishing the review:

image

Anyway, as soon as i have the time i'll review.

@magx2
Copy link
Contributor

magx2 commented Nov 1, 2025

Apparently I can merge it, but I will leave it to you @lsiepel

obraz

@lsiepel
Copy link
Contributor

lsiepel commented Nov 1, 2025

Could you give it a shot ? (squash and merge as is selected) i'm puzzled you see this.

@lsiepel lsiepel removed the work in progress A PR that is not yet ready to be merged label Nov 1, 2025
@magx2 magx2 merged commit 4bded90 into openhab:main Nov 1, 2025
3 checks passed
@magx2
Copy link
Contributor

magx2 commented Nov 1, 2025

It worked

@lsiepel lsiepel added this to the 5.1 milestone Nov 1, 2025
@lsiepel
Copy link
Contributor

lsiepel commented Nov 1, 2025

While this PR is merged fine and all is good. We are looking into why you where able to write to this repo.

@magx2
Copy link
Contributor

magx2 commented Nov 1, 2025

Some time ago you've added me to maintainers

@lsiepel
Copy link
Contributor

lsiepel commented Nov 1, 2025

Some time ago you've added me to maintainers

That should have been contributors. Unless i have missed some kind of discsussion about this. :-)

@kaikreuzer
Copy link
Member

Hey @magx2, thanks for letting us know!

That should have been contributors.

I guess @lsiepel is right - I have now just "downgraded" you to a member of the contributors team. This does not mean that your work is less appreciated, though - thanks for everything you do! 😄

@magx2
Copy link
Contributor

magx2 commented Nov 1, 2025

No worries. I also felt uncomfortable because of all the power 😂

@clinique clinique deleted the Issue_16852_v6 branch November 4, 2025 15:29
@Nadahar
Copy link
Contributor

Nadahar commented Dec 20, 2025

@clinique There's a potential issue here, although the circumstances don't make sense to me at this point: https://community.openhab.org/t/openhab-5-1-milestone-discussion/166385/233

I did some fighting with this issue earlier with UniFi Protect (as they also violate the HTTP spec here), as you can see in the linked forum post. What it boils down to is that Jetty handles (basic) authentication automatically for you, provided that the HTTP spec is followed. In particular, HTTP status 401 is required to carry a header that tells the client what authentication schemes are supported - which Jetty needs to attempt to resend the request in the proper form. If the server/device doesn't include information about supported authentication schemes, Jetty throws this exception because it don't know how to proceed. This also prevents the response from being processed normally.

The linked topic is very long, but the "fix" essentially boils down to disabling Jetty's automatic authentication handling: https://community.openhab.org/t/unifi-protect-binding-http-protocol-violation-authentication-challenge-without-www-authenticate-header/164289/6

This comes with the caveat that Jetty will no longer handle (basic) authentication automatically, but since these authentication schemes are rarely used these days, it might not actually matter.

Note: If automatic authentication handing is disabled, the binding can't use the shared HTTP clients 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature for an existing add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pihole] Support for pihole v6

7 participants