diff --git a/README.md b/README.md index 5d9a0a2..9e7eb02 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview Z-Push is an Exchange ActiveSync fronted written in php which lets you synchronize emails (imap/smtp backend) and calendar/contacts (carddav and caldav backend) -**Shipped version:** 2.5.2 +**Shipped version:** 2.6.1 ## Current status - [x] Z-push for Yunohost supports IMAP sync and Carddav/Caldav sync if Baikal or Nextcloud is installed diff --git a/check_process b/check_process index d6d5007..5c0bb81 100644 --- a/check_process +++ b/check_process @@ -15,13 +15,8 @@ upgrade=1 from_commit=9e8a72669814237122dfc6f901c9377895c193db backup_restore=1 multi_instance=1 - # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. - # incorrect_path=1 port_already_use=0 change_url=0 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email=yalh@yahoo.com Notification=all diff --git a/conf/app.src b/conf/app.src index 33206fe..0cae42c 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Z-Hub/Z-Push/archive/2.5.2.tar.gz -SOURCE_SUM=68fd705deee5481bb2935c32d9e184310ac2f1438e7791350313e7f4174d7040 +SOURCE_URL=https://github.com/Z-Hub/Z-Push/archive/2.6.1.tar.gz +SOURCE_SUM=db97e9ff2eebec01c65e1a9150524a1fb45dc4b003955fb0847fbb069f143e33 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 6af30cd..0a7f195 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -16,7 +16,7 @@ location /Microsoft-Server-ActiveSync/ { rewrite ^(.*)$ /Microsoft-Server-ActiveSync/index.php last; location ~ [^/]\.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; include fastcgi_params; @@ -31,7 +31,7 @@ location /Microsoft-Server-ActiveSync/ { location /AutoDiscover/AutoDiscover.xml { alias __FINALPATH__/autodiscover/autodiscover.php; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; include fastcgi_params; fastcgi_param HTTPS on; fastcgi_param SCRIPT_FILENAME $request_filename; @@ -39,7 +39,7 @@ location /AutoDiscover/AutoDiscover.xml { location /Autodiscover/Autodiscover.xml { alias __FINALPATH__/autodiscover/autodiscover.php; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; include fastcgi_params; fastcgi_param HTTPS on; fastcgi_param SCRIPT_FILENAME $request_filename; @@ -47,7 +47,7 @@ location /Autodiscover/Autodiscover.xml { location /autodiscover/autodiscover.xml { alias __FINALPATH__/autodiscover/autodiscover.php; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; include fastcgi_params; fastcgi_param HTTPS on; fastcgi_param SCRIPT_FILENAME $request_filename; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 50354f3..b592e5b 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -33,7 +33,7 @@ group = __USER__ ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; 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. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) diff --git a/manifest.json b/manifest.json index 0c41f77..1e058b9 100644 --- a/manifest.json +++ b/manifest.json @@ -3,10 +3,10 @@ "id": "z-push", "packaging_format": 1, "description": { - "en": "Z-Push is an ActiveSync frontend that helps you synchronize emails, calendar and contacts", - "fr": "Z-Push est un frontend ActiveSync qui permet de synchroniser emails, calendrier et contacts" + "en": "ActiveSync frontend that helps you synchronize emails, calendar and contacts", + "fr": "Frontend ActiveSync qui permet de synchroniser emails, calendrier et contacts" }, - "version": "2.5.2~ynh1", + "version": "2.6.1~ynh1", "url": "https://z-push.org", "license": "AGPL-3.0-or-later", "maintainer": { @@ -21,11 +21,11 @@ } ], "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 3.8.1" }, "services": [ "nginx", - "php7.0-fpm" + "php7.3-fpm" ], "multi_instance": true, "arguments": { @@ -34,8 +34,8 @@ "name": "domain", "type": "domain", "ask": { - "en": "Choose a domain for Z-push", - "fr": "Choisissez un domaine pour Z-push" + "en": "Choose a domain for Z-Push", + "fr": "Choisissez un domaine pour Z-Push" }, "example": "domain.org" } diff --git a/scripts/_common.sh b/scripts/_common.sh index 1228e40..8464ffd 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,10 @@ # COMMON VARIABLES #================================================= +YNH_PHP_VERSION="7.3" + # dependencies used by the app -pkg_dependencies="php-soap php-imap libawl-php php-xsl php-curl libawl-php php-xml php-ldap php-cli php-mbstring php-memcached" +pkg_dependencies="php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-xsl php${YNH_PHP_VERSION}-curl libawl-php php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-memcached" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index fd740e8..e0c5f29 100755 --- a/scripts/backup +++ b/scripts/backup @@ -32,13 +32,16 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) statedir=$(ynh_app_setting_get --app=$app --key=statedir) final_logpath=$(ynh_app_setting_get --app=$app --key=final_logpath) +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 #================================================= -ynh_print_info --message="Backing up the main app directory..." ynh_backup --src_path="$final_path" @@ -51,21 +54,18 @@ ynh_backup --src_path="$final_logpath" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Backing up nginx web server configuration..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_print_info --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 LOGROTATE #================================================= -ynh_print_info --message="Backing up logrotate configuration..." ynh_backup --src_path="/etc/logrotate.d/$app" diff --git a/scripts/install b/scripts/install index 8bbbdfc..0d3975f 100755 --- a/scripts/install +++ b/scripts/install @@ -23,7 +23,7 @@ ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -ynh_print_info --message="Retrieving arguments from the manifest..." +ynh_script_progression --message="Retrieving arguments from the manifest..." domain=$YNH_APP_ARG_DOMAIN path_url="/Microsoft-Server-ActiveSync" @@ -33,7 +33,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_print_info --message="Validating installation parameters..." +ynh_script_progression --message="Validating installation parameters..." final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -62,14 +62,14 @@ ynh_app_setting_set --app=$app --key=final_logpath --value="$final_logpath" #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_print_info --message="Installing dependencies..." +ynh_script_progression --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_print_info --message="Setting up source files..." +ynh_script_progression --message="Setting up source files..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src @@ -82,7 +82,7 @@ ynh_secure_remove "$final_path/tmp" #================================================= # NGINX CONFIGURATION #================================================= -ynh_print_info --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated nginx config ynh_add_nginx_config @@ -90,7 +90,7 @@ ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info --message="Configuring system user..." +ynh_script_progression --message="Configuring system user..." # Create a system user ynh_system_user_create --username=$app @@ -98,7 +98,7 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_print_info --message="Configuring php-fpm..." +ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated php-fpm config ynh_add_fpm_config @@ -108,7 +108,7 @@ ynh_add_fpm_config #================================================= # CREATE STATEDIR AND FINAL_LOGPATH #================================================= -ynh_print_info --message="Creating statedir and final_logpath..." +ynh_script_progression --message="Creating statedir and final_logpath..." mkdir -p $statedir chown -R $app: $statedir @@ -119,7 +119,7 @@ chown -R $app: $final_logpath #================================================= # MODIFY A CONFIG FILE #================================================= -ynh_print_info --message="Modifying a config file..." +ynh_script_progression --message="Modifying a config file..." # Configuration ynh_replace_string --match_string="__TIMEZONE__" --replace_string=$(cat /etc/timezone) --target_file="../conf/config.php" @@ -132,7 +132,7 @@ ynh_replace_string --match_string="__FINAL_LOGPATH__" --replace_string=$final_lo ynh_replace_string --match_string="__STATEDIR__" --replace_string=$statedir --target_file="../conf/config.php" # Enable caldav carddav support -if yunohost app list --installed -f baikal | grep -q id ; then +if yunohost app list | grep -q 'id: baikal' ; then echo "Detected Baikal" bailkaldomain=$(ynh_app_setting_get --app="baikal" --key=domain) bailkalpath=$(ynh_app_setting_get --app="baikal" --key=path) @@ -160,7 +160,7 @@ if yunohost app list --installed -f baikal | grep -q id ; then cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php cp ../conf/backend/config-combined.php $final_path/backend/combined/config.php -elif yunohost app list --installed -f nextcloud | grep -q id ; then +elif yunohost app list | grep -q 'id: nextcloud' ; then echo "Detected NextCloud" nextclouddomain=$(ynh_app_setting_get --app="nextcloud" --key=domain) nextcloudpath=$(ynh_app_setting_get --app="nextcloud" --key=path) @@ -213,7 +213,7 @@ ln -s /usr/share/awl/inc/XML* /var/www/$app/include/ #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_print_info --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." # Set permissions to app files chown -R $app: $final_path @@ -221,7 +221,7 @@ chown -R $app: $final_path #================================================= # SETUP LOGROTATE #================================================= -ynh_print_info --message="Configuring log rotation..." +ynh_script_progression --message="Configuring log rotation..." # Use logrotate to manage application logfile(s) ynh_use_logrotate @@ -229,7 +229,7 @@ ynh_use_logrotate #================================================= # SETUP SSOWAT #================================================= -ynh_print_info --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring SSOwat..." # Make app public ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" @@ -239,7 +239,7 @@ ynh_app_setting_set --app=$app --key=skipped_regex --value="$domain_regex/[Aa]ut #================================================= # RELOAD NGINX #================================================= -ynh_print_info --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -247,4 +247,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_print_info --message="Installation of $app completed" +ynh_script_progression --message="Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index 3f6bad4..f351894 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -27,7 +27,7 @@ final_logpath=$(ynh_app_setting_get --app=$app --key=final_logpath) #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_print_info --message="Removing dependencies..." +ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -35,7 +35,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_print_info --message="Removing app main directory..." +ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -43,7 +43,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated nginx config ynh_remove_nginx_config @@ -51,7 +51,7 @@ ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_print_info --message="Removing php-fpm configuration..." +ynh_script_progression --message="Removing PHP-FPM configuration..." # Remove the dedicated php-fpm config ynh_remove_fpm_config @@ -59,7 +59,7 @@ ynh_remove_fpm_config #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_print_info --message="Removing logrotate configuration..." +ynh_script_progression --message="Removing logrotate configuration..." # Remove the app-specific logrotate config ynh_remove_logrotate @@ -69,7 +69,7 @@ ynh_remove_logrotate #================================================= # REMOVE STATEDIR AND FINAL_LOGPATH #================================================= -ynh_print_info --message="Removing statedir and final_logpath..." +ynh_script_progression --message="Removing statedir and final_logpath..." ynh_secure_remove --file="$statedir" ynh_secure_remove --file="$final_logpath" @@ -78,4 +78,4 @@ ynh_secure_remove --file="$final_logpath" # END OF SCRIPT #================================================= -ynh_print_info --message="Removal of $app completed" +ynh_script_progression --message="Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 56df3f6..eabf8d3 100755 --- a/scripts/restore +++ b/scripts/restore @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading settings..." +ynh_script_progression --message="Loading settings..." app=$YNH_APP_INSTANCE_NAME @@ -33,11 +33,12 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) statedir=$(ynh_app_setting_get --app=$app --key=statedir) final_logpath=$(ynh_app_setting_get --app=$app --key=final_logpath) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_print_info --message="Validating restoration parameters..." +ynh_script_progression --message="Validating restoration parameters..." ynh_webpath_available --domain=$domain --path_url=$path_url \ || ynh_die --message="Path not available: ${domain}${path_url}" @@ -49,14 +50,14 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Restoring the nginx configuration..." +ynh_script_progression --message="Restoring the nginx configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_print_info --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" @@ -69,7 +70,7 @@ ynh_restore_file --origin_path="$final_logpath" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_print_info --message="Recreating the dedicated system user..." +ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) ynh_system_user_create --username=$app @@ -77,7 +78,7 @@ ynh_system_user_create --username=$app #================================================= # RESTORE USER RIGHTS #================================================= -ynh_print_info --message="Restoring user rights..." +ynh_script_progression --message="Restoring user rights..." # Restore permissions on app files chown -R $app: $final_path @@ -87,16 +88,16 @@ chown -R $app: $final_logpath #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_print_info --message="Restoring PHP-FPM configuration..." +ynh_script_progression --message="Restoring 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" #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_print_info --message="Reinstalling dependencies..." +ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -104,7 +105,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE LOGROTATE CONFIGURATION #================================================= -ynh_print_info --message="Restoring the logrotate configuration..." +ynh_script_progression --message="Restoring the logrotate configuration..." ynh_restore_file --origin_path="/etc/logrotate.d/$app" @@ -113,13 +114,13 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_print_info --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 #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Restoration completed for $app" +ynh_script_progression --message="Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index e60c67d..6a2c12d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -25,14 +25,14 @@ final_logpath=$(ynh_app_setting_get --app=$app --key=final_logpath) #================================================= # CHECK VERSION #================================================= -ynh_print_info --message="Checking version..." +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_print_info --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." # Fix is_public as a boolean value if [ "$is_public" = "Yes" ]; then @@ -66,7 +66,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_print_info --message="Backing up the app before upgrading (may take a while)..." +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade @@ -77,18 +77,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -# N.B. : this is for app installations before YunoHost 2.7 -# where this value might be something like /foo/ or foo/ -# instead of /foo .... -# If nobody installed your app before 2.7, then you may -# safely remove this line -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -97,7 +85,7 @@ path_url=$(ynh_normalize_url_path --path_url=$path_url) if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_print_info --message="Upgrading source files..." + ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src mkdir "$final_path/tmp" @@ -109,7 +97,7 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_print_info --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading nginx web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config @@ -117,14 +105,14 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_print_info --message="Upgrading dependencies..." +ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info --message="Making sure dedicated system user exists..." +ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create --username=$app @@ -132,7 +120,7 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_print_info --message="Upgrading php-fpm configuration..." +ynh_script_progression --message="Upgrading php-fpm configuration..." # Create a dedicated php-fpm config ynh_add_fpm_config @@ -142,7 +130,7 @@ ynh_add_fpm_config #================================================= # MODIFY A CONFIG FILE #================================================= -ynh_print_info --message="Modifying a config file..." +ynh_script_progression --message="Modifying a config file..." # Configuration ynh_replace_string --match_string="__TIMEZONE__" --replace_string="$(cat /etc/timezone)" --target_file="../conf/config.php" @@ -155,7 +143,7 @@ ynh_replace_string --match_string="__FINAL_LOGPATH__" --replace_string="$final_l ynh_replace_string __STATEDIR__ $statedir ../conf/config.php # Enable caldav carddav support -if yunohost app list --installed -f baikal | grep -q id ; then +if yunohost app list | grep -q 'id: baikal' ; then echo "Detected Baikal" bailkaldomain=$(ynh_app_setting_get --app=baikal --key=domain) bailkalpath=$(ynh_app_setting_get --app=baikal --key=path) @@ -183,7 +171,7 @@ if yunohost app list --installed -f baikal | grep -q id ; then cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php cp ../conf/backend/config-combined.php $final_path/backend/combined/config.php -elif yunohost app list --installed -f nextcloud | grep -q id ; then +elif yunohost app list | grep -q 'id: nextcloud' ; then echo "Detected NextCloud" nextclouddomain=$(ynh_app_setting_get --app=nextcloud --key=domain) nextcloudpath=$(ynh_app_setting_get --app=nextcloud --key=path) @@ -234,7 +222,7 @@ $final_path/z-push-admin.php -a fixstates #================================================= # SETUP LOGROTATE #================================================= -ynh_print_info --message="Upgrading logrotate configuration..." +ynh_script_progression --message="Upgrading logrotate configuration..." # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append @@ -244,7 +232,7 @@ ynh_use_logrotate --non-append #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_print_info --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." # Set permissions on app files chown -R $app: $final_path @@ -255,7 +243,7 @@ chown -R $app: $final_logpath #================================================= # SETUP SSOWAT #================================================= -ynh_print_info --message="Upgrading SSOwat configuration..." +ynh_script_progression --message="Upgrading SSOwat configuration..." # Make app public ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" @@ -265,7 +253,7 @@ ynh_app_setting_set --app=$app --key=skipped_regex --value="$domain_regex/[Aa]ut #================================================= # RELOAD NGINX #================================================= -ynh_print_info --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading nginx web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -273,4 +261,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_print_info --message="Upgrade of $app completed" +ynh_script_progression --message="Upgrade of $app completed"