From d8269ba3ca826ccad8e52cbd45d924a5f6d19ffb Mon Sep 17 00:00:00 2001 From: Sid Sun Date: Fri, 9 May 2025 23:27:26 +1000 Subject: [PATCH] Add the new hostname to heartbeatJSON messages, fix linter errors Signed-off-by: Sid Sun --- compose.yaml | 3 ++- server/model/monitor.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compose.yaml b/compose.yaml index 42fb50d65..c06430ff2 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,7 +1,8 @@ services: uptime-kuma: hostname: uptime-kuma - image: louislam/uptime-kuma:1 + # image: louislam/uptime-kuma:1 + volumes: - ./data:/app/data ports: diff --git a/server/model/monitor.js b/server/model/monitor.js index 92afb5c73..5b10c7c08 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -24,7 +24,7 @@ const { CookieJar } = require("tough-cookie"); const { HttpsCookieAgent } = require("http-cookie-agent/http"); const https = require("https"); const http = require("http"); -const os = require('os'); +const os = require("os"); const rootCertificates = rootCertificatesFingerprints(); @@ -1302,6 +1302,8 @@ class Monitor extends BeanModel { // Prevent if the msg is undefined, notifications such as Discord cannot send out. if (!heartbeatJSON["msg"]) { heartbeatJSON["msg"] = "N/A"; + } else { + heartbeatJSON["msg"] = `[${os.hostname()}] ${heartbeatJSON["msg"]}`; } // Also provide the time in server timezone