Add the new hostname to heartbeatJSON messages, fix linter errors

Signed-off-by: Sid Sun <sids@Sids-MacBook.local>
This commit is contained in:
Sid Sun 2025-05-09 23:27:26 +10:00
parent 0890660e01
commit d8269ba3ca
2 changed files with 5 additions and 2 deletions

View file

@ -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:

View file

@ -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