Skip to content

[codex] Fix start.sh dotenv filtering load - #2257

Merged
1 commit merged into
nesquena:masterfrom
franksong2702:franksong2702/fix-start-env-loader
May 14, 2026
Merged

1 commit merged into
nesquena:masterfrom
franksong2702:franksong2702/fix-start-env-loader

Conversation

@franksong2702

Copy link
Copy Markdown
Contributor

Thinking Path

A full-suite quality pass found the start.sh readonly .env regression tests failing on macOS/bash. The existing loader avoided UID/GID readonly crashes, but the source <(grep ...) form produced an empty sourced stream in this environment, so valid keys like HERMES_WEBUI_PORT were silently not loaded.

What Changed

  • Filter .env into a temporary file before sourcing it.
  • Keep filtering shell-readonly Docker keys: UID, GID, EUID, EGID, and PPID.
  • Preserve loading of all non-readonly keys.
  • Update the static test wording so it asserts the required contract instead of requiring process substitution specifically.
  • Update the changelog.

Why It Matters

start.sh is the documented local launcher. Users can reasonably expect .env overrides such as HERMES_WEBUI_PORT to work even when the same .env also contains Docker UID/GID entries.

Closes #2256.

Verification

  • bash -n start.sh
  • /Users/xuefusong/hermes-webui/.venv/bin/pytest tests/test_docker_env_readonly_vars.py -q
  • Direct bash reproduction of the extracted loader block with:
    • UID=501
    • GID=20
    • HERMES_WEBUI_PORT=8888
    • SOME_KEY=normal-value

The direct check printed PORT=8888, SOME=normal-value, and EXIT_OK.

Risks / Follow-ups

  • Low risk: the launcher still sources a filtered copy of the same .env; it only changes the transport from process substitution to a temp file.
  • The temp file is removed after successful sourcing. If the sourced .env itself has invalid shell syntax and exits early, a temp file may remain under ${TMPDIR:-/tmp}.

Model Used

OpenAI GPT-5 Codex. AI assistance was used for the quality scan, reproduction, patch, tests, and PR preparation.

@nesquena-hermes nesquena-hermes closed this pull request by merging all changes into nesquena:master in 18297f3 May 14, 2026
eleboucher pushed a commit to eleboucher/homelab that referenced this pull request May 14, 2026
… 0.51.62) (#470)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/nesquena/hermes-webui](https://github.com/nesquena/hermes-webui) | patch | `0.51.61` → `0.51.62` |

---

### Release Notes

<details>
<summary>nesquena/hermes-webui (ghcr.io/nesquena/hermes-webui)</summary>

### [`v0.51.62`](https://github.com/nesquena/hermes-webui/releases/tag/v0.51.62)

[Compare Source](nesquena/hermes-webui@v0.51.61...v0.51.62)

##### What's Changed

- stage-355: 11-PR full sweep batch — metadata-only cache hit fixes + skill detail fix + phone UX + escaping + display-title projection + RFC update + test fixture hardening by [@&#8203;nesquena-hermes](https://github.com/nesquena-hermes) in [#&#8203;2263](nesquena/hermes-webui#2263)
- Improve phone sidebar panel navigation by [@&#8203;franksong2702](https://github.com/franksong2702) in [#&#8203;2238](nesquena/hermes-webui#2238)
- fix: reconcile stale sidebar display titles by [@&#8203;dso2ng](https://github.com/dso2ng) in [#&#8203;2241](nesquena/hermes-webui#2241)
- Fix Archive Session for metadata-only cache hits by [@&#8203;franksong2702](https://github.com/franksong2702) in [#&#8203;2244](nesquena/hermes-webui#2244)
- Fix metadata-only cache hits in session mutation routes by [@&#8203;franksong2702](https://github.com/franksong2702) in [#&#8203;2249](nesquena/hermes-webui#2249)
- \[codex] Fix blank skill detail views by [@&#8203;franksong2702](https://github.com/franksong2702) in [#&#8203;2250](nesquena/hermes-webui#2250)
- docs(runtime): codify [#&#8203;1925](nesquena/hermes-webui#1925) adapter contract and migration gates by [@&#8203;franksong2702](https://github.com/franksong2702) in [#&#8203;2251](nesquena/hermes-webui#2251)
- \[codex] Show skill detail API errors by [@&#8203;franksong2702](https://github.com/franksong2702) in [#&#8203;2253](nesquena/hermes-webui#2253)
- \[codex] Escape model picker display text by [@&#8203;franksong2702](https://github.com/franksong2702) in [#&#8203;2255](nesquena/hermes-webui#2255)
- \[codex] Fix start.sh dotenv filtering load by [@&#8203;franksong2702](https://github.com/franksong2702) in [#&#8203;2257](nesquena/hermes-webui#2257)
- \[codex] Harden update-link git fixture by [@&#8203;franksong2702](https://github.com/franksong2702) in [#&#8203;2259](nesquena/hermes-webui#2259)

**Full Changelog**: <nesquena/hermes-webui@v0.51.61...v0.51.62>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/470
SysAdminDoc pushed a commit to SysAdminDoc/hermes-webui that referenced this pull request Jun 26, 2026
[codex] Fix start.sh dotenv filtering load (franksong2702)

# Conflicts:
#	CHANGELOG.md
bernyforce pushed a commit to bernyforce/hermes-webui that referenced this pull request Jul 29, 2026
[codex] Fix start.sh dotenv filtering load (franksong2702)

# Conflicts:
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(start): .env loader can filter UID/GID but fail to load remaining keys on macOS bash

2 participants