dzen.nstarikov.ru/README.md
2026-06-27 14:07:10 +03:00

43 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# vk2ok
Сервис принимает webhook VK на `https://vk2ok.bot.nstarikov.ru/webhook`, сохраняет событие в SQLite и ставит обработку в Redis/Celery.
## Развертывание
```bash
mkdir -p /var/www/bots/vk2ok
cd /var/www/bots/vk2ok
cp .env.example .env
docker compose up -d --build
```
В Caddy добавить:
```caddyfile
vk2ok.bot.nstarikov.ru {
reverse_proxy vk2ok-api:8000
}
```
После запуска в VK нажать "Подтвердить". На confirmation-запрос сервис вернет строку из `VK_CONFIRMATION_CODE`.
## Проверка webhook
```bash
curl -i https://vk2ok.bot.nstarikov.ru/health
curl -i -X POST https://vk2ok.bot.nstarikov.ru/webhook \
-H 'content-type: application/json' \
-d '{"type":"confirmation","group_id":9828339}'
```
Ожидаемый ответ второго запроса:
```text
58578d71
```
## Файлы
- SQLite: `/var/www/bots/vk2ok/data/vk2ok.sqlite3`
- Видео и обложки: `/var/www/bots/vk2ok/storage`
- cookies VK для yt-dlp: `/var/www/bots/vk2ok/data/vk_cookies.txt`