mirror of
https://github.com/YunoHost-Apps/osticket_ynh.git
synced 2024-09-03 19:56:17 +02:00
Merge 5fd1f80e10
into e55eeedd04
This commit is contained in:
commit
cd1273a928
11 changed files with 124 additions and 186 deletions
|
@ -1 +1 @@
|
|||
*/5 * * * * osticket /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/api/cron.php
|
||||
*/5 * * * * osticket /usr/bin/php__PHP_VERSION__ __INSTALL_DIR__/api/cron.php
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
; Additional php.ini defines, specific to this pool of workers.
|
||||
|
||||
php_admin_value[upload_max_filesize] = 256M
|
||||
php_admin_value[post_max_size] = 256M
|
|
@ -17,7 +17,7 @@ location __PATH__/ {
|
|||
|
||||
location ~ ^(.*[^/]\.php)(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
||||
fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__APP__.sock;
|
||||
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
|
|
|
@ -17,7 +17,8 @@ userdoc = "https://docs.osticket.com"
|
|||
code = "https://github.com/osTicket/osTicket"
|
||||
|
||||
[integration]
|
||||
yunohost = ">= 11.2"
|
||||
yunohost = ">= 11.2.18"
|
||||
helpers_version = "2.1"
|
||||
architectures = "all"
|
||||
multi_instance = true
|
||||
|
||||
|
@ -138,6 +139,7 @@ ram.runtime = "50M"
|
|||
[resources.system_user]
|
||||
|
||||
[resources.install_dir]
|
||||
group = "www-data:r-x"
|
||||
|
||||
[resources.permissions]
|
||||
main.url = "/"
|
||||
|
|
|
@ -1,17 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# FUTURE OFFICIAL HELPERS
|
||||
# COMMON VARIABLES AND CUSTOM HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -1,37 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
#=================================================
|
||||
ynh_print_info --message="Declaring files to be backed up..."
|
||||
ynh_print_info "Declaring files to be backed up..."
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="$install_dir"
|
||||
ynh_backup "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||
ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC BACKUP
|
||||
|
@ -39,17 +30,17 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
|||
# BACKUP VARIOUS FILES
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/etc/cron.d/$app"
|
||||
ynh_backup "/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE MYSQL DATABASE
|
||||
#=================================================
|
||||
ynh_print_info --message="Backing up the MySQL database..."
|
||||
ynh_print_info "Backing up the MySQL database..."
|
||||
|
||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||
ynh_mysql_dump_db > db.sql
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||
|
|
|
@ -1,25 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC STARTING
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
#=================================================
|
||||
# MODIFY URL IN NGINX CONF
|
||||
#=================================================
|
||||
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
||||
ynh_script_progression "Updating NGINX web server configuration..."
|
||||
|
||||
ynh_change_url_nginx_config
|
||||
ynh_config_change_url_nginx
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Change of URL completed for $app" --last
|
||||
ynh_script_progression "Change of URL completed for $app"
|
||||
|
|
|
@ -1,18 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
ynh_app_setting_set --key=php_upload_max_filesize --value=256M
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setting up source files..." --weight=1
|
||||
ynh_script_progression "Setting up source files..."
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$install_dir"
|
||||
|
@ -31,87 +27,86 @@ ynh_setup_source --dest_dir="$install_dir/include/plugins/build/preventautoscrol
|
|||
|
||||
rsync -a "../conf/i18n" "$install_dir/include/."
|
||||
|
||||
chmod 750 "$install_dir"
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
|
||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir"
|
||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
|
||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
|
||||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
|
||||
ynh_script_progression "Configuring PHP-FPM..."
|
||||
|
||||
# Create a dedicated PHP-FPM config
|
||||
ynh_add_fpm_config --usage=low --footprint=low
|
||||
ynh_config_add_phpfpm
|
||||
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
ynh_config_add_nginx
|
||||
|
||||
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
||||
ynh_config_add --template="cron" --destination="/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# ADD A CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||
ynh_script_progression "Adding $app's configuration..."
|
||||
|
||||
cp -f "../conf/ost-sampleconfig.php" "$install_dir/include/ost-config.php"
|
||||
|
||||
chmod 666 "$install_dir/include/ost-config.php"
|
||||
chown $app:www-data "$install_dir/include/ost-config.php"
|
||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 666 "$install_dir/include/ost-config.php"
|
||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:www-data "$install_dir/include/ost-config.php"
|
||||
|
||||
#=================================================
|
||||
# BUILD PLUGINS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Building plugins..." --weight=1
|
||||
ynh_script_progression "Building plugins..."
|
||||
|
||||
mkdir -p "$install_dir/include/plugins/build/.config/composer"
|
||||
chmod 660 "$install_dir/include/plugins/build/.config/composer"
|
||||
chown $app:www-data "$install_dir/include/plugins/build/.config/composer"
|
||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 660 "$install_dir/include/plugins/build/.config/composer"
|
||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:www-data "$install_dir/include/plugins/build/.config/composer"
|
||||
|
||||
export COMPOSER_HOME="$install_dir/include/plugins/build/.config/composer"
|
||||
pushd "$install_dir/include/plugins/build"
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion make.php hydrate
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build auth-cas
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build auth-ldap
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build auth-oauth
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build auth-passthru
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build storage-fs
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build storage-s3
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build archiver
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build attachment_preview
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build autocloser
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build fetch-note
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build field-radiobuttons
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build fwd-rewriter
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build mattermost
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build mentioner
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build microsoft-teams
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build slack
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build preventautoscroll
|
||||
ynh_exec_warn_less ynh_exec_as $app cp *.phar $install_dir/include/plugins/.
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version make.php hydrate
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build auth-cas
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build auth-ldap
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build auth-oauth
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build auth-passthru
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build storage-fs
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build storage-s3
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build archiver
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build attachment_preview
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build autocloser
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build fetch-note
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build field-radiobuttons
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build fwd-rewriter
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build mattermost
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build mentioner
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build microsoft-teams
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build slack
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build preventautoscroll
|
||||
ynh_hide_warnings ynh_exec_as_app cp *.phar $install_dir/include/plugins/.
|
||||
popd
|
||||
|
||||
ynh_secure_remove --file="$install_dir/include/plugins/build"
|
||||
ynh_safe_rm "$install_dir/include/plugins/build"
|
||||
|
||||
#=================================================
|
||||
# SETUP APPLICATION WITH CURL
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setuping application with CURL..." --weight=1
|
||||
ynh_script_progression "Setuping application with CURL..."
|
||||
|
||||
admin_fname=$(ynh_user_get_info $admin 'firstname')
|
||||
admin_lname=$(ynh_user_get_info $admin 'lastname')
|
||||
admin_mail=$(ynh_user_get_info $admin 'mail')
|
||||
|
||||
# Installation with curl
|
||||
ynh_script_progression --message="Finalizing installation..." --weight=1
|
||||
ynh_script_progression "Finalizing installation..."
|
||||
ynh_local_curl "/setup/install.php" "s=install" "name=$app" "email=$app@$domain" "lang_id=$language" "fname=$admin_fname" "lname=$admin_lname" "admin_email=$admin_mail" "username=$admin" "passwd=$password" "passwd2=$password" "prefix=ost_" "dbhost=localhost" "dbname=$db_name" "dbuser=$db_user" "dbpass=$db_pwd"
|
||||
|
||||
chmod 400 "$install_dir/include/ost-config.php"
|
||||
chown $app:www-data "$install_dir/include/ost-config.php"
|
||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/include/ost-config.php"
|
||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:www-data "$install_dir/include/ost-config.php"
|
||||
|
||||
ynh_store_file_checksum --file="$install_dir/include/ost-config.php"
|
||||
ynh_store_file_checksum "$install_dir/include/ost-config.php"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Installation of $app completed" --last
|
||||
ynh_script_progression "Installation of $app completed"
|
||||
|
|
|
@ -1,30 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
|
||||
ynh_script_progression "Removing NGINX web server configuration..."
|
||||
|
||||
# Remove the dedicated NGINX config
|
||||
ynh_remove_nginx_config
|
||||
ynh_config_remove_nginx
|
||||
|
||||
# Remove the dedicated PHP-FPM config
|
||||
ynh_remove_fpm_config
|
||||
ynh_config_remove_phpfpm
|
||||
|
||||
# Remove a cron file
|
||||
ynh_secure_remove --file="/etc/cron.d/$app"
|
||||
ynh_safe_rm "/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Removal of $app completed" --last
|
||||
ynh_script_progression "Removal of $app completed"
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
@ -13,44 +7,41 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
||||
ynh_script_progression "Restoring the app main directory..."
|
||||
|
||||
ynh_restore_file --origin_path="$install_dir"
|
||||
|
||||
chmod 750 "$install_dir"
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
ynh_restore "$install_dir"
|
||||
|
||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir"
|
||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
|
||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
|
||||
#=================================================
|
||||
# RESTORE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the MySQL database..." --weight=1
|
||||
ynh_script_progression "Restoring the MySQL database..."
|
||||
|
||||
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
||||
ynh_mysql_db_shell < ./db.sql
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1
|
||||
ynh_script_progression "Restoring the PHP-FPM configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||
ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf"
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
||||
ynh_restore "/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# RELOAD NGINX AND PHP-FPM
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1
|
||||
ynh_script_progression "Reloading NGINX web server and PHP-FPM..."
|
||||
|
||||
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
ynh_systemctl --service=php$php_version-fpm --action=reload
|
||||
ynh_systemctl --service=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Restoration completed for $app" --last
|
||||
ynh_script_progression "Restoration completed for $app"
|
||||
|
|
101
scripts/upgrade
101
scripts/upgrade
|
@ -1,34 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
ynh_app_setting_set_default --key=php_upload_max_filesize --value=256M
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed
|
||||
if ynh_app_upstream_version_changed
|
||||
then
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
ynh_script_progression "Upgrading source files..."
|
||||
|
||||
tmpdir="$(mktemp -d)"
|
||||
|
||||
mkdir $tmpdir/plugins
|
||||
rsync -a "$install_dir/include/plugins" "$tmpdir/."
|
||||
rsync -a "$install_dir/include/ost-config.php" "$tmpdir/."
|
||||
ynh_secure_remove --file="$install_dir"
|
||||
ynh_safe_rm "$install_dir"
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$install_dir"
|
||||
|
@ -47,85 +38,83 @@ then
|
|||
|
||||
rsync -a "$tmpdir/plugins" "$install_dir/include/."
|
||||
rsync -a "$tmpdir/ost-config.php" "$install_dir/include/."
|
||||
ynh_secure_remove --file="$tmpdir"
|
||||
ynh_safe_rm "$tmpdir"
|
||||
fi
|
||||
|
||||
rsync -a "../conf/i18n" "$install_dir/include/."
|
||||
|
||||
chmod 750 "$install_dir"
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
|
||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir"
|
||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
|
||||
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
|
||||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
|
||||
ynh_script_progression "Upgrading PHP-FPM configuration..."
|
||||
|
||||
# Create a dedicated PHP-FPM config
|
||||
ynh_add_fpm_config --usage=low --footprint=low
|
||||
ynh_config_add_phpfpm
|
||||
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
ynh_config_add_nginx
|
||||
|
||||
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
||||
ynh_config_add --template="cron" --destination="/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
#=================================================
|
||||
# UPDATE A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Updating a configuration file..." --weight=1
|
||||
ynh_script_progression "Updating configuration..."
|
||||
|
||||
ynh_store_file_checksum --file="$install_dir/include/ost-config.php"
|
||||
ynh_store_file_checksum "$install_dir/include/ost-config.php"
|
||||
|
||||
chmod 400 "$install_dir/include/ost-config.php"
|
||||
chown $app:www-data "$install_dir/include/ost-config.php"
|
||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/include/ost-config.php"
|
||||
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:www-data "$install_dir/include/ost-config.php"
|
||||
|
||||
#=================================================
|
||||
# BUILD PLUGINS
|
||||
#=================================================
|
||||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed
|
||||
if ynh_app_upstream_version_changed
|
||||
then
|
||||
ynh_script_progression --message="Building plugins..." --weight=1
|
||||
ynh_exec_as $app mkdir -p "$install_dir/include/plugins/build/.config/composer"
|
||||
ynh_script_progression "Building plugins..."
|
||||
ynh_exec_as_app mkdir -p "$install_dir/include/plugins/build/.config/composer"
|
||||
COMPOSER_HOME="$install_dir/include/plugins/build/.config/composer"
|
||||
pushd "$install_dir/include/plugins/build"
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion make.php hydrate
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build auth-cas
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build auth-ldap
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build auth-oauth
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build auth-passthru
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build storage-fs
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build storage-s3
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build archiver
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build attachment_preview
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build autocloser
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build fetch-note
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build field-radiobuttons
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build fwd-rewriter
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build mattermost
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build mentioner
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build microsoft-teams
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build slack
|
||||
ynh_exec_warn_less ynh_exec_as $app php$phpversion -dphar.readonly=0 make.php build preventautoscroll
|
||||
ynh_exec_warn_less ynh_exec_as $app cp -f *.phar $install_dir/include/plugins/.
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version make.php hydrate
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build auth-cas
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build auth-ldap
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build auth-oauth
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build auth-passthru
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build storage-fs
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build storage-s3
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build archiver
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build attachment_preview
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build autocloser
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build fetch-note
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build field-radiobuttons
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build fwd-rewriter
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build mattermost
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build mentioner
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build microsoft-teams
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build slack
|
||||
ynh_hide_warnings ynh_exec_as_app php$php_version -dphar.readonly=0 make.php build preventautoscroll
|
||||
ynh_hide_warnings ynh_exec_as_app cp -f *.phar $install_dir/include/plugins/.
|
||||
popd
|
||||
ynh_secure_remove --file="$install_dir/include/plugins/build"
|
||||
ynh_secure_remove --file="$install_dir/setup"
|
||||
ynh_safe_rm "$install_dir/include/plugins/build"
|
||||
ynh_safe_rm "$install_dir/setup"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# UPGRADE OSTICKET
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading the application..." --weight=1
|
||||
ynh_script_progression "Upgrading the application..."
|
||||
|
||||
pushd "$install_dir"
|
||||
php$phpversion manage.php upgrade
|
||||
php$php_version manage.php upgrade
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Upgrade of $app completed" --last
|
||||
ynh_script_progression "Upgrade of $app completed"
|
||||
|
|
Loading…
Add table
Reference in a new issue