61 lines
1.5 KiB
Markdown
61 lines
1.5 KiB
Markdown
# Running youdis
|
|
|
|
build and run the docker container
|
|
```
|
|
-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
|
|
|
|
# Development
|
|
|
|
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
|
|
```
|
|
|
|
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_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:
|
|
1. add `youdis/adapters/<adapter>.py`
|
|
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 `ENABLE_<adapter>` and supporting env vars to `.env.example`
|