attempt to make this work for podman and docker
This commit is contained in:
parent
e075e900cf
commit
115112552b
1 changed files with 9 additions and 1 deletions
|
|
@ -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/"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue