uptime-kuma: 1.23.16 -> 2.0.2

This commit is contained in:
Diogo Correia
2025-11-24 23:57:07 +00:00
parent 1883c1af9b
commit d4cb2eb133
3 changed files with 20 additions and 19 deletions
@@ -25,6 +25,11 @@ in
example = {
PORT = "4000";
NODE_EXTRA_CA_CERTS = lib.literalExpression "config.security.pki.caBundle";
UPTIME_KUMA_DB_TYPE = "mariadb";
UPTIME_KUMA_DB_HOSTNAME = "localhost";
UPTIME_KUMA_DB_NAME = "uptime-kuma";
UPTIME_KUMA_DB_USERNAME = "uptime-kuma";
UPTIME_KUMA_DB_PASSWORD = "uptime-kuma";
};
description = ''
Additional configuration for Uptime Kuma, see
@@ -42,6 +47,7 @@ in
NODE_ENV = lib.mkDefault "production";
HOST = lib.mkDefault "127.0.0.1";
PORT = lib.mkDefault "3001";
UPTIME_KUMA_DB_TYPE = lib.mkDefault "sqlite";
};
systemd.services.uptime-kuma = {
@@ -1,12 +1,12 @@
diff --git a/server/server.js b/server/server.js
index 0c9a45e6..cec31c7c 100644
--- a/server/server.js
+++ b/server/server.js
@@ -1583,6 +1583,7 @@ async function initDatabase(testMode = false) {
if (! fs.existsSync(Database.path)) {
log.info("server", "Copying Database");
fs.copyFileSync(Database.templatePath, Database.path);
+ fs.chmodSync(Database.path, 0o640);
}
diff --git a/server/database.js b/server/database.js
index d22ceb29..7490be8a 100644
--- a/server/database.js
+++ b/server/database.js
@@ -236,6 +236,7 @@ class Database {
if (! fs.existsSync(Database.sqlitePath)) {
log.info("server", "Copying Database");
fs.copyFileSync(Database.templatePath, Database.sqlitePath);
+ fs.chmodSync(Database.sqlitePath, 0o640);
}
log.info("server", "Connecting to the Database");
const Dialect = require("knex/lib/dialects/sqlite3/index.js");
+3 -8
View File
@@ -3,23 +3,22 @@
stdenv,
fetchFromGitHub,
buildNpmPackage,
python3,
nodejs,
nixosTests,
}:
buildNpmPackage rec {
pname = "uptime-kuma";
version = "1.23.16";
version = "2.0.2";
src = fetchFromGitHub {
owner = "louislam";
repo = "uptime-kuma";
rev = version;
hash = "sha256-+bhKnyZnGd+tNlsxvP96I9LXOca8FmOPhIFHp7ijmyA=";
hash = "sha256-zW5sl1g96PvDK3S6XhJ6F369/NSnvU9uSQORCQugfvs=";
};
npmDepsHash = "sha256-5i1NxwHqOahkioyM4wSu2X5KeMu7CdC4BqoUooAshn4=";
npmDepsHash = "sha256-EmSZJUbtD4FW7Rzdpue6/bV8oZt7RUL11tFBXGJQthg=";
patches = [
# Fixes the permissions of the database being not set correctly
@@ -27,10 +26,6 @@ buildNpmPackage rec {
./fix-database-permissions.patch
];
nativeBuildInputs = [ python3 ];
CYPRESS_INSTALL_BINARY = 0; # Stops Cypress from trying to download binaries
postInstall = ''
cp -r dist $out/lib/node_modules/uptime-kuma/