fix(config): use 0o701 for HERMES_HOME to allow web server traversal#7003
Closed
mvanhorn wants to merge 2 commits into
Closed
fix(config): use 0o701 for HERMES_HOME to allow web server traversal#7003mvanhorn wants to merge 2 commits into
mvanhorn wants to merge 2 commits into
Conversation
HERMES_HOME was set to 0o700 on every gateway startup, which strips the other-execute bit needed by web servers (nginx, caddy) to traverse into served subdirectories. Changed to 0o701 for the top-level directory only - subdirectories (cron, sessions, logs, memories) remain 0o700. The execute-only bit on a directory allows cd-through but not listing, which is the standard Unix pattern for web-serving parent directories. Fixes NousResearch#6991
The existing test expected 0o700 for HERMES_HOME. Updated to match the new 0o701 behavior while keeping 0o700 for subdirs.
1 task
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Changes
ensure_hermes_home()to set HERMES_HOME to0o701instead of0o700. This preserves owner-only read/write on the directory while allowing other users (likewww-data) to traverse it. Subdirectories (cron,sessions,logs,memories) remain at0o700.Related Issue
Fixes #6991
Type of Change
Changes Made
hermes_cli/config.py: Replaced_secure_dir(home)call inensure_hermes_home()with directos.chmod(home, 0o701), using the sametry/exceptpattern. Subdirectories still use_secure_dir()(0o700).tests/hermes_cli/test_config.py: Addedtest_permissions_home_701_and_subdirs_700verifying the permission split.tests/cron/test_file_permissions.py: Updated existing permission test to expect 0o701 for home.How to Test
~/.hermes/(e.g.,alias /home/user/.hermes/reports/;)ls -lad ~/.hermesshowsdrwx-----x(0o701)ls -lad ~/.hermes/sessionsshowsdrwx------(0o700)Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AAware of related PRs #6993 and #6994 which take a different approach (env var override). This PR takes the simpler path of changing the default, since
0o701(execute-only for others) is the standard Unix pattern for web-serving parent directories and doesn't require configuration.This contribution was developed with AI assistance (Codex).