ci: provision VK Callback API settings
This commit is contained in:
1 parent
ed9203ea77
commit
f92161de80
3 files changed
+7
No files matched your search
@@ -79,6 +79,8 @@ deploy:
|
|||||||
- test -n "$KUBE_CONFIG_B64"
|
- test -n "$KUBE_CONFIG_B64"
|
||||||
- test -n "$VK_GROUP_TOKEN"
|
- test -n "$VK_GROUP_TOKEN"
|
||||||
- test -n "$VK_GROUP_ID"
|
- test -n "$VK_GROUP_ID"
|
||||||
|
- test -n "$VK_CALLBACK_SECRET"
|
||||||
|
- test -n "$VK_CALLBACK_CONFIRMATION"
|
||||||
- test -n "$BELKI_DATABASE_URL"
|
- test -n "$BELKI_DATABASE_URL"
|
||||||
- test -n "$POSTGRES_PASSWORD"
|
- test -n "$POSTGRES_PASSWORD"
|
||||||
- test -n "$BELKI_ADMIN_PASSWORD"
|
- test -n "$BELKI_ADMIN_PASSWORD"
|
||||||
@@ -93,6 +95,8 @@ deploy:
|
|||||||
--from-literal=VK_GROUP_TOKEN="$VK_GROUP_TOKEN" \
|
--from-literal=VK_GROUP_TOKEN="$VK_GROUP_TOKEN" \
|
||||||
--from-literal=VK_GROUP_ID="$VK_GROUP_ID" \
|
--from-literal=VK_GROUP_ID="$VK_GROUP_ID" \
|
||||||
--from-literal=VK_API_VERSION="${VK_API_VERSION:-5.199}" \
|
--from-literal=VK_API_VERSION="${VK_API_VERSION:-5.199}" \
|
||||||
|
--from-literal=VK_CALLBACK_SECRET="$VK_CALLBACK_SECRET" \
|
||||||
|
--from-literal=VK_CALLBACK_CONFIRMATION="$VK_CALLBACK_CONFIRMATION" \
|
||||||
--from-literal=BELKI_DATABASE_URL="$BELKI_DATABASE_URL" \
|
--from-literal=BELKI_DATABASE_URL="$BELKI_DATABASE_URL" \
|
||||||
--from-literal=POSTGRES_PASSWORD="$POSTGRES_PASSWORD" \
|
--from-literal=POSTGRES_PASSWORD="$POSTGRES_PASSWORD" \
|
||||||
--from-literal=BELKI_ADMIN_PASSWORD="$BELKI_ADMIN_PASSWORD" \
|
--from-literal=BELKI_ADMIN_PASSWORD="$BELKI_ADMIN_PASSWORD" \
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
- VK scheduler lives in `app/belki/vk_scheduler.py`; use `BELKI_DATABASE_URL` in production and `BELKI_HISTORY_DB` for local SQLite checks. Keep mailing disabled until an administrator explicitly enables a conversation and schedule.
|
- VK scheduler lives in `app/belki/vk_scheduler.py`; use `BELKI_DATABASE_URL` in production and `BELKI_HISTORY_DB` for local SQLite checks. Keep mailing disabled until an administrator explicitly enables a conversation and schedule.
|
||||||
- VK Callback API and dialog durability live across `app/belki/vk_bot.py`, `app/belki/vk_callback.py`, and `app/belki/vk_scheduler.py`. The bot listens on callback port 8081; preserve `vk_dialog_states` and `vk_callback_events` when changing dialog steps, attachments, or event dispatch. Validate with `python -m unittest tests.test_vk_bot tests.test_vk_conversation -q`. Production uses `/api/vk/callback` on the existing public host and routes that exact path to the `belki-bot` Service.
|
- VK Callback API and dialog durability live across `app/belki/vk_bot.py`, `app/belki/vk_callback.py`, and `app/belki/vk_scheduler.py`. The bot listens on callback port 8081; preserve `vk_dialog_states` and `vk_callback_events` when changing dialog steps, attachments, or event dispatch. Validate with `python -m unittest tests.test_vk_bot tests.test_vk_conversation -q`. Production uses `/api/vk/callback` on the existing public host and routes that exact path to the `belki-bot` Service.
|
||||||
- The build job waits for the DinD daemon and runs `docker info` before building.
|
- The build job waits for the DinD daemon and runs `docker info` before building.
|
||||||
|
- The deploy job requires protected CI variables `VK_CALLBACK_SECRET` and `VK_CALLBACK_CONFIRMATION` and writes both into `belki-runtime` before applying the bot Deployment.
|
||||||
- Never commit `.env` or `.gitlab.variables.env`; the latter contains the GitLab Variable handoff and a namespace-scoped kubeconfig.
|
- Never commit `.env` or `.gitlab.variables.env`; the latter contains the GitLab Variable handoff and a namespace-scoped kubeconfig.
|
||||||
- Private image storage is the separate Kubernetes Secret `belki-image-store`, not the CI-recreated `belki-runtime`. It contains only the internal MinIO endpoints and bucket-scoped credentials; keep MinIO private and preserve the `/api/images/<id>` Belki proxy when changing upload flows.
|
- Private image storage is the separate Kubernetes Secret `belki-image-store`, not the CI-recreated `belki-runtime`. It contains only the internal MinIO endpoints and bucket-scoped credentials; keep MinIO private and preserve the `/api/images/<id>` Belki proxy when changing upload flows.
|
||||||
|
|
||||||
|
|||||||
@@ -115,6 +115,8 @@ belki-bot Service -> callback HTTP listener
|
|||||||
|
|
||||||
Токен группы нужен для исходящих вызовов `messages.send`; Callback API заменяет только канал получения событий.
|
Токен группы нужен для исходящих вызовов `messages.send`; Callback API заменяет только канал получения событий.
|
||||||
|
|
||||||
|
CI/CD должен передавать `VK_CALLBACK_SECRET` и `VK_CALLBACK_CONFIRMATION` как защищённые переменные GitLab. Deploy job записывает их в `belki-runtime`; значения не должны попадать в Git.
|
||||||
|
|
||||||
## План миграции
|
## План миграции
|
||||||
|
|
||||||
1. Вынести обработку одного события из Long Poll цикла в переиспользуемый метод. **Готово.**
|
1. Вынести обработку одного события из Long Poll цикла в переиспользуемый метод. **Готово.**
|
||||||
|
|||||||
Reference in new issue
Block a user