diff --git a/README.md b/README.md index 945e030..f65cb5f 100644 --- a/README.md +++ b/README.md @@ -29,25 +29,34 @@ You can extend - or even override - the Roundcube configuration which is coming * Official documentation: https://github.com/roundcube/roundcubemail/wiki * YunoHost documentation: https://github.com/YunoHost/doc/blob/master/app_roundcube.md: -## Licence - -LICENCE: GPL-3.0-only - ## YunoHost specific features In addition to Roundcube core features, the following are made available with -this package +this package: + + * Synchronize your email aliases as identities in Roundcube + * Install the [contextmenu](https://plugins.roundcube.net/packages/johndoh/contextmenu) + and [automatic addressbook](https://plugins.roundcube.net/packages/sblaisot/automatic_addressbook) + plugins by default + * Allow to install the [CardDAV](https://plugins.roundcube.net/packages/roundcube/carddav) + (address book) synchronization plugin at the installation - note that if + you have installed ownCloud or Baïkal, it will automatically add the + corresponding and existing address book. #### Multi-users support +* Integrate with YunoHost users and SSO - i.e. logout button, YunoHost users + search #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/roundcube%20%28Official%29.svg)](https://ci-apps.yunohost.org/ci/apps/roundcube/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/roundcube%20%28Official%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/roundcube/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/roundcube%20%28Official%29.svg)](https://ci-stretch.nohost.me/ci/apps/roundcube/) +* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/roundcube%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/roundcube/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/roundcube%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/roundcube/) +* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/roundcube%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/roundcube/) ## Limitations +* No known limitations. + ## Additional information #### Plugins @@ -94,34 +103,6 @@ steps as needed. You can also download the plugin and put it under the `plugins/` directory. In this case, do not forget to change ownerships of this folder to `roundcube`. -## YunoHost specific features - -In addition to Roundcube core features, the following are made available with -this package: - - * Synchronize your email aliases as identities in Roundcube - * Install the [contextmenu](https://plugins.roundcube.net/packages/johndoh/contextmenu) - and [automatic addressbook](https://plugins.roundcube.net/packages/sblaisot/automatic_addressbook) - plugins by default - * Allow to install the [CardDAV](https://plugins.roundcube.net/packages/roundcube/carddav) - (address book) synchronization plugin at the installation - note that if - you have installed ownCloud or Baïkal, it will automatically add the - corresponding and existing address book. - -#### Multi-users support -* Integrate with YunoHost users and SSO - i.e. logout button, YunoHost users - search -#### Supported architectures - -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/roundcube%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/roundcube/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/roundcube%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/roundcube/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/roundcube%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/roundcube/) - -## Limitations - -* No known limitations. - - ## Links * Report a bug: https://github.com/YunoHost-Apps/roundcube_ynh/issues diff --git a/check_process b/check_process index 6dd51b9..b7c4303 100644 --- a/check_process +++ b/check_process @@ -17,7 +17,7 @@ multi_instance=1 incorrect_path=1 port_already_use=0 - change_url=0 + change_url=1 ;;; Levels Level 5=auto ;;; Options diff --git a/scripts/change_url b/scripts/change_url new file mode 100644 index 0000000..14c221d --- /dev/null +++ b/scripts/change_url @@ -0,0 +1,92 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# RETRIEVE ARGUMENTS +#================================================= + +old_domain=$YNH_APP_OLD_DOMAIN +old_path=$YNH_APP_OLD_PATH + +new_domain=$YNH_APP_NEW_DOMAIN +new_path=$YNH_APP_NEW_PATH + +app=$YNH_APP_INSTANCE_NAME + +#================================================= +# LOAD SETTINGS +#================================================= +ynh_script_progression --message="Loading installation settings..." + +# Needed for helper "ynh_add_nginx_config" +final_path=$(ynh_app_setting_get --app=$app --key=final_path) + +#================================================= +# CHECK WHICH PARTS SHOULD BE CHANGED +#================================================= + +change_domain=0 +if [ "$old_domain" != "$new_domain" ] +then + change_domain=1 +fi + +change_path=0 +if [ "$old_path" != "$new_path" ] +then + change_path=1 +fi + +#================================================= +# STANDARD MODIFICATIONS +#================================================= +# MODIFY URL IN NGINX CONF +#================================================= +ynh_script_progression --message="Updating nginx web server configuration..." --weight=2 + +nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf + +# Change the path in the nginx config file +if [ $change_path -eq 1 ] +then + # Make a backup of the original nginx config file if modified + ynh_backup_if_checksum_is_different --file="$nginx_conf_path" + # Set global variables for nginx helper + domain="$old_domain" + path_url="$new_path" + # Create a dedicated nginx config + ynh_add_nginx_config +fi + +# Change the domain for nginx +if [ $change_domain -eq 1 ] +then + # Delete file checksum for the old conf file location + ynh_delete_file_checksum --file="$nginx_conf_path" + mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf + # Store file checksum for the new config file location + ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +fi + +#================================================= +# GENERIC FINALISATION +#================================================= +# RELOAD NGINX +#================================================= +ynh_script_progression --message="Reloading nginx web server..." + +ynh_systemd_action --service_name=nginx --action=reload + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index b3feb24..b993aed 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -165,6 +165,9 @@ then #================================================= ynh_script_progression --message="Updating dependencies with composer..." --weight=30 + # Upgrade composer itself + ynh_install_composer + # Check if dependencies need to be updated with composer if [ -f "$final_path/composer.json" ] then @@ -172,9 +175,6 @@ then else # Install composer.json cp "$final_path/composer.json-dist" "$final_path/composer.json" - - # Install composer - ynh_install_composer fi #================================================= # UPGRADE ADDITIONAL PLUGINS