A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.
fix: use public Pi-hole version discovery (#7032)
Thomasb7b803816c38
diff --git a/apps/docs/docs/integrations/pi-hole/index.mdx b/apps/docs/docs/integrations/pi-hole/index.mdxindex 65612dbe2..d6f2f5baf 100644--- a/apps/docs/docs/integrations/pi-hole/index.mdx+++ b/apps/docs/docs/integrations/pi-hole/index.mdx@@ -15,7 +15,8 @@ import { piHoleIntegration } from ".";<IntegrationHeader integration={piHoleIntegration} categories={["DNS Hole"]} /><Alert type="note" className="my-2">- Homarr supports both Pi-hole v5 and v6. It automatically detects the version and uses the correct API.+ Homarr supports both Pi-hole v5 and v6. It automatically detects the version and uses the correct API. If your reverse+ proxy restricts API paths, allow the public `/api/info/login` endpoint used to detect Pi-hole v6.</Alert>### Widgets & Capabilitiesdiff --git a/packages/integrations/src/pi-hole/pi-hole-integration-factory.ts b/packages/integrations/src/pi-hole/pi-hole-integration-factory.tsindex 346b40642..047509e89 100644--- a/packages/integrations/src/pi-hole/pi-hole-integration-factory.ts+++ b/packages/integrations/src/pi-hole/pi-hole-integration-factory.ts@@ -8,13 +8,13 @@ import { PiHoleIntegrationV6 } from "./v6/pi-hole-integration-v6";export const createPiHoleIntegrationAsync = async (input: IntegrationInput) => {try {const baseUrl = removeTrailingSlash(input.url);- const url = new URL(`${baseUrl}/api/info/version`);+ const url = new URL(`${baseUrl}/api/info/login`);const response = await fetchWithTrustedCertificatesAsync(url);/*** In pi-hole 5 the api was at /admin/api.php, in pi-hole 6 it was moved to /api- * For the /api/info/version endpoint, the response is 404 in pi-hole 5- * and 401 in pi-hole 6+ * The public /api/info/login endpoint returns 404 in pi-hole 5+ * and 200 in pi-hole 6, without requiring an authenticated session.*/if (response.status === 404) {return new PiHoleIntegrationV5(input);