From 5ddb86f71f068bb93a28ad6cb7ba0211d013d4cf Mon Sep 17 00:00:00 2001 From: Ayo Date: Sun, 23 Nov 2025 18:36:41 +0000 Subject: [PATCH] feat: set unstorage driver to 'fs' (#4) Reviewed-on: https://git.ayo.run:3000/ayo/yolk/pulls/4 Co-authored-by: Ayo Co-committed-by: Ayo --- modules/tauri/runtime/storage.ts | 41 -------------------------------- nuxt.config.ts | 2 +- 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 modules/tauri/runtime/storage.ts diff --git a/modules/tauri/runtime/storage.ts b/modules/tauri/runtime/storage.ts deleted file mode 100644 index 3c546b38..00000000 --- a/modules/tauri/runtime/storage.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Store } from 'tauri-plugin-store-api' -import { createStorage } from 'unstorage' -import redisDriver from 'unstorage/drivers/redis' - -const store = new Store('.servers.dat') - -/** - * TODO: Use redis as storage - * - docs: https://unstorage.unjs.io/drivers/redis - * - then we can probably remove need for `/elk/data` (see docker-compose) - */ -const storage = createStorage({ - driver: redisDriver({ - base: 'unstorage:elk:', - }), -}) - -storage.mount('servers', { - getKeys() { - return store.keys() - }, - async removeItem(key: string) { - await store.delete(key) - }, - clear() { - return store.clear() - }, - hasItem(key: string) { - return store.has(key) - }, - setItem(key: string, value: any) { - return store.set(key, value) - }, - getItem(key: string) { - return store.get(key) - }, -}) - -export function useStorage() { - return storage -} diff --git a/nuxt.config.ts b/nuxt.config.ts index 098f84a9..6ba7fc68 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -144,7 +144,7 @@ export default defineNuxtConfig({ }, appConfig: { storage: { - driver: process.env.NUXT_STORAGE_DRIVER ?? (isCI ? 'cloudflare' : 'fs'), + driver: 'fs', }, }, runtimeConfig: {