1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/roundcube_ynh.git synced 2024-09-03 20:16:28 +02:00
roundcube_ynh/scripts/upgrade

118 lines
3.7 KiB
Text
Raw Normal View History

#!/bin/bash
2017-08-26 03:24:41 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2017-06-02 17:15:57 +02:00
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
2021-08-18 21:46:27 +02:00
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
2019-03-03 18:12:41 +01:00
# If with_carddav doesn't exist, create it
2023-05-03 16:25:14 +02:00
if [ -z "${with_carddav:-}" ]; then
2023-05-03 16:16:05 +02:00
if [ -f "$install_dir/plugins/carddav/config.inc.php" ]
2019-03-03 18:12:41 +01:00
then
with_carddav=1
else
with_carddav=0
fi
2019-05-18 18:42:54 +02:00
ynh_app_setting_set --app=$app --key=with_carddav --value=$with_carddav
2019-03-03 18:12:41 +01:00
fi
# If language doesn't exist, create it
2023-05-03 16:25:14 +02:00
if [ -z "${language:-}" ]; then
2020-11-20 22:06:07 +01:00
language="en_GB"
ynh_app_setting_set --app=$app --key=language --value=$language
fi
2020-11-20 22:06:07 +01:00
# If fpm_footprint doesn't exist, create it
2023-05-03 16:25:14 +02:00
if [ -z "${fpm_footprint:-}" ]; then
fpm_footprint=low
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
fi
Testing (#159) * Update config.inc.php (#122) * Update manifest.json * Auto-update README * 1.5.1 (#124) * 1.5.1 * Add config panel (#128) * Plugin upgrade (#127) * Update plugins * Update config.inc.php * Update manifest.json * Auto-update README * Update remove * Update check_process * Update upgrade * 1.5.2 (#131) * 1.5.2 * Update config.inc.php (#134) * Fix plugins urls (#137) * fix plugins urls sblaisot/automatic_addressbook is abandonned and forked at projectmyst/automatic_addressbook * fix plugins urls as in previous commit * fix html5 plugin url * fix html5 plugin url * Auto-update README * Auto-update README * 1.5.3 (#142) * 1.5.3 * Auto-update README Co-authored-by: yunohost-bot <yunohost@yunohost.org> * user * Update _common.sh * Update _common.sh * version 16 (#146) * Fix * Auto-update README * Update config.inc.php * Update config.inc.php * Update install * Update install * Update install * Update install * Update upgrade * PHP8.0 * Update app.src * Update restore Co-authored-by: Yunohost-Bot <> * bullseye (#149) * bullseye * Auto-update README * Update app.src * set max filesize * Fix Co-authored-by: yunohost-bot <yunohost@yunohost.org> * Update manifest.json * Update upgrade * PHP7.4 * Update upgrade * Update _common.sh * Update upgrade * Install JS dependencies (#154) * INSTALL JS DEPENDENCIES * Update install * Update manifest.json * Auto-update README * Upgrade config panel (#158) * fix pgp home path in a muti-install context * Update manifest.json * config panel * fix * Update install * Update upgrade * Fix pgp home path in a muti-install context (#157) * fix pgp home path in a muti-install context * Update manifest.json * Update _common.sh Co-authored-by: Yunohost-Bot <> Co-authored-by: Xavier Brochard <xavier@alternatif.org> Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: SuNounix <91945628+SuNounix@users.noreply.github.com>
2022-09-30 18:31:12 +02:00
# If fpm_free_footprint doesn't exist, create it
2023-05-03 16:25:14 +02:00
if [ -z "${fpm_free_footprint:-}" ]; then
Testing (#159) * Update config.inc.php (#122) * Update manifest.json * Auto-update README * 1.5.1 (#124) * 1.5.1 * Add config panel (#128) * Plugin upgrade (#127) * Update plugins * Update config.inc.php * Update manifest.json * Auto-update README * Update remove * Update check_process * Update upgrade * 1.5.2 (#131) * 1.5.2 * Update config.inc.php (#134) * Fix plugins urls (#137) * fix plugins urls sblaisot/automatic_addressbook is abandonned and forked at projectmyst/automatic_addressbook * fix plugins urls as in previous commit * fix html5 plugin url * fix html5 plugin url * Auto-update README * Auto-update README * 1.5.3 (#142) * 1.5.3 * Auto-update README Co-authored-by: yunohost-bot <yunohost@yunohost.org> * user * Update _common.sh * Update _common.sh * version 16 (#146) * Fix * Auto-update README * Update config.inc.php * Update config.inc.php * Update install * Update install * Update install * Update install * Update upgrade * PHP8.0 * Update app.src * Update restore Co-authored-by: Yunohost-Bot <> * bullseye (#149) * bullseye * Auto-update README * Update app.src * set max filesize * Fix Co-authored-by: yunohost-bot <yunohost@yunohost.org> * Update manifest.json * Update upgrade * PHP7.4 * Update upgrade * Update _common.sh * Update upgrade * Install JS dependencies (#154) * INSTALL JS DEPENDENCIES * Update install * Update manifest.json * Auto-update README * Upgrade config panel (#158) * fix pgp home path in a muti-install context * Update manifest.json * config panel * fix * Update install * Update upgrade * Fix pgp home path in a muti-install context (#157) * fix pgp home path in a muti-install context * Update manifest.json * Update _common.sh Co-authored-by: Yunohost-Bot <> Co-authored-by: Xavier Brochard <xavier@alternatif.org> Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: SuNounix <91945628+SuNounix@users.noreply.github.com>
2022-09-30 18:31:12 +02:00
fpm_free_footprint=0
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
fi
# If fpm_usage doesn't exist, create it
2023-05-03 16:25:14 +02:00
if [ -z "${fpm_usage:-}" ]; then
fpm_usage=low
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
fi
2017-08-26 03:24:41 +02:00
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
# Get the current version of roundcube
2023-05-03 16:16:05 +02:00
oldversion=$(grep RCMAIL_VERSION "$install_dir/program/include/iniset.php" | cut -d\' -f4)
2017-08-26 03:24:41 +02:00
2024-02-04 23:21:02 +01:00
ynh_script_progression --message="Upgrading source files..." --weight=3
2019-05-18 18:42:54 +02:00
2024-02-04 23:21:02 +01:00
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
2017-08-26 03:24:41 +02:00
2023-05-03 16:16:05 +02:00
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
2021-10-19 12:45:44 +02:00
2017-08-26 03:24:41 +02:00
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
2020-09-27 22:39:12 +02:00
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=5
2020-09-27 22:39:12 +02:00
# Create a dedicated PHP-FPM config
2023-09-15 13:46:10 +02:00
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
# Create a dedicated NGINX config
ynh_add_nginx_config
2017-08-26 03:24:41 +02:00
#=================================================
# SPECIFIC UPGRADE
#=================================================
2017-10-15 01:14:08 +02:00
# CONFIGURE ROUNDCUBE
2017-08-26 03:24:41 +02:00
#=================================================
setup_composer_deps
2024-02-05 15:08:07 +01:00
ynh_script_progression --message="Configuring Roundcube..." --weight=2
configure_roundcube
ynh_script_progression --message="Installing ldap, automatic addressbook and contextmenu plugins..." --weight=60
install_ldap_addressbook_contextmenu_plugins
if [ $with_carddav -eq 1 ]
then
ynh_script_progression --message="Installing carddav plugin..." --weight=30
install_carddav_plugin
fi
ynh_script_progression --message="Updating Roundcube dependencies with Composer..." --weight=30
ynh_composer_exec --commands="update --no-dev"
2024-02-05 15:08:07 +01:00
ynh_script_progression --message="Install javascript dependencies..." --weight=10
update_javascript_deps
ynh_script_progression --message="Updating Roundcube configuration..." --weight=3
enable_plugins_in_config
2024-02-04 23:21:02 +01:00
# Migrate roundcube database
pushd "$install_dir"
2024-02-05 15:13:57 +01:00
COMPOSER_ALLOW_SUPERUSER=1 ynh_exec_warn php$phpversion ./bin/update.sh --version=$oldversion -y
2024-02-04 23:21:02 +01:00
popd
2019-03-03 18:13:57 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2020-11-02 17:47:49 +01:00
ynh_script_progression --message="Installation of $app completed" --last