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) {