Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,18 @@ if [ "$(id -u)" = "0" ]; then
# In rootless Podman the container's "root" is mapped to an unprivileged
# host UID — chown will fail. That's fine: the volume is already owned
# by the mapped user on the host side.
chown -R hermes:hermes "$HERMES_HOME" 2>/dev/null || \
echo "Warning: chown failed (rootless container?) — continuing anyway"
#
# WARNING: Do NOT use `chown -R` on the entire HERMES_HOME volume.
# That would recursively change every file in the mounted host directory,
# potentially destroying host-side file ownership (see issue #19788).
# Instead, fix only the top-level directory and the specific subdirectories
# that hermes actually writes to at runtime.
chown hermes:hermes "$HERMES_HOME" 2>/dev/null || true
for subdir in cron sessions logs hooks memories skills skins plans workspace home; do
mkdir -p "$HERMES_HOME/$subdir"
chown hermes:hermes "$HERMES_HOME/$subdir" 2>/dev/null || true
done
echo "Ownership fix complete (non-recursive)"
fi

# Ensure config.yaml is readable by the hermes runtime user even if it was
Expand Down