Skip to content

Commit

Permalink
v8.11
Browse files Browse the repository at this point in the history
- DietPi-Software | Nextcloud: Re-enabled the install option for ARMv6/ARMv7 systems. Nextcloud 25 is the last version which supports 32-bit systems, so be aware that you will not receive major version upgrades anymore if you do not use 64-bit hardware with an ARMv8/64-bit image. Many thanks to @PaulPink for bringing up the topic: #5888
  • Loading branch information
MichaIng committed Nov 18, 2022
1 parent 1f5cde2 commit 450c613
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Enhancements:
- DietPi-Software | Grafana: For ARMv6 RPi models, RPi 1 and Zero (1), bumped version to latest stable v9.2.4, update via reinstall: dietpi-software reinstall 77
- DietPi-Software | Grafana: Updated the APT list to use the new repository: https://grafana.com/docs/grafana/latest/setup-grafana/installation/debian/#repository-migration-november-8th-2022
- DietPi-Software | Webservers: The strict dependency on PHP has been removed. It is hence now possible to install any webserver via dietpi-software without having PHP installed forcefully as well. This became required for Homer, which is a purely static webpage.
- DietPi-Software | Nextcloud: Re-enabled the install option for ARMv6/ARMv7 systems. Nextcloud 25 is the last version which supports 32-bit systems, so be aware that you will not receive major version upgrades anymore if you do not use 64-bit hardware with an ARMv8/64-bit image. Many thanks to @PaulPink for bringing up the topic: https://github.com/MichaIng/DietPi/issues/5888

Bug fixes:
- ROCK 3A | Resolved an issue where the image wouldn't boot because of a wrong filesystem UUID.
Expand Down
63 changes: 35 additions & 28 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -4509,27 +4509,21 @@ _EOF_
Banner_Installing
aDEPS=("php$PHP_VERSION-intl") # https://doc.owncloud.com/server/next/admin_manual/installation/manual_installation/manual_installation_prerequisites.html#php-extensions

if [[ -f '/var/www/owncloud/occ' ]]; then

if [[ -f '/var/www/owncloud/occ' ]]
then
G_DIETPI-NOTIFY 2 'Existing ownCloud installation found, will NOT overwrite...'

else

local datadir=$(sed -n '/^[[:blank:]]*SOFTWARE_OWNCLOUD_DATADIR=/{s/^[^=]*=//p;q}' /boot/dietpi.txt | sed 's|/$||')
local datadir=$(sed -n '/^[[:blank:]]*SOFTWARE_OWNCLOUD_DATADIR=/{s/^[^=]*=//;s|/$||;p;q}' /boot/dietpi.txt)
[[ $datadir ]] || datadir='/mnt/dietpi_userdata/owncloud_data'
if [[ -f $datadir/dietpi-owncloud-installation-backup/occ ]]; then

if [[ -f $datadir/dietpi-owncloud-installation-backup/occ ]]
then
G_DIETPI-NOTIFY 2 'ownCloud installation backup found, starting recovery...'
G_EXEC cp -a "$datadir/dietpi-owncloud-installation-backup/." /var/www/owncloud/
# Correct config.php data directory entry, in case it changed due to server migration:
G_CONFIG_INJECT "'datadirectory'" "'datadirectory' => '$datadir'," /var/www/owncloud/config/config.php "'dbtype'"

else

Download_Install 'https://download.owncloud.com/server/stable/owncloud-latest.tar.bz2' /var/www

fi

fi

[[ ${aDEPS[0]} ]] && { G_DIETPI-NOTIFY 2 'Installing required PHP modules'; G_AGI "${aDEPS[@]}"; aDEPS=(); }
Expand Down Expand Up @@ -4622,7 +4616,7 @@ location = /.well-known/caldav { return 301 /owncloud/remote.php/dav/; }' > /et

fi

# Start MariaDB and Redis (required for reinstalls) for database creation and occ command
# Start MariaDB and Redis (for reinstalls) for database creation and occ command
G_EXEC systemctl restart mariadb
G_EXEC systemctl restart redis-server

Expand Down Expand Up @@ -4736,7 +4730,7 @@ The install script will now exit. After applying one of the the above, rerun die
GCI_PRESERVE=1 GCI_NEWLINE=1 G_CONFIG_INJECT "'memcache.locking'" "'memcache.locking' => '\\\\OC\\\\Memcache\\\\Redis',\n'redis' => array ('host' => '$redis_sock', 'port' => 0,)," "$config_php" "'filelocking.enabled'"

# Enable ownCloud background cron job:
crontab -u www-data -l 2> /dev/null | grep -q '/var/www/owncloud/.*cron' || ( crontab -u www-data -l 2> /dev/null ; echo '*/15 * * * * php /var/www/owncloud/occ system:cron' ) | crontab -u www-data -
crontab -u www-data -l 2> /dev/null | grep -q '/var/www/owncloud/.*cron' || { crontab -u www-data -l 2> /dev/null; echo '*/15 * * * * php /var/www/owncloud/occ system:cron'; } | crontab -u www-data -
occ background:cron

# On <1 GiB devices assure at least 512 MiB swap space are available to stand 512 MiB file uploads + increased PHP cache and session file usage: https://github.com/MichaIng/DietPi/issues/2293
Expand All @@ -4750,30 +4744,43 @@ The install script will now exit. After applying one of the the above, rerun die
Banner_Installing
aDEPS=("php$PHP_VERSION-intl") # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation

if [[ -f '/var/www/nextcloud/occ' ]]; then

