From 5d0616d8bad4a9589e5f004c80afd9f21f42bd6d Mon Sep 17 00:00:00 2001 From: Michael Reid Date: Sat, 19 Oct 2024 10:01:37 -0400 Subject: [PATCH] ownCloud: Revision for v10.15.0 (#6280) * Add PHP settings * Refresh PHP extensions * Refine database setup and install wizard --- spk/owncloud/Makefile | 2 +- spk/owncloud/src/conf/resource | 12 +++++-- spk/owncloud/src/service-setup.sh | 11 ++++--- spk/owncloud/src/web/owncloud.json | 12 +++++-- .../src/wizard_templates/install_uifile.sh | 31 ++++++++++++++++++- .../src/wizard_templates/install_uifile.yml | 6 +++- .../wizard_templates/install_uifile_fre.yml | 6 +++- 7 files changed, 68 insertions(+), 12 deletions(-) diff --git a/spk/owncloud/Makefile b/spk/owncloud/Makefile index 9d3a05b7b99..cf5c17ed30a 100644 --- a/spk/owncloud/Makefile +++ b/spk/owncloud/Makefile @@ -1,6 +1,6 @@ SPK_NAME = owncloud SPK_VERS = 10.15.0 -SPK_REV = 19 +SPK_REV = 20 SPK_ICON = src/owncloud.png DEPENDS = cross/owncloud diff --git a/spk/owncloud/src/conf/resource b/spk/owncloud/src/conf/resource index 67a132e6fc4..1d302ba5e0a 100644 --- a/spk/owncloud/src/conf/resource +++ b/spk/owncloud/src/conf/resource @@ -29,9 +29,11 @@ "backend": 8, "connect_timeout": 120, "extensions": [ - "bcmath", + "apcu", "bz2", "curl", + "exif", + "ftp", "gd", "gmp", "iconv", @@ -39,14 +41,20 @@ "imap", "intl", "ldap", + "memcached", "openssl", "pdo_mysql", + "phar", + "posix", "redis", - "ssh2", "zip", "zlib" ], "group": "http", + "php_settings": { + "error_log": "/var/services/web_packages/owncloud/php_errors.log", + "pdo_mysql.default_socket": "/run/mysqld/mysqld10.sock" + }, "profile_desc": "PHP Profile for ownCloud", "profile_name": "ownCloud Profile", "user": "sc-owncloud" diff --git a/spk/owncloud/src/service-setup.sh b/spk/owncloud/src/service-setup.sh index df1d0a38328..03cc1356886 100755 --- a/spk/owncloud/src/service-setup.sh +++ b/spk/owncloud/src/service-setup.sh @@ -17,6 +17,7 @@ fi MYSQL="/usr/local/mariadb10/bin/mysql" MYSQLDUMP="/usr/local/mariadb10/bin/mysqldump" MYSQL_DATABASE="${SYNOPKG_PKGNAME}" +MYSQL_USER="oc_${wizard_owncloud_admin_username}" WEB_ROOT="${WEB_DIR}/${SYNOPKG_PKGNAME}" SYNOSVC="/usr/syno/sbin/synoservice" @@ -76,13 +77,16 @@ exec_occ() { setup_owncloud_instance() { if [ "${SYNOPKG_PKG_STATUS}" = "INSTALL" ]; then + # Setup database + ${MYSQL} -u root -p"${wizard_mysql_password_root}" -e "CREATE DATABASE ${MYSQL_DATABASE}; GRANT ALL PRIVILEGES ON ${MYSQL_DATABASE}.* TO '${MYSQL_USER}'@'localhost' IDENTIFIED BY '${wizard_mysql_password_owncloud}';" + # Setup configuration file exec_occ maintenance:install \ --database "mysql" \ - --database-name "${SYNOPKG_PKGNAME}" \ + --database-name "${MYSQL_DATABASE}" \ --database-host "localhost:/run/mysqld/mysqld10.sock" \ - --database-user "root" \ - --database-pass "${wizard_mysql_password_root}" \ + --database-user "${MYSQL_USER}" \ + --database-pass "${wizard_mysql_password_owncloud}" \ --admin-user "${wizard_owncloud_admin_username}" \ --admin-pass "${wizard_owncloud_admin_password}" \ --data-dir "${DATA_DIR}" 2>&1 @@ -165,7 +169,6 @@ validate_preinst () fi if [ "${SYNOPKG_PKG_STATUS}" = "INSTALL" ]; then - MYSQL_USER="oc_${wizard_owncloud_admin_username}" # Check database if ! ${MYSQL} -u root -p"${wizard_mysql_password_root}" -e quit > /dev/null 2>&1; then echo "Incorrect MySQL 'root' password" diff --git a/spk/owncloud/src/web/owncloud.json b/spk/owncloud/src/web/owncloud.json index 27a3f43ee0d..a81a0bb84ef 100644 --- a/spk/owncloud/src/web/owncloud.json +++ b/spk/owncloud/src/web/owncloud.json @@ -5,9 +5,11 @@ "enable_cache": true, "enable_xdebug": false, "extensions": [ - "bcmath", + "apcu", "bz2", "curl", + "exif", + "ftp", "gd", "gmp", "iconv", @@ -15,10 +17,12 @@ "imap", "intl", "ldap", + "memcached", "openssl", "pdo_mysql", + "phar", + "posix", "redis", - "ssh2", "zip", "zlib" ], @@ -30,6 +34,10 @@ "start_servers": 2 }, "open_basedir": "", + "php_settings": { + "error_log": "/var/services/web/owncloud/php_errors.log", + "pdo_mysql.default_socket": "/run/mysqld/mysqld10.sock" + }, "profile_desc": "PHP Profile for ownCloud", "profile_name": "ownCloud Profile" } diff --git a/spk/owncloud/src/wizard_templates/install_uifile.sh b/spk/owncloud/src/wizard_templates/install_uifile.sh index 9a2355f91f4..c6b9be0588b 100644 --- a/spk/owncloud/src/wizard_templates/install_uifile.sh +++ b/spk/owncloud/src/wizard_templates/install_uifile.sh @@ -24,6 +24,7 @@ page_append () RESTORE_BACKUP_FILE="wizard_owncloud_restore" BACKUP_FILE_PATH="wizard_backup_file" +RESTORE_BLANK_TEXT="{{{OWNCLOUD_BACKUP_FILE_VALIDATION_BLANK_TEXT}}}" RESTORE_ERROR_TEXT="{{{OWNCLOUD_BACKUP_FILE_VALIDATION_ERROR_TEXT}}}" SHARE_ERROR_TEXT="{{{OWNCLOUD_DATA_DIRECTORY_VALIDATION_ERROR_TEXT}}}" MYSQL_ROOT_PASSWORD="wizard_mysql_password_root" @@ -35,8 +36,13 @@ checkBackupRestore() var backupFilePath = arguments[0]; var step = arguments[2]; var backupRestore = step.getComponent("${RESTORE_BACKUP_FILE}"); + const backupFileRegex = /^\/(volume|volumeUSB)[0-9]+\/([^\/]+\/)*owncloud_backup_v\d+\.\d+\.\d+_\d{8}\.tar\.gz$/; if (backupRestore.checked) { if (backupFilePath === "") { + return "${RESTORE_BLANK_TEXT}"; + } else if (backupFileRegex.test(backupFilePath)) { + return true; + } else { return "${RESTORE_ERROR_TEXT}"; } } @@ -169,6 +175,18 @@ EOF echo "$DEACTIVAETE" | quote_json } +getPasswordValidator() +{ + validator=$(/bin/cat<