From 39414db8158050ff45c82b60f2ec606bf67f7573 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sun, 29 Mar 2020 13:50:33 +0200 Subject: [PATCH 1/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d6b25d1..e15c0d8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Shell In A Box for YunoHost -[![Integration level](https://dash.yunohost.org/integration/shellinabox.svg)](https://dash.yunohost.org/appci/app/shellinabox) +[![Integration level](https://dash.yunohost.org/integration/shellinabox.svg)](https://dash.yunohost.org/appci/app/shellinabox) ![](https://ci-apps.yunohost.org/ci/badges/shellinabox.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/shellinabox.maintain.svg) [![Install Shell In A Box with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=shellinabox) > *This package allow you to install Shell In A Box quickly and simply on a YunoHost server. From 982cee4430829743dd8e140a6732fa1f11121516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 4 Nov 2020 22:58:15 +0100 Subject: [PATCH 2/7] Update README.md --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e15c0d8..a0c63c7 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,8 @@ Shell In A Box implements a web server that can export arbitrary command line to #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/shellinabox%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/shellinabox/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/shellinabox%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/shellinabox/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/shellinabox%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/shellinabox/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/shellinabox%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/shellinabox/) ## Limitations @@ -46,10 +45,8 @@ Shell In A Box implements a web server that can export arbitrary command line to --- -Developers info ----------------- +## Developers info -**Only if you want to use a testing branch for coding, instead of merging directly into master.** Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/shellinabox_ynh/tree/testing). To try the testing branch, please proceed like that. From bae5bc74a0b33ed6910a096b64ed379e728cd7ec Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 9 Jan 2021 22:47:07 +0100 Subject: [PATCH 3/7] Finding an available port --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 26ce1c5..e5de7ee 100644 --- a/scripts/install +++ b/scripts/install @@ -45,7 +45,7 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Configuring firewall..." --weight=2 +ynh_script_progression --message="Finding an available port..." --weight=2 # Find a free port port=$(ynh_find_port --port=4200) From 6e155c9a6e03b8df7e3f17424280b3484045cb46 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 13 Feb 2021 19:19:24 +0100 Subject: [PATCH 4/7] Fix linter warnings --- conf/nginx.conf | 2 +- scripts/_common.sh | 20 ++++++++++++++++++++ scripts/backup | 11 ++++++----- scripts/install | 3 ++- scripts/remove | 1 + scripts/restore | 4 +++- scripts/upgrade | 21 ++++++++++++++------- 7 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 scripts/_common.sh diff --git a/conf/nginx.conf b/conf/nginx.conf index a86f6cb..73d19a9 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -14,7 +14,7 @@ location __PATH__/ { access_log off; # Allow shellinabox to use 'eval' without blocking the execution. But keep a warning. - more_set_headers Content-Security-Policy-Report-Only "script-src https: 'unsafe-eval'"; + more_set_headers "Content-Security-Policy-Report-Only script-src https: 'unsafe-eval'"; more_clear_input_headers 'Accept-Encoding'; diff --git a/scripts/_common.sh b/scripts/_common.sh new file mode 100644 index 0000000..54e78b3 --- /dev/null +++ b/scripts/_common.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +#================================================= +# COMMON VARIABLES +#================================================= + +# dependencies used by the app +pkg_dependencies="shellinabox" + +#================================================= +# PERSONAL HELPERS +#================================================= + +#================================================= +# EXPERIMENTAL HELPERS +#================================================= + +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= diff --git a/scripts/backup b/scripts/backup index a58fb6d..0202264 100644 --- a/scripts/backup +++ b/scripts/backup @@ -18,18 +18,20 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= -# STANDARD BACKUP STEPS +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_script_progression --message="Backing up the main app directory..." ynh_backup --src_path="/etc/shellinabox" ynh_backup --src_path="/etc/default/shellinabox" @@ -37,7 +39,6 @@ ynh_backup --src_path="/etc/default/shellinabox" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up nginx web server configuration..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -45,4 +46,4 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/install b/scripts/install index e5de7ee..85ce212 100644 --- a/scripts/install +++ b/scripts/install @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +source _common.sh source /usr/share/yunohost/helpers #================================================= @@ -57,7 +58,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port ynh_script_progression --message="Installing shellinabox..." --weight=7 ynh_package_update -ynh_package_install shellinabox +ynh_install_app_dependencies $pkg_dependencies #================================================= # NGINX CONFIGURATION diff --git a/scripts/remove b/scripts/remove index 56374d6..cebc0f9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +source _common.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/restore b/scripts/restore index 2924c9a..7de0667 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= @@ -48,7 +49,8 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_script_progression --message="Installing shellinabox..." --weight=7 ynh_package_update -ynh_package_install shellinabox + +ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE APP MAIN DIR diff --git a/scripts/upgrade b/scripts/upgrade index 71f210a..ab999d1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +source _common.sh source /usr/share/yunohost/helpers #================================================= @@ -44,13 +45,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -61,6 +55,13 @@ ynh_script_progression --message="Upgrading nginx web server configuration..." - # Create a dedicated nginx config ynh_add_nginx_config +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # CONFIGURE SHELLINABOX #================================================= @@ -84,6 +85,12 @@ ynh_systemd_action --service_name=shellinabox --action=restart # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="/etc/default/shellinabox" +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +yunohost service add $app + #================================================= # RELOAD NGINX #================================================= From 8b3fbbba12c17a5244be2adc59d4ba6fd903564e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 13 Feb 2021 19:34:25 +0100 Subject: [PATCH 5/7] Fix --- README.md | 4 ++-- check_process | 3 --- conf/nginx.conf | 2 +- manifest.json | 10 ++++++---- scripts/change_url | 2 +- scripts/install | 4 ++-- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 4 ++-- 9 files changed, 16 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index a0c63c7..a2bb240 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Shell In A Box for YunoHost [![Integration level](https://dash.yunohost.org/integration/shellinabox.svg)](https://dash.yunohost.org/appci/app/shellinabox) ![](https://ci-apps.yunohost.org/ci/badges/shellinabox.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/shellinabox.maintain.svg) -[![Install Shell In A Box with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=shellinabox) +[![Install Shell In A Box with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=shellinabox) > *This package allow you to install Shell In A Box 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.* @@ -10,7 +10,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to Shell In A Box implements a web server that can export arbitrary command line tools to a web based terminal emulator. This emulator is accessible to any JavaScript and CSS enabled web browser and does not require any additional browser plugins. -**Shipped version:** Current Debian version. +**Shipped version:** 2.21 (current Debian version) ## Screenshots diff --git a/check_process b/check_process index 8f2ac22..d9efa95 100644 --- a/check_process +++ b/check_process @@ -13,11 +13,8 @@ upgrade=1 from_commit=a94b50de8b68501148fa90419ad3ea8e24c675e1 backup_restore=1 multi_instance=0 - incorrect_path=1 port_already_use=0 change_url=1 -;;; Levels - Level 5=auto ;;; Options Email= Notification=none diff --git a/conf/nginx.conf b/conf/nginx.conf index 73d19a9..1785e97 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -14,7 +14,7 @@ location __PATH__/ { access_log off; # Allow shellinabox to use 'eval' without blocking the execution. But keep a warning. - more_set_headers "Content-Security-Policy-Report-Only script-src https: 'unsafe-eval'"; + more_set_headers "Content-Security-Policy-Report-Only: script-src https: 'unsafe-eval'"; more_clear_input_headers 'Accept-Encoding'; diff --git a/manifest.json b/manifest.json index 52a89e6..a0e4700 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Web based AJAX terminal emulator", "fr": "Émulateur de terminal web" }, - "version": "1.1.0~ynh1", + "version": "2.21~ynh1", "url": "https://github.com/shellinabox/shellinabox", "license": "GPL-2.0", "maintainer": { @@ -14,7 +14,7 @@ "email": "kload@kload.fr" }, "requirements": { - "yunohost": ">= 3.5.0" + "yunohost": ">= 3.8.1" }, "multi_instance": false, "services": [ @@ -26,7 +26,8 @@ "name": "domain", "type": "domain", "ask": { - "en": "Choose a domain for Shell In A Box" + "en": "Choose a domain for Shell In A Box", + "fr": "Choisissez un nom de domaine pour Shell In A Box" }, "example": "domain.org" }, @@ -34,7 +35,8 @@ "name": "path", "type": "path", "ask": { - "en": "Choose a path for Shell In A Box" + "en": "Choose a path for Shell In A Box", + "fr": "Choisissez un chemin pour Shell In A Box" }, "example": "/ssh", "default": "/ssh" diff --git a/scripts/change_url b/scripts/change_url index 19c7c8a..5e94b89 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -95,7 +95,7 @@ ynh_systemd_action --service_name=shellinabox --action=start #================================================= # 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 85ce212..205ed3f 100644 --- a/scripts/install +++ b/scripts/install @@ -63,7 +63,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=2 +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated nginx config ynh_add_nginx_config @@ -102,7 +102,7 @@ yunohost service add $app #================================================= # 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/remove b/scripts/remove index cebc0f9..93df963 100644 --- a/scripts/remove +++ b/scripts/remove @@ -42,7 +42,7 @@ ynh_package_autopurge shellinabox #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated nginx config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index 7de0667..1d248bd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -78,7 +78,7 @@ yunohost service add $app #================================================= # 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 ab999d1..c3b5993 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -50,7 +50,7 @@ ynh_abort_if_errors #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 # Create a dedicated nginx config ynh_add_nginx_config @@ -94,7 +94,7 @@ yunohost service add $app #================================================= # 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 From 944c8f73d4c498feea57947b3460a3eab79d69cd Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 26 Mar 2021 22:25:19 +0100 Subject: [PATCH 6/7] Add ynh_abort_if_errors --- manifest.json | 12 ++---------- pull_request_template.md | 12 ++---------- scripts/change_url | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/manifest.json b/manifest.json index a0e4700..78b8a86 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Web based AJAX terminal emulator", "fr": "Émulateur de terminal web" }, - "version": "2.21~ynh1", + "version": "2.21~ynh2", "url": "https://github.com/shellinabox/shellinabox", "license": "GPL-2.0", "maintainer": { @@ -14,7 +14,7 @@ "email": "kload@kload.fr" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1.7" }, "multi_instance": false, "services": [ @@ -25,19 +25,11 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for Shell In A Box", - "fr": "Choisissez un nom de domaine pour Shell In A Box" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Shell In A Box", - "fr": "Choisissez un chemin pour Shell In A Box" - }, "example": "/ssh", "default": "/ssh" } diff --git a/pull_request_template.md b/pull_request_template.md index 47703f3..0a198cf 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -11,14 +11,6 @@ - [ ] Upgrade from last version tested. - [ ] Can be reviewed and tested. -## Validation +## Package_check results --- -*Minor decision* -- **Upgrade previous version** : -- [ ] **Code review** : -- [ ] **Approval (LGTM)** : -- [ ] **Approval (LGTM)** : -- **CI succeeded** : -[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/shellinabox_ynh%20PR-NUM-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/shellinabox_ynh%20PR-NUM-/) -*Please replace '-NUM-' in this link by the PR number.* -When the PR is marked as ready to merge, you have to wait for 3 days before really merging it. +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/change_url b/scripts/change_url index 5e94b89..9f57d76 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +source _common.sh source /usr/share/yunohost/helpers #================================================= @@ -29,6 +30,23 @@ ynh_script_progression --message="Loading installation settings..." final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --time --weight=1 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. + ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" + + # Restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= From 1b64c856bdd49b4117d05be3f962040853a3b178 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 17 Apr 2021 22:52:53 +0200 Subject: [PATCH 7/7] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a2bb240..8f58152 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ Shell In A Box implements a web server that can export arbitrary command line to #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/shellinabox%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/shellinabox/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/shellinabox%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/shellinabox/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/shellinabox.svg)](https://ci-apps.yunohost.org/ci/apps/shellinabox/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/shellinabox.svg)](https://ci-apps-arm.yunohost.org/ci/apps/shellinabox/) ## Limitations