fix(docker): allow default dev frontend origins (#4959)

This commit is contained in:
Tsai Yuan 2026-08-24 07:21:18 +08:00 committed by GitHub
parent 613b90b0e6
commit 8d15b87d8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -80,6 +80,14 @@ def test_bind_address_remains_overridable(variant: str):
assert _bind_address(mapping) == "${BIND_HOST:-127.0.0.1}", f"{variant} compose must keep the bind address overridable via BIND_HOST; got: {mapping!r}"
def test_dev_frontend_allows_default_loopback_origins():
"""The Docker dev frontend must hydrate on its default published hosts."""
compose = yaml.safe_load(COMPOSE_PATHS["dev"].read_text(encoding="utf-8"))
environment = compose["services"]["frontend"]["environment"]
assert "DEER_FLOW_DEV_ALLOWED_ORIGINS=${DEER_FLOW_DEV_ALLOWED_ORIGINS:-127.0.0.1,::1}" in environment
def _bind_address(mapping: str) -> str | None:
"""Return the bind-address segment of a compose port mapping, if any.

View File

@ -138,6 +138,7 @@ services:
- WATCHPACK_POLLING=true
- CI=true
- DEER_FLOW_INTERNAL_GATEWAY_BASE_URL=http://gateway:8001
- DEER_FLOW_DEV_ALLOWED_ORIGINS=${DEER_FLOW_DEV_ALLOWED_ORIGINS:-127.0.0.1,::1}
env_file:
- ../frontend/.env
networks: