From da29c0bc0c7f1ae692b6cad5eeae09eaca85f98a Mon Sep 17 00:00:00 2001 From: Yann Sionneau Date: Sat, 14 May 2022 15:26:37 +0200 Subject: [PATCH] Update to Pytition 2.5.1 and fix user image uploads and TinyMCE editors When uploading images in mediaroot, files must have gid www-data so that nginx can serve them. Also, image upload script URL for TinyMCE editor was wrong if STATIC_ROOT is not '/static/' Tinymce js url was wrong in this case also. --- README.md | 21 ++++++++++----------- README_fr.md | 27 +++++++++++---------------- conf/app.src | 4 ++-- conf/config.py | 4 ++++ conf/systemd.service | 2 +- conf/uwsgi.yaml | 2 +- manifest.json | 2 +- 7 files changed, 30 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 6101980..ed28dd4 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Pytition for YunoHost -[![Integration level](https://dash.yunohost.org/integration/pytition.svg)](https://dash.yunohost.org/appci/app/pytition) ![Working status](https://ci-apps.yunohost.org/ci/badges/pytition.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/pytition.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/pytition.svg)](https://dash.yunohost.org/appci/app/pytition) ![](https://ci-apps.yunohost.org/ci/badges/pytition.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pytition.maintain.svg) [![Install Pytition with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pytition) *[Lire ce readme en français.](./README_fr.md)* @@ -28,13 +28,13 @@ Pytition is an application for privacy-friendly online petitions you can host on - You can export signatures in CSV format. -**Shipped version:** 2.4~ynh1 +**Shipped version:** 2.5.1~ynh1 **Demo:** https://demo.pytition.org ## Screenshots -![Screenshot of Pytition](./doc/screenshots/stop_doing_teams.webp) +![](./doc/screenshots/stop_doing_teams.webp) ## Disclaimers / important information @@ -42,22 +42,21 @@ Pytition is an application for privacy-friendly online petitions you can host on ## Documentation and resources -* Official app website: -* Official admin documentation: -* Upstream app code repository: -* YunoHost documentation for this app: -* Report a bug: +* Official app website: https://pytition.org +* Official admin documentation: https://pytition.readthedocs.io/en/latest/ +* Upstream app code repository: https://github.com/pytition/Pytition +* YunoHost documentation for this app: https://yunohost.org/app_pytition +* Report a bug: https://github.com/YunoHost-Apps/pytition_ynh/issues ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/pytition_ynh/tree/testing). To try the testing branch, please proceed like that. - -``` bash +``` sudo yunohost app install https://github.com/YunoHost-Apps/pytition_ynh/tree/testing --debug or sudo yunohost app upgrade pytition -u https://github.com/YunoHost-Apps/pytition_ynh/tree/testing --debug ``` -**More info regarding app packaging:** +**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 eb2f118..e96e8c9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,14 +1,10 @@ - - # Pytition pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/pytition.svg)](https://dash.yunohost.org/appci/app/pytition) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/pytition.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/pytition.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/pytition.svg)](https://dash.yunohost.org/appci/app/pytition) ![](https://ci-apps.yunohost.org/ci/badges/pytition.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pytition.maintain.svg) [![Installer Pytition avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pytition) *[Read this readme in english.](./README.md)* +*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer Pytition 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.* @@ -28,13 +24,13 @@ Pytition permet d'héberger des pétitions respectueuses de la vie privée sur v - Vous pouvez exporter les signatures via CSV. -**Version incluse :** 2.4~ynh1 +**Version incluse :** 2.5.1~ynh1 **Démo :** https://demo.pytition.org ## Captures d'écran -![Capture d'écran de Pytition](./doc/screenshots/stop_doing_teams.webp) +![](./doc/screenshots/stop_doing_teams.webp) ## Avertissements / informations importantes @@ -42,22 +38,21 @@ Pytition permet d'héberger des pétitions respectueuses de la vie privée sur v ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : -* Documentation YunoHost pour cette app : -* Signaler un bug : +* Site officiel de l'app : https://pytition.org +* Documentation officielle de l'admin : https://pytition.readthedocs.io/en/latest/ +* Dépôt de code officiel de l'app : https://github.com/pytition/Pytition +* Documentation YunoHost pour cette app : https://yunohost.org/app_pytition +* Signaler un bug : https://github.com/YunoHost-Apps/pytition_ynh/issues ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/pytition_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. - -``` bash +``` sudo yunohost app install https://github.com/YunoHost-Apps/pytition_ynh/tree/testing --debug ou sudo yunohost app upgrade pytition -u https://github.com/YunoHost-Apps/pytition_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/conf/app.src b/conf/app.src index 588bb81..4dea908 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/pytition/Pytition/archive/refs/tags/v2.4.tar.gz -SOURCE_SUM=466c788139fc90049a42d084472df36ea0f15b46766777f248ce989e3dbebcc4 +SOURCE_URL=https://github.com/pytition/Pytition/archive/refs/tags/v2.5.1.tar.gz +SOURCE_SUM=cc65f0b10d0e38f89adeba64a2db2439721d564528ee278cf65dbc371982f501 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/config.py b/conf/config.py index 2d19fba..382bf3e 100644 --- a/conf/config.py +++ b/conf/config.py @@ -28,6 +28,10 @@ ALLOWED_HOSTS = ['127.0.0.1', 'localhost', '[::1]', '__DOMAIN__'] import os +# This needs to be redefined because STATIC_URL might be set in this config +# after TINYMCE_JS_URL was defined +TINYMCE_JS_URL = STATIC_URL + TINYMCE_JS_PATH + if DEFAULT_INDEX_THUMBNAIL == "": print("Please set a default index thumbnail or your index page will not be very beautiful") diff --git a/conf/systemd.service b/conf/systemd.service index 2355f97..c34fe3f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,7 +6,7 @@ After=network.target mysql.service [Service] Type=notify User=__APP__ -Group=__APP__ +Group=www-data WorkingDirectory=__FINALPATH__ RuntimeDirectory=__APP__ ExecStart=uwsgi --yaml __FINALPATH__/uwsgi.yaml --die-on-term diff --git a/conf/uwsgi.yaml b/conf/uwsgi.yaml index 5ccc15b..de8a79c 100644 --- a/conf/uwsgi.yaml +++ b/conf/uwsgi.yaml @@ -1,7 +1,7 @@ uwsgi: # Who will run the code uid: __APP__ - gid: __APP__ + gid: www-data # Number of workers workers: 10 diff --git a/manifest.json b/manifest.json index 3870800..43d73d8 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Host privacy-friendly online petitions", "fr": "Hébergez des pétitions en ligne respectueuses de la vie privée" }, - "version": "2.4~ynh1", + "version": "2.5.1~ynh1", "url": "https://example.com", "upstream": { "license": "BSD-3-Clause",