mirror of
https://github.com/wireadmin/wireadmin
synced 2025-06-26 18:28:06 +00:00
fix: storage path was not pointing to /data
This commit is contained in:
9
web/src/lib/env.ts
Normal file
9
web/src/lib/env.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { createEnv } from '@t3-oss/env-core';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const env = createEnv({
|
||||
runtimeEnv: process.env,
|
||||
server: {
|
||||
STORAGE_PATH: z.string().default('/data/storage.pack'),
|
||||
},
|
||||
});
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Client, MSGPack } from '@litehex/storage-box';
|
||||
import { FsDriver } from '@litehex/storage-box/driver';
|
||||
import { Client, FsDriver, MSGPack } from '@litehex/storage-box';
|
||||
import { resolve } from 'node:path';
|
||||
import { env } from '$lib/env';
|
||||
|
||||
const storagePath = resolve(process.cwd(), 'storage.pack');
|
||||
const storagePath = resolve(env.STORAGE_PATH);
|
||||
const driver = new FsDriver(storagePath, { parser: MSGPack });
|
||||
|
||||
export const client = new Client(driver);
|
||||
|
||||
Reference in New Issue
Block a user