Worker: inject the egress proxy variables into strict task environments
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start with client/src/orcaster_worker/task_env.py, especially build_scrubbed_base_env and the proxy reservation and passthrough logic; then trace its use in client/src/orcaster_worker/venv_manager.py. Read client/tests/test_task_env.py and client/tests/test_venv_manager_env.py to see the expected environment behavior. Done means the acceptance cases pass, the requested warnings and source reporting are covered, and the listed user manual, README, troubleshooting, and changelog text is updated.
Written by the indexing model from the issue text.
Description
Problem
With egress isolation on, the worker container gets the proxy as HTTPS_PROXY, HTTP_PROXY and NO_PROXY (Makefile:466-473). The worker uses the same signal to detect a proxy at startup (client/src/orcaster_worker/main.py:789).
A task that declares task_env runs with a scrubbed environment: a fixed passthrough base plus the names it declares (client/src/orcaster_worker/task_env.py:50-63, task_env.py:307-359). The proxy variables are not in the base. They are reserved and owned by the worker (task_env.py:170-174), so a task gets them only if it lists them in task_env. The same scrubbed environment is used for uv pip install during venv setup (client/src/orcaster_worker/venv_manager.py:102).
A strict task that forgets the three names has no route out of the --internal network. It fails within seconds with a DNS error (Could not resolve host, dns error), which reads like a network outage and not like a configuration error. The behavior is documented as a known limit (docs/user-manual.md:1155-1173, client/README.md:659-665, client/README.md:722-730), and every task author must learn it.
Some clients read only the lowercase names (http_proxy, https_proxy, no_proxy). The Makefile never sets them, so declaring them in task_env usually has no effect today. An operator can still add them to the worker environment through EXTRA_ENV, which the fleet scripts copy into every worker env file (setup-scripts/debian13-worker/run-fleet.sh:174).
Proposed change
- When the worker runs with egress isolation (the worker environment has
HTTPS_PROXYorHTTP_PROXY), add the proxy variables to every strict task environment, whether or not the task declared them:HTTPS_PROXY,HTTP_PROXY,NO_PROXYwith the worker values;https_proxy,http_proxy,no_proxywith the same values as the uppercase worker names.
The lowercase values come from the uppercase worker values, not from a lowercase name in the worker environment. On a host with several workers, each worker has its own proxy (Makefile:372,Makefile:469-470), whileEXTRA_ENVis the same for every worker. A lowercase value fromEXTRA_ENVcould send a task to the proxy of another worker, which applies another allowlist. When a task declares a lowercase name intask_env, it gets the lowercase worker value if the worker environment has one (as today). If the worker environment has no lowercase value, it gets the uppercase worker value, like an undeclared task. Today such a declared name is not injected at all (client/src/orcaster_worker/task_env.py:347-350), which leaves lowercase-only clients without a proxy.
- Apply it in one place so that the task commands and the venv setup get the same environment (
build_scrubbed_base_env, or its callers invenv_manager.py:102andvenv_manager.py:164). - At startup, log one WARNING for each lowercase proxy name in the worker environment whose value differs from its uppercase name. The line names the variable, never the value.
- Log a warning, once per execution and with the task id, when a strict task declared none of the proxy names. The warning is informative only: the task still runs with the injected values.
- Do not inject anything when egress isolation is off (no proxy in the worker environment). Do not change legacy tasks without
task_env: they already inherit the worker environment. - Do not inject
ALL_PROXYor anyGIT_*variable. - Keep the per-task environment source line accurate: injected names are reported as coming from the worker environment (
docs/user-manual.md:2605). - Update the docs: replace "The known limit" section (
docs/user-manual.md:1155-1173), the troubleshooting row (docs/user-manual.md:2783), the note atdocs/user-manual.md:1780, andclient/README.md:659-665andclient/README.md:722-730.
Compatibility
- Tasks that already declare
HTTPS_PROXY,HTTP_PROXYandNO_PROXYget the same values as today. - Tasks that declare a lowercase proxy name keep today's value for it when the worker environment has one. Otherwise they now get the uppercase worker value instead of no value. Tasks that did not declare one get the lowercase names from the uppercase worker values, even if
EXTRA_ENVsets other lowercase values. - Tasks that did not declare them now reach the proxy. The proxy still applies each task's egress allowlist, so they reach only allowed hosts.
- Workers without egress isolation and legacy tasks without
task_envsee no change. - Server values for these names are still refused, because the names stay reserved.
- No server change, no protocol change and no configuration step. Task definitions can keep declaring the names.
Acceptance criteria
- With
HTTPS_PROXY,HTTP_PROXYandNO_PROXYin the worker environment, a strict task that declares none of them gets all six names (both cases) with the worker values, in the task commands and in the venv setup. - A strict task that declares the uppercase names gets the same values as before the change.
- On a host with two workers and lowercase proxy names in
EXTRA_ENV, a strict task that does not declare them gets lowercase values equal to the uppercase values of its own worker. - A strict task that declares a lowercase proxy name gets the worker value for that name, as today.
- On a worker with no lowercase proxy names in its environment, a strict task that declares
http_proxygets the value ofHTTP_PROXY. - A worker whose lowercase proxy value differs from its uppercase value logs one startup WARNING that names the variable and not the value.
- Without a proxy in the worker environment, no proxy variable is injected.
- A legacy task without
task_envgets the same environment as before. - A server secret named like a proxy variable (any case) is still refused.
- A strict task that declares none of the proxy names produces one warning per execution with the task id. The log line contains no variable value.
- Tests cover each case above in
client/tests/test_task_env.pyandclient/tests/test_venv_manager_env.py. - Existing deployments keep working without config changes, and existing task definitions do not need edits.
- The user manual and the client README no longer tell task authors to declare the proxy variables.
- CHANGELOG entry under Unreleased.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AInvirion/orcaster
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
enhancement good first issue P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug P2 server
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
All issues in AInvirion/orcaster
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
daniel-ospina/tortoise#15308 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
difficulty:easy prio:low type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NatronGitHub/Natron#2405 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Jstar269/nakagawa-recomp#3746 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day