consolidated env vars and .env

This commit is contained in:
ben
2026-04-02 17:14:05 -04:00
parent 90b9dad59c
commit 1757318523
5 changed files with 57 additions and 39 deletions

View File

@@ -1,22 +1,55 @@
v2 architecture draft: see `docs/architecture-v2.org`
# Running youdis
default v2 app run:
build and run the docker container
```
python3 ./youdis.py
-v [host_downloads]:/downloads
-v [host_config]:/config
-e ENABLE_DISCORD=1
-e DISCORD_BOT_TOKEN=<token>
-e DISCORD_BOT_SCOPE=<scope-int>
```
config contains data to persist across container updates, i.e., unraid appdata,
such as yt-dlp's archive.txt
`youdis.py` is the app-level runner. It starts the backend first, waits for health, then starts each enabled adapter explicitly.
# Development
direct component runs still work for testing:
v2 architecture draft: `docs/architecture-v2.org`
The app runs with `youdis.py`.
This starts the backend first, waits for health, then starts each enabled adapter explicitly.
Test components directly with uvicorn:
```
python3 -m uvicorn youdis.main:app --host 127.0.0.1 --port 8000
python3 -m youdis.adapters.discord
```
adapter selection is controlled by env, currently:
Key runner/config vars:
```
YOUDIS_ENABLE_BACKEND=1 #default enabled, dont disable unless testing
YOUDIS_BACKEND_HOST=127.0.0.1
YOUDIS_BACKEND_PORT=8000
YOUDIS_BACKEND_HEALTH_TIMEOUT=20
YOUDIS_BACKEND_HEALTH_INTERVAL=0.5
YOUDIS_POLL_INTERVAL_SECONDS=2
YOUDIS_YTDLP_EXECUTABLE=yt-dlp
YOUDIS_CONFIG_DIR=/path/to/config/
YOUDIS_DOWNLOAD_DIR=/path/to/downloads/
ENABLE_DISCORD=1
DISCORD_BOT_TOKEN=<token-string>
DISCORD_BOT_SCOPE=123456789
```
## Add Adapter
Configure adapter selection in .env, like so:
```
YOUDIS_RUN_BACKEND=1
YOUDIS_ENABLED_ADAPTERS=discord
YOUDIS_BACKEND_HOST=127.0.0.1
YOUDIS_BACKEND_PORT=8000
ENABLE_DISCORD=1
DISCORD_BOT_TOKEN=<api_key>
DISCORD_BOT_SCOPE=123456789
```
to add a new adapter:
@@ -24,13 +57,4 @@ to add a new adapter:
2. make it independently runnable
3. add `start_<adapter>()` to `youdis.py`
4. register it in the explicit adapter starter map in `youdis.py`
5. add any required env vars to `.env.example`
build and run the docker container
```
DISCORD_BOT_TOKEN = [discord bot token]
-v [downloads]:/downloads
-v [config]:/config
```
config contains data to persist across container updates, i.e., unraid appdata,
such as yt-dlp's archive.txt
5. add `ENABLE_<adapter>` and supporting env vars to `.env.example`