Heimdall icon indicating copy to clipboard operation
Heimdall copied to clipboard

Heimdall + Pihole v6 Api

Open P4TRINUS opened this issue 10 months ago • 16 comments

Does anybody now to get the Pihole V6 Api working?

Or is in development?

Thanks !

P4TRINUS avatar Mar 16 '25 14:03 P4TRINUS

It's working. I had to convince the linuxserver.io image to update its SupportedApps. See linuxserver/Heimdall#290 for details.

My setup uses the linuxserver.io image. Heimdall's /config is-a bind volume, source: /docker/heimdall/config on the host.

Here were my steps to update Heimdall's SupportedApps

  • stop the Heimdall docker container

  • on host: rename /docker/heimdall/config/www/SupportedApps to SupportedApps-OLD

  • start the Heimdall container

  • goto Heimdall's Application list, and click the 'Update Apps List'.

Then it was updating my Pi-hole application's configuration from V5 to V6.

This required setting Pi-hole's "App Password", and using that password in the V6 settings.

wblew avatar Mar 24 '25 00:03 wblew

On my side it's also not working. Today I setup a clean install of Heimdall for the first time.

Steps I took:

  • Within Pi-hole I went to:
    • Settings --> Web interface / API
    • Enabled Expert mode by clicking on the green "basic" button
    • Clicked Configure app password
    • Copied the password and clicked Enable new app password
  • In Heimdall I did the following:
    • Application list
    • Clicked Update Apps List
    • Clicked Add
    • Clicked Application Type and selected Pi-hole
    • Url http://XXX.XXX.XXX.XXX/
    • Config:
      • URL I tried leaving it empty, http://XXX.XXX.XXX.XXX, http://XXX.XXX.XXX.XXX/, http://XXX.XXX.XXX.XXX/admin and http://XXX.XXX.XXX.XXX/admin/api.php
      • App Password(v6) I entered the password copied from pihole (the entire string)
      • Version I set on V6
      • I also tried toggling Skipping TLS verification

I always get the same response: Something went wrong: { "message": "Server Error" }

I'm not sure what else to do.

LucasMateijsen avatar Mar 26 '25 16:03 LucasMateijsen

ClickingUpdate Apps List didn't work for me. It refuses to update Heimdall's already in use apps.

I went through the same issue you are having, and was it annoying!

The solution I found was the steps I described above: https://github.com/linuxserver/Heimdall/issues/1442#issuecomment-2746622152

wblew avatar Mar 26 '25 23:03 wblew

I tried your steps described in #1442 (comment), but to no avail.

  • docker compose down
  • cd /path/to/valheim/config/www
  • mv SupportedApps/ SupportedApps-old/
  • cd /back/to/compose/file
  • docker compose up -d
  • Then I went to the application list and pressed Update Apps List. Folder SupprotedApps is re-created on the server, but I'm observing the exact same behaviour. After filling everything as described in #1442 (comment), I'm still getting Something went wrong: { "message": "Server Error" }.

Potential differences from your setup is that you mentioned that your pi-hole config was being updated from V5 to V6, indicating you had this working before. I'm working with a completely new setup of Heimdall and have to previous configuration of the pi-hole item.

Versions i'm using: Heimdall(Docker) 6.2.3 Pi-hole Docker tag 2025.03.0 Pi-hole Core 6.0.5 Pi-hole FTL 6.0.4 Pi-hole Web Interface 6.0.2

LucasMateijsen avatar Mar 27 '25 15:03 LucasMateijsen

For me it also doesnt works !

I have

stop the Heimdall docker container

on host: rename /docker/heimdall/config/www/SupportedApps to SupportedApps-OLD

start the Heimdall container

goto Heimdall's Application list, and click the 'Update Apps List'.

Bam - 500 Server error.

I switchtet to the old SupportedApps.

Clicked to "Update Apps List"

No Server Error but PiholeApi doesnt work!

Something went wrong: { "message": "Server Error" }

P4TRINUS avatar Mar 27 '25 16:03 P4TRINUS

Some additional information:

After bashing into the heimdall container, I looked into the laravel log file at /config/www/logs/laravel-YYYY-MM-DD.log:

