From b871cf08ab8405afaf0b40af349544cd69508ce6 Mon Sep 17 00:00:00 2001 From: axel Date: Sat, 12 Apr 2025 00:22:05 +0200 Subject: [PATCH] fixed db path for anyone reading past history, enjoy a free copy of my garbage-filled local dev db file --- db.json | 68 -------------------------------------- src/lib/server/db/index.ts | 4 +-- 2 files changed, 2 insertions(+), 70 deletions(-) delete mode 100644 db.json diff --git a/db.json b/db.json deleted file mode 100644 index babc996..0000000 --- a/db.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "users": [ - { - "id": "EqWthpxM6dwLpdg6_GMNv", - "name": "admin", - "password": "$2b$10$M5f38oxNH2TbtJrSeR5bi.qgz9n5rhnxrQPh3Y.8GIZaH1Z6MgZDa", - "admin": true, - "groups": [], - "devices": [ - "2PAUDI9gbzwuD8ptcptDM", - "A6u-0SaX5q5s_DzMFf3N1" - ] - }, - { - "id": "l6GVetq1ifjsHmnoy3TrC", - "name": "axel", - "admin": false, - "groups": [ - "2Y1OFiRWu8r50_WBLaB-j" - ], - "devices": [ - "ps8lzN3c2uHcGtqHdmaEz" - ], - "password": "$2b$10$MGb8xG3a4oxIvFq6fiqG8.X8HKS1j8WdjYjc6fgO6W.5s0vvQi8A." - } - ], - "groups": [ - { - "id": "2Y1OFiRWu8r50_WBLaB-j", - "name": "Gr1", - "devices": [ - "2PAUDI9gbzwuD8ptcptDM", - "ps8lzN3c2uHcGtqHdmaEz" - ] - }, - { - "id": "gNaTU4Tdj-6-a8wRyWf21", - "name": "Gr2", - "devices": [] - } - ], - "devices": [ - { - "id": "2PAUDI9gbzwuD8ptcptDM", - "name": "Dev1", - "mac": "00:00:00:00:00:00", - "broadcast": "255.255.255.254", - "port": 9, - "packets": 3 - }, - { - "id": "ps8lzN3c2uHcGtqHdmaEz", - "name": "Dev2", - "mac": "00:00:00:00:00:00", - "broadcast": "255.255.255.255", - "port": 9, - "packets": 3 - }, - { - "id": "A6u-0SaX5q5s_DzMFf3N1", - "name": "Dev3", - "mac": "00:00:00:00:00:00", - "broadcast": "255.255.255.255", - "port": 9, - "packets": 3 - } - ] -} \ No newline at end of file diff --git a/src/lib/server/db/index.ts b/src/lib/server/db/index.ts index ec61cad..facc170 100644 --- a/src/lib/server/db/index.ts +++ b/src/lib/server/db/index.ts @@ -1,7 +1,7 @@ import { JSONFilePreset } from 'lowdb/node'; +import type { Device } from './types/device'; import type { Group } from './types/group'; import type { User } from './types/user'; -import type { Device } from './types/device'; type Data = { users: User[]; @@ -9,7 +9,7 @@ type Data = { devices: Device[]; }; -export const db = await JSONFilePreset('db.json', { +export const db = await JSONFilePreset('./data/db.json', { users: [], groups: [], devices: [],