diff --git a/README.md b/README.md index ef69870..6fadb2f 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,58 @@ # My-Mind for YunoHost -[![Integration level](https://dash.yunohost.org/integration/my-mind.svg)](https://dash.yunohost.org/appci/app/my-mind) -[![Install my-mind with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=my-mind) +[![Integration level](https://dash.yunohost.org/integration/my-mind.svg)](https://dash.yunohost.org/appci/app/my-mind) ![](https://ci-apps.yunohost.org/ci/badges/my-mind.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/my-mind.maintain.svg) +[![Install My-Mind with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=my-mind) -> *This package allow you to install my-mind quickly and simply on a YunoHost server. +> *This package allow you to install My-Mind quickly and simply on a YunoHost server. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* -Version: 1.2

-* [Yunohost project](https://yunohost.org) -* [My-Mind official web page](http://my-mind.github.io/) -* [Sample mind map](http://my-mind.github.io/?map=examples/features.mymind) showcasing many features -* [My-Mind News / Changelog](https://github.com/ondras/my-mind/wiki/News) -* [My-Mind documentation](https://github.com/ondras/my-mind/wiki) - -![Screenshot](https://github.com/ondras/my-mind/blob/master/screenshot.png) - -## What is My-Mind ? -My Mind is a web application for creating and managing Mind maps. It is free to use and you can fork its source code. It is distributed under the terms of the MIT license. - +## Overview +My-Mind is a web application for creating and managing Mind maps. It is free to use and you can fork its source code. It is distributed under the terms of the MIT license. New to Mind maps? They are useful, aesthetic and cool! Read more about these special diagrams in [the Wikipedia article](http://en.wikipedia.org/wiki/Mind_map). -**Multi-user:** Yes. +**Shipped version:** 1.2 + +## Screenshots + +![](https://github.com/ondras/my-mind/blob/master/screenshot.png) + +## Demo + +* [Official demo](http://my-mind.github.io/?map=examples/features.mymind) + +## Configuration + +How to configure this app: From an admin panel, a plain file with SSH, or any other way. + +## Documentation + + * Official documentation: https://github.com/ondras/my-mind/wiki + * YunoHost documentation: If specific documentation is needed, feel free to contribute. + +## YunoHost specific features + +#### Multi-user support + + * Are LDAP and HTTP auth supported? **No** +* Can the app be used by multiple users? **Yes** #### Supported architectures * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/my-mind%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/my-mind/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/my-mind%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/my-mind/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/my-mind%20%28Community%29.svg)](https://ci-stretch.nohost.me/ci/apps/my-mind/) + +## Limitations + +* Any known limitations. + +## Additional information + +* Other info you would like to add about this app. + +## Links + + * Report a bug: https://github.com/YunoHost-Apps/my-mind_ynh/issues + * App website: http://my-mind.github.io/ + * Upstream app repository: https://github.com/ondras/my-mind + * YunoHost website: https://yunohost.org/ + diff --git a/check_process b/check_process index 20b4bff..8ba9f57 100644 --- a/check_process +++ b/check_process @@ -18,7 +18,6 @@ upgrade=1 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=1 diff --git a/conf/nginx.conf b/conf/nginx.conf index 119a81e..856e524 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,7 +9,6 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } -### Example PHP configuration (remove it if not used) index index.html index.php; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file @@ -18,14 +17,7 @@ location __PATH__/ { try_files $uri $uri/ index.php index.html; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; - - # If you don't use a dedicated fpm config for your app, - # use a general fpm pool. - # This is to be used INSTEAD of line above - # Don't forget to adjust scripts install/upgrade/remove/backup accordingly - # - #fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; @@ -33,7 +25,6 @@ location __PATH__/ { fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $request_filename; } - # PHP configuration end # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index ab5dca9..ab1a471 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 8ef43f3..39a4a87 100644 --- a/manifest.json +++ b/manifest.json @@ -1,10 +1,10 @@ { - "name": "my-mind", + "name": "My-Mind", "id": "my-mind", "packaging_format": 1, "description": { "en": "Online Mindmapping Software", - "fr": "Editeur de mindmaps, carte mentales" + "fr": "Éditeur de cartes mentales" }, "version": "1.2~ynh1", "url": "https://github.com/ondras/my-mind", @@ -15,7 +15,7 @@ "url": "https://datamol.org" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": [ @@ -28,8 +28,8 @@ "name": "domain", "type": "domain", "ask": { - "en": "Choose a domain name for my-mind", - "fr": "Choisissez un nom de domaine pour my-mind" + "en": "Choose a domain name for My-Mind", + "fr": "Choisissez un nom de domaine pour My-Mind" }, "example": "example.com" }, @@ -37,8 +37,8 @@ "name": "path", "type": "path", "ask": { - "en": "Choose a path for my-mind", - "fr": "Choisissez un chemin pour my-mind" + "en": "Choose a path for My-Mind", + "fr": "Choisissez un chemin pour My-Mind" }, "example": "/example", "default": "/mymind" diff --git a/scripts/_common.sh b/scripts/_common.sh index 8bb05b4..d7614e9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,7 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -pkg_dependencies="deb1 deb2" +YNH_PHP_VERSION="7.3" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 614e835..ea50559 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,6 @@ # 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 @@ -14,48 +13,44 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) +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_script_progression --message="Backing up the main app directory..." --time --weight=1 ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up nginx web server configuration..." --time --weight=1 ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Backing up php-fpm configuration..." --time --weight=1 -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" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --time --last +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 517d497..8667411 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,20 +24,15 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) -# Add settings here as needed by your application -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name -#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up the app before changing its URL(may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -72,7 +67,7 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -98,18 +93,12 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi -#================================================= -# SPECIFIC MODIFICATIONS -#================================================= -# ... -#================================================= - #================================================= # GENERIC FINALISATION #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -117,4 +106,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --time --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index 79af9f0..ed2c5fc 100644 --- a/scripts/install +++ b/scripts/install @@ -13,11 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -27,16 +22,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC -### If it's a multi-instance app, meaning it can be installed several times independently -### The id of the app as stated in the manifest is available as $YNH_APP_ID -### The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...) -### The app instance name is available as $YNH_APP_INSTANCE_NAME -### - the first time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample -### - the second time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample__2 -### - ynhexample__{N} for the subsequent installations, with N=3,4, ... -### The app instance name is probably what interests you most, since this is -### guaranteed to be unique. This is a good unique identifier to define installation path, -### db names, ... + app=$YNH_APP_INSTANCE_NAME #================================================= @@ -44,8 +30,6 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." --time --weight=1 -### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". -### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -61,18 +45,11 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=is_public --value=$is_public -#================================================= -# STANDARD MODIFICATIONS -#================================================= #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --time --weight=1 -### `ynh_setup_source` is used to install an app from a zip or tar.gz file, -### downloaded from an upstream source, like a git repository. -### `ynh_setup_source` use the file conf/app.src - ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" @@ -80,9 +57,7 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --time --weight=1 - -### `ynh_add_nginx_config` will use the file conf/nginx.conf +ynh_script_progression --message="Configuring NGINX web server..." --time --weight=1 # Create a dedicated nginx config ynh_add_nginx_config @@ -98,53 +73,34 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." --time --weight=1 - -### `ynh_add_fpm_config` is used to set up a PHP config. -### You can remove it if your app doesn't use PHP. -### `ynh_add_fpm_config` will use the files conf/php-fpm.conf -### If you're not using these lines: -### - You can remove these files in conf/. -### - Remove the section "BACKUP THE PHP-FPM CONFIGURATION" in the backup script -### - Remove also the section "REMOVE PHP-FPM CONFIGURATION" in the remove script -### - As well as the section "RESTORE THE PHP-FPM CONFIGURATION" in the restore script -### With the reload at the end of the script. -### - And the section "PHP-FPM CONFIGURATION" in the upgrade script +ynh_script_progression --message="Configuring PHP-FPM..." --time --weight=1 # Create a dedicated php-fpm config -ynh_add_fpm_config - - +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SETUP APPLICATION WITH CURL #================================================= -### Use these lines only if the app installation needs to be finalized through -### web forms. We generally don't want to ask the final user, -### so we're going to use curl to automatically fill the fields and submit the -### forms. - # Set right permissions for curl install chown -R $app: $final_path - #================================================= # SETUP SSOWAT #================================================= ynh_script_progression --message="Configuring SSOwat..." --time --weight=1 -# Make app public if necessary +# Make app public if necessary or protect it if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + ynh_permission_update --permission "main" --add "visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading nginx web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -152,4 +108,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --time --last +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove index 75ab015..7f5e0e3 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,23 +12,17 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -#================================================= -# STANDARD REMOVE -#================================================= - - - #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --time --weight=1 +ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -49,7 +43,6 @@ ynh_script_progression --message="Removing php-fpm configuration..." --time --we # Remove the dedicated php-fpm config ynh_remove_fpm_config - #================================================= # GENERIC FINALIZATION #================================================= @@ -64,4 +57,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --time --last +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index e796489..eee910a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,11 +14,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -31,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -72,14 +68,12 @@ ynh_system_user_create --username=$app # Restore permissions on app files chown -R $app: $final_path - #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" - #================================================= # GENERIC FINALIZATION #================================================= @@ -87,7 +81,7 @@ ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" #================================================= ynh_script_progression --message="Reloading nginx web server and php-fpm..." --time --weight=1 -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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d569f23..fd40204 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -74,7 +75,6 @@ ynh_script_progression --message="Upgrading nginx web server configuration..." - # Create a dedicated nginx config ynh_add_nginx_config - #================================================= # CREATE DEDICATED USER #================================================= @@ -89,8 +89,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading php-fpm configuration..." --time --weight=1 # Create a dedicated php-fpm config -ynh_add_fpm_config - +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION #================================================= # SETUP APPLICATION WITH CURL @@ -99,19 +98,6 @@ ynh_add_fpm_config # Set right permissions for curl install chown -R $app: $final_path - -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1 - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # unprotected_uris allows SSO credentials to be passed anyway - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -fi - #================================================= # RELOAD NGINX #================================================= @@ -123,4 +109,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --time --last +ynh_script_progression --message="Upgrade of $app completed" --last