[2025-03-27 16:19:11] local.ERROR: Connection refused
[2025-03-27 16:19:11] local.DEBUG: cURL error 7: Failed to connect to XXX.XXX.XXX.XXX port YY after 3053 ms: Could not connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://XXX.XXX.XXX.XXX/api/auth
[2025-03-27 16:19:11] local.ERROR: Call to a member function getBody() on null {"userId":1,"exception":"[object] (Error(code: 0): Call to a member function getBody() on null at /config/www/SupportedApps/Pihole/Pihole.php:115)

It looks like the app is not yet fully updated to comply with the new API?

If I go the the url manually, I can see it does exist and I get a valid response:

{"session":{"valid":true,"totp":false,"sid":"XYZXYZYXYZ=","csrf":"XYZXYZYXYZ=","validity":1800,"message":"correct password"},"took":5.9843063354492188e-05}

LucasMateijsen avatar Mar 27 '25 16:03 LucasMateijsen

Reading the pihole v6 documentation:

The Pi-hole API uses a session-based authentication system. This means that you will not be able to use a static token to authenticate your requests.

And the app in Heimdall requires an API Key =(

tristobal avatar Apr 01 '25 00:04 tristobal

And the app in Heimdall requires an API Key =(

I just got it working myself. The same docs you reference show that Heimdall needs to make an API call to get a session ID, which it does.

Exactly how I got it to work was:

  1. Followed the instructions above up update the apps.
  2. Go into Pi-hole Web Interface / API settings, turn on Expert settings, and click Configure app password.
  3. Copy the password then click Replace app password or whatever the button in the bottom right says if you haven't set one up before. You'll get logged out of the Pi-hole.
  4. In Heimdall put that app password in the API config, set version to v6, and if you're like me and have the /admin in your Heimdall Pi-hole URL put the hostname without the /admin in the API config URL.

mtrolley avatar Apr 06 '25 13:04 mtrolley

"4. In Heimdall put that app password in the API config, set version to v6, and if you're like me and have the /admin in your Heimdall Pi-hole URL put the hostname without the /admin in the API config URL."

This was the missing step for me

Xanex2000 avatar Apr 23 '25 11:04 Xanex2000

Hi all, I am having the same problem. But following the guide of @wblew did not solve it.

I have stopped the heimdall container, changed the map to SupportedApps-OLD, started the container again en updated the apps list.

I also don't have a option to choose pihole v6.

What am I doing wrong?

m3tc0n avatar Apr 30 '25 19:04 m3tc0n

When I updated my SupportedApps-OLD it didn't update the Pi-hole app. Which I found strange.

Maybe that is what's happening?

wblew avatar Apr 30 '25 21:04 wblew

OK, but the metrics are still not working in heimdall. How is that possible?

m3tc0n avatar May 01 '25 05:05 m3tc0n

And the app in Heimdall requires an API Key =(

I just got it working myself. The same docs you reference show that Heimdall needs to make an API call to get a session ID, which it does.

Exactly how I got it to work was:

  1. Followed the instructions above up update the apps.
  2. Go into Pi-hole Web Interface / API settings, turn on Expert settings, and click Configure app password.
  3. Copy the password then click Replace app password or whatever the button in the bottom right says if you haven't set one up before. You'll get logged out of the Pi-hole.
  4. In Heimdall put that app password in the API config, set version to v6, and if you're like me and have the /admin in your Heimdall Pi-hole URL put the hostname without the /admin in the API config URL.

This worked for me. Thank you very much.

The key for me was with the URL information in step 4.

misterjtc avatar May 11 '25 20:05 misterjtc

I have the Image :

lscr.io/linuxserver/heimdall:development

working fine !! THANKS !

P4TRINUS avatar May 12 '25 11:05 P4TRINUS

I've had PiHole running for a while <core version 6.0.6> and have installed Heimdall again and had the issues above where the Pi-Hole api is failing to configure. Following the above steps, I am unable to get the Heimdall page to successfully pull the APIs.

I do not believe I am using a password as I can pull https:///api/history and get data back just fine. I can also curl this successfully when attached to the running docker. I have tried renaming the Heimdall updates file, but It already lets me select 'v6' as an option for the API. I have tried the Development branch, same issues.

The only two real odd things in my setup might be that I am not using authentication? I can just go to https:///admin and it goes to the dashboard. I can just pull http:///api/<whatever API call> and get the results.

The docker can ping the pihole and curl the pages, it just seems like Heimdall is not using the new v6 API?

PrometheusWannaB3 avatar May 17 '25 02:05 PrometheusWannaB3

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

LinuxServer-CI avatar Jun 16 '25 15:06 LinuxServer-CI

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

LinuxServer-CI avatar Jul 29 '25 15:07 LinuxServer-CI

This issue is locked due to inactivity

LinuxServer-CI avatar Oct 28 '25 15:10 LinuxServer-CI