From db1fb4b8999f78480d358ac0efe76fa37335f0c0 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat, 12 Oct 2024 15:30:45 -0700 Subject: [PATCH] Enhancement: support netalertX token for password-protected instances (#4122) --- docs/widgets/services/netalertx.md | 3 +++ src/utils/proxy/handlers/credentialed.js | 1 + src/widgets/netalertx/widget.js | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/widgets/services/netalertx.md b/docs/widgets/services/netalertx.md index 4579d74cdee..1f618182cbe 100644 --- a/docs/widgets/services/netalertx.md +++ b/docs/widgets/services/netalertx.md @@ -9,8 +9,11 @@ _Note that the project was renamed from PiAlert to NetAlertX._ Allowed fields: `["total", "connected", "new_devices", "down_alerts"]`. +If you have enabled a password on your NetAlertX instance, you will need to provide the `SYNC_api_token` as the `key` in your config. + ```yaml widget: type: netalertx url: http://ip:port + key: netalertxsyncapitoken # optional, only if password is enabled ``` diff --git a/src/utils/proxy/handlers/credentialed.js b/src/utils/proxy/handlers/credentialed.js index e907912daa7..b1b9922c644 100644 --- a/src/utils/proxy/handlers/credentialed.js +++ b/src/utils/proxy/handlers/credentialed.js @@ -41,6 +41,7 @@ export default async function credentialedProxyHandler(req, res, map) { "ghostfolio", "linkwarden", "mealie", + "netalertx", "tailscale", "tandoor", "pterodactyl", diff --git a/src/widgets/netalertx/widget.js b/src/widgets/netalertx/widget.js index b4329519a8f..033d3d81d8c 100644 --- a/src/widgets/netalertx/widget.js +++ b/src/widgets/netalertx/widget.js @@ -1,8 +1,8 @@ -import genericProxyHandler from "utils/proxy/handlers/generic"; +import credentialedProxyHandler from "utils/proxy/handlers/credentialed"; const widget = { api: "{url}/php/server/devices.php?action=getDevicesTotals", - proxyHandler: genericProxyHandler, + proxyHandler: credentialedProxyHandler, mappings: { data: {