Skip to content

Commit

Permalink
Amend installer with PHP extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
mreid-tt committed Jan 27, 2024
1 parent f2915a1 commit 4146415
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 4 deletions.
7 changes: 4 additions & 3 deletions spk/fengoffice/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ POST_STRIP_TARGET = fengoffice_extra_install
include ../../mk/spksrc.spk.mk

.PHONY: fengoffice_extra_install
fengoffice_extra_install:
install -m 755 -d $(STAGING_DIR)/app
install -m 644 src/app/config $(STAGING_DIR)/app/config
fengoffice_extra_install:
install -m 755 -d $(STAGING_DIR)/web
install -m 644 src/web/fengoffice.conf $(STAGING_DIR)/web/fengoffice.conf
install -m 644 src/web/fengoffice.json $(STAGING_DIR)/web/fengoffice.json
16 changes: 15 additions & 1 deletion spk/fengoffice/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,21 @@ service_postinst ()

# Run installer
if [ "${SYNOPKG_PKG_STATUS}" = "INSTALL" ]; then
cd ${WEB_DIR}/${SYNOPKG_PKGNAME}/public/install/ && QUERY_STRING="script_installer_storage[database_type]=mysql&script_installer_storage[database_host]=localhost&script_installer_storage[database_user]=${MYSQL_USER}&script_installer_storage[database_pass]=${wizard_mysql_password_fengoffice:=fengoffice}&script_installer_storage[database_name]=${MYSQL_DATABASE}&script_installer_storage[database_prefix]=fo_&script_installer_storage[database_engine]=InnoDB&script_installer_storage[absolute_url]=http://${wizard_domain_name:=$(hostname)}/${SYNOPKG_PKGNAME}&script_installer_storage[plugins][]=core_dimensions&script_installer_storage[plugins][]=workspaces&script_installer_storage[plugins][]=mail&submited=submited" php install_helper.php > /dev/null
# 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")
# Setup parameters for installation script
QUERY_STRING="script_installer_storage[database_type]=mysql&script_installer_storage[database_host]=localhost&script_installer_storage[database_user]=${MYSQL_USER}&script_installer_storage[database_pass]=${wizard_mysql_password_fengoffice:=fengoffice}&script_installer_storage[database_name]=${MYSQL_DATABASE}&script_installer_storage[database_prefix]=fo_&script_installer_storage[database_engine]=InnoDB&script_installer_storage[absolute_url]=http://${wizard_domain_name:=$(hostname)}/${SYNOPKG_PKGNAME}&script_installer_storage[plugins][]=core_dimensions&script_installer_storage[plugins][]=workspaces&script_installer_storage[plugins][]=mail&submited=submited"
# Prepare environment
COMMAND="${PHP} ${PHP_EXTENSIONS} install_helper.php"
cd ${WEB_DIR}/${SYNOPKG_PKGNAME}/public/install/
# Execute based on DSM version
if [ ${SYNOPKG_DSM_VERSION_MAJOR} -lt 7 ]; then
/bin/su "$WEB_USER" -s /bin/sh -c "${COMMAND}" > /dev/null
else
$COMMAND > /dev/null
fi
fi

# Fix permissions
Expand Down
16 changes: 16 additions & 0 deletions spk/fengoffice/src/web/fengoffice.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Alias "/fengoffice" "/var/services/web/fengoffice"

<Proxy "unix:/run/php-fpm/php-com-synocommunity-packages-fengoffice.sock|fcgi://fengoffice">
ProxySet timeout=3600
</Proxy>

<Directory "/var/services/web/fengoffice">

<FilesMatch "\.(php[345]?|phtml)$">
SetHandler "proxy:fcgi://fengoffice"
</FilesMatch>

<IfModule dir_module>
DirectoryIndex index.php index.htm index.html
</IfModule>
</Directory>
29 changes: 29 additions & 0 deletions spk/fengoffice/src/web/fengoffice.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"backend": 8,
"custom_open_basedir": false,
"display_errors": false,
"enable_cache": true,
"enable_xdebug": false,
"extensions": [
"curl",
"gd",
"imagick",
"imap",
"intl",
"mysqli",
"pdo_mysql",
"xmlrpc",
"zip"
],
"fpm_settings": {
"max_children": 20,
"max_spare_servers": 3,
"min_spare_servers": 1,
"mode": "dynamic",
"start_servers": 2
},
"open_basedir": "",
"php_settings": {},
"profile_desc": "PHP Profile for fengoffice",
"profile_name": "fengoffice Profile"
}

0 comments on commit 4146415

Please sign in to comment.