mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-23 23:11:13 -04:00
allow changing data dir
This commit is contained in:
parent
dac410c850
commit
c74986647e
2 changed files with 11 additions and 4 deletions
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue