From 6e3e2fc85c8a05426a95660c59276cc7a30b995c Mon Sep 17 00:00:00 2001 From: LouisLam Date: Thu, 2 Sep 2021 21:08:00 +0800 Subject: [PATCH] fix db path --- server/database.js | 4 ++-- server/server.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/database.js b/server/database.js index 6db61ea4d..c4e1bce9f 100644 --- a/server/database.js +++ b/server/database.js @@ -5,8 +5,8 @@ const { setSetting, setting } = require("./util-server"); class Database { static templatePath = "./db/kuma.db" - static dataDir = "./data/"; - static path = this.dataDir + "kuma.db"; + static dataDir; + static path; static latestVersion = 8; static noReject = true; static sqliteInstance = null; diff --git a/server/server.js b/server/server.js index 7ca6ce0d2..3c0d281db 100644 --- a/server/server.js +++ b/server/server.js @@ -52,6 +52,7 @@ const sslCert = process.env.SSL_CERT || args["ssl-cert"] || undefined; // Data Directory (must be end with "/") Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data/"; +Database.path = Database.dataDir + "kuma.db"; console.log(`Data Dir: ${Database.dataDir}`); console.log("Creating express and socket.io instance")