Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion nextcloud_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ fi
# Upgrade OS dependencies
export DEBIAN_FRONTEND=noninteractive ; apt-get dist-upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"

# Temporary fix for PHP 2024-08-27
# Temporary fix for PHP 2023-08-27
# There's a bug in PHP 8.1.21 which causes server to crash
# If you're on Ondrejs PPA, PHP isn't updated, so do that here instead
apt-mark unhold php* >/dev/null 2>&1
Expand Down Expand Up @@ -779,6 +779,23 @@ else
print_text_in_color "$IGreen" "Your apps are already up to date!"
fi

# Apply correct redirect rule to avoid security check errors
REDIRECTRULE="$(grep -r "\[R=301,L\]" $SITES_AVAILABLE | cut -d ":" -f1)"
if [ -n "$REDIRECTRULE" ]
then
# Change the redirect rule in all files in Apache available
mapfile -t REDIRECTRULE <<< "$REDIRECTRULE"
for rule in "${REDIRECTRULE[@]}"
do
sed -i "s|\[R=301,L\]|\[END,NE,R=permanent\]|g" "$rule"
done
# Restart Apache
if check_command apachectl configtest
then
restart_webserver
fi
fi

# Nextcloud 13 is required.
lowest_compatible_nc 13

Expand Down