mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-08 21:38:37 +08:00
allow changing data dir
This commit is contained in:
@@ -5,7 +5,8 @@ const { setSetting, setting } = require("./util-server");
|
||||
class Database {
|
||||
|
||||
static templatePath = "./db/kuma.db"
|
||||
static path = "./data/kuma.db";
|
||||
static dataDir = "./data/";
|
||||
static path = this.dataDir + "kuma.db";
|
||||
static latestVersion = 8;
|
||||
static noReject = true;
|
||||
static sqliteInstance = null;
|
||||
@@ -56,7 +57,7 @@ class Database {
|
||||
console.info("Database patch is needed")
|
||||
|
||||
console.info("Backup the db")
|
||||
const backupPath = "./data/kuma.db.bak" + version;
|
||||
const backupPath = this.dataDir + "kuma.db.bak" + version;
|
||||
fs.copyFileSync(Database.path, backupPath);
|
||||
|
||||
const shmPath = Database.path + "-shm";
|
||||
|
Reference in New Issue
Block a user