From eaeb90b05265207e0a0d31df8fbabf5be074baed Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 23 Apr 2021 07:37:15 +0200 Subject: [PATCH 01/18] Cleaning up --- README.md | 4 ++-- manifest.json | 12 ++---------- scripts/change_url | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 5c94666..e9305bd 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ Libreto has no user management, but YunoHost allow you to decide if this app is #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/libreto%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/libreto/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/libreto%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/libreto/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/libreto.svg)](https://ci-apps.yunohost.org/ci/apps/libreto/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/libreto.svg)](https://ci-apps-arm.yunohost.org/ci/apps/libreto/) ## Limitations diff --git a/manifest.json b/manifest.json index d3672df..a0b8080 100644 --- a/manifest.json +++ b/manifest.json @@ -15,22 +15,18 @@ "url": "https://reflexlibre.net" }, "requirements": { - "yunohost": ">= 3.8.5" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ "nginx", - "php7.0-fpm" + "php7.3-fpm" ], "arguments": { "install" : [ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for Libreto", - "fr": "Choisissez un nom de domaine pour Libreto" - }, "example": "example.com" }, { @@ -51,10 +47,6 @@ { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "help": { "en": "If enabled, Libreto will be accessible by people who do not have an account. This can be changed later via the webadmin.", "fr": "Si cette case est cochée, Libreto sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." diff --git a/scripts/change_url b/scripts/change_url index 876fb11..7a109a9 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -17,7 +17,7 @@ old_domain=$YNH_APP_OLD_DOMAIN old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +new_path="/" app=$YNH_APP_INSTANCE_NAME From 201850cb0879cdf8c38c689778f747c27bc9c139 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Thu, 13 May 2021 17:48:41 +0200 Subject: [PATCH 02/18] [autopatch] Update issue and PR templates --- .github/ISSUE_TEMPLATE.md | 55 ++++++++++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 16 ++++++++++ 2 files changed, 71 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..2729a6b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,55 @@ +--- +name: Bug report +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. + +--- + +**How to post a meaningful bug report** +1. *Read this whole template first.* +2. *Determine if you are on the right place:* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* + - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* +--- + +### Describe the bug + +*A clear and concise description of what the bug is.* + +### Context + +- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* +- YunoHost version: x.x.x +- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* + - If yes, please explain: +- Using, or trying to install package version/branch: +- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* + +### Steps to reproduce + +- *If you performed a command from the CLI, the command itself is enough. For example:* + ```sh + sudo yunohost app install the_app + ``` +- *If you used the webadmin, please perform the equivalent command from the CLI first.* +- *If the error occurs in your browser, explain what you did:* + 1. *Go to '...'* + 2. *Click on '...'* + 3. *Scroll down to '...'* + 4. *See error* + +### Expected behavior + +*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* + +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + +*If applicable and useful, add screenshots to help explain your problem.* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ef70e18 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Problem + +- *Description of why you made this PR* + +## Solution + +- *And how do you fix that problem* + +## PR Status + +- [ ] Code finished and ready to be reviewed/tested +- [ ] The fix/enhancement were manually tested (if applicable) + +## Automatic tests + +Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) From abf8804461722e2e442e62b2b5ed64f504fe24b4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 2 Jul 2021 15:19:53 +0200 Subject: [PATCH 03/18] Set rights --- scripts/install | 29 ++++++++++++----------------- scripts/remove | 12 ++---------- scripts/restore | 24 ++++++++++++++++++------ scripts/upgrade | 13 ++++--------- 4 files changed, 36 insertions(+), 42 deletions(-) diff --git a/scripts/install b/scripts/install index 9e305d1..db4d1bb 100755 --- a/scripts/install +++ b/scripts/install @@ -53,6 +53,14 @@ ynh_app_setting_set --app=$app --key=etherpad_instance --value=$etherpad_instanc ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=creation_open --value=$creation_open +#================================================= +# 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 #================================================= @@ -69,6 +77,10 @@ pushd "$final_path" git submodule update --init --recursive --quiet popd +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -77,14 +89,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated nginx config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -118,15 +122,6 @@ fi # Calculate and store the config file checksum into the app settings ynh_store_file_checksum "$final_path/config.php" -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -chown -R root: $final_path - #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/remove b/scripts/remove index d460e90..c7594f0 100755 --- a/scripts/remove +++ b/scripts/remove @@ -16,8 +16,8 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get $app domain) -final_path=$(ynh_app_setting_get $app final_path) +domain=$(ynh_app_setting_get --app=$app --key=domain) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # STANDARD REMOVE @@ -45,14 +45,6 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - -# Remove the app-specific logrotate config -ynh_remove_logrotate - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 4cf92a5..6fcca80 100755 --- a/scripts/restore +++ b/scripts/restore @@ -45,10 +45,11 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS #================================================= -# RESTORE FILES +# RESTORE THE NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 -ynh_restore +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RECREATE THE DEDICATED USER @@ -56,14 +57,25 @@ ynh_restore ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= -# RESTORE USER RIGHTS +# RESTORE THE APP MAIN DIR #================================================= +ynh_script_progression --message="Restoring the app main directory..." --weight=1 -# Restore permissions on app files -chown -R root: $final_path +ynh_restore_file --origin_path="$final_path" + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index fb1abfe..ca08087 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -50,6 +50,10 @@ pushd "$final_path" git submodule update --init --recursive --quiet popd +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -81,15 +85,6 @@ ynh_backup_if_checksum_is_different "$final_path/config.php" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum "$final_path/config.php" -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions on app files -chown -R root: $final_path - #================================================= # SETUP SSOWAT #================================================= From 33982a4d66fd8999f6b8535396bdae58eb050ac5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 2 Jul 2021 15:29:02 +0200 Subject: [PATCH 04/18] Add templates --- check_process | 5 ++--- doc/DISCLAIMER.md | 0 {img => doc/screenshots}/home.png | Bin {img => doc/screenshots}/menu.png | Bin manifest.json | 9 ++++++++- scripts/change_url | 2 +- scripts/upgrade | 12 ++++++------ 7 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 doc/DISCLAIMER.md rename {img => doc/screenshots}/home.png (100%) rename {img => doc/screenshots}/menu.png (100%) diff --git a/check_process b/check_process index 10ea98e..ad000b6 100644 --- a/check_process +++ b/check_process @@ -1,8 +1,8 @@ ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) + domain="domain.tld" etherpad_instance="https://annuel2.framapad.org" - is_public=1 (PUBLIC|public=1|private=0) + is_public=1 creation_open=1 ; Checks pkg_linter=1 @@ -14,7 +14,6 @@ upgrade=1 backup_restore=1 multi_instance=1 - port_already_use=0 change_url=1 ;;; Options Email=ljf+libreto_ynh@reflexlibre.net diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..e69de29 diff --git a/img/home.png b/doc/screenshots/home.png similarity index 100% rename from img/home.png rename to doc/screenshots/home.png diff --git a/img/menu.png b/doc/screenshots/menu.png similarity index 100% rename from img/menu.png rename to doc/screenshots/menu.png diff --git a/manifest.json b/manifest.json index a0b8080..763834c 100644 --- a/manifest.json +++ b/manifest.json @@ -8,6 +8,13 @@ }, "version": "0.0.20180605~ynh2", "url": "https://libreto.net", + "upstream": { + "license": "GPL-3.0-or-later", + "website": "https://libreto.net", + "demo": "https://libreto.net", + "admindoc": "https://github.com/Ventricule/libreto", + "code": "https://github.com/Ventricule/libreto" + }, "license": "GPL-3.0-or-later", "maintainer": { "name": "ljf", @@ -15,7 +22,7 @@ "url": "https://reflexlibre.net" }, "requirements": { - "yunohost": ">= 4.1.7" + "yunohost": ">= 4.2.0" }, "multi_instance": true, "services": [ diff --git a/scripts/change_url b/scripts/change_url index 7a109a9..021c6a7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -27,7 +27,7 @@ app=$YNH_APP_INSTANCE_NAME ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get $app final_path) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP diff --git a/scripts/upgrade b/scripts/upgrade index ca08087..a46f4f7 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,12 +15,12 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get $app domain) -path_url=$(ynh_app_setting_get $app path) -is_public=$(ynh_app_setting_get $app is_public) -final_path=$(ynh_app_setting_get $app final_path) -etherpad_instance=$(ynh_app_setting_get $app etherpad_instance) -creation_open=$(ynh_app_setting_get $app creation_open) +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) +etherpad_instance=$(ynh_app_setting_get --app=$app --key=etherpad_instance) +creation_open=$(ynh_app_setting_get --app=$app --key=creation_open) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP From 3ebef9943623997c675d5566096fca3314bc3db8 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 2 Jul 2021 13:29:09 +0000 Subject: [PATCH 05/18] Auto-update README --- README.md | 68 ++++++++++++++++++++-------------------------------- README_fr.md | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 42 deletions(-) create mode 100644 README_fr.md diff --git a/README.md b/README.md index e9305bd..10d3aa3 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,42 @@ + + # Libreto for YunoHost [![Integration level](https://dash.yunohost.org/integration/libreto.svg)](https://dash.yunohost.org/appci/app/libreto) ![](https://ci-apps.yunohost.org/ci/badges/libreto.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/libreto.maintain.svg) [![Install Libreto with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=libreto) -> *This package allow you to install Libreto 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.* +*[Lire ce readme en français.](./README_fr.md)* + +> *This package allows you to install Libreto 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 -Libreto let you aggregate your pad (Etherpad lite) to create a kind of wiki easily. -**Shipped version:** 0.0.20180605 +Aggregate your pads to create a wiki. + +**Shipped version:** 0.0.20180605~ynh2 + +**Demo:** https://libreto.net ## Screenshots -![Home page of Libreto](img/home.png) -![Usage of Libreto](img/menu.png) +![](./doc/screenshots/home.png) +![](./doc/screenshots/menu.png) -## Demo +## Documentation and resources -* [Official demo](https://libreto.net) +* Official app website: https://libreto.net +* Official admin documentation: https://github.com/Ventricule/libreto +* Upstream app code repository: https://github.com/Ventricule/libreto +* YunoHost documentation for this app: https://yunohost.org/app_libreto +* Report a bug: https://github.com/YunoHost-Apps/libreto_ynh/issues -## Configuration +## Developer info -No configuration needed. - -## Documentation - - * Official documentation: https://github.com/Ventricule/libreto - -## YunoHost specific features - -#### Multi-users support - -Libreto has no user management, but YunoHost allow you to decide if this app is public or not. - -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/libreto.svg)](https://ci-apps.yunohost.org/ci/apps/libreto/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/libreto.svg)](https://ci-apps-arm.yunohost.org/ci/apps/libreto/) - -## Limitations - -Only app instances with a valid certificate and allowing to be included in Frame could be used. - -## Links - - * Report a bug: https://github.com/YunoHost-Apps/libreto_ynh/issues - * App website: http://libreto.net/ - * Upstream app repository: https://github.com/Ventricule/libreto - * YunoHost website: https://yunohost.org/ - ---- - -## Developers info - -Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/libreto_ynh/tree/testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/libreto_ynh/tree/testing). To try the testing branch, please proceed like that. ``` @@ -62,3 +44,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/libreto_ynh/tree/test or sudo yunohost app upgrade libreto -u https://github.com/YunoHost-Apps/libreto_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 new file mode 100644 index 0000000..21867bf --- /dev/null +++ b/README_fr.md @@ -0,0 +1,44 @@ +# Libreto pour YunoHost + +[![Niveau d'intégration](https://dash.yunohost.org/integration/libreto.svg)](https://dash.yunohost.org/appci/app/libreto) ![](https://ci-apps.yunohost.org/ci/badges/libreto.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/libreto.maintain.svg) +[![Installer Libreto avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=libreto) + +*[Read this readme in english.](./README.md)* +*[Lire ce readme en français.](./README_fr.md)* + +> *Ce package vous permet d'installer Libreto 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.* + +## Vue d'ensemble + +Agrégez vos pads pour créer un wiki. + +**Version incluse :** 0.0.20180605~ynh2 + +**Démo :** https://libreto.net + +## Captures d'écran + +![](./doc/screenshots/home.png) +![](./doc/screenshots/menu.png) + +## Documentations et ressources + +* Site officiel de l'app : https://libreto.net +* Documentation officielle de l'admin : https://github.com/Ventricule/libreto +* Dépôt de code officiel de l'app : https://github.com/Ventricule/libreto +* Documentation YunoHost pour cette app : https://yunohost.org/app_libreto +* Signaler un bug : https://github.com/YunoHost-Apps/libreto_ynh/issues + +## Informations pour les développeurs + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/libreto_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/libreto_ynh/tree/testing --debug +ou +sudo yunohost app upgrade libreto -u https://github.com/YunoHost-Apps/libreto_ynh/tree/testing --debug +``` + +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file From db73da02856ca95e2b2df6901c3b47ab3bd94b8b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 2 Jul 2021 15:36:33 +0200 Subject: [PATCH 06/18] Update upgrade --- scripts/upgrade | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index a46f4f7..27ff9ff 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,12 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) etherpad_instance=$(ynh_app_setting_get --app=$app --key=etherpad_instance) creation_open=$(ynh_app_setting_get --app=$app --key=creation_open) +#================================================= +# CHECK VERSION +#================================================= + +upgrade_type=$(ynh_check_app_version_changed) + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -35,20 +41,32 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # STANDARD UPGRADE STEPS #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading source files..." --weight=5 -# Download, check integrity, uncompress and patch the source from app.src -pushd "$final_path" - git checkout master - git pull --quiet - git checkout $COMMIT --quiet - git submodule update --init --recursive --quiet -popd +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." --weight=5 + + # Download, check integrity, uncompress and patch the source from app.src + pushd "$final_path" + git checkout master + git pull --quiet + git checkout $COMMIT --quiet + git submodule update --init --recursive --quiet + popd +fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" @@ -62,14 +80,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app - #================================================= # PHP-FPM CONFIGURATION #================================================= From 7a4ef3b394cc33bf399e87a2dd5e406e8be6ab76 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 2 Jul 2021 15:38:46 +0200 Subject: [PATCH 07/18] Update check_process --- check_process | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/check_process b/check_process index ad000b6..4bb1a5e 100644 --- a/check_process +++ b/check_process @@ -12,9 +12,14 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=f6fcb8686cec30da2a7b9e5ba12d6c5b295528d8 backup_restore=1 multi_instance=1 change_url=1 ;;; Options Email=ljf+libreto_ynh@reflexlibre.net Notification=down +;;; Upgrade options + ; commit=f6fcb8686cec30da2a7b9e5ba12d6c5b295528d8 + name=Merge pull request #7 from YunoHost-Apps/testing + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& From afc719d2bb51017a17820a5e7dd00d753dfdd006 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 2 Jul 2021 15:45:21 +0200 Subject: [PATCH 08/18] set permissions --- conf/config.dist.php | 7 ------- scripts/install | 10 ++-------- scripts/upgrade | 29 ++++++++++++----------------- 3 files changed, 14 insertions(+), 32 deletions(-) diff --git a/conf/config.dist.php b/conf/config.dist.php index ca3d0f0..98cc27e 100644 --- a/conf/config.dist.php +++ b/conf/config.dist.php @@ -28,13 +28,6 @@ $providers = array( 'markdown' => false, 'html' => true, ), - 'factor' => array( - 'name' => "Factor", - 'url' => "https://factor.cc/pad", - 'default_text' => "Welcome to factor.cc Pad!", - 'markdown' => false, - 'html' => true, - ), 'etherpad' => array( 'name' => "Etherpad.net", 'url' => "https://etherpad.net", diff --git a/scripts/install b/scripts/install index db4d1bb..086ffc1 100755 --- a/scripts/install +++ b/scripts/install @@ -50,7 +50,6 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url 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=etherpad_instance --value=$etherpad_instance -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=creation_open --value=$creation_open #================================================= @@ -125,17 +124,12 @@ ynh_store_file_checksum "$final_path/config.php" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary if [ $is_public -eq 1 ] then - if [ $creation_open -eq 1 ] - then - ynh_app_setting_set $app skipped_uris "/" - else - ynh_app_setting_set $app skipped_regex "/[^/]+" - fi + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 27ff9ff..c69f910 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -17,7 +17,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) etherpad_instance=$(ynh_app_setting_get --app=$app --key=etherpad_instance) creation_open=$(ynh_app_setting_get --app=$app --key=creation_open) @@ -41,6 +40,18 @@ ynh_clean_setup () { # 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..." --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 + #================================================= # CREATE DEDICATED USER #================================================= @@ -95,22 +106,6 @@ ynh_backup_if_checksum_is_different "$final_path/config.php" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum "$final_path/config.php" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1 - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - if [ $creation_open -eq 1 ] - then - ynh_app_setting_set $app skipped_uris "/" - else - ynh_app_setting_set $app skipped_regex "/[^/]+" - fi -fi - #================================================= # RELOAD NGINX #================================================= From 7a1a6d798689bc17540dea34608ba44661c9094c Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Wed, 29 Sep 2021 22:32:52 +0200 Subject: [PATCH 09/18] [fix] Subpath install --- conf/config.dist.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/config.dist.php b/conf/config.dist.php index 98cc27e..cdb7787 100644 --- a/conf/config.dist.php +++ b/conf/config.dist.php @@ -54,7 +54,9 @@ $providers = array( // CUSTOM_PROVIDER); $options = array( - 'name' => "Libreto", + 'name' => "Libreto", + 'root' => '__PATH__', + 'use_subdomain' => false, 'default_provider' => "__PROVIDER__", 'providers' => $providers, ); From 21303d1d46ba9d46986f386401fe9a94be4869fd Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Wed, 29 Sep 2021 22:33:42 +0200 Subject: [PATCH 10/18] [enh] Add path support in install script --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 086ffc1..2aa595c 100755 --- a/scripts/install +++ b/scripts/install @@ -25,7 +25,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url="/" +path_url=$YNH_APP_ARG_PATH etherpad_instance=$YNH_APP_ARG_ETHERPAD_INSTANCE is_public=$YNH_APP_ARG_IS_PUBLIC creation_open=$YNH_APP_ARG_CREATION_OPEN From f35254a65f116ecb507b5a9d83fed56f6d2356d8 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Wed, 29 Sep 2021 22:35:14 +0200 Subject: [PATCH 11/18] [enh] Add path question --- manifest.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manifest.json b/manifest.json index 763834c..b07006c 100644 --- a/manifest.json +++ b/manifest.json @@ -36,6 +36,12 @@ "type": "domain", "example": "example.com" }, + { + "name": "path", + "type": "path", + "example": "/libreto", + "default": "/libreto" + }, { "name": "etherpad_instance", "type": "string", From 8a19e000f6d755629615064cd29d7579b905b892 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 12 Nov 2021 13:35:59 +0100 Subject: [PATCH 12/18] Fix linter --- manifest.json | 10 ++++------ scripts/restore | 2 -- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/manifest.json b/manifest.json index b07006c..8e1ba67 100644 --- a/manifest.json +++ b/manifest.json @@ -3,16 +3,15 @@ "id": "libreto", "packaging_format": 1, "description": { - "en": "Aggregate your pads to create a wiki.", - "fr": "Agrégez vos pads pour créer un wiki." + "en": "Aggregate your pads to create a wiki", + "fr": "Agrégez vos pads pour créer un wiki" }, - "version": "0.0.20180605~ynh2", + "version": "0.0.20180605~ynh3", "url": "https://libreto.net", "upstream": { "license": "GPL-3.0-or-later", "website": "https://libreto.net", "demo": "https://libreto.net", - "admindoc": "https://github.com/Ventricule/libreto", "code": "https://github.com/Ventricule/libreto" }, "license": "GPL-3.0-or-later", @@ -33,8 +32,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", diff --git a/scripts/restore b/scripts/restore index 6fcca80..6761640 100755 --- a/scripts/restore +++ b/scripts/restore @@ -37,8 +37,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=2 -ynh_webpath_available $domain $path_url \ - || ynh_die "Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die "There is already a directory: $final_path " From e6dd37442cb2b7bd874c3220dea299e61971446c Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 12 Nov 2021 12:36:05 +0000 Subject: [PATCH 13/18] Auto-update README --- README.md | 5 ++--- README_fr.md | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 10d3aa3..d9fd2b9 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Aggregate your pads to create a wiki. +Aggregate your pads to create a wiki -**Shipped version:** 0.0.20180605~ynh2 +**Shipped version:** 0.0.20180605~ynh3 **Demo:** https://libreto.net @@ -29,7 +29,6 @@ Aggregate your pads to create a wiki. ## Documentation and resources * Official app website: https://libreto.net -* Official admin documentation: https://github.com/Ventricule/libreto * Upstream app code repository: https://github.com/Ventricule/libreto * YunoHost documentation for this app: https://yunohost.org/app_libreto * Report a bug: https://github.com/YunoHost-Apps/libreto_ynh/issues diff --git a/README_fr.md b/README_fr.md index 21867bf..26e9a51 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,9 +11,9 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble -Agrégez vos pads pour créer un wiki. +Agrégez vos pads pour créer un wiki -**Version incluse :** 0.0.20180605~ynh2 +**Version incluse :** 0.0.20180605~ynh3 **Démo :** https://libreto.net @@ -25,7 +25,6 @@ Agrégez vos pads pour créer un wiki. ## Documentations et ressources * Site officiel de l'app : https://libreto.net -* Documentation officielle de l'admin : https://github.com/Ventricule/libreto * Dépôt de code officiel de l'app : https://github.com/Ventricule/libreto * Documentation YunoHost pour cette app : https://yunohost.org/app_libreto * Signaler un bug : https://github.com/YunoHost-Apps/libreto_ynh/issues From bd74b7a7d618d8145025c70af923f62ef6b85362 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 12 Nov 2021 13:39:53 +0100 Subject: [PATCH 14/18] Add description --- doc/DESCRIPTION.md | 1 + doc/DESCRIPTION_fr.md | 1 + 2 files changed, 2 insertions(+) create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DESCRIPTION_fr.md diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..3452eac --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +Libreto is a collaborative etherpad-based notebook. It can become a mini-site, the synopsis of a workshop or the support for writing a collective book. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..8b03f55 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +Libreto est un carnet de note collaboratif fondé sur etherpad. Il peut devenir un mini-site, le carnet de bord d'un workshop ou le support de rédaction d'un livre collectif. \ No newline at end of file From 8d33f0ca32cf563df5229c74ce80b35fa9b93978 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 12 Nov 2021 13:40:05 +0100 Subject: [PATCH 15/18] Update DESCRIPTION_fr.md --- doc/DESCRIPTION_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 8b03f55..7f457da 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1 +1 @@ -Libreto est un carnet de note collaboratif fondé sur etherpad. Il peut devenir un mini-site, le carnet de bord d'un workshop ou le support de rédaction d'un livre collectif. \ No newline at end of file +Libreto est un carnet de note collaboratif fondé sur etherpad. Il peut devenir un mini-site, le carnet de bord d'un workshop ou le support de rédaction d'un livre collectif. From 54f7bc7141b205b5ef528e5ec9228bc0d3d7c23e Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 12 Nov 2021 12:40:15 +0000 Subject: [PATCH 16/18] Auto-update README --- README.md | 3 ++- README_fr.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d9fd2b9..b8ce694 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Aggregate your pads to create a wiki +Libreto is a collaborative etherpad-based notebook. It can become a mini-site, the synopsis of a workshop or the support for writing a collective book. + **Shipped version:** 0.0.20180605~ynh3 diff --git a/README_fr.md b/README_fr.md index 26e9a51..c78871d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,8 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble -Agrégez vos pads pour créer un wiki +Libreto est un carnet de note collaboratif fondé sur etherpad. Il peut devenir un mini-site, le carnet de bord d'un workshop ou le support de rédaction d'un livre collectif. + **Version incluse :** 0.0.20180605~ynh3 From c6e7372c9d6a2ebe87a4db982edef5d090843a74 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 20 Nov 2021 22:43:24 +0100 Subject: [PATCH 17/18] Update change_url --- scripts/change_url | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index 021c6a7..3bbea99 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -17,7 +17,7 @@ old_domain=$YNH_APP_OLD_DOMAIN old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN -new_path="/" +new_path=$YNH_APP_NEW_PATH app=$YNH_APP_INSTANCE_NAME From 0dd102b704fc547a55b92c27d48aab3e6b578e36 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Nov 2021 23:33:20 +0100 Subject: [PATCH 18/18] Remove nginx rewite --- conf/nginx.conf | 5 ----- manifest.json | 2 +- scripts/restore | 3 +-- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 29739e9..e09ce6d 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.php; location __PATH__/libreto/assets/ { diff --git a/manifest.json b/manifest.json index 8e1ba67..b75d7f6 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "url": "https://reflexlibre.net" }, "requirements": { - "yunohost": ">= 4.2.0" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ diff --git a/scripts/restore b/scripts/restore index 6761640..60a1500 100755 --- a/scripts/restore +++ b/scripts/restore @@ -37,8 +37,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=2 -test ! -d $final_path \ - || ynh_die "There is already a directory: $final_path " +test ! -d $final_path || ynh_die "There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS