From 22d9c518be2a196b3dc9121204f8ceec39ed2cd9 Mon Sep 17 00:00:00 2001 From: pinks Date: Wed, 18 Oct 2023 23:11:25 +0200 Subject: [PATCH] add env var for db path --- README.md | 11 ++++++----- app/db.ts | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7d2b084..f2b5790 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/app/db.ts b/app/db.ts index 194fd79..bea2e14 100644 --- a/app/db.ts +++ b/app/db.ts @@ -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);