From 9883e7e655c8c583c92cebc640b70c2136954617 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 19 Nov 2020 21:56:06 +0100 Subject: [PATCH] small fixes --- README.md | 1 + README_fr.md | 1 + conf/nginx.conf | 1 + manifest.json | 2 +- scripts/change_url | 2 +- scripts/install | 14 ++++++-------- scripts/remove | 2 +- scripts/restore | 10 +++++----- scripts/upgrade | 18 ++++++++---------- 9 files changed, 25 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 1737cd0..08900ef 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ You can configure HedgeDoc by editing this file `/var/www/hedgedoc/config.json` ## Links * Report a bug: https://github.com/YunoHost-Apps/hedgedoc_ynh/issues + * App website: https://hedgedoc.org * Upstream app repository: https://github.com/hedgedoc/hedgedoc * YunoHost website: https://yunohost.org/ diff --git a/README_fr.md b/README_fr.md index 687dac5..eec2501 100644 --- a/README_fr.md +++ b/README_fr.md @@ -45,6 +45,7 @@ Vous pouvez configurer HedgeDoc en modifiant le fichier `/var/www/hedgedoc/confi ## Liens * Signaler un bug : https://github.com/YunoHost-Apps/hedgedoc_ynh/issues + * Site de l'application : https://hedgedoc.org * Dépôt de l'application principale : https://github.com/hedgedoc/hedgedoc * Site web YunoHost : https://yunohost.org/ diff --git a/conf/nginx.conf b/conf/nginx.conf index 1879457..a0fc0ae 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,5 @@ location ^~ __PATH__/ { + # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; diff --git a/manifest.json b/manifest.json index 31933b5..f7bf253 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,7 @@ "name": "" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.0.8" }, "multi_instance": true, "services": [ diff --git a/scripts/change_url b/scripts/change_url index 6d44905..16ede2b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -107,7 +107,7 @@ fi #================================================= # SPECIFIC MODIFICATIONS #================================================= -# CONFIGURE CODIMD +# CONFIGURE HEDGEDOC #================================================= ynh_backup_if_checksum_is_different --file="$final_path/config.json" diff --git a/scripts/install b/scripts/install index 1d18f36..a957b6a 100644 --- a/scripts/install +++ b/scripts/install @@ -108,7 +108,7 @@ ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 +ynh_script_progression --message="Configuring system user..." --weight=2 # Create a system user ynh_system_user_create --username=$app --home_dir=$final_path @@ -116,16 +116,14 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # SPECIFIC SETUP #============================================== -# INSTALL CODIMD +# INSTALL HEDGEDOC #============================================== -ynh_script_progression --message="Building HedgeDoc... (this will take some time and resources!)" --weight=240 +ynh_script_progression --message="Building HedgeDoc... (this will take some time and resources!)" --weight=10 pushd "$final_path" || ynh_die - ynh_use_nodejs bin/setup ynh_exec_warn_less yarn run build - popd || ynh_die #================================================= @@ -141,7 +139,7 @@ ynh_add_systemd_config #================================================= # MODIFY A CONFIG FILE #================================================= -ynh_script_progression --message="Modifying a config file..." +ynh_script_progression --message="Modifying a config file..." --weight=1 cp ../conf/config.json.example "$final_path/config.json" @@ -170,7 +168,7 @@ ynh_store_file_checksum --file="$final_path/.sequelizerc" #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_script_progression --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions to app files chown -R $app:$app $final_path @@ -178,7 +176,7 @@ chown -R $app:$app $final_path #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 yunohost service add $app --description "Collaborative Markdown notes" --log="/var/log/$app/$app.log" diff --git a/scripts/remove b/scripts/remove index b737882..4649abb 100644 --- a/scripts/remove +++ b/scripts/remove @@ -28,7 +28,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) +# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then ynh_script_progression --message="Removing $app service..." --weight=1 diff --git a/scripts/restore b/scripts/restore index 832d3d6..49aceb0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -48,14 +48,14 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." +ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring HedgeDoc main directory..." --weight=60 +ynh_script_progression --message="Restoring HedgeDoc main directory..." --weight=10 ynh_restore_file --origin_path="$final_path" @@ -70,7 +70,7 @@ ynh_system_user_create --username=$app #================================================= # RESTORE USER RIGHTS #================================================= -ynh_script_progression --message="Restoring user rights..." +ynh_script_progression --message="Restoring user rights..." --weight=2 # Restore permissions on app files chown -R $app:$app $final_path @@ -80,7 +80,7 @@ chown -R $app:$app $final_path #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=7 +ynh_script_progression --message="Reinstalling dependencies..." --weight=6 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -111,7 +111,7 @@ systemctl enable $app.service #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 yunohost service add $app --description "collaborative Markdown editor" --log "/var/log/$app/$app.log" diff --git a/scripts/upgrade b/scripts/upgrade index 5cc0804..dcfd276 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,14 +29,14 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." +ynh_script_progression --message="Checking version..." --weight=2 upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up HedgeDoc before upgrading (may take a while)..." --weight=120 +ynh_script_progression --message="Backing up HedgeDoc before upgrading (may take a while)..." --weight=10 # Backup the current version of the app ynh_backup_before_upgrade @@ -62,7 +62,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." --weight=160 + ynh_script_progression --message="Upgrading source files..." --weight=10 # Create a temporary directory tmpdir="$(mktemp -d)" @@ -96,7 +96,7 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=18 +ynh_script_progression --message="Upgrading dependencies..." --weight=10 ynh_install_app_dependencies $pkg_dependencies @@ -117,18 +117,16 @@ ynh_system_user_create --username=$app #================================================= # SPECIFIC UPGRADE #============================================== -# INSTALL CODIMD +# INSTALL HEDGEDOC #============================================== if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Building HedgeDoc... (this will take some time and resources!)" --weight=160 + ynh_script_progression --message="Building HedgeDoc... (this will take some time and resources!)" --weight=10 pushd "$final_path" || ynh_die - ynh_use_nodejs bin/setup ynh_exec_warn_less yarn run build - popd || ynh_die fi @@ -169,7 +167,7 @@ ynh_add_systemd_config #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_script_progression --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions on app files chown -R $app:$app $final_path @@ -177,7 +175,7 @@ chown -R $app:$app $final_path #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 yunohost service add $app --description "Collaborative Markdown notes" --log="/var/log/$app/$app.log"