Database Setup Page (#2738)

* WIP

* WIP: Database setup process

* Add database setup page
This commit is contained in:
Louis Lam
2023-02-11 14:41:02 +08:00
committed by GitHub
parent db4663d6be
commit e4183ee2b7
16 changed files with 513 additions and 59 deletions

View File

@@ -235,13 +235,13 @@ describe("The function filterAndJoin", () => {
describe("Test uptimeKumaServer.getClientIP()", () => {
it("should able to get a correct client IP", async () => {
Database.init({
Database.initDataDir({
"data-dir": "./data/test"
});
if (! fs.existsSync(Database.path)) {
if (! fs.existsSync(Database.sqlitePath)) {
log.info("server", "Copying Database");
fs.copyFileSync(Database.templatePath, Database.path);
fs.copyFileSync(Database.templatePath, Database.sqlitePath);
}
await Database.connect(true);