diff --git a/packages/dream2nix-overrides/nodejs/uptime-kuma/data-dir-concat-with-slash.patch b/packages/dream2nix-overrides/nodejs/uptime-kuma/data-dir-concat-with-slash.patch index 15f7459..75a70be 100644 --- a/packages/dream2nix-overrides/nodejs/uptime-kuma/data-dir-concat-with-slash.patch +++ b/packages/dream2nix-overrides/nodejs/uptime-kuma/data-dir-concat-with-slash.patch @@ -1,14 +1,22 @@ diff --git a/server/database.js b/server/database.js -index b17e7f4..7b77f84 100644 +index 575827f3..8e288095 100644 --- a/server/database.js +++ b/server/database.js -@@ -74,13 +74,13 @@ class Database { +@@ -87,20 +87,20 @@ class Database { */ static init(args) { // Data Directory (must be end with "/") - Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data/"; -- Database.path = Database.dataDir + "kuma.db"; + Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data"; + + // Plugin feature is working only if the dataDir = "./data"; +- if (Database.dataDir !== "./data/") { ++ if (Database.dataDir !== "./data") { + log.warn("PLUGIN", "Warning: In order to enable plugin feature, you need to use the default data directory: ./data/"); + PluginsManager.disable = true; + } + +- Database.path = Database.dataDir + "kuma.db"; + Database.path = Database.dataDir + "/kuma.db"; if (! fs.existsSync(Database.dataDir)) { fs.mkdirSync(Database.dataDir, { recursive: true }); @@ -19,7 +27,7 @@ index b17e7f4..7b77f84 100644 if (! fs.existsSync(Database.uploadDir)) { fs.mkdirSync(Database.uploadDir, { recursive: true }); -@@ -429,7 +429,7 @@ class Database { +@@ -455,7 +455,7 @@ class Database { static backup(version) { if (! this.backupPath) { log.info("db", "Backing up the database");