From 00e6d54b67eb5901e2214caab437145e9d629d59 Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Sun, 18 Apr 2021 17:21:13 +0200 Subject: [PATCH] Merge from testing (#17) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Upgrade to version 12.9.3 * Update README.md Small update on the link's demo. We don't know how long they gonna redirect draw.io to app.diagrams.net * Remove commented code unused * Force http parameter to disable 3rds parties * fix quotting * Documentation * Upgrade version to 12.9.7 * Update README.md (#9) * Upgrade to upstream 13.2.5 * V.14.1.1 (#10) * Testing (#8) * Upgrade to version 12.9.3 * Update README.md Small update on the link's demo. We don't know how long they gonna redirect draw.io to app.diagrams.net * Remove commented code unused * Force http parameter to disable 3rds parties * fix quotting * Documentation * Upgrade version to 12.9.7 * Update README.md (#9) Co-authored-by: quentin-abiterra <49190209+quentin-abiterra@users.noreply.github.com> Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> * Upgrade to upstream version Co-authored-by: Gofannon <17145502+Gofannon@users.noreply.github.com> Co-authored-by: quentin-abiterra <49190209+quentin-abiterra@users.noreply.github.com> * Upgrade to upstream v14.4.0 (#12) * Upgrade to version 14.4.4 (#15) * Upgrade to version 14.4.0 (#13) * Upgrade to version 12.9.3 * Update README.md Small update on the link's demo. We don't know how long they gonna redirect draw.io to app.diagrams.net * Remove commented code unused * Force http parameter to disable 3rds parties * fix quotting * Documentation * Upgrade version to 12.9.7 * Update README.md (#9) * Upgrade to upstream 13.2.5 * V.14.1.1 (#10) * Testing (#8) * Upgrade to version 12.9.3 * Update README.md Small update on the link's demo. We don't know how long they gonna redirect draw.io to app.diagrams.net * Remove commented code unused * Force http parameter to disable 3rds parties * fix quotting * Documentation * Upgrade version to 12.9.7 * Update README.md (#9) Co-authored-by: quentin-abiterra <49190209+quentin-abiterra@users.noreply.github.com> Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> * Upgrade to upstream version Co-authored-by: Gofannon <17145502+Gofannon@users.noreply.github.com> Co-authored-by: quentin-abiterra <49190209+quentin-abiterra@users.noreply.github.com> * Upgrade to upstream v14.4.0 (#12) Co-authored-by: quentin-abiterra <49190209+quentin-abiterra@users.noreply.github.com> Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> * [fix] migrate to new permission system * [enh] add CI test for new permission system * Upgrade to version 14.4.4 * Cleaning up Co-authored-by: Gofannon <17145502+Gofannon@users.noreply.github.com> Co-authored-by: quentin-abiterra <49190209+quentin-abiterra@users.noreply.github.com> Co-authored-by: quentin-abiterra <49190209+quentin-abiterra@users.noreply.github.com> Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: ericgaspar --- README.md | 2 +- check_process | 6 ++--- conf/app.src | 4 ++-- manifest.json | 16 ++----------- pull_request_template.md | 4 +--- scripts/install | 12 +++++----- scripts/remove | 4 +--- scripts/restore | 2 +- scripts/upgrade | 51 +++++++++++++++++----------------------- 9 files changed, 38 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index adae11d..88c3e5d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to diagrams.net (formerly draw.io) lets you create a wide range of diagrams, from simple tree and flow diagrams, to highly technical network, rack and electrical diagrams. -**Shipped version:** 14.4.0 +**Shipped version:** 14.4.4 ## Screenshots diff --git a/check_process b/check_process index 1b2e1c9..36d21a1 100644 --- a/check_process +++ b/check_process @@ -11,7 +11,7 @@ setup_private=1 setup_public=1 upgrade=1 - #upgrade=1 from_commit=CommitHash + upgrade=1 from_commit=9e0c1be11dfe6485ab66f898494eff5bd6bac817 backup_restore=1 multi_instance=1 change_url=1 @@ -19,7 +19,7 @@ Email= Notification=none ;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. + ; commit=9e0c1be11dfe6485ab66f898494eff5bd6bac817 + name=Upgrade to version 14.4.0 (#13) manifest_arg=domain=DOMAIN&path=PATH&is_public=1 diff --git a/conf/app.src b/conf/app.src index 8dcf597..e11f10b 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/jgraph/drawio/archive/v14.4.0.tar.gz -SOURCE_SUM=a3bec714651eb421ecbf81e25171da2e7dc834cefb4119ecb3842a45e4f554d6 +SOURCE_URL=https://github.com/jgraph/drawio/archive/v14.4.4.tar.gz +SOURCE_SUM=a310355c75e5b2c15dbe96ff97dc64fe911f4508d426f26aa3a2ef63fad3174b SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 976cfd9..8b67db6 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online diagram software for making flowcharts, process diagrams, org charts, UML, ER and network diagrams.", "fr": "Application en ligne qui permet de faire des schémas et du dessin vectoriel." }, - "version": "14.4.0~ynh1", + "version": "14.4.4~ynh1", "url": "https://www.diagrams.net/", "license": "Apache-2.0", "maintainer": { @@ -14,7 +14,7 @@ "email": "gofannon@riseup.net" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ @@ -25,29 +25,17 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for Diagrams.net", - "fr": "Choisissez un nom de domaine pour Diagrams.net" - }, "example": "example.com" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Diagrams.net", - "fr": "Choisissez un chemin pour Diagrams.net" - }, "example": "/diagram", "default": "/diagram" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "default": false } ] diff --git a/pull_request_template.md b/pull_request_template.md index 18e20f7..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -13,6 +13,4 @@ ## Package_check results --- -*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* - -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/diagramsnet_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/diagramsnet_ynh%20PR-NUM-%20(USERNAME)/) +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/install b/scripts/install index 3e3064e..bd63fda 100644 --- a/scripts/install +++ b/scripts/install @@ -48,7 +48,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=2 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 #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -61,7 +60,7 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=15 +ynh_script_progression --message="Configuring NGINX web server..." --weight=15 # Create a dedicated nginx config ynh_add_nginx_config @@ -88,19 +87,20 @@ chown -R root: $final_path #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=3 +ynh_script_progression --message="Configuring permissions..." --weight=3 # 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="/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission="main" --add="visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index a0f80d2..14216b8 100644 --- a/scripts/remove +++ b/scripts/remove @@ -16,8 +16,6 @@ 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) #================================================= @@ -31,7 +29,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated nginx config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index f66a673..b0d5877 100644 --- a/scripts/restore +++ b/scripts/restore @@ -69,7 +69,7 @@ chown -R root: $final_path #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -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 diff --git a/scripts/upgrade b/scripts/upgrade index 93d41e4..40a80cf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME 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) #================================================= @@ -27,6 +26,18 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -41,7 +52,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -54,22 +64,7 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" -fi -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=17 - -# Create a dedicated nginx config -ynh_add_nginx_config - -#================================================= -# REMOVE CALLS TO THIRD PARTY WEBSITES -#================================================= - -if [ "$upgrade_type" == "UPGRADE_APP" ] -then # Add "offline" parameter in index.html # See https://desk.draw.io/support/solutions/articles/16000042546-what-url-parameters-are-supported- # and https://shelter.moe/@Neil/103928506546498078 [French] @@ -77,6 +72,14 @@ then sed -i "$sed_pattern" "$final_path/src/main/webapp/index.html" fi +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=17 + +# Create a dedicated nginx config +ynh_add_nginx_config + #================================================= # SECURE FILES AND DIRECTORIES #================================================= @@ -84,22 +87,10 @@ fi # Set permissions on app files chown -R root: $final_path -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=3 - -# 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 #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload