feat: set unstorage driver to 'fs' (#4)
Some checks are pending
ci / ci (push) Waiting to run
build & push docker container / docker (push) Waiting to run
ci / check-provenance (push) Waiting to run

Reviewed-on: #4
Co-authored-by: Ayo <ayo@ayco.io>
Co-committed-by: Ayo <ayo@ayco.io>
This commit is contained in:
Ayo Ayco 2025-11-23 18:36:41 +00:00 committed by Ayo Ayco
parent 29b1841280
commit 5ddb86f71f
2 changed files with 1 additions and 42 deletions

View file

@ -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
}

View file

@ -144,7 +144,7 @@ export default defineNuxtConfig({
}, },
appConfig: { appConfig: {
storage: { storage: {
driver: process.env.NUXT_STORAGE_DRIVER ?? (isCI ? 'cloudflare' : 'fs'), driver: 'fs',
}, },
}, },
runtimeConfig: { runtimeConfig: {