Skip to content

feat(tg-bot): wire IG_COOKIES from Vault - #99

Merged
k5sha merged 1 commit into
mainfrom
feat/tg-bot-ig-cookies
Nov 30, 2026
Merged

k5sha merged 1 commit into
mainfrom
feat/tg-bot-ig-cookies

Conversation

@k5sha

@k5sha k5sha commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Summary

Wires the IG_COOKIES environment variable for tg-bot from the existing Secret/ExternalSecret so Instagram downloads work from the cluster (Instagram returns HTTP 429 for anonymous datacenter IPs).

Changes:

  • manifests/tg-bot/external-secret.yaml: new ig_cookies key mapped from Vault secret/tg-bot property ig_cookies.
  • manifests/tg-bot/deployment.yaml: new IG_COOKIES env from tg-bot-secrets key ig_cookies, marked optional: true.

optional: true means the pod still starts if the Vault property has not been created yet; the bot simply logs that Instagram cookies are not configured.

Required before/after merge

The Vault property does not exist yet, so ExternalSecret/tg-bot-secrets will report SecretSyncedError until it is added. Add the cookie value first:

kubectl -n vault exec -it vault-0 -- \
  vault kv patch secret/tg-bot ig_cookies='sessionid=...; csrftoken=...; ds_user_id=...'

Then force ESO to sync and restart the deployment so the env var is picked up:

kubectl -n tg-bot annotate externalsecret tg-bot-secrets force-sync="$(date +%s)" --overwrite
kubectl -n tg-bot rollout restart deploy/tg-bot

Verify:

kubectl -n tg-bot get externalsecret tg-bot-secrets
kubectl -n tg-bot logs deploy/tg-bot | grep -i instagram

The startup warning Instagram cookies/proxy are not configured should disappear after the restart.

Dependency

The running image must include Instagram support (k5sha/tg-downloader-bot PR #8). With the current image the env var is ignored; it becomes active after the CD job rolls out the new tag.

Notes

  • No cookie values are committed here; only the secret wiring.
  • No other manifests or apps are touched.

Map the ig_cookies property from secret/tg-bot into tg-bot-secrets and expose it as an optional IG_COOKIES env var so Instagram downloads work from the cluster.
@k5sha
k5sha merged commit f1f14ce into main Nov 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant