diff --git a/10-systems/hosts/gntasks.md b/10-systems/hosts/gntasks.md index d2175e3..a47ebc5 100644 --- a/10-systems/hosts/gntasks.md +++ b/10-systems/hosts/gntasks.md @@ -51,7 +51,7 @@ - **Stack:** docker compose — `db` (postgres:17-alpine, healthy), `api` (FastAPI, healthy, migrations run at container start), `web` (nginx, SPA + proxy /api/, /auth/, /mcp/ → api) - **Public URL:** https://tasks.gnexus.space (TLS terminates on internal-proxy-vps .226, separate LE cert valid until 2026-12-20; upstream http://192.168.1.179:8135) - **WEB_PORT:** 8135 (container web 0.0.0.0:8135→80) -- **Config:** /srv/gntodo/.env — GAUTH_BASE_URL=https://auth.gnexus.space, GAUTH_REDIRECT_URI=https://tasks.gnexus.space/auth/callback, OLLAMA_BASE_URL=http://192.168.1.130:11434, OLLAMA_MODEL=qwen3.5:2b-q4_K_M (model confirmed present on .130), random SESSION_SECRET/POSTGRES_PASSWORD, MCP_TOKEN empty (deprecated by per-user tokens) +- **Config:** /srv/gntodo/.env — GAUTH_BASE_URL=https://auth.gnexus.space, GAUTH_REDIRECT_URI=https://tasks.gnexus.space/auth/callback, OLLAMA_BASE_URL=http://192.168.1.130:11434, OLLAMA_MODEL=qwen3.5:2b-q4_K_M (model confirmed present on .130), random SESSION_SECRET/POSTGRES_PASSWORD, MCP_TOKEN empty (deprecated by per-user tokens), VAPID_* set (Web Push enabled 2026-10-10) - **SSO (configured 2026-09-21):** GAUTH_CLIENT_ID=gnx_8z9SjVg1pFrDWUjXka36mW9cdeu68jLa, GAUTH_CLIENT_SECRET set (owner-provided), api container recreated via `docker compose up -d` (env interpolation — plain restart does not pick up .env changes). Credentials: gnexus-creds secret "gntodo SSO client + webhook secret (tasks.gnexus.space)" (id ca8836f7-79b9-474e-8703-f564d69b7e6f). /auth/login → OAuth authorize on auth.gnexus.space verified (sign-in page renders, client accepted); final browser login pending owner test - **Webhook from SSO (configured 2026-09-21, ТЗ 3.16):** endpoint POST https://tasks.gnexus.space/auth/webhook; HMAC-SHA256 signature X-Gnexus-Signature: t=,v1=; events user.email_changed / user.profile_updated / user.blocked / user.archived / user.deleted (revoke events wipe the user's MCP tokens); empty secret → 503 disabled. GAUTH_WEBHOOK_SECRET rotated same day (owner-provided): first whsec_DlRa... replaced by whsec_kgL... in .env, api recreated; verified with real signed HMAC test (webhook.test): new secret → 200 {"ok":true}, old secret → 400 Invalid webhook, unsigned → 400. Current secret in gnexus-creds ca8836f7 - **MCP (per-user tokens since ac8aefb, ТЗ 3.10):** https://tasks.gnexus.space/mcp/ (streamable HTTP, JSON-RPC over SSE). Tokens are generated per user in Settings → Токены MCP (plaintext shown once, sha256 hash in DB); agent acts on behalf of the token owner and sees only their data. The old shared MCP_TOKEN from .env is no longer used (empty in .env; old value preserved in pre-update backup). Verified: POST /mcp/ without token → 401 @@ -61,7 +61,8 @@ - **Update 2026-09-30 #1 (dcb6976 → b8ee805, rei):** gnexus-ui-kit 0.4.0 → 1.0.0 with raw custom blocks (visual language of kit 1.0.0), achievements condition popover (GnPopover), garden rebalance (coins ×2 per task completion, micro-rewards, level bonus ×2), iOS Safari fixes. Full rebuild (web + api): backup → git pull --ff-only → docker compose up -d --build via nohup (~6 min on 2 vCPU). No new migrations (alembic context clean at api start). Pre-update backup: /srv/gntodo-backups/gntodo-pre-update-20260930-075743.sql.gz + env-pre-update-20260930-075743.bak. Verified: api/db healthy, web up, /api/health {"status":"ok"} local and public, SPA 200 text/html, no errors in api logs, MCP list_projects OK through the new build - **Update 2026-09-30 #2 (b8ee805 → 6ca1491, rei):** image paste into task/note description, logo/icons brand chip of kit 1.0.0 (ТЗ 0.52), popup draft survives close (ТЗ 0.51), extension popup restyled to kit 1.0.0 language, ТЗ 0.50 visual style and custom components (§3.19). Frontend + extension only — api container was NOT recreated (no backend changes in these commits). Full rebuild via nohup (web image includes the extension ZIP build). Pre-update backup: /srv/gntodo-backups/gntodo-pre-update-20260930-083512.sql.gz + env-pre-update-20260930-083512.bak. Verified: api/db healthy, web up, /api/health {"status":"ok"} local and public, SPA 200, extension ZIP https://tasks.gnexus.space/extension/gntodo-extension.zip → 200 application/zip 7126192 bytes (fresh build, contains dist/manifest.json, dist/logo.svg, icons, popup assets), no errors in api logs, MCP list_projects OK. Note: GET /extension/ (physical dir) → 403 nginx autoindex — expected, no index.html there; the SPA instruction route is /extension (no trailing slash) - **Update 2026-10-09 (6ca1491 → 6ddbcef, rei):** favicon service (FAVICONS_PATH=/data/favicons hardcoded, new `favicons` docker volume auto-created by compose), achievements UI, MCP server changes; 3 additive alembic migrations on `projects` only (b1c2d3e4f5a6 color+site_url, c3d4e5f6a7b8 pinned, d4e5f6a7b8c9 repository_url; chain a9b8c7d6e5f4 → d4e5f6a7b8c9), no DROP/TRUNCATE. Pre-flight: no new required env vars. Full rebuild via nohup (~3.5 min; note: the nohup launch ssh call itself may time out at 60s while the build survives — verify via /tmp log + ps before retrying). Pre-update backup: /srv/gntodo-backups/gntodo-pre-update-20261009-230508.sql.gz (96.5 KB, verified) + env-pre-update-20261009-230508.bak + volumes-pre-update-20261009-230508.tar.gz (attachments volume gntodo_attachments, 7 files). Verified: db/api healthy, /api/health ok local and public, alembic d4e5f6a7b8c9, data counts at baseline (tasks 310, projects 19, users 3, documents 329, tags 42), no api log errors -- **Update 2026-10-10 (6ddbcef → 94af80e, rei):** 21 commit: агентский мандат (ТЗ 3.20 — claim/release/acceptance задач агентом, task_events журнал действий, actor session-vs-token), системные уведомления Web Push (ТЗ 3.21 — VAPID, push_subscriptions/push_deliveries, scheduler, напоминания 0.89 с тихими часами), JournalView, мобильные фиксы, регулярные задачи (дата следующего раза, метка в списке, фильтр). 3 additive alembic миграции (a1b2c3d4e5f7 мандат, c1d2e3f4a5b6 push_subscriptions, d2e3f4a5b6c7 push_deliveries; chain d4e5f6a7b8c9 → d2e3f4a5b6c7), только CREATE TABLE/ADD COLUMN, без DROP/TRUNCATE. Pre-flight: новые env опциональны — VAPID_PUBLIC_KEY/VAPID_PRIVATE_KEY/VAPID_SUBJECT (пусто = системные уведомления выключены) и REMINDER_TIMEZONE (дефолт Europe/Kyiv); в .env НЕ заданы — push не активен, включить при настройке (ключи печатает `cd backend && uv run python -m app.vapid`). Full rebuild via nohup (~5 мин, /tmp/gntodo-build-20261010.log). Pre-update backup: /srv/gntodo-backups/gntodo-pre-update-20261010-171409.sql.gz (96 651 B, verified) + env-pre-update-20261010-171409.bak. Verified: db/api healthy, /api/health {"status":"ok"} local and public, SPA 200 text/html, extension ZIP 200 application/zip 7 125 498 B, alembic_version d2e3f4a5b6c7 (все 3 миграции применены, таблицы push_subscriptions/push_deliveries/task_events созданы), данные на месте (tasks 312, projects 16, users 3), api-логи без ошибок, MCP list_projects OK (15 проектов) +- **Update 2026-10-10 (6ddbcef → 94af80e, rei):** 21 commit: агентский мандат (ТЗ 3.20 — claim/release/acceptance задач агентом, task_events журнал действий, actor session-vs-token), системные уведомления Web Push (ТЗ 3.21 — VAPID, push_subscriptions/push_deliveries, scheduler, напоминания 0.89 с тихими часами), JournalView, мобильные фиксы, регулярные задачи (дата следующего раза, метка в списке, фильтр). 3 additive alembic миграции (a1b2c3d4e5f7 мандат, c1d2e3f4a5b6 push_subscriptions, d2e3f4a5b6c7 push_deliveries; chain d4e5f6a7b8c9 → d2e3f4a5b6c7), только CREATE TABLE/ADD COLUMN, без DROP/TRUNCATE. Pre-flight: новые env опциональны — VAPID_PUBLIC_KEY/VAPID_PRIVATE_KEY/VAPID_SUBJECT (пусто = системные уведомления выключены) и REMINDER_TIMEZONE (дефолт Europe/Kyiv); на момент обновления в .env НЕ заданы — push не активен; включены позже в тот же день (см. «Web Push enabled»). Full rebuild via nohup (~5 мин, /tmp/gntodo-build-20261010.log). Pre-update backup: /srv/gntodo-backups/gntodo-pre-update-20261010-171409.sql.gz (96 651 B, verified) + env-pre-update-20261010-171409.bak. Verified: db/api healthy, /api/health {"status":"ok"} local and public, SPA 200 text/html, extension ZIP 200 application/zip 7 125 498 B, alembic_version d2e3f4a5b6c7 (все 3 миграции применены, таблицы push_subscriptions/push_deliveries/task_events созданы), данные на месте (tasks 312, projects 16, users 3), api-логи без ошибок, MCP list_projects OK (15 проектов) +- **Web Push enabled (2026-10-10, rei):** VAPID-пара сгенерирована штатным генератором (`docker exec gntodo-api-1 uv run python -m app.vapid`), записана в /srv/gntodo/.env (бэкап .env.bak-prevapid-20261010), VAPID_SUBJECT=mailto:goldmikki@gmail.com. Грабля: апстримный compose НЕ пробрасывает VAPID_* в контейнер api (pydantic-settings читает env_file=".env", которого в образе нет — WORKDIR /srv/app), поэтому .env сам по себе не работает — локальная правка docker-compose.yml добавляет 3 строки в `environment:` api (VAPID_PUBLIC_KEY/VAPID_PRIVATE_KEY/VAPID_SUBJECT через ${VAR}-интерполяцию); compose теперь modified относительно апстрима (тот же паттерн, что у hard-panel — перепроверять при git pull). api пересоздан через `docker compose up -d api` (env-интерполяция — обычный restart не подхватывает .env). Verified: get_settings().push_enabled=True внутри контейнера, /api/health {"status":"ok"} локально и по LAN, контейнер healthy, hard-panel services_overview gntodo up 200 (транзиентный 502 в окне рестарта). Креды: gnexus-creds secret "gntodo VAPID keys (Web Push, tasks.gnexus.space)" (id 65d621ed-214e-4ace-8239-7edc85365093, приватный ключ зашифрован) — потеря приватного ключа = перевыпуск всех push-подписок. Действие владельца: включить уведомления в настройках веб-приложения (браузер спросит разрешение → подписка) - **Deploy notes:** built by ayame via peer task (docker compose up -d --build; build takes several minutes on 2 vCPU — run in background with nohup, first attempt hit a 20s command timeout); docker requires sudo (ubuntu user not in docker group); /srv/gntodo owned by root — git operations need sudo - **Verified 2026-09-21 after update (external):** https://tasks.gnexus.space/ → 200 text/html (fresh SPA build), /api/health → {"status":"ok"}, /auth/webhook unsigned → 400 Invalid webhook, /mcp/ without token → 401; signed webhook.test with current secret → 200 (local, via web container) diff --git a/90-maintenance/pending-changes/20261010182923-29342548.json b/90-maintenance/pending-changes/20261010182923-29342548.json new file mode 100644 index 0000000..578a39d --- /dev/null +++ b/90-maintenance/pending-changes/20261010182923-29342548.json @@ -0,0 +1,19 @@ +{ + "id": "20261010182923-29342548", + "kind": "doc", + "target": "10-systems/hosts/gntasks.md", + "summary": "gntodo: Web Push включён — VAPID-ключи сгенерированы, .env + локальная правка compose (проброс в api), push_enabled=True, креды в gnexus-creds", + "reason": "Web Push в gntodo включён и проверен (VAPID-ключи, проброс в compose, push_enabled=True) — фиксирую в канонической документе хоста", + "payload": { + "content": "---\ntitle: \"VPS gntasks (navi instance ayame)\"\ntype: host\nip: 192.168.1.179\npurpose: \"Navi agent instance (ayame, profile navi_code) + gntodo (GNexus Tasks) web service in home LAN\"\nowner: gmikcon\nstatus: active\nconfidence: \"100\"\nlast_reviewed: \"2026-10-10\"\nreview_interval: \"90d\"\nsource_of_truth: \"ssh-host-and-owner-confirmed\"\n---\n\n# VPS gntasks (navi instance ayame + gntodo)\n\n## Overview\n\nHome LAN VPS (KVM/QEMU guest). Hosts the navi-1 agent instance **ayame**\n(profile `navi_code`), deployed 2026-09-21 by navi (rei) from the `deploy`\nbranch of https://git.gnexus.space/git/root/navi-1.git, and since 2026-09-21\nthe **gntodo** (GNexus Tasks) web service — deployed by ayame (peer task,\nverified by rei) from https://git.gnexus.space/git/root/gnexus-tasks.git.\n\n## Technical Details\n\n- **IP:** 192.168.1.179\n- **Hostname:** gntasks\n- **OS:** Ubuntu 22.04.5 LTS, kernel 5.15.0-191-generic\n- **Platform:** KVM guest, 2 vCPU, 3.8 GiB RAM, 31G root disk (22G free at deploy)\n- **User:** ubuntu (SSH + sudo, same password; root password identical)\n- **Credentials:** gnexus-creds secret \"VPS gntasks SSH (192.168.1.179)\" (id e4e28fe1-c9ac-4bb9-a462-0d57bce13692)\n- **Firewall:** ufw inactive (all LAN traffic allowed)\n\n## Navi instance ayame (deployed 2026-09-21)\n\n- **Instance name:** ayame\n- **Instance ID:** 1606fff0-5abc-468c-af57-6c3c316494ac\n- **Repo:** /home/ubuntu/navi-1 (branch `deploy`, commit e276b1e)\n- **Service:** navi.service (systemd, enabled, Restart=always, runs as root)\n- **Server port:** 8099 (0.0.0.0), health endpoint http://127.0.0.1:8099/health\n- **Postgres:** docker container navi-postgres (pgvector) on 127.0.0.1:5432\n- **Python:** standalone CPython 3.12.14 at /home/ubuntu/navi-1/.python/\n- **Swarm:** .swarm-key copied from hive host (rei, 192.168.1.168); HIVE_URL=http://192.168.1.168:8087; hive.announce_ok confirmed in journalctl; visible in peer list as `ayame — 192.168.1.179:8099 [online]`\n- **Ollama backend:** OLLAMA_HOST=https://ollama.com, model glm-5.3-flash:cloud (deploy-branch .env); OLLAMA_API_KEY appended from hive .env\n- **Embeddings:** EMBEDDING_OLLAMA_HOST=http://192.168.1.168:11434 — embed.ok=true in /health (better than other instances, which show embed.ok=false)\n- **Webclient/auth:** NAVI_WEBCLIENT_ENABLED=false, NAVI_AUTH_ENABLED=false (default deploy shape)\n\n## gntodo / GNexus Tasks (deployed 2026-09-21, updated 2026-10-10 to 94af80e)\n\n- **Repo:** /srv/gntodo (https://git.gnexus.space/git/root/gnexus-tasks.git), branch `master`, HEAD 94af80e\n- **Stack:** docker compose — `db` (postgres:17-alpine, healthy), `api` (FastAPI, healthy, migrations run at container start), `web` (nginx, SPA + proxy /api/, /auth/, /mcp/ → api)\n- **Public URL:** https://tasks.gnexus.space (TLS terminates on internal-proxy-vps .226, separate LE cert valid until 2026-12-20; upstream http://192.168.1.179:8135)\n- **WEB_PORT:** 8135 (container web 0.0.0.0:8135→80)\n- **Config:** /srv/gntodo/.env — GAUTH_BASE_URL=https://auth.gnexus.space, GAUTH_REDIRECT_URI=https://tasks.gnexus.space/auth/callback, OLLAMA_BASE_URL=http://192.168.1.130:11434, OLLAMA_MODEL=qwen3.5:2b-q4_K_M (model confirmed present on .130), random SESSION_SECRET/POSTGRES_PASSWORD, MCP_TOKEN empty (deprecated by per-user tokens), VAPID_* set (Web Push enabled 2026-10-10)\n- **SSO (configured 2026-09-21):** GAUTH_CLIENT_ID=gnx_8z9SjVg1pFrDWUjXka36mW9cdeu68jLa, GAUTH_CLIENT_SECRET set (owner-provided), api container recreated via `docker compose up -d` (env interpolation — plain restart does not pick up .env changes). Credentials: gnexus-creds secret \"gntodo SSO client + webhook secret (tasks.gnexus.space)\" (id ca8836f7-79b9-474e-8703-f564d69b7e6f). /auth/login → OAuth authorize on auth.gnexus.space verified (sign-in page renders, client accepted); final browser login pending owner test\n- **Webhook from SSO (configured 2026-09-21, ТЗ 3.16):** endpoint POST https://tasks.gnexus.space/auth/webhook; HMAC-SHA256 signature X-Gnexus-Signature: t=,v1=; events user.email_changed / user.profile_updated / user.blocked / user.archived / user.deleted (revoke events wipe the user's MCP tokens); empty secret → 503 disabled. GAUTH_WEBHOOK_SECRET rotated same day (owner-provided): first whsec_DlRa... replaced by whsec_kgL... in .env, api recreated; verified with real signed HMAC test (webhook.test): new secret → 200 {\"ok\":true}, old secret → 400 Invalid webhook, unsigned → 400. Current secret in gnexus-creds ca8836f7\n- **MCP (per-user tokens since ac8aefb, ТЗ 3.10):** https://tasks.gnexus.space/mcp/ (streamable HTTP, JSON-RPC over SSE). Tokens are generated per user in Settings → Токены MCP (plaintext shown once, sha256 hash in DB); agent acts on behalf of the token owner and sees only their data. The old shared MCP_TOKEN from .env is no longer used (empty in .env; old value preserved in pre-update backup). Verified: POST /mcp/ without token → 401\n- **Multi-tenancy (since ac8aefb, ТЗ 0.34):** users table, user_id on tasks/projects/tags/attachments/xp/garden, per-user settings, claim on first login; alembic migration f9a0b1c2d3e4 applied 2026-09-21 (e7f8a9b0c1d2 → f9a0b1c2d3e4). Supersedes the earlier \"no user_id\" architecture note\n- **Update 2026-09-21 (400e69a → ac8aefb):** multitenancy (ТЗ 0.34), webhooks from gnexus-auth (ТЗ 3.16), mobile UI fixes, GAUTH_WEBHOOK_SECRET in compose. Procedure: backup → git pull --ff-only → .env edit → docker compose up -d --build. Pre-update backup: /srv/gntodo-backups/gntodo-pre-multitenant-20260921-231508.sql.gz + env-pre-multitenant-20260921-231508.bak (contains the old MCP_TOKEN f4993e...)\n- **Update 2026-09-22 (42aada2 → dcb6976, rei):** MCP project management (ТЗ 3.10: create_project / update_project / archive_project / restore_project — archive instead of deletion, project note summarization for detailing context) and detailing improvement (dropped title details are moved to description; fallback puts the original title into description when the model shortens it without a description; ТЗ 0.46). Backend-only change: rebuilt only the `api` image (`docker compose build api` — service is named `api`, not backend), `up -d api`; web/db containers untouched. No migrations. Verified: api healthy, /api/health 200 local and public, MCP list_projects works through the new build\n- **Update 2026-09-30 #1 (dcb6976 → b8ee805, rei):** gnexus-ui-kit 0.4.0 → 1.0.0 with raw custom blocks (visual language of kit 1.0.0), achievements condition popover (GnPopover), garden rebalance (coins ×2 per task completion, micro-rewards, level bonus ×2), iOS Safari fixes. Full rebuild (web + api): backup → git pull --ff-only → docker compose up -d --build via nohup (~6 min on 2 vCPU). No new migrations (alembic context clean at api start). Pre-update backup: /srv/gntodo-backups/gntodo-pre-update-20260930-075743.sql.gz + env-pre-update-20260930-075743.bak. Verified: api/db healthy, web up, /api/health {\"status\":\"ok\"} local and public, SPA 200 text/html, no errors in api logs, MCP list_projects OK through the new build\n- **Update 2026-09-30 #2 (b8ee805 → 6ca1491, rei):** image paste into task/note description, logo/icons brand chip of kit 1.0.0 (ТЗ 0.52), popup draft survives close (ТЗ 0.51), extension popup restyled to kit 1.0.0 language, ТЗ 0.50 visual style and custom components (§3.19). Frontend + extension only — api container was NOT recreated (no backend changes in these commits). Full rebuild via nohup (web image includes the extension ZIP build). Pre-update backup: /srv/gntodo-backups/gntodo-pre-update-20260930-083512.sql.gz + env-pre-update-20260930-083512.bak. Verified: api/db healthy, web up, /api/health {\"status\":\"ok\"} local and public, SPA 200, extension ZIP https://tasks.gnexus.space/extension/gntodo-extension.zip → 200 application/zip 7126192 bytes (fresh build, contains dist/manifest.json, dist/logo.svg, icons, popup assets), no errors in api logs, MCP list_projects OK. Note: GET /extension/ (physical dir) → 403 nginx autoindex — expected, no index.html there; the SPA instruction route is /extension (no trailing slash)\n- **Update 2026-10-09 (6ca1491 → 6ddbcef, rei):** favicon service (FAVICONS_PATH=/data/favicons hardcoded, new `favicons` docker volume auto-created by compose), achievements UI, MCP server changes; 3 additive alembic migrations on `projects` only (b1c2d3e4f5a6 color+site_url, c3d4e5f6a7b8 pinned, d4e5f6a7b8c9 repository_url; chain a9b8c7d6e5f4 → d4e5f6a7b8c9), no DROP/TRUNCATE. Pre-flight: no new required env vars. Full rebuild via nohup (~3.5 min; note: the nohup launch ssh call itself may time out at 60s while the build survives — verify via /tmp log + ps before retrying). Pre-update backup: /srv/gntodo-backups/gntodo-pre-update-20261009-230508.sql.gz (96.5 KB, verified) + env-pre-update-20261009-230508.bak + volumes-pre-update-20261009-230508.tar.gz (attachments volume gntodo_attachments, 7 files). Verified: db/api healthy, /api/health ok local and public, alembic d4e5f6a7b8c9, data counts at baseline (tasks 310, projects 19, users 3, documents 329, tags 42), no api log errors\n- **Update 2026-10-10 (6ddbcef → 94af80e, rei):** 21 commit: агентский мандат (ТЗ 3.20 — claim/release/acceptance задач агентом, task_events журнал действий, actor session-vs-token), системные уведомления Web Push (ТЗ 3.21 — VAPID, push_subscriptions/push_deliveries, scheduler, напоминания 0.89 с тихими часами), JournalView, мобильные фиксы, регулярные задачи (дата следующего раза, метка в списке, фильтр). 3 additive alembic миграции (a1b2c3d4e5f7 мандат, c1d2e3f4a5b6 push_subscriptions, d2e3f4a5b6c7 push_deliveries; chain d4e5f6a7b8c9 → d2e3f4a5b6c7), только CREATE TABLE/ADD COLUMN, без DROP/TRUNCATE. Pre-flight: новые env опциональны — VAPID_PUBLIC_KEY/VAPID_PRIVATE_KEY/VAPID_SUBJECT (пусто = системные уведомления выключены) и REMINDER_TIMEZONE (дефолт Europe/Kyiv); на момент обновления в .env НЕ заданы — push не активен; включены позже в тот же день (см. «Web Push enabled»). Full rebuild via nohup (~5 мин, /tmp/gntodo-build-20261010.log). Pre-update backup: /srv/gntodo-backups/gntodo-pre-update-20261010-171409.sql.gz (96 651 B, verified) + env-pre-update-20261010-171409.bak. Verified: db/api healthy, /api/health {\"status\":\"ok\"} local and public, SPA 200 text/html, extension ZIP 200 application/zip 7 125 498 B, alembic_version d2e3f4a5b6c7 (все 3 миграции применены, таблицы push_subscriptions/push_deliveries/task_events созданы), данные на месте (tasks 312, projects 16, users 3), api-логи без ошибок, MCP list_projects OK (15 проектов)\n- **Web Push enabled (2026-10-10, rei):** VAPID-пара сгенерирована штатным генератором (`docker exec gntodo-api-1 uv run python -m app.vapid`), записана в /srv/gntodo/.env (бэкап .env.bak-prevapid-20261010), VAPID_SUBJECT=mailto:goldmikki@gmail.com. Грабля: апстримный compose НЕ пробрасывает VAPID_* в контейнер api (pydantic-settings читает env_file=\".env\", которого в образе нет — WORKDIR /srv/app), поэтому .env сам по себе не работает — локальная правка docker-compose.yml добавляет 3 строки в `environment:` api (VAPID_PUBLIC_KEY/VAPID_PRIVATE_KEY/VAPID_SUBJECT через ${VAR}-интерполяцию); compose теперь modified относительно апстрима (тот же паттерн, что у hard-panel — перепроверять при git pull). api пересоздан через `docker compose up -d api` (env-интерполяция — обычный restart не подхватывает .env). Verified: get_settings().push_enabled=True внутри контейнера, /api/health {\"status\":\"ok\"} локально и по LAN, контейнер healthy, hard-panel services_overview gntodo up 200 (транзиентный 502 в окне рестарта). Креды: gnexus-creds secret \"gntodo VAPID keys (Web Push, tasks.gnexus.space)\" (id 65d621ed-214e-4ace-8239-7edc85365093, приватный ключ зашифрован) — потеря приватного ключа = перевыпуск всех push-подписок. Действие владельца: включить уведомления в настройках веб-приложения (браузер спросит разрешение → подписка)\n- **Deploy notes:** built by ayame via peer task (docker compose up -d --build; build takes several minutes on 2 vCPU — run in background with nohup, first attempt hit a 20s command timeout); docker requires sudo (ubuntu user not in docker group); /srv/gntodo owned by root — git operations need sudo\n- **Verified 2026-09-21 after update (external):** https://tasks.gnexus.space/ → 200 text/html (fresh SPA build), /api/health → {\"status\":\"ok\"}, /auth/webhook unsigned → 400 Invalid webhook, /mcp/ without token → 401; signed webhook.test with current secret → 200 (local, via web container)\n\n## Daily backups (2026-10-09, rei)\n\n- **Script:** /usr/local/bin/gntodo-backup.sh (root, 755) — pg_dump of gntodo-db-1 (user/db `gntodo`) → /srv/gntodo-backups/gntodo-daily-.sql.gz, `gunzip -t` integrity check (failed dump is deleted, script exits 1), tar of the attachments volume gntodo_attachments → gntodo-daily-volumes-.tar.gz, rotation keeps the newest 10 of each pattern (`gntodo-daily-*.sql.gz`, `gntodo-daily-volumes-*.tar.gz`); manual `pre-update-*` / `pre-multitenant-*` files are never touched. Log: /var/log/gntodo-backup.log (logrotate weekly ×4, /etc/logrotate.d/gntodo-backup)\n- **Schedule:** root crontab `30 3 * * * /usr/local/bin/gntodo-backup.sh` (server TZ = UTC → daily 03:30 UTC)\n- **Verified 2026-10-09:** test run EXIT=0 (dump 96 962 B, GZIP_OK, attachments tar OK, log written); rotation tested with dummy files (13 → exactly 10 kept, dummies cleaned up afterwards)\n- **Restore:** `zcat .sql.gz | sudo docker exec -i gntodo-db-1 psql -U gntodo gntodo`; attachments from the matching volumes tar; .env from the matching .bak\n\n## MCP integration into navi swarm (2026-09-22, rei)\n\n- The per-user MCP credential for the rei instance was issued by the owner in the web UI (Settings → MCP tokens; plaintext shown once, value not documented here).\n- Credential reference: gnexus-creds secret titled \"gntodo MCP token (tasks.gnexus.space)\" (value stored encrypted).\n- **Endpoint verified live:** POST https://tasks.gnexus.space/mcp/ with a Bearer authorization header → initialize 200 (serverInfo gntodo 1.30.0, protocol 2025-03-26, SSE response, Mcp-Session-Id header). Since dcb6976 (2026-09-22) tools/list → 12 tools: list_projects, get_project, create_project, update_project, archive_project, restore_project, create_task, update_task, complete_task, list_tasks, get_task, list_tags. Since 94af80e (2026-10-10) → 15 tools: + claim_task, release_task, list_available_tasks (агентский мандат, ТЗ 3.20).\n- **rei (192.168.1.168):** config /home/ubuntu/navi-1/mcp_servers.d/gntodo.json (transport streamable_http, Bearer header, groups read/write), profile server_admin config.json got `gntodo: [read, write]` in tools.agent.mcp and tools.subagent.mcp. Applied via navi.service restart (restart kills the running agent turn — service enters deactivating until the turn ends, then systemd starts the new process; Restart=always).\n- **Other instances (ayame, tsukiko, pilar, kael, zoe):** same config shape applies; not yet deployed there.\n\n## REST API (verified 2026-10-02, rei)\n\n- The same per-user Bearer MCP token also authorizes the plain REST API: `Authorization: Bearer ` on https://tasks.gnexus.space/api/* — no separate token needed. Without the header → 401 {\"detail\":\"Not authenticated\"}.\n- Verified endpoints: GET /api/projects (list), GET /api/tasks?project_id=&limit=200 (flat task list with status/tags/project/description), DELETE /api/tasks/{id} → 200 {\"ok\":true}, PATCH /api/tasks/{id} with JSON body (e.g. {\"status\":\"done\"}) → 200 with updated task. /openapi.json returns the SPA HTML (no spec), /api/projects/{id}/tasks → 404.\n- **Use REST for bulk operations** (imports, deduplication, mass status changes): it is fast and reliable, while MCP tools/call over SSE can split a JSON-RPC response into chunks — a naive parser sees a broken response, retries, and the server has already committed the change → duplicates. This happened during the SmartHome Trello import (2026-10-02): ~150 duplicate tasks created by retries, cleaned up by title-based deduplication via REST DELETE. MCP remains fine for single interactive calls.\n- Task statuses: to_do / in_progress / done / cancelled. create_task (MCP) cannot set status at creation — create then PATCH/update_task.\n\n## Deploy notes (navi ayame)\n\n- Docker 29.1.3 was preinstalled; docker compose plugin v5.5.1 installed manually to /usr/local/lib/docker/cli-plugins/docker-compose before install.sh\n- install.sh ran via `echo | sudo -S bash deploy/install.sh` (idempotent)\n- install.sh generated .swarm-key as root (600) — chown to ubuntu before copying the real hive key over scp\n- OLLAMA_API_KEY / EMBEDDING_* appended to .env from the hive host's .env (secrets not documented here)\n- First boot crashed once with `relation \"sessions\" does not exist` (DB schema race during restart); subsequent boots clean\n\n## Listening ports (TCP, verified 2026-09-21)\n\n- 22 — sshd\n- 8135 — gntodo web container (docker, 0.0.0.0)\n- 8099 — navi-server (ayame)\n- 5432 — navi-postgres docker (localhost only)\n\n## Notes\n\n- Known non-critical warnings (same as other swarm instances): MCP server 'navi_ui' connect failed (anyio CancelledError), tool_loader.file_error for gmail.py (ModuleNotFoundError: html2text)\n- gntodo update procedure: backup (pg_dump + .env copy to /srv/gntodo-backups/) → `cd /srv/gntodo && git pull --ff-only && docker compose up -d --build` (migrations run automatically at api start; build in background via nohup on this 2-vCPU host). For backend-only changes `docker compose build api && docker compose up -d api` is enough (web image untouched). Frontend/extension changes require the full rebuild — the extension ZIP is built inside the web image. Daily DB+attachments backups are automated since 2026-10-09 (see \"Daily backups\")\n- MCP token for agents: owner generates in Settings → Токены MCP and distributes; no shared token anymore" + }, + "status": "applied", + "created_at": "2026-10-10T18:29:23Z", + "updated_at": "2026-10-10T18:29:25Z", + "applied_at": "2026-10-10T18:29:25Z", + "validation": { + "status": "ok", + "issue_count": 0, + "issues": [] + } +}