add env var for db path

This commit is contained in:
pinks 2023-10-18 23:11:25 +02:00
parent 4ba6f494d2
commit 22d9c518be
2 changed files with 7 additions and 6 deletions

View File

@ -14,15 +14,16 @@ You can put these in `.env` file or pass them as environment variables.
- `TG_BOT_TOKEN` - Telegram bot token. Get yours from [@BotFather](https://t.me/BotFather).
Required.
- `TG_ADMIN_USERNAMES` - Comma separated list of usernames of users that can use admin commands.
- `DENO_KV_PATH` - [Deno KV](https://deno.land/api?s=Deno.openKv&unstable) database file path. A
temporary file is used by default.
- `LOG_LEVEL` - [Log level](https://deno.land/std@0.201.0/log/mod.ts?s=LogLevels). Default: `INFO`.
You can configure more stuff in [Eris WebUI](http://localhost:5999/) when running.
## Running
- Start stable diffusion webui: `cd sd-webui`, `./webui.sh --api`
- Start bot: `deno task start`
To connect your SD to the bot, open the [Eris UI](http://localhost:5999/), login as admin and add a
worker.
- Start Stable Diffusion WebUI: `./webui.sh --api` (in SD WebUI directory)
- Start Eris: `deno task start`
## Codegen

View File

@ -1,4 +1,4 @@
import { KvFs } from "kvfs";
export const db = await Deno.openKv("./app.db");
export const db = await Deno.openKv(Deno.env.get("DENO_KV_PATH"));
export const fs = new KvFs(db);