Skip to content

fix: set HOME for profile gateway services - #33370

Closed
akropp wants to merge 1 commit into
NousResearch:mainfrom
akropp:fix/s6-profile-gateway-home
Closed

fix: set HOME for profile gateway services#33370
akropp wants to merge 1 commit into
NousResearch:mainfrom
akropp:fix/s6-profile-gateway-home

Conversation

@akropp

@akropp akropp commented May 27, 2026

Copy link
Copy Markdown

Summary

  • Set HOME from HERMES_HOME in generated profile gateway s6 run scripts
  • Keep profile gateway services from inheriting /root as HOME after s6-setuidgid drops to the hermes user
  • Add test coverage for the generated run script

Why

When a per-profile gateway runs under s6 in the Docker container, the generated service script drops privileges with s6-setuidgid hermes but can still inherit HOME=/root. Code paths that resolve state/cache paths through Path.home() or XDG defaults may then attempt to write under /root, causing permission errors for the hermes user. The container main wrapper already normalizes HOME; profile gateway service scripts should do the same.

Test Plan

  • python -m pytest tests/hermes_cli/test_service_manager.py -q
  • python -m ruff check hermes_cli/service_manager.py tests/hermes_cli/test_service_manager.py

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists area/docker Docker image, Compose, packaging comp/cli CLI entry point, hermes_cli/, setup wizard labels May 27, 2026
@benbarclay

Copy link
Copy Markdown
Collaborator

Thanks for the catch — #33481 lands the same HOME reset for profile gateway services and extends it to the dashboard service (docker/s6-rc.d/dashboard/run) which has the identical issue. #33481 includes regression tests for both paths and merged as c341a2d. Closing this one in favor of it; full credit to you for spotting the gateway side first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docker Docker image, Compose, packaging comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants