Bartok
740fb28d02
fix(config): chown ensure_hermes_home dirs to HERMES_UID/GID in Docker ( #34107 ) ( #34268 )
...
Fixes #34107 . When Hermes runs in Docker with HERMES_UID=1000 /
HERMES_GID=911, the entrypoint chowns the top-level HERMES_HOME once
at startup — but subdirectories created at runtime by
ensure_hermes_home() (especially for profile namespaces under
profiles/<name>/ spawned by kanban workers) were landing as root:root
and blocking subsequent uid-mapped worker invocations with:
PermissionError: [Errno 13] Permission denied:
'/opt/data/profiles/charles/logs/curator'
Fix: add _resolve_hermes_uid_gid + _chown_to_hermes_uid helpers that
read the env vars and apply chown after mkdir. Invoke from _secure_dir
which already runs after every directory creation in the home-init path,
so all newly-created subdirs (including the profile namespaces) get the
right ownership.
Safety properties:
- No-op when HERMES_UID/HERMES_GID unset (the dominant non-Docker path)
- No-op on Windows (os.chown doesn't exist; AttributeError swallowed)
- No-op when running as non-root (EPERM swallowed — the entrypoint's
startup chown -R picks it up on next restart, and in most cases the
dir was already correctly-owned by the calling user)
- Uses -1 sentinel for missing field so only the set value applies
- Empty-string env vars treated as unset
Adds 14 tests across:
- TestResolveHermesUidGid (7) — env-var parsing
- TestChownToHermesUid (5) — chown helper invariants
- TestSecureDirChown (2) — end-to-end through _secure_dir
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-01 13:27:30 +10:00
..
2026-02-26 03:20:08 +03:00
2026-05-27 02:12:27 -07:00
2026-05-19 11:10:51 -07:00
2026-05-28 22:26:25 -07:00
2026-05-25 01:20:33 -07:00
2026-04-07 17:19:07 -07:00
2026-05-28 22:26:25 -07:00
2026-04-26 05:43:31 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 00:43:32 -07:00
2026-05-28 22:26:25 -07:00
2026-04-21 14:31:48 -05:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 02:24:48 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 05:47:30 -07:00
2026-05-29 02:24:48 -07:00
2026-05-27 09:38:58 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-04-24 03:00:33 -07:00
2026-05-08 14:27:40 -07:00
2026-05-24 04:25:32 -07:00
2026-05-19 14:51:21 -07:00
2026-05-18 20:01:34 -07:00
2026-05-18 10:14:38 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 13:22:54 -07:00
2026-05-28 15:14:05 +10:00
2026-05-15 14:45:43 -07:00
2026-05-28 22:26:25 -07:00
2026-04-23 23:28:34 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 15:14:05 +10:00
2026-05-28 22:26:25 -07:00
2026-04-09 16:24:53 -07:00
2026-04-29 23:18:55 -07:00
2026-05-28 22:26:25 -07:00
2026-05-25 01:20:33 -07:00
2026-05-28 15:50:25 +10:00
2026-05-31 17:46:56 -05:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 12:16:15 -07:00
2026-05-28 22:26:25 -07:00
2026-05-17 02:29:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-13 09:34:15 -07:00
2026-04-21 14:23:45 -07:00
2026-05-28 22:26:25 -07:00
2026-04-17 19:03:26 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-04-29 23:18:55 -07:00
2026-06-01 11:28:56 +10:00
2026-05-28 22:26:25 -07:00
2026-04-28 01:18:09 -07:00
2026-04-24 05:09:08 -07:00
2026-05-29 23:45:05 -07:00
2026-04-24 05:09:08 -07:00
2026-05-18 17:39:50 +00:00
2026-05-28 22:26:25 -07:00
2026-05-09 18:43:40 -07:00
2026-05-07 05:27:47 -07:00
2026-05-07 05:27:47 -07:00
2026-05-31 13:59:56 +05:30
2026-05-28 22:26:25 -07:00
2026-04-25 18:47:53 -07:00
2026-05-31 03:19:37 -07:00
2026-05-29 12:17:12 +10:00
2026-05-27 02:12:27 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 02:12:27 -07:00
2026-05-29 12:17:12 +10:00
2026-05-27 02:12:27 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 02:12:27 -07:00
2026-05-29 12:17:12 +10:00
2026-05-27 02:12:27 -07:00
2026-05-31 17:46:56 -05:00
2026-05-27 02:12:27 -07:00
2026-04-30 06:43:22 -04:00
2026-05-28 22:26:25 -07:00
2026-05-12 13:59:22 -04:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-09 11:04:46 -07:00
2026-04-20 22:14:29 -07:00
2026-04-20 22:14:29 -07:00
2026-04-17 05:08:07 -07:00
2026-05-03 03:25:45 -07:00
2026-05-28 22:26:25 -07:00
2026-05-09 13:36:33 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 15:14:05 +10:00
2026-06-01 13:27:30 +10:00
2026-05-13 18:40:14 -07:00
2026-05-28 22:26:25 -07:00
2026-05-04 15:31:15 -04:00
2026-05-28 22:26:25 -07:00
2026-04-09 16:24:53 -07:00
2026-05-28 22:26:25 -07:00
2026-05-09 17:54:17 -07:00
2026-05-30 23:05:56 -07:00
2026-03-14 12:11:23 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 12:36:59 -07:00
2026-05-28 03:25:32 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 17:46:56 -05:00
2026-04-24 04:46:17 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 23:45:05 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 01:23:06 -07:00
2026-05-31 17:46:56 -05:00
2026-05-28 22:26:25 -07:00
2026-04-29 20:33:29 -07:00
2026-05-28 00:19:31 -07:00
2026-05-21 19:17:45 -07:00
2026-05-31 17:46:56 -05:00
2026-05-28 22:26:25 -07:00
2026-05-30 01:40:57 -07:00
2026-05-18 20:17:10 -07:00
2026-05-28 21:00:46 -07:00
2026-05-18 21:33:08 -07:00
2026-05-28 22:26:25 -07:00
2026-05-30 01:40:49 -07:00
2026-05-30 01:40:57 -07:00
2026-05-18 09:40:44 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 19:02:55 -07:00
2026-05-18 20:47:01 -07:00
2026-05-31 01:16:33 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 19:02:55 -07:00
2026-05-23 23:10:36 -07:00
2026-05-07 13:04:41 -07:00
2026-05-07 13:04:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 17:50:42 -07:00
2026-03-29 21:54:36 -07:00
2026-05-06 03:50:59 -07:00
2026-05-31 17:46:56 -05:00
2026-05-19 01:28:32 -07:00
2026-05-07 05:17:03 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 12:32:19 -07:00
2026-05-28 22:26:25 -07:00
2026-05-30 07:45:26 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 22:29:48 -07:00
2026-05-20 09:18:23 -07:00
2026-05-31 17:46:56 -05:00
2026-05-28 22:26:25 -07:00
2026-04-17 06:33:21 -07:00
2026-05-31 03:19:37 -07:00
2026-04-25 18:47:53 -07:00
2026-04-16 01:16:14 -07:00
2026-05-29 12:32:35 -07:00
2026-04-24 04:58:46 -07:00
2026-04-08 19:58:16 -07:00
2026-05-29 23:45:05 -07:00
2026-05-28 22:26:25 -07:00
2026-05-30 20:57:01 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 00:19:31 -07:00
2026-05-13 18:40:14 -07:00
2026-04-13 04:33:52 -07:00
2026-05-29 02:24:48 -07:00
2026-06-01 06:32:48 +05:30
2026-05-28 22:26:25 -07:00
2026-05-29 23:45:05 -07:00
2026-05-09 23:17:25 -07:00
2026-05-06 09:08:33 -07:00
2026-05-17 02:29:41 -07:00
2026-04-21 05:19:43 -07:00
2026-05-28 22:26:25 -07:00
2026-03-16 06:07:45 -07:00
2026-05-05 04:37:47 -07:00
2026-05-30 00:22:46 -07:00
2026-03-14 10:35:14 -07:00
2026-05-23 17:49:47 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 00:59:42 -07:00
2026-05-31 17:46:56 -05:00
2026-05-25 01:41:19 -07:00
2026-05-24 18:04:54 -07:00
2026-05-28 22:26:25 -07:00
2026-05-09 13:02:25 -07:00
2026-05-17 13:54:12 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-24 18:07:47 -07:00
2026-05-29 22:29:48 -07:00
2026-05-28 22:26:25 -07:00
2026-05-25 01:20:33 -07:00
2026-05-30 02:53:42 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 15:02:26 -07:00
2026-05-29 02:24:48 -07:00
2026-05-28 02:36:09 -07:00
2026-05-21 16:40:04 +05:30
2026-05-31 03:19:37 -07:00
2026-05-07 05:10:33 -07:00
2026-05-28 22:26:25 -07:00
2026-05-08 14:27:40 -07:00
2026-04-27 08:52:12 -07:00
2026-05-28 03:34:47 -07:00
2026-05-29 12:32:35 -07:00
2026-05-25 01:20:33 -07:00
2026-05-12 01:02:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-10 13:06:25 -07:00
2026-05-28 22:26:25 -07:00
2026-04-26 18:31:07 -07:00
2026-05-28 22:26:25 -07:00
2026-05-02 02:08:06 -07:00
2026-05-15 10:36:38 +05:30
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 03:19:37 -07:00
2026-05-31 09:13:06 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-19 01:28:32 -07:00
2026-05-25 01:20:33 -07:00
2026-05-31 09:13:06 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 11:59:58 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 04:53:13 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-08 17:01:12 -07:00
2026-05-07 05:53:14 -07:00
2026-05-08 16:07:23 -07:00
2026-05-29 22:26:24 +05:30
2026-05-28 00:19:31 -07:00
2026-05-28 22:26:25 -07:00
2026-03-30 11:17:15 -07:00
2026-05-28 22:26:25 -07:00
2026-05-08 11:18:14 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 03:19:37 -07:00
2026-05-25 01:47:55 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 17:46:56 -05:00
2026-03-26 13:39:41 -07:00
2026-05-24 18:04:54 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 22:03:45 -05:00
2026-05-22 00:16:52 -05:00
2026-05-30 07:31:48 -07:00
2026-05-29 17:24:38 -07:00
2026-05-14 14:28:14 -07:00
2026-05-29 13:30:28 -07:00
2026-05-30 02:38:40 -07:00
2026-04-19 22:43:09 -07:00
2026-05-28 22:26:25 -07:00
2026-05-19 03:01:02 -07:00
2026-05-28 22:26:25 -07:00
2026-05-08 14:55:40 -07:00
2026-05-28 22:26:25 -07:00
2026-04-30 19:44:26 -07:00
2026-05-30 02:08:11 -07:00
2026-05-15 12:11:32 -07:00
2026-05-06 15:49:59 -07:00
2026-05-29 02:24:48 -07:00
2026-05-25 01:15:24 -07:00
2026-05-24 15:00:44 -07:00
2026-05-24 17:47:24 -07:00
2026-05-31 17:46:56 -05:00
2026-05-31 17:46:56 -05:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-17 12:35:01 -07:00
2026-05-24 18:12:16 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00