From 5cc1a49c9c7cda0b884f5a434e98097fae403285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 18 Dec 2020 12:55:45 +0100 Subject: [PATCH 1/2] Fix linter warnings (#81) * Fix linter warnings --- README.md | 5 ++- manifest.json | 8 ++--- scripts/change_url | 2 +- scripts/install | 6 ++-- scripts/restore | 8 ++--- scripts/upgrade | 8 ++--- scripts/ynh_check_app_version_changed | 46 --------------------------- 7 files changed, 18 insertions(+), 65 deletions(-) delete mode 100644 scripts/ynh_check_app_version_changed diff --git a/README.md b/README.md index db8939d..3d4a281 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # WriteFreely for YunoHost [![Integration level](https://dash.yunohost.org/integration/writefreely.svg)](https://dash.yunohost.org/appci/app/writefreely) ![](https://ci-apps.yunohost.org/ci/badges/writefreely.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/writefreely.maintain.svg) -[![Install WriteFreely with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=writefreely) +[![Install WriteFreely with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=writefreely) > *This package allow you to install WriteFreely 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.* @@ -63,8 +63,7 @@ If User Mode is configured Multiple users, the app be used by multiple users --- -Developer info ----------------- +## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/writefreely_ynh/tree/testing). diff --git a/manifest.json b/manifest.json index 96f06e9..24f1563 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "For starting a minimalist, federated blog — or an entire community.", "fr": "Permet de créer un blog fédéré minimaliste ou une communauté entière." }, - "version": "0.12.0~ynh2", + "version": "0.12.0~ynh3", "url": "https://writefreely.org", "license": "AGPL-3.0-or-later", "maintainer": [ @@ -18,7 +18,7 @@ "name": "yalh76" }], "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": [ @@ -67,8 +67,8 @@ "name": "single_user", "type": "boolean", "ask": { - "en": "Choose if you want a Single User Blog ?", - "fr": "Souhaitez vous un blog pour un seul utilisateur?" + "en": "Choose if you want a Single User Blog?", + "fr": "Souhaitez vous un blog pour un seul utilisateur ?" }, "default": true } diff --git a/scripts/change_url b/scripts/change_url index f96d983..a50bdba 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -136,7 +136,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index b8f0e7c..06c5855 100755 --- a/scripts/install +++ b/scripts/install @@ -102,7 +102,7 @@ ynh_setup_source --dest_dir="$final_path" --source_id=$architecture #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated nginx config ynh_add_nginx_config @@ -176,7 +176,7 @@ chown -R "$app":"$app" "$final_path" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for WriteFreely" --log "/var/log/$app/$app.log" +yunohost service add $app --description="WriteFreely daemon" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE @@ -201,7 +201,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/restore b/scripts/restore index c084d99..8eb8358 100755 --- a/scripts/restore +++ b/scripts/restore @@ -48,7 +48,7 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the nginx configuration..." +ynh_script_progression --message="Restoring the NGINX configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -92,14 +92,14 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ ynh_script_progression --message="Restoring the systemd configuration..." ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service +systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for WriteFreely" --log_type systemd +yunohost service add $app --description="WriteFreely daemon" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE @@ -113,7 +113,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 3a7de24..0c80ca6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -119,9 +119,9 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -180,7 +180,7 @@ chown -R "$app":"$app" "$final_path" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for WriteFreely" --log "/var/log/$app/$app.log" +yunohost service add $app --description="WriteFreely daemon" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE @@ -204,7 +204,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/ynh_check_app_version_changed b/scripts/ynh_check_app_version_changed deleted file mode 100644 index 641815c..0000000 --- a/scripts/ynh_check_app_version_changed +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -# Checks the app version to upgrade with the existing app version and returns: -# - UPGRADE_APP if the upstream app version has changed -# - UPGRADE_PACKAGE if only the YunoHost package has changed -# -## It stops the current script without error if the package is up-to-date -# -# This helper should be used to avoid an upgrade of an app, or the upstream part -# of it, when it's not needed -# -# To force an upgrade, even if the package is up to date, -# you have to set the variable YNH_FORCE_UPGRADE before. -# example: sudo YNH_FORCE_UPGRADE=1 yunohost app upgrade MyApp - -# usage: ynh_check_app_version_changed -ynh_check_app_version_changed () { - local force_upgrade=${YNH_FORCE_UPGRADE:-0} - local package_check=${PACKAGE_CHECK_EXEC:-0} - - # By default, upstream app version has changed - local return_value="UPGRADE_APP" - - local current_version=$(ynh_read_manifest "/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" "version" || echo 1.0) - local current_upstream_version="${current_version/~ynh*/}" - local update_version=$(ynh_read_manifest "../manifest.json" "version" || echo 1.0) - local update_upstream_version="${update_version/~ynh*/}" - - if [ "$current_version" == "$update_version" ] ; then - # Complete versions are the same - if [ "$force_upgrade" != "0" ] - then - echo "Upgrade forced by YNH_FORCE_UPGRADE." >&2 - unset YNH_FORCE_UPGRADE - elif [ "$package_check" != "0" ] - then - echo "Upgrade forced for package check." >&2 - else - ynh_die "Up-to-date, nothing to do" 0 - fi - elif [ "$current_upstream_version" == "$update_upstream_version" ] ; then - # Upstream versions are the same, only YunoHost package versions differ - return_value="UPGRADE_PACKAGE" - fi - echo $return_value -} From 5ac207e14985bda77dc797353902548696622b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 15 Jan 2021 22:57:30 +0100 Subject: [PATCH 2/2] Testing (#82) * Fix linter warnings * Change version * Finding an available port Co-authored-by: Alexandre Aubin --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 06c5855..f047368 100755 --- a/scripts/install +++ b/scripts/install @@ -74,7 +74,7 @@ ynh_app_setting_set --app=$app --key=single_user --value=$single_user #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Configuring firewall..." +ynh_script_progression --message="Finding an available port..." # Find an available port port=$(ynh_find_port --port=8095)