diff --git a/README.md b/README.md index a62b125..9a8015c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ + + # Strut for YunoHost [![Integration level](https://dash.yunohost.org/integration/strut.svg)](https://dash.yunohost.org/appci/app/strut) ![](https://ci-apps.yunohost.org/ci/badges/strut.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/strut.maintain.svg) @@ -5,38 +10,22 @@ *[Lire ce readme en français.](./README_fr.md)* -> *This package allow you to install Strut 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.* +> *This package allows you to install Strut quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview + Strut is a simple, online editor that doesn't even require registration to operate. Everything you do is recoverable and re-usable. -**Shipped version:** 20171224-1 +**Shipped version:** 20220404~ynh1 + +**Demo:** http://strut.io/dist/ ## Screenshots -![](https://f.cloud.github.com/assets/1009003/515405/f1003c6a-be74-11e2-84b9-14776c652afb.png) +![](./doc/screenshots/f1003c6a-be74-11e2-84b9-14776c652afb.png) -## Demo - -* [Official demo](http://strut.io/dist/) - -## Configuration - -If configuration is needed, feel free to contribute. - -## Documentation - - * YunoHost documentation: If specific documentation is needed, feel free to contribute. - -## YunoHost specific features - -#### Multi-users support - -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/strut.svg)](https://ci-apps.yunohost.org/ci/apps/strut/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/strut.svg)](https://ci-apps-arm.yunohost.org/ci/apps/strut/) +## Disclaimers / important information ## Limitations No import/export from/to OpenDocument or pptx. @@ -49,18 +38,16 @@ Initial Strut software includes Google Analytics and is bind to Imgur to upload To avoid to take time to build this html/js app, this package setups a builded version of Strut with the patch that remove Google Analytics and Imgur dependencies. It is a build of this version https://github.com/tantaman/Strut/commits/6761b141ee7aa622916e2d23cced84ee95618cce . So it's not the more recent version. -## Links +## Documentation and resources - * Report a bug: https://github.com/YunoHost-Apps/strut_ynh/issues - * Strut website: http://strut.io - * Strut repository: https://github.com/MohannadNaj/Strut - * YunoHost website: https://yunohost.org/ +* Official app website: http://strut.io +* Upstream app code repository: https://github.com/MohannadNaj/Strut +* YunoHost documentation for this app: https://yunohost.org/app_strut +* Report a bug: https://github.com/YunoHost-Apps/strut_ynh/issues ---- +## Developer info -## Developers info - -Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/strut_ynh/tree/testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/strut_ynh/tree/testing). To try the testing branch, please proceed like that. ``` @@ -68,3 +55,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/strut_ynh/tree/testin or sudo yunohost app upgrade strut -u https://github.com/YunoHost-Apps/strut_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/README_fr.md b/README_fr.md index 408fde6..9987b99 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,42 +1,28 @@ # Strut pour YunoHost -[![Niveau d'integration](https://dash.yunohost.org/integration/strut.svg)](https://dash.yunohost.org/appci/app/strut) +[![Niveau d'intégration](https://dash.yunohost.org/integration/strut.svg)](https://dash.yunohost.org/appci/app/strut) ![](https://ci-apps.yunohost.org/ci/badges/strut.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/strut.maintain.svg) [![Installer Strut avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=strut) -*[Read this readme in english.](./README.md)* +*[Read this readme in english.](./README.md)* +*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer Strut rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/install) pour savoir comment l'installer et en profiter* +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* ## Vue d'ensemble + Strut est un éditeur WEB de présentations fonctionnant en HTML/JS. Tout se passe en local. Il fonctinne grâce à [impress.js](http://bartaz.github.com/impress.js/#/bored). -**Version incluse :** 20171224-1 + +**Version incluse :** 20220404~ynh1 + +**Démo :** http://strut.io/dist/ ## Captures d'écran -![](https://f.cloud.github.com/assets/1009003/515405/f1003c6a-be74-11e2-84b9-14776c652afb.png) +![](./doc/screenshots/f1003c6a-be74-11e2-84b9-14776c652afb.png) -## Démo - -* [Démo officielle](http://strut.io/editor/index.html) - -## Configuration - -S'il y a une configuration possible, sentez vous libre d'y contribuer. - -## Documentation - - * S'il y a une documentation spéficique, sentez vous libre d'y contribuer. - -## Caractéristiques spécifiques à YunoHost - -#### Support multi-utilisateurs - -#### Architectures supportées - -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/strut.svg)](https://ci-apps.yunohost.org/ci/apps/strut/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/strut.svg)](https://ci-apps-arm.yunohost.org/ci/apps/strut/) +## Avertissements / informations importantes ## Limitations @@ -53,14 +39,12 @@ Pour compiler le logiciel, cela nécessite grunt, ce qui ne peut pas être suppr Pour éviter de devoir générer cette application HTML/JS, ce package créé une version compilée de Strut avec le patch qui supprime les dépendances à Google Analytics et Imgur. Voici la version compilée https://github.com/tantaman/Strut/commits/6761b141ee7aa622916e2d23cced84ee95618cce. Ce n'est pas la version la plus récente. -## Liens +## Documentations et ressources - * Signaler un bug : https://github.com/YunoHost-Apps/strut_ynh/issues - * Site web de Strut : http://strut.io - * Dépôt de Strut : https://github.com/MohannadNaj/Strut - * Site web de YunoHost : https://yunohost.org/ - ---- +* Site officiel de l'app : http://strut.io +* Dépôt de code officiel de l'app : https://github.com/MohannadNaj/Strut +* Documentation YunoHost pour cette app : https://yunohost.org/app_strut +* Signaler un bug : https://github.com/YunoHost-Apps/strut_ynh/issues ## Informations pour les développeurs @@ -72,3 +56,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/strut_ynh/tree/testin ou sudo yunohost app upgrade strut -u https://github.com/YunoHost-Apps/strut_ynh/tree/testing --debug ``` + +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/check_process b/check_process index 79ac566..ab3a929 100644 --- a/check_process +++ b/check_process @@ -1,8 +1,8 @@ ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - is_public=1 (PUBLIC|public=1|private=0) + domain="domain.tld" + path="/path" + is_public=1 ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/conf/nginx.conf b/conf/nginx.conf index 5b29d2d..ded657f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index index.html; try_files $uri $uri/ /index.html; diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..9837ae8 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +Strut is a simple, online editor that doesn't even require registration to operate. Everything you do is recoverable and re-usable. \ No newline at end of file diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..5a66639 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +Strut est un éditeur WEB de présentations fonctionnant en HTML/JS. Tout se passe en local. Il fonctinne grâce à [impress.js](http://bartaz.github.com/impress.js/#/bored). diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..61fde57 --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,10 @@ +## Limitations +No import/export from/to OpenDocument or pptx. + +## Additional information + +* This package doesn't contained the exact sources of the upstream https://github.com/tantaman/Strut. + +Initial Strut software includes Google Analytics and is bind to Imgur to upload images. This kind of trackers or external services are not accepted by the package team of YunoHost. So this trackers are removed from sources, a pull request has been done and merged but has finally be removed from the strut upstream with no explanation. In more, Strut developers don't deliver builded versions. To build a version it needs grunt, that can't be removed easily. + +To avoid to take time to build this html/js app, this package setups a builded version of Strut with the patch that remove Google Analytics and Imgur dependencies. It is a build of this version https://github.com/tantaman/Strut/commits/6761b141ee7aa622916e2d23cced84ee95618cce . So it's not the more recent version. diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..145f346 --- /dev/null +++ b/doc/DISCLAIMER_fr.md @@ -0,0 +1,14 @@ +## Limitations + +Pas d'import/export possible depuis ou vers des fichiers OpenDocument ou pptx. + +## Information supplémentaires + +* Ce package ne contient pas les sources exactes de [la version originale de Strut](https://github.com/tantaman/Strut) + +Strut, à l'origine, inclut Google Analytics et est lié à Imgur pour téléverser des images. Ces pisteurs ou services externes ne sont pas acceptés par l'équipe de YunoHost. +Ils sont donc supprimés par rapport aux sources. +Une pull request pour les supprimer de leur côté a été validée et mergée mais finalement supprimée sans explication. De plus, les développeurs de Strut ne fournissent pas le logiciel compilé. +Pour compiler le logiciel, cela nécessite grunt, ce qui ne peut pas être supprimé facilement. +Pour éviter de devoir générer cette application HTML/JS, ce package créé une version compilée de Strut avec le patch qui supprime les dépendances à Google Analytics et Imgur. +Voici la version compilée https://github.com/tantaman/Strut/commits/6761b141ee7aa622916e2d23cced84ee95618cce. Ce n'est pas la version la plus récente. diff --git a/doc/screenshots/f1003c6a-be74-11e2-84b9-14776c652afb.png b/doc/screenshots/f1003c6a-be74-11e2-84b9-14776c652afb.png new file mode 100644 index 0000000..87f716e Binary files /dev/null and b/doc/screenshots/f1003c6a-be74-11e2-84b9-14776c652afb.png differ diff --git a/manifest.json b/manifest.json index 95a7d1c..b849e98 100644 --- a/manifest.json +++ b/manifest.json @@ -2,20 +2,26 @@ "name": "Strut", "id": "strut", "packaging_format": 1, - "version": "20171224-1~ynh2", - "url": "http://strut.io", - "license": "AGPL-3.0", - "requirements": { - "yunohost": ">= 4.1.7" - }, "description": { - "en": "Slide editor for creating impress.js presentations.", - "fr": "Éditeur de diapositives permettant de créer des présentations impress.js." + "en": "Slide editor for creating impress.js presentations", + "fr": "Éditeur de diapositives permettant de créer des présentations impress.js" }, + "version": "20220404~ynh1", + "url": "http://strut.io", + "upstream": { + "license": "AGPL-3.0", + "website": "http://strut.io", + "demo": "http://strut.io/dist/", + "code": "https://github.com/MohannadNaj/Strut" + }, + "license": "AGPL-3.0", "maintainer": { "name": "ljf", "email": "ljf+yunohost@grimaud.me" }, + "requirements": { + "yunohost": ">= 4.3.0" + }, "multi_instance": true, "services": [ "nginx" @@ -24,8 +30,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", diff --git a/scripts/change_url b/scripts/change_url index c6b3bcb..9f0cb6d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -82,7 +82,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index 07dac7c..c2fd5c1 100644 --- a/scripts/install +++ b/scripts/install @@ -45,6 +45,14 @@ 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 +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=1 + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # STANDARD MODIFICATIONS #================================================= @@ -86,14 +94,14 @@ ynh_replace_string --match_string="are currently uploaded to imgur.*re working o #================================================= # Set permissions to app files -chown -R root:www-data "$final_path" +chown -R $app:www-data "$final_path" chmod -R 640 "$final_path" find "$final_path" -type d -print0 | xargs -0 chmod 750 #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary if [ $is_public -eq 1 ] @@ -104,7 +112,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +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 af1284c..12d0321 100644 --- a/scripts/remove +++ b/scripts/remove @@ -37,6 +37,14 @@ ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated NGINX config ynh_remove_nginx_config +#================================================= +# REMOVE DEDICATED USER +#================================================= +ynh_script_progression --message="Removing the dedicated system user..." --weight=1 + +# Delete a system user +ynh_system_user_delete --username=$app + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 13aa9e5..9865364 100644 --- a/scripts/restore +++ b/scripts/restore @@ -32,8 +32,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=3 -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " @@ -42,13 +40,22 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_restore_file --origin_path="$final_path" @@ -57,7 +64,7 @@ ynh_restore_file --origin_path="$final_path" #================================================= # Restore permissions on app files -chown -R root:www-data "$final_path" +chown -R $app:www-data "$final_path" chmod -R 640 "$final_path" find "$final_path" -type d -print0 | xargs -0 chmod 750 @@ -66,7 +73,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 5810d25..2710124 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,10 +26,24 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=6 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If final_path doesn't exist, create it if [ -z "$final_path" ]; then @@ -45,18 +59,12 @@ if ynh_legacy_permissions_exists; then fi #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=6 +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # STANDARD UPGRADE STEPS @@ -81,7 +89,7 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 # Create a dedicated nginx config ynh_add_nginx_config @@ -106,14 +114,14 @@ fi #================================================= # Set permissions on app files -chown -R root:www-data "$final_path" +chown -R $app:www-data "$final_path" chmod -R 640 "$final_path" find "$final_path" -type d -print0 | xargs -0 chmod 750 #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload