diff --git a/README.md b/README.md index bcafaf6..5da41f1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview Flow-based programming for the Internet of Things. -**Shipped version:** 1.1.3 +**Shipped version:** 1.2.1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 4506923..08eb6f3 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble Programmation par flux de données pour l'Internet des objets. -**Version incluse :** 1.1.3 +**Version incluse :** 1.2.1 ## Captures d'écran diff --git a/conf/app.src b/conf/app.src index 7b0d075..efad3ac 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/node-red/node-red/releases/download/1.1.3/node-red-1.1.3.zip -SOURCE_SUM=f57687b3396936fb6ef5a69a132a7f11caa4841ef7494329e14a0471617d998e +SOURCE_URL=https://github.com/node-red/node-red/releases/download/1.2.1/node-red-1.2.1.zip +SOURCE_SUM=165cf76bb4ef8df4c9f3b40bf4e0a0ff0db9c8d5b1b13db9d423b1a5c382e4b4 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 933584a..71a0521 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Flow-based programming for the Internet of Things.", "fr": "Programmation par flux de données pour l'Internet des objets." }, - "version": "1.1.3~ynh1", + "version": "1.2.1~ynh1", "url": "https://nodered.org", "license": "Apache-2.0", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 80c6b73..17a4f57 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -16,3 +16,16 @@ nodejs_version=12 #================================================= # FUTURE OFFICIAL HELPERS #================================================= + +# Execute a command as another user +# usage: exec_as USER COMMAND [ARG ...] +exec_as() { + local USER=$1 + shift 1 + + if [[ $USER = $(whoami) ]]; then + eval "$@" + else + sudo -u "$USER" "$@" + fi +} diff --git a/scripts/backup b/scripts/backup index 4fd18aa..a47c764 100755 --- a/scripts/backup +++ b/scripts/backup @@ -61,4 +61,4 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info --message="Backup script completed for Node-RED. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 2f5cad4..96ffe6c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -58,7 +58,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating nginx web server configuration..." --weight=2 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -104,7 +104,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -112,4 +112,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression --message="Change of URL completed for Node-RED" --last diff --git a/scripts/install b/scripts/install index 6234369..b004a50 100755 --- a/scripts/install +++ b/scripts/install @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_exec_as source /usr/share/yunohost/helpers #================================================= @@ -84,7 +83,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # Install through npm #================================================= -ynh_script_progression --message="Installing node-red..." --weight=2 +ynh_script_progression --message="Installing Node-RED..." --weight=2 chown -R $app: $final_path @@ -96,9 +95,9 @@ popd #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=30 +ynh_script_progression --message="Configuring NGINX web server..." --weight=30 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -168,7 +167,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -176,4 +175,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression --message="Installation of Node-RED completed" --last diff --git a/scripts/remove b/scripts/remove index 0bb7ccc..2cc5e22 100755 --- a/scripts/remove +++ b/scripts/remove @@ -29,7 +29,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # Remove a service from the admin panel, added by `yunohost service add` if ynh_exec_warn_less yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service..." --weight=1 + ynh_script_progression --message="Removing Node-RED service..." --weight=1 yunohost service remove $app fi @@ -44,7 +44,7 @@ ynh_remove_systemd_config #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=2 +ynh_script_progression --message="Removing Node-RED main directory..." --weight=2 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -52,9 +52,9 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= @@ -103,4 +103,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression --message="Removal of Node-RED completed" --last diff --git a/scripts/restore b/scripts/restore index 48c8d71..d327049 100755 --- a/scripts/restore +++ b/scripts/restore @@ -48,7 +48,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=10 +ynh_script_progression --message="Restoring Node-RED main directory..." --weight=10 ynh_restore_file --origin_path="$final_path" @@ -107,7 +107,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -115,4 +115,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression --message="Restoration completed for Node-RED" --last diff --git a/scripts/upgrade b/scripts/upgrade index 01469f7..177ca06 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_exec_as source /usr/share/yunohost/helpers #================================================= @@ -52,7 +51,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 +ynh_script_progression --message="Backing up Node-RED before upgrading (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -101,7 +100,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # Install through npm #================================================= -ynh_script_progression --message="Installing node-red..." --weight=30 +ynh_script_progression --message="Installing Node-RED..." --weight=30 chown -R $app: $final_path @@ -113,9 +112,9 @@ popd #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -179,7 +178,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -187,4 +186,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression --message="Upgrade of Node-RED completed" --last diff --git a/scripts/ynh_exec_as b/scripts/ynh_exec_as deleted file mode 100644 index 11b056b..0000000 --- a/scripts/ynh_exec_as +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Execute a command as another user -# usage: exec_as USER COMMAND [ARG ...] -exec_as() { - local USER=$1 - shift 1 - - if [[ $USER = $(whoami) ]]; then - eval "$@" - else - sudo -u "$USER" "$@" - fi -}