From efff4cb1ba32cd05f6d7c9f310e9e55f6f0b7f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 12 Jul 2022 08:03:31 +0200 Subject: [PATCH] Testing (#43) * Small fixes * 1.7.0 (#4) * Upgrde to v.1.7.0 * Set requirements to 3.8.1 * Update README.md * Upgrade to 1.7.1 (#6) * Add limitations * Avoid to buid frontend bundle * Remove PostegrSQL warning * Update README.md Add you should reload service for changes in config to be registered. * Add restart systemd tuto * Change version * Finding an available port * Upgrade to version 1.7.2 (#12) * Patch (#17) * Cleaning up * Update manifest.json * Cleaning up * Secure config file * Remove yarn * Update change_url * Update change_url * Revert "Remove yarn" This reverts commit a8cabf0c0addf8f9c4569b27ae04512db5c93df0. * Update change_url * Update systemd.service * Update systemd.service * Cleaning up * Fix * fix badges * Upgrade to version 1.8.0 (#21) * Upgrade to version 1.8.0 * Upgrade to 1.8.0 * Upgrade to 1.8.0 * Upgrade to version 1.8.1 * [autopatch] Update issue and PR templates (#25) Co-authored-by: Yunohost-Bot <> * Add templates * Upgrade to 1.8.2 * Update check_process * Add templates * Auto-update README * Set new requirements (#28) * Fix * Simplify config * Auto-update README Co-authored-by: Yunohost-Bot <> * Update manifest.json * Auto-update README * 1.9.0 (#31) * 1.9.0 * Update manifest.json * Auto-update README * Systemd hardening (#33) * Update systemd.service * Update app.src * Update manifest.json * 1.9.1 (#34) * Upgrade to 1.9.1 * 1.9.2 (#36) * Remove replace_string * Fix (#39) * Update manifest.json * Auto-update README * Update config.json.example * Update config.json.example * 1.9.3 * Auto-update README * 1.9.4 (#42) * 1.9.4 * Auto-update README Co-authored-by: yunohost-bot Co-authored-by: Eauchat <34686393+eauchat@users.noreply.github.com> Co-authored-by: Alexandre Aubin Co-authored-by: YunoHost Bot Co-authored-by: Yunohost-Bot <> Co-authored-by: yunohost-bot --- README.md | 34 +++++++++++++++++++++++----------- README_fr.md | 40 ++++++++++++++++++++++++++++------------ conf/app.src | 4 ++-- conf/systemd.service | 2 +- doc/DESCRIPTION.md | 12 ++++++++++++ manifest.json | 2 +- scripts/install | 21 ++++++--------------- scripts/restore | 9 +++++---- scripts/upgrade | 22 +++++++--------------- 9 files changed, 85 insertions(+), 61 deletions(-) create mode 100644 doc/DESCRIPTION.md diff --git a/README.md b/README.md index 22b475e..710e3cc 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # HedgeDoc for YunoHost -[![Integration level](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![Working status](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg) [![Install HedgeDoc with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc) *[Lire ce readme en français.](./README_fr.md)* @@ -15,15 +15,26 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Collaborative editor to work on notes written in Markdown +HedgeDoc (formerly known as CodiMD) is an open-source, web-based, self-hosted, collaborative markdown editor. -**Shipped version:** 1.9.3~ynh1 +You can use it to easily collaborate on notes, graphs and even presentations in real-time. All you need to do is to share your note-link to your co-workers and they’re ready to go. + +### Features + +- Real-time collaboration +- Graphs & diagrams +- Revisions +- Presentation mode +- Easy to use permission system +- Low system requirements + +**Shipped version:** 1.9.4~ynh1 **Demo:** https://demo.hedgedoc.org/ ## Screenshots -![](./doc/screenshots/screenshot.png) +![Screenshot of HedgeDoc](./doc/screenshots/screenshot.png) ## Disclaimers / important information @@ -34,21 +45,22 @@ When you finished editing the configuration, for your changes to take effect, yo ## Documentation and resources -* Official app website: https://hedgedoc.org -* Official admin documentation: https://docs.hedgedoc.org/ -* Upstream app code repository: https://github.com/hedgedoc/hedgedoc -* YunoHost documentation for this app: https://yunohost.org/app_hedgedoc -* Report a bug: https://github.com/YunoHost-Apps/hedgedoc_ynh/issues +* Official app website: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug or sudo yunohost app upgrade hedgedoc -u https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 8b8c5a4..1f9c333 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,25 +1,40 @@ + + # HedgeDoc pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg) [![Installer HedgeDoc avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer HedgeDoc 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 -Éditeur collaboratif pour travailler sur des notes en Markdown +HedgeDoc (formerly known as CodiMD) is an open-source, web-based, self-hosted, collaborative markdown editor. -**Version incluse :** 1.9.3~ynh1 +You can use it to easily collaborate on notes, graphs and even presentations in real-time. All you need to do is to share your note-link to your co-workers and they’re ready to go. + +### Features + +- Real-time collaboration +- Graphs & diagrams +- Revisions +- Presentation mode +- Easy to use permission system +- Low system requirements + +**Version incluse :** 1.9.4~ynh1 **Démo :** https://demo.hedgedoc.org/ ## Captures d'écran -![](./doc/screenshots/screenshot.png) +![Capture d'écran de HedgeDoc](./doc/screenshots/screenshot.png) ## Avertissements / informations importantes @@ -30,21 +45,22 @@ Lorsque vous avez terminé de modifier la configuration, pour que vos modificati ## Documentations et ressources -* Site officiel de l'app : https://hedgedoc.org -* Documentation officielle de l'admin : https://docs.hedgedoc.org/ -* Dépôt de code officiel de l'app : https://github.com/hedgedoc/hedgedoc -* Documentation YunoHost pour cette app : https://yunohost.org/app_hedgedoc -* Signaler un bug : https://github.com/YunoHost-Apps/hedgedoc_ynh/issues +* 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 : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug ou sudo yunohost app upgrade hedgedoc -u https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** diff --git a/conf/app.src b/conf/app.src index 244e254..f7b0555 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/hedgedoc/hedgedoc/releases/download/1.9.3/hedgedoc-1.9.3.tar.gz -SOURCE_SUM=0115278fc5ae048e3629cc0beba98046cb19460ba66108b3eba45ea5e22e8548 +SOURCE_URL=https://github.com/hedgedoc/hedgedoc/releases/download/1.9.4/hedgedoc-1.9.4.tar.gz +SOURCE_SUM=f8ed595cb3b47eb71f22518e0a1e93ed120c44dcf1eb30136c16f530c4aaf0a7 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/systemd.service b/conf/systemd.service index 90d6159..caea1b3 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__ -Environment="PATH=__ENV_PATH__" +Environment="__YNH_NODE_LOAD_PATH__" Environment="NODE_ENV=production" ExecStart=__YNH_NPM__ start --production Restart=always diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..98d04c5 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1,12 @@ +HedgeDoc (formerly known as CodiMD) is an open-source, web-based, self-hosted, collaborative markdown editor. + +You can use it to easily collaborate on notes, graphs and even presentations in real-time. All you need to do is to share your note-link to your co-workers and they’re ready to go. + +### Features + +- Real-time collaboration +- Graphs & diagrams +- Revisions +- Presentation mode +- Easy to use permission system +- Low system requirements \ No newline at end of file diff --git a/manifest.json b/manifest.json index ebb930c..1a349c6 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Collaborative editor to work on notes written in Markdown", "fr": "Éditeur collaboratif pour travailler sur des notes en Markdown" }, - "version": "1.9.3~ynh1", + "version": "1.9.4~ynh1", "url": "https://hedgedoc.org", "upstream": { "license": "free", diff --git a/scripts/install b/scripts/install index 35fb5ac..6b71a53 100644 --- a/scripts/install +++ b/scripts/install @@ -100,6 +100,10 @@ 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 +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -125,8 +129,7 @@ popd #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 -env_path="$PATH" - +# Create a dedicated systemd config ynh_add_systemd_config #================================================= @@ -137,21 +140,9 @@ ynh_script_progression --message="Modifying a config file..." --weight=1 url_path=${path_url#/} ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json" -chmod 400 "$final_path/config.json" +chmod 600 "$final_path/config.json" chown $app:$app "$final_path/config.json" -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." --weight=1 - -# Set permissions to app files -chown -R $app:$app $final_path -chmod o-rwx $final_path -chmod 600 $final_path/config.json - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/restore b/scripts/restore index c167e57..bb4d2a2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -38,7 +38,8 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=2 -test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS @@ -64,9 +65,9 @@ ynh_script_progression --message="Restoring HedgeDoc main directory..." --weight ynh_restore_file --origin_path="$final_path" -chown -R $app:$app $final_path -chmod o-rwx $final_path -chmod 600 $final_path/config.json +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index dbe33a1..1d392a3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -85,6 +85,10 @@ then ynh_setup_source --dest_dir=$final_path --keep="$final_path/config.json" fi +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -108,9 +112,10 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st #================================================= # SPECIFIC UPGRADE -#============================================== +#================================================= # INSTALL HEDGEDOC -#============================================== +#================================================= + if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Building HedgeDoc... (this will take some time and resources!)" --weight=20 @@ -126,22 +131,9 @@ fi #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=2 -env_path="$PATH" # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." --weight=1 - -# Set permissions on app files -chown -R $app:$app $final_path -chmod o-rwx $final_path -chmod 600 $final_path/config.json - #================================================= # INTEGRATE SERVICE IN YUNOHOST #=================================================