You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SSRF_PROXY_ALLOW_PRIVATE_IPS / SSRF_PROXY_ALLOW_PRIVATE_DOMAINS set in envs/infrastructure/ssrf-proxy.env have no effect #40415
The values configured in docker/envs/infrastructure/ssrf-proxy.env should take effect, so the allowlist written into the squid config (dify_allowed_private_networks / dify_allowed_private_domains) reflects them. Per the documented convention in docker/README.md:
Docker Compose reads envs/*.env files when present, then reads .env last so values in .env take precedence.
So setting the variables in the root .env should still be able to override envs/infrastructure/ssrf-proxy.env.
❌ Actual Behavior
The ssrf_proxy service does not load envs/infrastructure/ssrf-proxy.env at all. The two variables are only wired via environment: interpolation (${SSRF_PROXY_ALLOW_PRIVATE_IPS:-}), which reads from the root .env only — edits to envs/infrastructure/ssrf-proxy.env are silently ignored.
Additionally, dify-env-sync strips these two variables from the root .env during upgrades (they live in the envs/ category, not the root .env.example), so configuring them in .env does not survive an upgrade either. envs/infrastructure/ssrf-proxy.env is the natural home for them per the project's env-file design, but that path is currently broken.
This bug report is valid — there are actually two issues here:
1. ssrf_proxy service doesn't load envs/infrastructure/ssrf-proxy.env
The ssrf_proxy service in docker-compose.yaml has no env_file: directive pointing to ssrf-proxy.env. It only uses environment: with shell interpolation from the root .env[1]:
So values set in envs/infrastructure/ssrf-proxy.env are silently ignored, even though that file's .example template [2] lists both variables — which is misleading. Other Dify services (api, worker, web) do load ssrf-proxy.env via shared YAML anchors [3], but the ssrf_proxy container itself does not.
2. SSRF_PROXY_ALLOW_PRIVATE_DOMAINS is missing from root .env.example
SSRF_PROXY_ALLOW_PRIVATE_IPS is present in docker/.env.example[4], but SSRF_PROXY_ALLOW_PRIVATE_DOMAINS is not. Since dify-env-sync rebuilds .env from .env.example and only preserves variables that exist in the template, running the sync tool will strip SSRF_PROXY_ALLOW_PRIVATE_DOMAINS if a user manually added it to root .env.
Workaround for now: Add both variables directly to the root docker/.env file (not the envs/infrastructure/ file), and be aware that SSRF_PROXY_ALLOW_PRIVATE_DOMAINS may be removed by dify-env-sync on upgrades and need to be re-added.
To fix this properly, two changes would be needed:
Add SSRF_PROXY_ALLOW_PRIVATE_DOMAINS to docker/.env.example so it survives sync
Either add an env_file: directive to the ssrf_proxy service for ssrf-proxy.env, or remove these variables from ssrf-proxy.env.example to avoid confusion
Thanks @dosu for confirming the issue and outlining the current behavior.
I'd like to work on this issue. I reproduced the behavior against the current main branch and have a patch ready.
The proposed fix:
Load ./envs/infrastructure/ssrf-proxy.env directly for the ssrf_proxy service.
Keep these optional allowlist settings scoped to the infrastructure env file.
Preserve non-empty legacy root .env and shell overrides through scoped override variables, without loading the entire root .env into the Squid container.
Fall back to the infrastructure values when a legacy root override is empty.
Add regression coverage for Compose resolution, override precedence, and preventing unrelated root secrets from entering the container.
I also validated the behavior with a real Squid container, including private-domain allow/deny behavior and IP allowlist fallback.
Could a maintainer please assign this issue to me? Once assigned, I'll open the PR.
Activity
dosubot commentedon Aug 10, 2026
This bug report is valid — there are actually two issues here:
1.
ssrf_proxyservice doesn't loadenvs/infrastructure/ssrf-proxy.envThe
ssrf_proxyservice indocker-compose.yamlhas noenv_file:directive pointing tossrf-proxy.env. It only usesenvironment:with shell interpolation from the root.env[1]:So values set in
envs/infrastructure/ssrf-proxy.envare silently ignored, even though that file's.exampletemplate [2] lists both variables — which is misleading. Other Dify services (api, worker, web) do loadssrf-proxy.envvia shared YAML anchors [3], but thessrf_proxycontainer itself does not.2.
SSRF_PROXY_ALLOW_PRIVATE_DOMAINSis missing from root.env.exampleSSRF_PROXY_ALLOW_PRIVATE_IPSis present indocker/.env.example[4], butSSRF_PROXY_ALLOW_PRIVATE_DOMAINSis not. Sincedify-env-syncrebuilds.envfrom.env.exampleand only preserves variables that exist in the template, running the sync tool will stripSSRF_PROXY_ALLOW_PRIVATE_DOMAINSif a user manually added it to root.env.Workaround for now: Add both variables directly to the root
docker/.envfile (not theenvs/infrastructure/file), and be aware thatSSRF_PROXY_ALLOW_PRIVATE_DOMAINSmay be removed bydify-env-syncon upgrades and need to be re-added.To fix this properly, two changes would be needed:
SSRF_PROXY_ALLOW_PRIVATE_DOMAINStodocker/.env.exampleso it survives syncenv_file:directive to thessrf_proxyservice forssrf-proxy.env, or remove these variables fromssrf-proxy.env.exampleto avoid confusionTo reply, just mention @dosu.
Docs are dead. Just use Dosu.
yang0228 commentedon Sep 3, 2026
Thanks @dosu for confirming the issue and outlining the current behavior.
I'd like to work on this issue. I reproduced the behavior against the current
mainbranch and have a patch ready.The proposed fix:
./envs/infrastructure/ssrf-proxy.envdirectly for thessrf_proxyservice..envand shell overrides through scoped override variables, without loading the entire root.envinto the Squid container.I also validated the behavior with a real Squid container, including private-domain allow/deny behavior and IP allowlist fallback.
Could a maintainer please assign this issue to me? Once assigned, I'll open the PR.
orangeclk commentedon Sep 4, 2026
I've already made a PR and I have reopened it. @yang0228
41tair commentedon Nov 5, 2026
Fixed in #45359.