Fix: healthcheck could shutdown during migration (#6204)

This commit is contained in:
Louis Lam 2025-10-21 00:11:28 +08:00 committed by GitHub
commit 5aca422f5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "uptime-kuma",
"version": "2.0.0",
"version": "2.0.1",
"license": "MIT",
"repository": {
"type": "git",
@ -41,7 +41,7 @@
"build-docker-pr-test": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64 -t louislam/uptime-kuma:pr-test2 --target pr-test2 . --push",
"upload-artifacts": "node extra/release/upload-artifacts.mjs",
"upload-artifacts-beta": "node extra/release/upload-artifacts-beta.mjs",
"setup": "git checkout 2.0.0 && npm ci --omit dev && npm run download-dist",
"setup": "git checkout 2.0.1 && npm ci --omit dev && npm run download-dist",
"download-dist": "node extra/download-dist.js",
"mark-as-nightly": "node extra/mark-as-nightly.js",
"reset-password": "node extra/reset-password.js",

View File

@ -37,6 +37,18 @@ class SimpleMigrationServer {
this.server = http.createServer(this.app);
this.app.get("/", (req, res) => {
res.set("Content-Type", "text/html");
// HTML meta tag redirect to /status
res.end(`
<html lang="en">
<head><meta http-equiv="refresh" content="0; URL=/migrate-status" /></head>
<body>Migration server is running.</body>
</html>
`);
});
this.app.get("/migrate-status", (req, res) => {
res.set("Content-Type", "text/plain");
res.write("Migration is in progress, listening message...\n");
if (this.response) {