1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shellinabox_ynh.git synced 2024-09-03 20:26:12 +02:00

Merge pull request #31 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2023-06-04 22:29:51 +02:00 committed by GitHub
commit e2dbb5e8d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 70 additions and 353 deletions

View file

@ -6,6 +6,7 @@ It shall NOT be edited by hand.
# Shell In A Box for YunoHost # Shell In A Box for YunoHost
[![Integration level](https://dash.yunohost.org/integration/shellinabox.svg)](https://dash.yunohost.org/appci/app/shellinabox) ![Working status](https://ci-apps.yunohost.org/ci/badges/shellinabox.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/shellinabox.maintain.svg) [![Integration level](https://dash.yunohost.org/integration/shellinabox.svg)](https://dash.yunohost.org/appci/app/shellinabox) ![Working status](https://ci-apps.yunohost.org/ci/badges/shellinabox.status.svg) ![Maintenance status](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.svg)](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)
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
@ -18,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
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. 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:** 2.21~ynh3 **Shipped version:** 2.21~ynh4
## Screenshots ## Screenshots

View file

@ -5,31 +5,32 @@ It shall NOT be edited by hand.
# Shell In A Box pour YunoHost # Shell In A Box pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/shellinabox.svg)](https://dash.yunohost.org/appci/app/shellinabox) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/shellinabox.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/shellinabox.maintain.svg) [![Niveau dintégration](https://dash.yunohost.org/integration/shellinabox.svg)](https://dash.yunohost.org/appci/app/shellinabox) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/shellinabox.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/shellinabox.maintain.svg)
[![Installer Shell In A Box avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=shellinabox) [![Installer Shell In A Box avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=shellinabox)
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
> *Ce package vous permet d'installer Shell In A Box rapidement et simplement sur un serveur YunoHost. > *Ce package vous permet dinstaller Shell In A Box rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment linstaller et en profiter.*
## Vue d'ensemble ## Vue densemble
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. 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.
**Version incluse :** 2.21~ynh3 **Version incluse :** 2.21~ynh4
## Captures d'écran ## Captures décran
![Capture d'écran de Shell In A Box](./doc/screenshots/screenshot.gif) ![Capture décran de Shell In A Box](./doc/screenshots/screenshot.gif)
## Documentations et ressources ## Documentations et ressources
* Site officiel de l'app : <https://code.google.com/archive/p/shellinabox/> * Site officiel de lapp : <https://code.google.com/archive/p/shellinabox/>
* Documentation officielle utilisateur : <https://code.google.com/p/shellinabox/wiki/shellinaboxd_man> * Documentation officielle utilisateur : <https://code.google.com/p/shellinabox/wiki/shellinaboxd_man>
* Documentation officielle de l'admin : <https://github.com/shellinabox/shellinabox/wiki/shellinaboxd_man> * Documentation officielle de ladmin : <https://github.com/shellinabox/shellinabox/wiki/shellinaboxd_man>
* Dépôt de code officiel de l'app : <https://github.com/shellinabox/shellinabox> * Dépôt de code officiel de lapp : <https://github.com/shellinabox/shellinabox>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_shellinabox> * Documentation YunoHost pour cette app : <https://yunohost.org/app_shellinabox>
* Signaler un bug : <https://github.com/YunoHost-Apps/shellinabox_ynh/issues> * Signaler un bug : <https://github.com/YunoHost-Apps/shellinabox_ynh/issues>
@ -45,4 +46,4 @@ ou
sudo yunohost app upgrade shellinabox -u https://github.com/YunoHost-Apps/shellinabox_ynh/tree/testing --debug sudo yunohost app upgrade shellinabox -u https://github.com/YunoHost-Apps/shellinabox_ynh/tree/testing --debug
``` ```
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps> **Plus dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>

View file

@ -1,23 +0,0 @@
;; Test complet
; Manifest
domain="domain.tld"
path="/path"
; Checks
pkg_linter=1
setup_sub_dir=1
setup_root=1
setup_nourl=0
setup_private=0
setup_public=0
upgrade=1
# 1.1.0
upgrade=1 from_commit=a94b50de8b68501148fa90419ad3ea8e24c675e1
#2.21~ynh2
upgrade=1 from_commit=83014f57450daf58746e7fb79003f52ad8d2da1e
backup_restore=1
multi_instance=0
port_already_use=0
change_url=1
;;; Options
Email=
Notification=none

View file

@ -6,7 +6,7 @@ SHELLINABOX_PORT=__PORT__
# Parameters that are managed by the system and usually should not need # Parameters that are managed by the system and usually should not need
# changing: # changing:
# SHELLINABOX_DATADIR=/var/lib/shellinabox # SHELLINABOX_DATA_DIR=/var/lib/shellinabox
# SHELLINABOX_USER=shellinabox # SHELLINABOX_USER=shellinabox
# SHELLINABOX_GROUP=shellinabox # SHELLINABOX_GROUP=shellinabox

View file

View file

@ -1,44 +0,0 @@
{
"name": "Shell In A Box",
"id": "shellinabox",
"packaging_format": 1,
"description": {
"en": "Web based AJAX terminal emulator",
"fr": "Émulateur de terminal web"
},
"version": "2.21~ynh3",
"url": "https://github.com/shellinabox/shellinabox",
"upstream": {
"license": "GPL-2.0",
"website": "https://code.google.com/archive/p/shellinabox/",
"admindoc": "https://github.com/shellinabox/shellinabox/wiki/shellinaboxd_man",
"userdoc": "https://code.google.com/p/shellinabox/wiki/shellinaboxd_man",
"code": "https://github.com/shellinabox/shellinabox"
},
"license": "GPL-2.0",
"maintainer": {
"name": "",
"email": ""
},
"requirements": {
"yunohost": ">= 4.3.0"
},
"multi_instance": false,
"services": [
"nginx"
],
"arguments": {
"install": [
{
"name": "domain",
"type": "domain"
},
{
"name": "path",
"type": "path",
"example": "/ssh",
"default": "/ssh"
}
]
}
}

46
manifest.toml Normal file
View file

@ -0,0 +1,46 @@
packaging_format = 2
id = "shellinabox"
name = "Shell In A Box"
description.en = "Web based AJAX terminal emulator"
description.fr = "Émulateur de terminal web"
version = "2.21~ynh4"
maintainers = []
[upstream]
license = "GPL-2.0"
website = "https://code.google.com/archive/p/shellinabox/"
admindoc = "https://github.com/shellinabox/shellinabox/wiki/shellinaboxd_man"
userdoc = "https://code.google.com/p/shellinabox/wiki/shellinaboxd_man"
code = "https://github.com/shellinabox/shellinabox"
[integration]
yunohost = ">= 11.1.19"
architectures = "all"
multi_instance = false
ldap = false
sso = false
disk = "50M"
ram.build = "200M"
ram.runtime = "50M"
[install]
[install.domain]
type = "domain"
[install.path]
type = "path"
default = "/ssh"
[resources]
[resources.ports]
main.default = 4200
[resources.permissions]
main.url = "/"
[resources.apt]
packages = "shellinabox"

View file

@ -4,9 +4,6 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
# dependencies used by the app
pkg_dependencies="shellinabox"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================

View file

@ -10,25 +10,6 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
#================================================= #=================================================
# DECLARE DATA AND CONF FILES TO BACKUP # DECLARE DATA AND CONF FILES TO BACKUP
#================================================= #=================================================

View file

@ -9,61 +9,6 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
old_domain=$YNH_APP_OLD_DOMAIN
old_path=$YNH_APP_OLD_PATH
new_domain=$YNH_APP_NEW_DOMAIN
new_path=$YNH_APP_NEW_PATH
app=$YNH_APP_INSTANCE_NAME
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)
#=================================================
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# 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
#=================================================
change_domain=0
if [ "$old_domain" != "$new_domain" ]
then
change_domain=1
fi
change_path=0
if [ "$old_path" != "$new_path" ]
then
change_path=1
fi
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
#================================================= #=================================================
@ -78,29 +23,7 @@ ynh_systemd_action --service_name=$app --action="stop"
#================================================= #=================================================
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 ynh_change_url_nginx_config
# Change the path in the NGINX config file
if [ $change_path -eq 1 ]
then
# Make a backup of the original NGINX config file if modified
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
# Set global variables for NGINX helper
domain="$old_domain"
path_url="$new_path"
# Create a dedicated NGINX config
ynh_add_nginx_config
fi
# Change the domain for NGINX
if [ $change_domain -eq 1 ]
then
# Delete file checksum for the old conf file location
ynh_delete_file_checksum --file="$nginx_conf_path"
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
# Store file checksum for the new config file location
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
fi
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION
@ -111,13 +34,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2
ynh_systemd_action --service_name=$app --action="start" ynh_systemd_action --service_name=$app --action="start"
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -9,60 +9,6 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
app=$YNH_APP_INSTANCE_NAME
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
ynh_script_progression --message="Validating installation parameters..."
# Register (book) web path
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# FIND AND OPEN A PORT
#=================================================
ynh_script_progression --message="Finding an available port..." --weight=2
# Find an available port
port=$(ynh_find_port --port=4200)
ynh_app_setting_set --app=$app --key=port --value=$port
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=7
ynh_package_update
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -106,13 +52,6 @@ ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=shellinabox --action=restart ynh_systemd_action --service_name=shellinabox --action=restart
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=2
ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -9,16 +9,6 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --weight=2
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
#================================================= #=================================================
@ -32,19 +22,9 @@ then
yunohost service remove $app yunohost service remove $app
fi fi
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
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 ynh_remove_nginx_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..."
# Remove metapackage and its dependencies # Remove metapackage and its dependencies
ynh_package_autopurge shellinabox ynh_package_autopurge shellinabox

View file

@ -10,38 +10,6 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading settings..."
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
port=$(ynh_app_setting_get --app=$app --key=port)
#=================================================
# SPECIFIC RESTORATION
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies
ynh_package_update
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================

View file

@ -9,39 +9,12 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
port=$(ynh_app_setting_get --app=$app --key=port)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=5
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================
@ -51,24 +24,6 @@ ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" ynh_systemd_action --service_name=$app --action="stop"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=2
# If port doesn't exist, create it
if [ -z "$port" ]; then
port=4200
ynh_app_setting_set --app=$app --key=port --value=$port
fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=1
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -108,13 +63,6 @@ ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name=shellinabox --action=restart ynh_systemd_action --service_name=shellinabox --action=restart
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

7
tests.toml Normal file
View file

@ -0,0 +1,7 @@
test_format = 1.0
[default]
# -------------------------------
# Commits to test upgrade from
# -------------------------------