From 8fb958e772f1277c334bdae743110e8713eb5549 Mon Sep 17 00:00:00 2001 From: mospell Date: Sun, 23 Nov 2025 16:39:09 +0100 Subject: [PATCH 1/3] Feat: Add link to infrastructure details for Notifications --- server/src/config/services.js | 1 + .../service/v1/infrastructure/notificationUtils.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/server/src/config/services.js b/server/src/config/services.js index c1679868d..498e37ade 100644 --- a/server/src/config/services.js +++ b/server/src/config/services.js @@ -158,6 +158,7 @@ export const initializeServices = async ({ logger, envSettings, settingsService const notificationUtils = new NotificationUtils({ stringService, emailService, + settingsService, }); const notificationService = new NotificationService({ diff --git a/server/src/service/v1/infrastructure/notificationUtils.js b/server/src/service/v1/infrastructure/notificationUtils.js index d6b92cc0e..2051fb6a4 100644 --- a/server/src/service/v1/infrastructure/notificationUtils.js +++ b/server/src/service/v1/infrastructure/notificationUtils.js @@ -3,9 +3,10 @@ const SERVICE_NAME = "NotificationUtils"; class NotificationUtils { static SERVICE_NAME = SERVICE_NAME; - constructor({ stringService, emailService }) { + constructor({ stringService, emailService, settingsService }) { this.stringService = stringService; this.emailService = emailService; + this.settingsService = settingsService; } get serviceName() { @@ -99,6 +100,8 @@ class NotificationUtils { const metrics = networkResponse?.payload?.data; const { cpu: { usage_percent: cpuUsage = -1 } = {}, memory: { usage_percent: memoryUsage = -1 } = {}, disk = [] } = metrics; + const { clientHost } = this.settingsService.getSettings(); + const alerts = { cpu: cpuThreshold !== -1 && cpuUsage > cpuThreshold ? true : false, memory: memoryThreshold !== -1 && memoryUsage > memoryThreshold ? true : false, @@ -140,6 +143,10 @@ class NotificationUtils { value: `${(d?.usage_percent * 100).toFixed(0)}%`, inline: true, })), + { + name: `Go to incident`, + value: `${clientHost}/infrastructure/${monitor._id}`, + }, ], }), }; @@ -182,8 +189,10 @@ class NotificationUtils { }; buildHardwareNotificationMessage = (alerts, monitor) => { + const { clientHost } = this.settingsService.getSettings(); const alertsHeader = [`Monitor: ${monitor.name}`, `URL: ${monitor.url}`]; - const alertText = alerts.length > 0 ? [...alertsHeader, ...alerts] : []; + const alertFooter = [`Go to incident: ${clientHost}/infrastructure/${monitor._id}`]; + const alertText = alerts.length > 0 ? [...alertsHeader, ...alerts, ...alertFooter] : []; return alertText.map((alert) => alert).join("\n"); }; buildHardwareWebhookBody = (alerts, monitor) => { From 90593c0d7cf0122cb76b1d7f5f117f1cdc469231 Mon Sep 17 00:00:00 2001 From: mospell Date: Sun, 23 Nov 2025 17:18:09 +0100 Subject: [PATCH 2/3] added 'go-to' links to the remaining Discord notifications --- .../src/service/v1/infrastructure/notificationUtils.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/server/src/service/v1/infrastructure/notificationUtils.js b/server/src/service/v1/infrastructure/notificationUtils.js index 2051fb6a4..90251800c 100644 --- a/server/src/service/v1/infrastructure/notificationUtils.js +++ b/server/src/service/v1/infrastructure/notificationUtils.js @@ -114,12 +114,13 @@ class NotificationUtils { { name: "Monitor", value: monitor.name, inline: true }, { name: "URL", value: monitor.url, inline: false }, ]; + const goToIncidentField = { name: `Go to incident`, value: `${clientHost}/infrastructure/${monitor._id}` }; const formatDiscordAlert = { cpu: () => ({ title: "CPU alert", description: `Your current CPU usage (${(cpuUsage * 100).toFixed(0)}%) is above your threshold (${(cpuThreshold * 100).toFixed(0)}%)`, color: 15548997, - fields: monitorInfoFields, + fields: [...monitorInfoFields, goToIncidentField], footer: { text: "Checkmate" }, }), @@ -127,7 +128,7 @@ class NotificationUtils { title: "Memory alert", description: `Your current memory usage (${(memoryUsage * 100).toFixed(0)}%) is above your threshold (${(memoryThreshold * 100).toFixed(0)}%)`, color: 15548997, - fields: monitorInfoFields, + fields: [...monitorInfoFields, goToIncidentField], footer: { text: "Checkmate" }, }), @@ -143,10 +144,7 @@ class NotificationUtils { value: `${(d?.usage_percent * 100).toFixed(0)}%`, inline: true, })), - { - name: `Go to incident`, - value: `${clientHost}/infrastructure/${monitor._id}`, - }, + goToIncidentField, ], }), }; From 6c2908681a8729d8e1070db53745db6b992ac470 Mon Sep 17 00:00:00 2001 From: SuryaGanesh284 Date: Tue, 25 Nov 2025 22:12:16 +0530 Subject: [PATCH 3/3] Add quick setup checklist to CONTRIBUTING.md Added a quick setup checklist for contributors. --- CONTRIBUTING.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5565d3797..656523f88 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,6 +10,31 @@ PS: **We work closely with contributors on our [Discord channel](https://discord --- + +## 🚀 Quick Setup Checklist + +Before you dive in, make sure you have these installed: + +```bash +# Check Node.js (v16+ required) +node --version + +# Check npm +npm --version + +# Check Docker +docker --version + +# Check Git +git --version +``` + +**New to contributing?** Start here: +1. Pick a [`good-first-issue`](https://github.com/bluewave-labs/checkmate/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) +2. Comment that you'd like to work on it +3. Follow the [setup guide](#set-up-checkmate-locally) below +4. Join our [Discord](https://discord.com/invite/NAb6H3UTjK) if you get stuck + ## Table of contents - [How do I...?](#how-do-i)