feat(deploy): inject OBJECTIVE_API_KEY into backend/.env.runtime
Без ключа 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).
This commit is contained in:
parent
4bed58b43c
commit
8bcb60213e
1 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue