diff --git a/assets/entrypoint.sh b/assets/entrypoint.sh index 5d2aff0..d924a65 100755 --- a/assets/entrypoint.sh +++ b/assets/entrypoint.sh @@ -122,7 +122,15 @@ fi # 4. Ownership Fix (Crucial for Docker volumes) 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/hidden_service/"