From 032fdc1b12c85781993b1f0ef69fa9784219fe33 Mon Sep 17 00:00:00 2001 From: Shivam Patel Date: Mon, 9 Feb 2026 01:48:53 -0500 Subject: [PATCH] Fix website URL and uptime check logic - Website: www.akkolli.net has no DNS record, use akkolli.net instead - Uptime: treat any response < 500 as up (was res.ok / 200-299 only). Nextcloud returns non-200 for untrusted Host headers but is still running. Only 5xx and network errors count as down. Co-Authored-By: Claude Opus 4.6 --- monitor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monitor.js b/monitor.js index bd8925e..a54a393 100644 --- a/monitor.js +++ b/monitor.js @@ -3,7 +3,7 @@ const { open } = require('sqlite'); // Node 18+ has global fetch built-in const SERVICES = [ - { name: 'Website', url: 'https://www.akkolli.net' }, + { name: 'Website', url: 'https://akkolli.net' }, { name: 'Gitea', url: 'https://code.akkolli.net' }, { name: 'Nextcloud', url: 'http://host.docker.internal:6060' }, ]; @@ -49,7 +49,9 @@ async function monitor() { }); clearTimeout(timeout); - status = res.ok ? 'up' : 'down'; + // Any HTTP response means the service is reachable (up). + // Only network errors/timeouts (caught below) count as down. + status = res.status < 500 ? 'up' : 'down'; const end = performance.now(); latency = Math.round(end - start); } catch (err) {