From 8bcb60213edcf03a201d652f5662fb2ec5def38b Mon Sep 17 00:00:00 2001 From: lekss361 Date: Sun, 17 May 2026 19:02:07 +0300 Subject: [PATCH] feat(deploy): inject OBJECTIVE_API_KEY into backend/.env.runtime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Без ключа Celery beat task sync_all_groups early-returns со skipped=no_api_key, admin trigger /scrape/objective/sync-our -> 503. Используется тот же sed-pattern что и GLITCHTIP_DSN. Требует Forgejo Actions secret OBJECTIVE_API_KEY (см. issue #307 OBJ). --- .forgejo/workflows/deploy.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index fa6e4cf0..3f8b058e 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -160,12 +160,13 @@ jobs: SENTRY_RELEASE_VAL: ${{ github.sha }} GHCR_PAT: ${{ secrets.GHCR_PAT }} GLITCHTIP_BACKEND_DSN: ${{ secrets.GLITCHTIP_BACKEND_DSN }} + OBJECTIVE_API_KEY: ${{ secrets.OBJECTIVE_API_KEY }} with: host: ${{ secrets.DEPLOY_HOST }} username: ${{ secrets.DEPLOY_USER }} key: ${{ secrets.DEPLOY_SSH_KEY }} port: ${{ secrets.DEPLOY_PORT }} - envs: IMAGE_TAG,SENTRY_RELEASE_VAL,GHCR_PAT,GLITCHTIP_BACKEND_DSN + envs: IMAGE_TAG,SENTRY_RELEASE_VAL,GHCR_PAT,GLITCHTIP_BACKEND_DSN,OBJECTIVE_API_KEY script: | set -euo pipefail cd /opt/gendesign @@ -197,6 +198,13 @@ jobs: else printf 'GLITCHTIP_DSN=%s\n' "$GLITCHTIP_BACKEND_DSN" >> backend/.env.runtime fi + # Objective API key — для live scraper sync_all_groups (issue #307 OBJ-1). + # Пустой secret = no-op (sync_objective_group skipped с reason=no_api_key). + if grep -q '^OBJECTIVE_API_KEY=' backend/.env.runtime; then + sed -i "s|^OBJECTIVE_API_KEY=.*|OBJECTIVE_API_KEY=$OBJECTIVE_API_KEY|" backend/.env.runtime + else + printf 'OBJECTIVE_API_KEY=%s\n' "$OBJECTIVE_API_KEY" >> backend/.env.runtime + fi chmod 600 backend/.env.runtime # External network для Caddy + obsidian-stack share