if [[ -f '/var/www/nextcloud/occ' ]]
then
G_DIETPI-NOTIFY 2 'Existing Nextcloud installation found, will NOT overwrite...'

else

local datadir=$(sed -n '/^[[:blank:]]*SOFTWARE_NEXTCLOUD_DATADIR=/{s/^[^=]*=//p;q}' /boot/dietpi.txt | sed 's|/$||')
local datadir=$(sed -n '/^[[:blank:]]*SOFTWARE_NEXTCLOUD_DATADIR=/{s/^[^=]*=//;s|/$||;p;q}' /boot/dietpi.txt)
[[ $datadir ]] || datadir='/mnt/dietpi_userdata/nextcloud_data'
if [[ -f $datadir/dietpi-nextcloud-installation-backup/occ ]]; then

if [[ -f $datadir/dietpi-nextcloud-installation-backup/occ ]]
then
G_DIETPI-NOTIFY 2 'Nextcloud installation backup found, starting recovery...'
G_EXEC cp -a "$datadir/dietpi-nextcloud-installation-backup/." /var/www/nextcloud/
# Correct config.php data directory entry, in case it changed due to server migration:
G_CONFIG_INJECT "'datadirectory'" "'datadirectory' => '$datadir'," /var/www/nextcloud/config/config.php "'dbtype'"

else

# Nextcloud 24 won't support PHP7.3 anymore: https://github.com/nextcloud/server/pull/29286
local version='latest'
(( $G_DISTRO > 5 )) || version='latest-23'
# Nextcloud 24 won't support PHP7.3 anymore: https://github.com/nextcloud/server/pull/29286
if (( $G_DISTRO < 6 ))
then
G_DIETPI-NOTIFY 2 'Downloading latest Nextcloud 23, since Nextcloud 24 does not support PHP7.3 anymore'
version='latest-23'
# Nextcloud 26 won't support 32-bit anymore: https://github.com/MichaIng/DietPi/issues/5888
elif [[ $G_HW_ARCH == [12] ]]
then
G_DIETPI-NOTIFY 2 'Downloading latest Nextcloud 25, since Nextcloud 26 does not support 32-bit anymore'
version='latest-25'
if grep -q 'self::SIZE_PROPERTYNAME, function () use ($node): ?int' /var/www/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php
then
G_WHIP_MSG '[WARNING] Patching Nextcloud v25.0.1 for 32-bit support
\nNextcloud 25 accidentally broke 32-bit support. It is however meant to be the last version supporting 32-bit, not the first dropping it.
\nNextcloud 25.0.2 will fix this, and since it has not been released yet, we will patch your instance beforehand. This can lead to integrity check errors on the Nextcloud admin panel in the following file:
- /var/www/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php
\nMore info: https://github.com/nextcloud/server/pull/34905'
G_EXEC sed -i 's/self::SIZE_PROPERTYNAME, function () use ($node): ?int/self::SIZE_PROPERTYNAME, function () use ($node)/' /var/www/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php
fi
fi
Download_Install "https://download.nextcloud.com/server/releases/$version.tar.bz2" /var/www

fi

fi

[[ ${aDEPS[0]} ]] && { G_DIETPI-NOTIFY 2 'Installing required PHP modules'; G_AGI "${aDEPS[@]}"; aDEPS=(); }
Expand Down Expand Up @@ -4869,7 +4876,7 @@ location = /.well-known/caldav { return 301 /nextcloud/remote.php/dav/; }' > /e

fi

# Start MariaDB and Redis (required for reinstalls) for database creation and ncc command
# Start MariaDB and Redis (for reinstalls) for database creation and ncc command
G_EXEC systemctl restart mariadb
G_EXEC systemctl restart redis-server

Expand Down Expand Up @@ -4992,12 +4999,12 @@ The install script will now exit. After applying one of the the above, rerun die
# Tweak Argon2 hashing
# - Use all available CPU threads
GCI_PRESERVE=1 G_CONFIG_INJECT "'hashingThreads'" "'hashingThreads' => ${G_HW_CPU_CORES}," "$config_php" "'version'"
# - ToDo: Configure the other settings after getting some clarifications: https://github.com/nextcloud/server/pull/19023#issuecomment-660071524
# - ToDo: Configure the other settings after getting some clarification: https://github.com/nextcloud/server/pull/19023#issuecomment-660071524
#GCI_PRESERVE=1 G_CONFIG_INJECT "'hashingMemoryCost'" "'hashingMemoryCost' => 65536," $config_php "'hashingThreads'"
#GCI_PRESERVE=1 G_CONFIG_INJECT "'hashingTimeCost'" "'hashingTimeCost' => 4," $config_php "'hashingMemoryCost'"

# Enable Nextcloud background cron job: https://docs.nextcloud.com/server/17/admin_manual/configuration_server/background_jobs_configuration.html#cron
crontab -u www-data -l 2> /dev/null | grep -q '/var/www/nextcloud/cron.php' || ( crontab -u www-data -l 2> /dev/null ; echo '*/5 * * * * php /var/www/nextcloud/cron.php' ) | crontab -u www-data -
crontab -u www-data -l 2> /dev/null | grep -q '/var/www/nextcloud/cron.php' || { crontab -u www-data -l 2> /dev/null; echo '*/5 * * * * php /var/www/nextcloud/cron.php'; } | crontab -u www-data -
ncc background:cron

# Convert filecache table to bigint, which is not done automatically by Nextcloud since v15
Expand Down

0 comments on commit 450c613

Please sign in to comment.