opensafely-core / opensafely-core/backend-server
Fix BACKEND configuration
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 1
- Forks
- 5
- Avg merge
- 1h 36m
- Merged PRs (30d)
- 2
Description
We define BACKEND=tpp in the default environment profille. We make this readonly, as it shouldn't be changed to something else.
This works fine when running stuff in a shell.
However, we do not pass this env var explicitly through to job-runner and airlock.
So they have relied on it being defined in ~opensafely/config/03_backend.env, as they do load that env file.
However, if it is in there then the load-env script fails to load them, because with set -a it tries to set them, which it can't do with BACKEND as it is read only.
We should probably explicitly pass BACKEND env var through in the docker-compose yaml.
For the systemd units, we may need to add /etc/profile.d/opensafely.sh as a sourced env file config
Associated Slack conversation:
https://bennettoxford.slack.com/archives/C02GL3A9THD/p1731000367418999
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start by tracing the load-env script and the 03_backend.env handling, then inspect the docker-compose YAML and systemd units that launch job-runner and airlock. Verify how /etc/profile.d/opensafely.sh is sourced. Done means BACKEND is explicitly available to both services and load-env completes successfully with the readonly variable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, shell
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100