Fix and Update Nextcloud

- Harden Redis install
- Update Nextcloud to 19 (Fixes #193 )
- Update PHP to PHP74 (Fixes #193 )
- Fix nextcloud Admin password not presented/set correctly
- Remove PHP-Hash (included in base PHP now) (Fixes #193 )
- Remove PHP-WDDX (not available anymore for PHP74) (Fixes #193 )
This commit is contained in:
kjeld Schouten-Lebbing 2020-07-13 16:08:26 +02:00
parent d793671646
commit 53a3eaa742
No known key found for this signature in database
GPG Key ID: 4CDAD4A532BC1EDB
3 changed files with 10 additions and 9 deletions

View File

@ -1,3 +1,3 @@
blueprint: blueprint:
nextcloud: nextcloud:
pkgs: nano sudo redis php73-ctype gnupg php73-dom php73-gd php73-iconv php73-json php73-mbstring php73-posix php73-simplexml php73-xmlreader php73-xmlwriter php73-zip php73-zlib php73-hash php73-xml php73 php73-pecl-redis php73-session php73-wddx php73-xsl php73-filter php73-pecl-APCu php73-curl php73-fileinfo php73-bz2 php73-intl php73-openssl php73-ldap php73-ftp php73-imap php73-exif php73-gmp php73-pecl-memcache php73-pecl-imagick php73-pecl-smbclient perl5 p5-Locale-gettext help2man texinfo m4 autoconf php73-opcache php73-pcntl php73-bcmath php73-pecl-APCu pkgs: nano sudo redis php74-ctype gnupg php74-dom php74-gd php74-iconv php74-json php74-mbstring php74-posix php74-simplexml php74-xmlreader php74-xmlwriter php74-zip php74-zlib php74-xml php74 php74-pecl-redis php74-session php74-xsl php74-filter php74-pecl-APCu php74-curl php74-fileinfo php74-bz2 php74-intl php74-openssl php74-ldap php74-ftp php74-imap php74-exif php74-gmp php74-pecl-memcache php74-pecl-imagick php74-pecl-smbclient perl5 p5-Locale-gettext help2man texinfo m4 autoconf php74-opcache php74-pcntl php74-bcmath php74-pecl-APCu

View File

@ -98,8 +98,8 @@ tcp-backlog 511
# incoming connections. There is no default, so Redis will not listen # incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified. # on a unix socket when not specified.
# #
unixsocket /tmp/redis.sock unixsocket /var/run/redis/redis.sock
unixsocketperm 777 unixsocketperm 770
# Close the connection after a client is idle for N seconds (0 to disable) # Close the connection after a client is idle for N seconds (0 to disable)
timeout 0 timeout 0

View File

@ -50,7 +50,7 @@ if [ -z "${JAIL_IP}" ]; then
exit 1 exit 1
fi fi
if [ -z "${ADMIN_PASSWORD}" ]; then if [ -z "${!ADMIN_PASSWORD}" ]; then
echo 'Configuration error: The Nextcloud jail requires a admin_password' echo 'Configuration error: The Nextcloud jail requires a admin_password'
echo 'Please reinstall using a fixed IP adress' echo 'Please reinstall using a fixed IP adress'
exit 1 exit 1
@ -130,7 +130,7 @@ iocage exec "${1}" chmod -R 770 /config/files
##### #####
if [ "${DB_TYPE}" = "mariadb" ]; then if [ "${DB_TYPE}" = "mariadb" ]; then
iocage exec "${1}" pkg install -qy mariadb103-client php73-pdo_mysql php73-mysqli iocage exec "${1}" pkg install -qy mariadb104-client php74-pdo_mysql php74-mysqli
fi fi
fetch -o /tmp https://getcaddy.com fetch -o /tmp https://getcaddy.com
@ -150,7 +150,7 @@ iocage exec "${1}" sysrc php_fpm_enable="YES"
# #
##### #####
FILE="latest-18.tar.bz2" FILE="latest-19.tar.bz2"
if ! iocage exec "${1}" fetch -o /tmp https://download.nextcloud.com/server/releases/"${FILE}" https://download.nextcloud.com/server/releases/"${FILE}".asc https://nextcloud.com/nextcloud.asc if ! iocage exec "${1}" fetch -o /tmp https://download.nextcloud.com/server/releases/"${FILE}" https://download.nextcloud.com/server/releases/"${FILE}".asc https://nextcloud.com/nextcloud.asc
then then
echo "Failed to download Nextcloud" echo "Failed to download Nextcloud"
@ -165,6 +165,7 @@ then
fi fi
iocage exec "${1}" tar xjf /tmp/"${FILE}" -C /usr/local/www/ iocage exec "${1}" tar xjf /tmp/"${FILE}" -C /usr/local/www/
iocage exec "${1}" chown -R www:www /usr/local/www/nextcloud/ iocage exec "${1}" chown -R www:www /usr/local/www/nextcloud/
iocage exec "${1}" pw usermod www -G redis
# Generate and install self-signed cert, if necessary # Generate and install self-signed cert, if necessary
@ -231,7 +232,7 @@ else
# Save passwords for later reference # Save passwords for later reference
iocage exec "${1}" echo "${DB_NAME} root password is ${DB_ROOT_PASSWORD}" > /root/"${1}"_db_password.txt iocage exec "${1}" echo "${DB_NAME} root password is ${DB_ROOT_PASSWORD}" > /root/"${1}"_db_password.txt
iocage exec "${1}" echo "Nextcloud database password is ${!DB_PASSWORD}" >> /root/"${1}"_db_password.txt iocage exec "${1}" echo "Nextcloud database password is ${!DB_PASSWORD}" >> /root/"${1}"_db_password.txt
iocage exec "${1}" echo "Nextcloud Administrator password is ${ADMIN_PASSWORD}" >> /root/"${1}"_db_password.txt iocage exec "${1}" echo "Nextcloud Administrator password is ${!ADMIN_PASSWORD}" >> /root/"${1}"_db_password.txt
# CLI installation and configuration of Nextcloud # CLI installation and configuration of Nextcloud
if [ "${DB_TYPE}" = "mariadb" ]; then if [ "${DB_TYPE}" = "mariadb" ]; then
@ -246,7 +247,7 @@ else
iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set loglevel --value="2"' iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set loglevel --value="2"'
iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set logrotate_size --value="104847600"' iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set logrotate_size --value="104847600"'
iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"' iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"'
iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis host --value="/tmp/redis.sock"' iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis host --value="/var/run/redis/redis.sock"'
iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis port --value=0 --type=integer' iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis port --value=0 --type=integer'
iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.locking --value="\OC\Memcache\Redis"' iocage exec "${1}" su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.locking --value="\OC\Memcache\Redis"'
iocage exec "${1}" su -m www -c "php /usr/local/www/nextcloud/occ config:system:set overwritehost --value=\"${!HOST_NAME}\"" iocage exec "${1}" su -m www -c "php /usr/local/www/nextcloud/occ config:system:set overwritehost --value=\"${!HOST_NAME}\""
@ -287,7 +288,7 @@ if [ "${REINSTALL}" == "true" ]; then
echo "You did a reinstall, please use your old database and account credentials" echo "You did a reinstall, please use your old database and account credentials"
else else
echo "Default user is admin, password is ${ADMIN_PASSWORD}" echo "Default user is admin, password is ${!ADMIN_PASSWORD}"
echo "" echo ""
echo "Database Information" echo "Database Information"