attempt to make this work for podman and docker

This commit is contained in:
wander 2026-02-06 23:45:30 -05:00
parent e075e900cf
commit 115112552b

View file

@ -122,7 +122,15 @@ fi
# 4. Ownership Fix (Crucial for Docker volumes) # 4. Ownership Fix (Crucial for Docker volumes)
mkdir -p "$DATA_DIR/hidden_service/" mkdir -p "$DATA_DIR/hidden_service/"
chown -R tor:root "$DATA_DIR" # Ensure the current user owns the data directory (Fix for Podman/Docker permission mismatch)
if [ "$(id -u)" = "0" ]; then
chown -R tor:root "$DATA_DIR"
else
# Non-root (e.g. Podman rootless or user:1000), we just hope we have write access
# or that the volume was mounted with correct permissions.
# But let's try to be helpful if we are root-ish.
:
fi
chmod 700 "$DATA_DIR" chmod 700 "$DATA_DIR"
chmod 700 "$DATA_DIR/hidden_service/" chmod 700 "$DATA_DIR/hidden_service/"