Repository navigation
feat(tg-bot): wire IG_COOKIES from Vault - #99
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires the
IG_COOKIESenvironment variable fortg-botfrom 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: newig_cookieskey mapped from Vaultsecret/tg-botpropertyig_cookies.manifests/tg-bot/deployment.yaml: newIG_COOKIESenv fromtg-bot-secretskeyig_cookies, markedoptional: true.optional: truemeans 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-secretswill reportSecretSyncedErroruntil it is added. Add the cookie value first: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-botVerify:
kubectl -n tg-bot get externalsecret tg-bot-secrets kubectl -n tg-bot logs deploy/tg-bot | grep -i instagramThe startup warning
Instagram cookies/proxy are not configuredshould disappear after the restart.Dependency
The running image must include Instagram support (
k5sha/tg-downloader-botPR #8). With the current image the env var is ignored; it becomes active after the CD job rolls out the new tag.Notes