chore(EVO-2178): ship MEDIA_HOST_ALLOWLIST on every deploy surface - #168
Merged
Conversation
The bot runtime validates the host of an incoming attachment before fetching it, and reads the authorized hosts from MEDIA_HOST_ALLOWLIST only — an allowlist taken from the event would be chosen by whoever sent the event. Unset means no attachment is fetched, so the variable has to travel with the service or media silently stops reaching the agent. Set it to the host that signs the attachment URLs: ACTIVE_STORAGE_URL when present, otherwise BACKEND_URL. Add the storage host as well when ActiveStorage runs in redirect mode (presigned S3/MinIO links), or the CDN host when one fronts the CRM. Wired into docker-compose.yml, docker-compose.swarm.yaml, internal/review/docker-compose.yml and both env examples. The swarm file leaves it blank next to the instructions, like the other per-deployment values there.
There was a problem hiding this comment.
Sorry @gomessguii, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
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.
Companion to evolution-foundation/evo-bot-runtime#7 — they should land together.
The bot runtime validates the host of an incoming attachment before fetching it, and reads the authorized hosts from
MEDIA_HOST_ALLOWLISTonly (an allowlist taken from the event would be chosen by whoever sent the event). Unset means no attachment is fetched, so the variable has to travel with the service or media silently stops reaching the agent.Set it to the host that signs the attachment URLs:
ACTIVE_STORAGE_URLwhen present, otherwiseBACKEND_URL. Add the storage host as well when ActiveStorage runs in redirect mode (presigned S3/MinIO links), or the CDN host when one fronts the CRM.Wired into:
docker-compose.yml—${MEDIA_HOST_ALLOWLIST:-localhost}, matching theBACKEND_URLin.env.exampleinternal/review/docker-compose.yml—localhost,evo_crmdocker-compose.swarm.yaml— left blank next to the instructions, like the other per-deployment values there.env.exampleand.env.swarm.exampleNo submodule pointers are touched.
Part of EVO-2178.
🤖 Generated with Claude Code