Limit the scope of fixing permissions

Permissions should only be fixed for mutable data directories, not the Docker image itself.

v2: Change to only ignore node_modules
v3: Throw in some extra restrictions for static content that is part of
    the Docker image
v4: Include .config.js files in the list as necessary
pull/1142/head
Christopher Snowhill 8 months ago committed by Christopher Snowhill
parent 100e6f8174
commit 76e8cdf750
No known key found for this signature in database

@ -3,5 +3,5 @@ set -eu
# chown current working directory to current user
echo "[entrypoint] setup permission, this may take a while"
find . \! -user "$UID" -exec chown "$UID:$GID" '{}' + || echo "WARNING! Could not change directory ownership. If you manage permissions externally this is fine, otherwise you may experience issues when downloading or deleting videos."
find . \! -user "$UID" -and \( \! -path './node_modules*' -and \! -path './.npm*' -and \! -path './fix-scripts*' -and \! -path './public*' -and \! -path './*.js' -or -path './*.config.js' \) -exec chown "$UID:$GID" '{}' + || echo "WARNING! Could not change directory ownership. If you manage permissions externally this is fine, otherwise you may experience issues when downloading or deleting videos."
exec gosu "$UID:$GID" "$@"

Loading…
Cancel
Save