From 767c7ef8908a0fdd1dd0c968236f4dc7cb3dcdb2 Mon Sep 17 00:00:00 2001 From: mreid-tt <943378+mreid-tt@users.noreply.github.com> Date: Mon, 29 Jan 2024 01:20:02 -0400 Subject: [PATCH] Miscellaneous fixes - Add variable for synoservice - Simplify DSM 6 permissions - Fix mysqli default socket in DSM 6 - Add PHP extension zlib - Amend uninstall wizard text --- spk/fengoffice/src/conf/resource | 3 ++- spk/fengoffice/src/service-setup.sh | 22 ++++++++++--------- spk/fengoffice/src/web/fengoffice.json | 7 ++++-- spk/fengoffice/src/wizard/uninstall_uifile.sh | 2 +- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/spk/fengoffice/src/conf/resource b/spk/fengoffice/src/conf/resource index 5c3fe2eb81b1..24c4770f090d 100644 --- a/spk/fengoffice/src/conf/resource +++ b/spk/fengoffice/src/conf/resource @@ -52,7 +52,8 @@ "mysqli", "pdo_mysql", "xmlrpc", - "zip" + "zip", + "zlib" ], "group": "http", "profile_desc": "PHP Profile for fengoffice", diff --git a/spk/fengoffice/src/service-setup.sh b/spk/fengoffice/src/service-setup.sh index fa4326a66490..07a0167cdcba 100755 --- a/spk/fengoffice/src/service-setup.sh +++ b/spk/fengoffice/src/service-setup.sh @@ -22,6 +22,7 @@ else WEB_GROUP="http" fi WEB_ROOT="${WEB_DIR}/${SYNOPKG_PKGNAME}" +SYNOSVC="/usr/syno/sbin/synoservice" service_prestart () { @@ -140,12 +141,21 @@ service_postinst () ${RM} ${TEMPDIR} fi + # Fix permissions + if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then + chown -R ${WEB_USER}:${WEB_GROUP} ${WEB_ROOT} + fi + # Run installer if [ "${SYNOPKG_PKG_STATUS}" = "INSTALL" ]; then # Define the resource file RESOURCE_FILE="${SYNOPKG_PKGDEST}/web/fengoffice.json" # Extract extensions and assign to variable - PHP_EXTENSIONS=$(jq -r '.extensions[] | "-dextension=" + . + ".so"' "$RESOURCE_FILE") + PHP_SETTINGS=$(jq -r '.extensions[] | "-d extension=" + . + ".so"' "$RESOURCE_FILE") + # Fix for mysqli default socket on DSM 6 + if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then + PHP_SETTINGS="${PHP_SETTINGS} -d mysqli.default_socket=/run/mysqld/mysqld10.sock" + fi # Setup parameters for installation script QUERY_STRING="\ script_installer_storage[database_type]=mysqli\ @@ -161,7 +171,7 @@ script_installer_storage[database_type]=mysqli\ &script_installer_storage[plugins][]=workspaces\ &submited=submited" # Prepare environment - COMMAND="${PHP} ${PHP_EXTENSIONS} install_helper.php" + COMMAND="${PHP} ${PHP_SETTINGS} install_helper.php" cd ${WEB_ROOT}/public/install/ || exit 1 # Execute based on DSM version if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then @@ -170,14 +180,6 @@ script_installer_storage[database_type]=mysqli\ $COMMAND > /dev/null 2>&1 fi fi - - # Fix permissions - if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then - chown -R ${WEB_USER}:${WEB_GROUP} ${WEB_ROOT}/config - chown -R ${WEB_USER}:${WEB_GROUP} ${WEB_ROOT}/cache - chown -R ${WEB_USER}:${WEB_GROUP} ${WEB_ROOT}/upload - chown -R ${WEB_USER}:${WEB_GROUP} ${WEB_ROOT}/tmp - fi } service_preuninst () diff --git a/spk/fengoffice/src/web/fengoffice.json b/spk/fengoffice/src/web/fengoffice.json index 6dd55a852004..7d2884625577 100644 --- a/spk/fengoffice/src/web/fengoffice.json +++ b/spk/fengoffice/src/web/fengoffice.json @@ -13,7 +13,8 @@ "mysqli", "pdo_mysql", "xmlrpc", - "zip" + "zip", + "zlib" ], "fpm_settings": { "max_children": 20, @@ -23,7 +24,9 @@ "start_servers": 2 }, "open_basedir": "", - "php_settings": {}, + "php_settings": { + "mysqli.default_socket": "/run/mysqld/mysqld10.sock" + }, "profile_desc": "PHP Profile for fengoffice", "profile_name": "fengoffice Profile" } diff --git a/spk/fengoffice/src/wizard/uninstall_uifile.sh b/spk/fengoffice/src/wizard/uninstall_uifile.sh index e213ee5d3e08..fb17b45cfc1a 100644 --- a/spk/fengoffice/src/wizard/uninstall_uifile.sh +++ b/spk/fengoffice/src/wizard/uninstall_uifile.sh @@ -60,7 +60,7 @@ PAGE_UNINSTALL_CONFIG=$(/bin/cat<