From 1d9658c5c6b8b976e9fd92cc756a38dcb3c49d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 27 Apr 2021 13:48:15 +0200 Subject: [PATCH] Testing (#22) * Upgrade to version 1.8.0 --- README.md | 8 ++++---- README_fr.md | 8 ++++---- check_process | 1 - conf/.sequelizerc.example | 8 -------- conf/app.src | 4 ++-- conf/systemd.service | 6 ++++++ manifest.json | 2 +- scripts/install | 21 ++++----------------- scripts/restore | 3 ++- scripts/upgrade | 7 +++---- 10 files changed, 26 insertions(+), 42 deletions(-) delete mode 100644 conf/.sequelizerc.example diff --git a/README.md b/README.md index c110cf1..3cb78f9 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,12 @@ *[Lire ce readme en français.](./README_fr.md)* > *This package allows you to install HedgeDoc 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.* +If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* ## Overview HedgeDoc ([formerly known as CodiMD](https://hedgedoc.org/history/)) is an open-source collaborative markdown editor. With HedgeDoc you can 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. -**Shipped version:** 1.7.2 +**Shipped version:** 1.8.0 ## Screenshots @@ -40,8 +40,8 @@ When you finished editing the configuration, for your changes to take effect, yo #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/hedgedoc%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/hedgedoc/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/hedgedoc%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/hedgedoc/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/hedgedoc.svg)](https://ci-apps.yunohost.org/ci/apps/hedgedoc/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/hedgedoc.svg)](https://ci-apps-arm.yunohost.org/ci/apps/hedgedoc/) ## Limitations diff --git a/README_fr.md b/README_fr.md index 7ffeef7..174252c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -6,12 +6,12 @@ *[Read this readme in english.](./README.md)* > *Ce package vous permet d'installer HedgeDoc rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* +Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/install) pour apprendre comment l'installer.* ## Vue d'ensemble HedgeDoc ([anciennement connu sous le nom de CodiMD](https://hedgedoc.org/history/)) est un éditeur Markdown collaboratif open-source. Avec HedgeDoc, vous pouvez facilement collaborer sur des notes, des graphiques et même des présentations en temps réel. Tout ce que vous avez à faire est de partager votre lien de note avec vos collègues. -**Version incluse :** 1.7.2 +**Version incluse :** 1.8.0 ## Captures d'écran @@ -40,8 +40,8 @@ Lorsque vous avez terminé de modifier la configuration, pour que vos modificati #### Architectures supportées -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/hedgedoc%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/hedgedoc/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/hedgedoc%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/hedgedoc/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/hedgedoc.svg)](https://ci-apps.yunohost.org/ci/apps/hedgedoc/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/hedgedoc.svg)](https://ci-apps-arm.yunohost.org/ci/apps/hedgedoc/) ## Limitations diff --git a/check_process b/check_process index c96585b..15aa133 100644 --- a/check_process +++ b/check_process @@ -15,7 +15,6 @@ upgrade=1 from_commit=2a6ed9db5f7f0644eab251b2495c190811735832 backup_restore=1 multi_instance=1 - port_already_use=1 change_url=1 ;;; Options Email= diff --git a/conf/.sequelizerc.example b/conf/.sequelizerc.example deleted file mode 100644 index ddb5cba..0000000 --- a/conf/.sequelizerc.example +++ /dev/null @@ -1,8 +0,0 @@ -var path = require('path'); - -module.exports = { - 'config': path.resolve('config.json'), - 'migrations-path': path.resolve('lib', 'migrations'), - 'models-path': path.resolve('lib', 'models'), - 'url': 'postgres://__DB_NAME__:__DB_PWD__@localhost:5432/__DB_NAME__' -} diff --git a/conf/app.src b/conf/app.src index 80312fa..273e25c 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/hedgedoc/hedgedoc/releases/download/1.7.2/hedgedoc-1.7.2.tar.gz -SOURCE_SUM=8bb66ba9c839a4d81f72267b91a201f97a48f16aa95434586d6dd6be40502d6d +SOURCE_URL=https://github.com/hedgedoc/hedgedoc/releases/download/1.8.0-rc1/hedgedoc-1.8.0-rc1.tar.gz +SOURCE_SUM=d9ea1d4d81312b82e53a33ab472eca5641d2f24b23c92590c0aef45b63c64dba SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/systemd.service b/conf/systemd.service index 7ad3203..839ebca 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -15,5 +15,11 @@ Restart=always PrivateTmp=true PrivateDevices=true +ProtectControlGroups=true +ProtectHome=true +ProtectKernelTunables=true +ProtectSystem=full +RestrictSUIDSGID=true + [Install] WantedBy=multi-user.target diff --git a/manifest.json b/manifest.json index 6a521f0..cf9329a 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.7.2~ynh2", + "version": "1.8.0~ynh1", "url": "https://github.com/hedgedoc/hedgedoc", "license": "AGPL-3.0-only", "maintainer": { diff --git a/scripts/install b/scripts/install index daa62a7..f9eb446 100644 --- a/scripts/install +++ b/scripts/install @@ -46,7 +46,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url 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=path --value=$path_url #================================================= # STANDARD MODIFICATIONS @@ -125,7 +125,7 @@ popd || ynh_die #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 -ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" +ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" ynh_add_systemd_config @@ -137,22 +137,8 @@ ynh_script_progression --message="Modifying a config file..." --weight=1 path=${path_url:1} -# cp ../conf/config.json.example "$final_path/config.json" - -# # Main config File -# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.json" -# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config.json" -# ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="$final_path/config.json" -# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.json" -# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.json" -# ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/config.json" - -# ynh_store_file_checksum --file="$final_path/config.json" - ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json" -ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_path/.sequelizerc" - #================================================= # GENERIC FINALIZATION #================================================= @@ -162,7 +148,8 @@ ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions to app files chown -R $app:$app $final_path -chmod 600 $final_path/.sequelizerc +chmod o-rwx $final_path +chmod 600 $final_path/config.json #================================================= # INTEGRATE SERVICE IN YUNOHOST diff --git a/scripts/restore b/scripts/restore index 96f392b..47778fb 100644 --- a/scripts/restore +++ b/scripts/restore @@ -74,7 +74,8 @@ ynh_script_progression --message="Restoring user rights..." --weight=2 # Restore permissions on app files chown -R $app:$app $final_path -chmod 600 $final_path/.sequelizerc +chmod o-rwx $final_path +chmod 600 $final_path/config.json #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index 81aa8e8..807341c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -64,7 +64,7 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action=stop --log_path="systemd" +ynh_systemd_action --service_name=$app --action=stop --log_path=systemd #================================================= # CREATE DEDICATED USER @@ -87,7 +87,6 @@ then # Backup the config file in the temp dir cp -a "$final_path/config.json" "$tmpdir/config.json" - cp -a "$final_path/.sequelizerc" "$tmpdir/.sequelizerc" # Remove the app directory securely ynh_secure_remove --file=$final_path @@ -97,7 +96,6 @@ then #Copy the admin saved settings from tmp directory to final path cp -a "$tmpdir/config.json" "$final_path/config.json" - cp -a "$tmpdir/.sequelizerc" "$final_path/.sequelizerc" # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir" @@ -159,7 +157,8 @@ ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions on app files chown -R $app:$app $final_path -chmod 600 $final_path/.sequelizerc +chmod o-rwx $final_path +chmod 600 $final_path/config.json #================================================= # INTEGRATE SERVICE IN YUNOHOST