mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-17 09:41:58 +00:00
fix(dashboard): keep local file browser on home
This commit is contained in:
parent
16fb573bae
commit
d206e1f51d
2 changed files with 33 additions and 1 deletions
|
|
@ -1230,7 +1230,12 @@ def _managed_files_policy(request: Request, *, create_root: bool = True) -> Mana
|
|||
root = _ensure_managed_root(raw_forced_root) if create_root else _canonical_path(Path(raw_forced_root))
|
||||
return ManagedFilesPolicy(default_path=root, locked_root=root, can_change_path=False)
|
||||
|
||||
if not _local_dashboard_request(request) or _default_hermes_root_is_opt_data():
|
||||
# Remote/OAuth access does not imply a hosted container. Users can expose a
|
||||
# local dashboard through the auth gate (for example a macOS launchd install)
|
||||
# and still expect the Files page to browse their local home directory. Lock
|
||||
# to /opt/data only when the installation's Hermes root is actually /opt/data
|
||||
# (the container/hosted layout) or when HERMES_DASHBOARD_FILES_ROOT is set.
|
||||
if _default_hermes_root_is_opt_data():
|
||||
root = _ensure_managed_root(_HOSTED_MANAGED_FILES_ROOT) if create_root else _HOSTED_MANAGED_FILES_ROOT
|
||||
return ManagedFilesPolicy(default_path=root, locked_root=root, can_change_path=False)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue