pi-hole / web

Pi-hole Dashboard for stats and more
https://pi-hole.net
Other
2.05k stars 559 forks source link

/admin/scripts/pi-hole/php/customdns.php persistently fails even with password disabled #2985

Closed MysticalMount closed 8 months ago

MysticalMount commented 8 months ago

Versions

Pi-hole version is v5.17.3 (Latest: v5.17.3) web version is v5.21 (Latest: null) FTL version is v5.25.1 (Latest: null)

Platform

Docker pihole/pihole:latest

Host OS Ubuntu 22.04

Note: I have changed the default port from 80 to 21000 as the server Im running it on doesnt have 80 available

Expected behavior

When authenticated the endpoint responds.

Actual behavior / bug

Persistently get: Not allowed (login session invalid or expired, please relogin on the Pi-hole dashboard)!

Dashboard/UI is working fine every single link, but for external-dns (Kubernetes) to work we require this endpoint to manipulate the local DNS.

Steps to reproduce

Steps to reproduce the behavior:

Deploy latest via Docker, try to access: /admin/scripts/pi-hole/php/customdns.php

Debug Token

MysticalMount commented 8 months ago

UPDATED with correct resolution:

Ok so the "not allowed" means that the "API like" endpoints do require a token in order to work.

That token can only be gotten by logging in, and then reading a hidden div element in the return HTML.

If you get your password wrong, it will look like the HTML parse is failing to retrieve the token.

Realising this narrowed it down for me, enabled password, and got the right one!

MysticalMount commented 8 months ago

Closing as above