diff --git a/src/pages/api/modules/dns-hole/control.ts b/src/pages/api/modules/dns-hole/control.ts index c3a3424dc..4dfe4b522 100644 --- a/src/pages/api/modules/dns-hole/control.ts +++ b/src/pages/api/modules/dns-hole/control.ts @@ -57,7 +57,7 @@ const processAdGuard = async (app: ConfigAppType, enable: boolean) => { }; const processPiHole = async (app: ConfigAppType, enable: boolean) => { - const pihole = new PiHoleClient(app.url, findAppProperty(app, 'password')); + const pihole = new PiHoleClient(app.url, findAppProperty(app, 'apiKey')); if (enable) { await pihole.enable(); diff --git a/src/pages/api/modules/dns-hole/summary.spec.ts b/src/pages/api/modules/dns-hole/summary.spec.ts index e80999a3e..05470be69 100644 --- a/src/pages/api/modules/dns-hole/summary.spec.ts +++ b/src/pages/api/modules/dns-hole/summary.spec.ts @@ -28,7 +28,7 @@ describe('DNS hole', () => { type: 'pihole', properties: [ { - field: 'password', + field: 'apiKey', type: 'private', value: 'hf3829fj238g8', }, @@ -130,7 +130,7 @@ describe('DNS hole', () => { type: 'pihole', properties: [ { - field: 'password', + field: 'apiKey', type: 'private', value: 'hf3829fj238g8', }, @@ -144,7 +144,7 @@ describe('DNS hole', () => { type: 'pihole', properties: [ { - field: 'password', + field: 'apiKey', type: 'private', value: 'ayaka', }, diff --git a/src/pages/api/modules/dns-hole/summary.ts b/src/pages/api/modules/dns-hole/summary.ts index 8970f0851..2807b711b 100644 --- a/src/pages/api/modules/dns-hole/summary.ts +++ b/src/pages/api/modules/dns-hole/summary.ts @@ -32,7 +32,7 @@ export const Get = async (request: NextApiRequest, response: NextApiResponse) => try { switch (app.integration?.type) { case 'pihole': { - const piHole = new PiHoleClient(app.url, findAppProperty(app, 'password')); + const piHole = new PiHoleClient(app.url, findAppProperty(app, 'apiKey')); const summary = await piHole.getSummary(); data.domainsBeingBlocked += summary.domains_being_blocked; diff --git a/src/server/api/routers/dns-hole.ts b/src/server/api/routers/dns-hole.ts index 13d98e962..19d903c84 100644 --- a/src/server/api/routers/dns-hole.ts +++ b/src/server/api/routers/dns-hole.ts @@ -97,7 +97,7 @@ const processAdGuard = async (app: ConfigAppType, enable: boolean) => { }; const processPiHole = async (app: ConfigAppType, enable: boolean) => { - const pihole = new PiHoleClient(app.url, findAppProperty(app, 'password')); + const pihole = new PiHoleClient(app.url, findAppProperty(app, 'apiKey')); if (enable) { await pihole.enable(); @@ -108,7 +108,7 @@ const processPiHole = async (app: ConfigAppType, enable: boolean) => { }; const collectPiHoleSummary = async (app: ConfigAppType) => { - const piHole = new PiHoleClient(app.url, findAppProperty(app, 'password')); + const piHole = new PiHoleClient(app.url, findAppProperty(app, 'apiKey')); const summary = await piHole.getSummary(); return { diff --git a/src/types/app.ts b/src/types/app.ts index 847ef8353..7d4f481f9 100644 --- a/src/types/app.ts +++ b/src/types/app.ts @@ -86,7 +86,7 @@ export const integrationFieldProperties: { transmission: ['username', 'password'], jellyfin: ['username', 'password'], plex: ['apiKey'], - pihole: ['password'], + pihole: ['apiKey'], adGuardHome: ['username', 'password'], };