2022-04-27 22:00:56 +03:00
|
|
|
diff --git a/server/database.js b/server/database.js
|
2023-02-25 09:59:51 +02:00
|
|
|
index 575827f3..8e288095 100644
|
2022-04-27 22:00:56 +03:00
|
|
|
--- a/server/database.js
|
|
|
|
+++ b/server/database.js
|
2023-02-25 09:59:51 +02:00
|
|
|
@@ -87,20 +87,20 @@ class Database {
|
2022-04-27 22:00:56 +03:00
|
|
|
*/
|
|
|
|
static init(args) {
|
|
|
|
// Data Directory (must be end with "/")
|
|
|
|
- Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data/";
|
|
|
|
+ Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data";
|
2023-02-25 09:59:51 +02:00
|
|
|
|
|
|
|
// 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";
|
2022-04-27 22:00:56 +03:00
|
|
|
+ Database.path = Database.dataDir + "/kuma.db";
|
|
|
|
if (! fs.existsSync(Database.dataDir)) {
|
|
|
|
fs.mkdirSync(Database.dataDir, { recursive: true });
|
|
|
|
}
|
|
|
|
|
|
|
|
- Database.uploadDir = Database.dataDir + "upload/";
|
|
|
|
+ Database.uploadDir = Database.dataDir + "/upload/";
|
|
|
|
|
|
|
|
if (! fs.existsSync(Database.uploadDir)) {
|
|
|
|
fs.mkdirSync(Database.uploadDir, { recursive: true });
|
2023-02-25 09:59:51 +02:00
|
|
|
@@ -455,7 +455,7 @@ class Database {
|
2022-04-27 22:00:56 +03:00
|
|
|
static backup(version) {
|
|
|
|
if (! this.backupPath) {
|
|
|
|
log.info("db", "Backing up the database");
|
|
|
|
- this.backupPath = this.dataDir + "kuma.db.bak" + version;
|
|
|
|
+ this.backupPath = this.dataDir + "/kuma.db.bak" + version;
|
|
|
|
fs.copyFileSync(Database.path, this.backupPath);
|
|
|
|
|
|
|
|
const shmPath = Database.path + "-shm";
|