fix slow chown; add quotes

This commit is contained in:
Yannis Gerlach
2026-04-30 17:28:14 +02:00
parent a95484f4dd
commit 520d0d5139
+4 -4
View File
@@ -49,17 +49,17 @@ if [ "$(id -u)" = '0' ]; then
echo "-----> Setting PGVERSION=$PGVERSION PGBIN=$PGBIN PGCONF_FILE=$PGCONF_FILE"
export PATH="$PGBIN:$PATH"
mkdir -p $APP_DATA_PATH/{files,git,svn}
mkdir -p "$APP_DATA_PATH"/{files,git,svn}
# The $APP_DATA_PATH may be hosted on a NAS that creates snapshots (or a btrfs filesystem). In such a case, the .snapshot folder cannot be touched.
find $APP_DATA_PATH | grep -v .snapshot | xargs -n 1 chown $APP_USER:$APP_USER
find "$APP_DATA_PATH" -path '*/.snapshot*' -prune -o -exec chown "$APP_USER:$APP_USER" {} +
if [ -d /etc/apache2/sites-enabled ]; then
chown -R $APP_USER:$APP_USER /etc/apache2/sites-enabled
chown -R "$APP_USER:$APP_USER" /etc/apache2/sites-enabled
echo "OpenProject currently expects to be reached on the following domain: ${SERVER_NAME:=localhost}, which does not seem to be how your installation is configured." > /var/www/html/index.html
echo "If you are an administrator, please ensure you have correctly set the SERVER_NAME variable when launching your container." >> /var/www/html/index.html
fi
# Clean up any dangling PID file
rm -f $APP_PATH/tmp/pids/*
rm -f "$APP_PATH"/tmp/pids/*
# Clean up a dangling PID file of apache
if [ -e "$APACHE_PIDFILE" ]; then