mirror of
https://github.com/YunoHost-Apps/roundcube_ynh.git
synced 2024-09-03 20:16:28 +02:00
Upgrade to 7.3
This commit is contained in:
parent
da6509c3ea
commit
5ef91a8bc5
11 changed files with 70 additions and 87 deletions
|
@ -12,7 +12,6 @@
|
||||||
setup_private=0
|
setup_private=0
|
||||||
setup_public=0
|
setup_public=0
|
||||||
upgrade=1
|
upgrade=1
|
||||||
upgrade=1 from_commit=8d0acb6953a4c4c2206985c7d9881c5b7b637ebd
|
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
incorrect_path=1
|
incorrect_path=1
|
||||||
|
@ -24,6 +23,4 @@
|
||||||
Email=
|
Email=
|
||||||
Notification=none
|
Notification=none
|
||||||
;;; Upgrade options
|
;;; Upgrade options
|
||||||
; commit=269500433bdbce3b477fa84d0af0db3ac466244d
|
|
||||||
name=Fix install+upgrade and refactoring
|
|
||||||
manifest_arg=domain=DOMAIN&path=PATH&with_carddav=1&with_enigma=1&
|
manifest_arg=domain=DOMAIN&path=PATH&with_carddav=1&with_enigma=1&
|
||||||
|
|
|
@ -17,7 +17,7 @@ location __PATH__/ {
|
||||||
location ~ [^/]\.php(/|$) {
|
location ~ [^/]\.php(/|$) {
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
|
|
||||||
fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock;
|
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
fastcgi_param REMOTE_USER $remote_user;
|
fastcgi_param REMOTE_USER $remote_user;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
|
|
@ -33,7 +33,7 @@ group = __USER__
|
||||||
; (IPv6 and IPv4-mapped) on a specific port;
|
; (IPv6 and IPv4-mapped) on a specific port;
|
||||||
; '/path/to/unix/socket' - to listen on a unix socket.
|
; '/path/to/unix/socket' - to listen on a unix socket.
|
||||||
; Note: This value is mandatory.
|
; Note: This value is mandatory.
|
||||||
listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock
|
listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock
|
||||||
|
|
||||||
; Set listen(2) backlog.
|
; Set listen(2) backlog.
|
||||||
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
|
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"email": "apps@yunohost.org"
|
"email": "apps@yunohost.org"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.5.0"
|
"yunohost": ">= 4.0.8"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
|
|
@ -4,8 +4,10 @@
|
||||||
# COMMON VARIABLES
|
# COMMON VARIABLES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
YNH_PHP_VERSION="7.3"
|
||||||
|
|
||||||
# Package dependencies
|
# Package dependencies
|
||||||
pkg_dependencies="php-cli php-common php-intl php-json php-pear php-auth-sasl php-mail-mime php-patchwork-utf8 php-net-smtp php-net-socket php-zip php-gd php-mbstring php-curl"
|
extra_php_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-common php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-pear php${YNH_PHP_VERSION}-auth-sasl php${YNH_PHP_VERSION}-mail-mime php${YNH_PHP_VERSION}-patchwork-utf8 php${YNH_PHP_VERSION}-net-smtp php${YNH_PHP_VERSION}-net-socket php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-curl"
|
||||||
|
|
||||||
# Plugins version
|
# Plugins version
|
||||||
contextmenu_version=2.3
|
contextmenu_version=2.3
|
||||||
|
@ -31,7 +33,7 @@ ynh_composer_exec () {
|
||||||
# Manage arguments with getopts
|
# Manage arguments with getopts
|
||||||
ynh_handle_getopts_args "$@"
|
ynh_handle_getopts_args "$@"
|
||||||
workdir="${workdir:-$final_path}"
|
workdir="${workdir:-$final_path}"
|
||||||
phpversion="${phpversion:-7.0}"
|
phpversion="${phpversion:-7.3}"
|
||||||
|
|
||||||
COMPOSER_HOME="$workdir/.composer" \
|
COMPOSER_HOME="$workdir/.composer" \
|
||||||
php${phpversion} "$workdir/composer.phar" $commands \
|
php${phpversion} "$workdir/composer.phar" $commands \
|
||||||
|
@ -51,7 +53,7 @@ ynh_install_composer () {
|
||||||
# Manage arguments with getopts
|
# Manage arguments with getopts
|
||||||
ynh_handle_getopts_args "$@"
|
ynh_handle_getopts_args "$@"
|
||||||
workdir="${workdir:-$final_path}"
|
workdir="${workdir:-$final_path}"
|
||||||
phpversion="${phpversion:-7.0}"
|
phpversion="${phpversion:-7.3}"
|
||||||
|
|
||||||
curl -sS https://getcomposer.org/installer \
|
curl -sS https://getcomposer.org/installer \
|
||||||
| COMPOSER_HOME="$workdir/.composer" \
|
| COMPOSER_HOME="$workdir/.composer" \
|
||||||
|
|
|
@ -19,41 +19,42 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..."
|
ynh_print_info --message="Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD BACKUP STEPS
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up the main app directory..."
|
|
||||||
|
|
||||||
ynh_backup --src_path="$final_path"
|
ynh_backup --src_path="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up nginx web server configuration..."
|
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE PHP-FPM CONFIGURATION
|
# BACKUP THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up php-fpm configuration..."
|
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf"
|
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE MYSQL DATABASE
|
# BACKUP THE MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up the MySQL database..."
|
ynh_print_info --message="Backing up the MySQL database..."
|
||||||
|
|
||||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||||
|
|
||||||
|
@ -61,4 +62,4 @@ ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last
|
ynh_print_info --message="Backup script completed for Roundcube. (YunoHost will then actually copy those files to the archive)."
|
||||||
|
|
|
@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..."
|
ynh_script_progression --message="Loading installation settings..." --weight=2
|
||||||
|
|
||||||
# Needed for helper "ynh_add_nginx_config"
|
# Needed for helper "ynh_add_nginx_config"
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
@ -50,23 +50,23 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# MODIFY URL IN NGINX CONF
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating nginx web server configuration..." --weight=2
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
|
||||||
|
|
||||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||||
|
|
||||||
# Change the path in the nginx config file
|
# Change the path in the NGINX config file
|
||||||
if [ $change_path -eq 1 ]
|
if [ $change_path -eq 1 ]
|
||||||
then
|
then
|
||||||
# Make a backup of the original nginx config file if modified
|
# Make a backup of the original NGINX config file if modified
|
||||||
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
|
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
|
||||||
# Set global variables for nginx helper
|
# Set global variables for NGINX helper
|
||||||
domain="$old_domain"
|
domain="$old_domain"
|
||||||
path_url="$new_path"
|
path_url="$new_path"
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Change the domain for nginx
|
# Change the domain for NGINX
|
||||||
if [ $change_domain -eq 1 ]
|
if [ $change_domain -eq 1 ]
|
||||||
then
|
then
|
||||||
# Delete file checksum for the old conf file location
|
# Delete file checksum for the old conf file location
|
||||||
|
@ -81,7 +81,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading nginx web server..."
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=2
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
@ -89,4 +89,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Change of URL completed for $app" --last
|
ynh_script_progression --message="Change of URL completed for Roundcube" --last
|
||||||
|
|
|
@ -50,13 +50,6 @@ ynh_app_setting_set --app=$app --key=with_enigma --value=$with_enigma
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
#=================================================
|
|
||||||
# INSTALL DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Installing dependencies..."
|
|
||||||
|
|
||||||
ynh_install_app_dependencies "$pkg_dependencies"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A MYSQL DATABASE
|
# CREATE A MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -78,9 +71,9 @@ ynh_setup_source --dest_dir="$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring nginx web server..."
|
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -94,17 +87,18 @@ ynh_system_user_create --username=$app
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring php-fpm..." --weight=2
|
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config
|
ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies"
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL AND INITIALIZE COMPOSER
|
# INSTALL AND INITIALIZE COMPOSER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing roundcube with composer..." --weight=30
|
ynh_script_progression --message="Installing Roundcube with Composer..." --weight=30
|
||||||
|
|
||||||
# Install composer.json
|
# Install composer.json
|
||||||
cp "$final_path/composer.json-dist" "$final_path/composer.json"
|
cp "$final_path/composer.json-dist" "$final_path/composer.json"
|
||||||
|
@ -123,7 +117,7 @@ ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name
|
||||||
#=================================================
|
#=================================================
|
||||||
# CONFIGURE ROUNDCUBE
|
# CONFIGURE ROUNDCUBE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring roundcube..."
|
ynh_script_progression --message="Configuring Roundcube..."
|
||||||
|
|
||||||
rc_conf="$final_path/config/config.inc.php"
|
rc_conf="$final_path/config/config.inc.php"
|
||||||
|
|
||||||
|
@ -163,7 +157,7 @@ then
|
||||||
carddav_server=0
|
carddav_server=0
|
||||||
|
|
||||||
# Look for installed and supported CardDAV servers
|
# Look for installed and supported CardDAV servers
|
||||||
for carddav_app in "owncloud" "nextcloud" "baikal"
|
for carddav_app in "nextcloud" "baikal"
|
||||||
do
|
do
|
||||||
carddav_app_id=$(yunohost app list --installed -f $carddav_app \
|
carddav_app_id=$(yunohost app list --installed -f $carddav_app \
|
||||||
--output-as json | grep -Po '"id":[ ]?"\K.*?(?=")' | head -1)
|
--output-as json | grep -Po '"id":[ ]?"\K.*?(?=")' | head -1)
|
||||||
|
@ -183,7 +177,7 @@ then
|
||||||
# Copy the plugin configuration file
|
# Copy the plugin configuration file
|
||||||
cp "$carddav_tmp_config" ""$final_path/plugins/carddav/config.inc.php""
|
cp "$carddav_tmp_config" ""$final_path/plugins/carddav/config.inc.php""
|
||||||
|
|
||||||
# Do not actualy add the carddav plugin if there's no carddav server available...
|
# Do not actualy add the carddav plugin if there's no CardDAV server available...
|
||||||
if [ $carddav_server -eq 1 ]
|
if [ $carddav_server -eq 1 ]
|
||||||
then
|
then
|
||||||
installed_plugins+=" 'carddav',"
|
installed_plugins+=" 'carddav',"
|
||||||
|
@ -205,7 +199,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE ROUNDCUBE CONFIGURATION
|
# UPDATE ROUNDCUBE CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating roundcube configuration..." --weight=3
|
ynh_script_progression --message="Updating Roundcube configuration..." --weight=3
|
||||||
|
|
||||||
ynh_replace_string --match_string="^\s*// installed plugins" --replace_string="&\n $installed_plugins" --target_file="$rc_conf"
|
ynh_replace_string --match_string="^\s*// installed plugins" --replace_string="&\n $installed_plugins" --target_file="$rc_conf"
|
||||||
|
|
||||||
|
@ -230,7 +224,7 @@ chown -R $app: "$final_path/"{temp,logs,plugins/enigma/home}
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading nginx web server..." --weight=2
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=2
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
@ -238,4 +232,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Installation of $app completed" --last
|
ynh_script_progression --message="Installation of Roundcube completed" --last
|
||||||
|
|
|
@ -41,7 +41,7 @@ ynh_mysql_remove_db --db_user=$db_name --db_name=$db_name
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE APP MAIN DIR
|
# REMOVE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing app main directory..." --weight=3
|
ynh_script_progression --message="Removing Roundcube main directory..." --weight=3
|
||||||
|
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
ynh_secure_remove --file="$final_path"
|
ynh_secure_remove --file="$final_path"
|
||||||
|
@ -49,17 +49,17 @@ ynh_secure_remove --file="$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NGINX CONFIGURATION
|
# REMOVE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing nginx web server configuration..." --weight=2
|
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=2
|
||||||
|
|
||||||
# Remove the dedicated nginx config
|
# Remove the dedicated NGINX config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE PHP-FPM CONFIGURATION
|
# REMOVE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing php-fpm configuration..." --weight=3
|
ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=3
|
||||||
|
|
||||||
# Remove the dedicated php-fpm config
|
# Remove the dedicated PHP-FPM config
|
||||||
ynh_remove_fpm_config
|
ynh_remove_fpm_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -76,4 +76,4 @@ ynh_system_user_delete --username=$app
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Removal of $app completed" --last
|
ynh_script_progression --message="Removal of Roundcube completed" --last
|
||||||
|
|
|
@ -27,6 +27,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
|
@ -49,7 +50,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the app main directory..."
|
ynh_script_progression --message="Restoring Roundcube main directory..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$final_path"
|
ynh_restore_file --origin_path="$final_path"
|
||||||
|
|
||||||
|
@ -74,18 +75,12 @@ chown -R $app: "$final_path/"{temp,logs,plugins/enigma/home}
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
|
ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
#=================================================
|
|
||||||
# REINSTALL DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=30
|
|
||||||
|
|
||||||
# Define and install dependencies
|
|
||||||
ynh_install_app_dependencies "$pkg_dependencies"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE MYSQL DATABASE
|
# RESTORE THE MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -100,13 +95,13 @@ ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX AND PHP-FPM
|
# RELOAD NGINX AND PHP-FPM
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading nginx web server and php-fpm..."
|
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=php7.0-fpm --action=reload
|
ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Restoration completed for $app" --last
|
ynh_script_progression --message="Restoration completed for Roundcube" --last
|
||||||
|
|
|
@ -22,6 +22,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
with_carddav=$(ynh_app_setting_get --app=$app --key=with_carddav)
|
with_carddav=$(ynh_app_setting_get --app=$app --key=with_carddav)
|
||||||
with_enigma=$(ynh_app_setting_get --app=$app --key=with_enigma)
|
with_enigma=$(ynh_app_setting_get --app=$app --key=with_enigma)
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -71,7 +72,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=30
|
ynh_script_progression --message="Backing up Roundcube before upgrading (may take a while)..." --weight=30
|
||||||
|
|
||||||
# Backup the current version of the app
|
# Backup the current version of the app
|
||||||
ynh_backup_before_upgrade
|
ynh_backup_before_upgrade
|
||||||
|
@ -109,18 +110,11 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading nginx web server configuration..."
|
ynh_script_progression --message="Upgrading NGINX web server configuration..."
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# UPGRADE DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading dependencies..." --weight=25
|
|
||||||
|
|
||||||
ynh_install_app_dependencies "$pkg_dependencies"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -132,10 +126,10 @@ ynh_system_user_create --username=$app
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=5
|
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=5
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config
|
ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
|
@ -145,7 +139,7 @@ ynh_add_fpm_config
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Reconfiguring roundcube..."
|
ynh_script_progression --message="Reconfiguring Roundcube..."
|
||||||
|
|
||||||
rc_conf="$final_path/config/config.inc.php"
|
rc_conf="$final_path/config/config.inc.php"
|
||||||
|
|
||||||
|
@ -163,12 +157,12 @@ then
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE DEPENDENCIES WITH COMPOSER
|
# UPDATE DEPENDENCIES WITH COMPOSER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating dependencies with composer..." --weight=30
|
ynh_script_progression --message="Updating dependencies with Composer..." --weight=30
|
||||||
|
|
||||||
# Upgrade composer itself
|
# Upgrade composer itself
|
||||||
ynh_install_composer
|
ynh_install_composer
|
||||||
|
|
||||||
# Check if dependencies need to be updated with composer
|
# Check if dependencies need to be updated with Composer
|
||||||
if [ -f "$final_path/composer.json" ]
|
if [ -f "$final_path/composer.json" ]
|
||||||
then
|
then
|
||||||
ynh_exec_warn_less ynh_composer_exec --commands=\"update --no-dev --prefer-dist\"
|
ynh_exec_warn_less ynh_composer_exec --commands=\"update --no-dev --prefer-dist\"
|
||||||
|
@ -205,7 +199,7 @@ then
|
||||||
carddav_server=0
|
carddav_server=0
|
||||||
|
|
||||||
# Look for installed and supported CardDAV servers
|
# Look for installed and supported CardDAV servers
|
||||||
for carddav_app in "owncloud" "nextcloud" "baikal"
|
for carddav_app in "nextcloud" "baikal"
|
||||||
do
|
do
|
||||||
carddav_app_id=$(yunohost app list --installed -f $carddav_app \
|
carddav_app_id=$(yunohost app list --installed -f $carddav_app \
|
||||||
--output-as json | grep -Po '"id":[ ]?"\K.*?(?=")' | head -1)
|
--output-as json | grep -Po '"id":[ ]?"\K.*?(?=")' | head -1)
|
||||||
|
@ -225,7 +219,7 @@ then
|
||||||
# Copy the plugin configuration file
|
# Copy the plugin configuration file
|
||||||
cp "$carddav_tmp_config" ""$final_path/plugins/carddav/config.inc.php""
|
cp "$carddav_tmp_config" ""$final_path/plugins/carddav/config.inc.php""
|
||||||
|
|
||||||
# Do not actually add the carddav plugin if there's no carddav server available...
|
# Do not actually add the cardDAV plugin if there's no carddav server available...
|
||||||
if [ $carddav_server -eq 1 ]
|
if [ $carddav_server -eq 1 ]
|
||||||
then
|
then
|
||||||
installed_plugins+=" 'carddav',"
|
installed_plugins+=" 'carddav',"
|
||||||
|
@ -247,11 +241,11 @@ then
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE ROUNDCUBE CONFIGURATION
|
# UPDATE ROUNDCUBE CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating roundcube configuration..." --weight=4
|
ynh_script_progression --message="Updating Roundcube configuration..." --weight=4
|
||||||
|
|
||||||
ynh_replace_string --match_string="^\s*// installed plugins" --replace_string="&\n $installed_plugins" --target_file="$rc_conf"
|
ynh_replace_string --match_string="^\s*// installed plugins" --replace_string="&\n $installed_plugins" --target_file="$rc_conf"
|
||||||
|
|
||||||
# Update javascript dependencies
|
# Update JavaScript dependencies
|
||||||
(cd "$final_path"
|
(cd "$final_path"
|
||||||
/usr/bin/php -q ./bin/install-jsdeps.sh)
|
/usr/bin/php -q ./bin/install-jsdeps.sh)
|
||||||
|
|
||||||
|
@ -261,7 +255,7 @@ then
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE ROUNDCUBE CORE
|
# UPDATE ROUNDCUBE CORE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating roundcube core..." --weight=4
|
ynh_script_progression --message="Updating Roundcube core..." --weight=4
|
||||||
|
|
||||||
( cd "$final_path"
|
( cd "$final_path"
|
||||||
ynh_exec_warn ./bin/update.sh --version=$oldversion -y)
|
ynh_exec_warn ./bin/update.sh --version=$oldversion -y)
|
||||||
|
@ -281,7 +275,7 @@ chown -R $app: "$final_path/"{temp,logs,plugins/enigma/home}
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading nginx web server..."
|
ynh_script_progression --message="Reloading NGINX web server..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
@ -289,4 +283,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Installation of $app completed" --last
|
ynh_script_progression --message="Installation of Roundcube completed" --last
|
||||||
|
|
Loading…
Reference in a new issue