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

Normalization from example_ynh

This commit is contained in:
Maniack Crudelis 2019-03-04 16:23:36 +01:00
parent 919792c493
commit 91d30d5e87
9 changed files with 93 additions and 41 deletions

View file

@ -1,13 +1,59 @@
# Shell In A Box for YunoHost
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. Most typically, login shells would be exported this way:
[![Integration level](https://dash.yunohost.org/integration/shellinabox.svg)](https://dash.yunohost.org/appci/app/shellinabox)
[![Install Shell In A Box with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=shellinabox)
https://github.com/shellinabox/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.*
### Install
## Overview
`$ sudo yunohost app install https://github.com/YunoHost-Apps/shellinabox_ynh.git`
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.
### Update
**Shipped version:** Current Debian version.
`$ sudo yunohost app upgrade --verbose shellinabox -u https://github.com/YunoHost-Apps/shellinabox_ynh.git`
## Screenshots
![](https://raw.githubusercontent.com/shellinabox/shellinabox/master/misc/preview.gif)
## Configuration
## Documentation
* Official documentation: https://code.google.com/archive/p/shellinabox/wikis/shellinaboxd_man.wiki
* YunoHost documentation: If specific documentation is needed, feel free to contribute.
## YunoHost specific features
#### Multi-users support
#### Supported architectures
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/shellinabox%20%28Official%29.svg)](https://ci-apps.yunohost.org/ci/apps/shellinabox/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/shellinabox%20%28Official%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%28Official%29.svg)](https://ci-stretch.nohost.me/ci/apps/shellinabox/)
## Limitations
## Additional information
## Links
* Report a bug: https://github.com/YunoHost-Apps/shellinabox_ynh/issues
* Shell In A Box website: https://github.com/shellinabox/shellinabox
* YunoHost website: https://yunohost.org/
---
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.
```
sudo yunohost app install https://github.com/YunoHost-Apps/shellinabox_ynh/tree/testing --debug
or
sudo yunohost app upgrade shellinabox -u https://github.com/YunoHost-Apps/shellinabox_ynh/tree/testing --debug
```

View file

@ -1,5 +1,4 @@
;; Test complet
auto_remove=1
; Manifest
domain="domain.tld" (DOMAIN)
path="/path" (PATH)

View file

@ -1,4 +1,7 @@
location __PATH__ {
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
@ -9,11 +12,12 @@ location __PATH__ {
proxy_buffering off;
tcp_nodelay on;
access_log off;
# Allow shellinabox to use 'eval' without blocking the execution. But keep a warning.
add_header Content-Security-Policy-Report-Only "script-src https: 'unsafe-eval'";
more_clear_input_headers 'Accept-Encoding';
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
more_clear_input_headers 'Accept-Encoding';
}

View file

@ -6,7 +6,7 @@
"en": "Web based AJAX terminal emulator",
"fr": "Émulateur de terminal web"
},
"version": "1.1.0",
"version": "1.1.0~ynh1",
"url": "https://github.com/shellinabox/shellinabox",
"license": "GPL-2.0",
"maintainer": {
@ -18,8 +18,7 @@
},
"multi_instance": false,
"services": [
"nginx",
"shellinabox"
"nginx"
],
"arguments": {
"install": [

View file

@ -2,19 +2,19 @@
#=================================================
# GENERIC START
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit on command errors and treat access to unset variables as an error
set -eu
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================

View file

@ -31,8 +31,6 @@ app=$YNH_APP_INSTANCE_NAME
# Normalize the url path syntax
path_url=$(ynh_normalize_url_path $path_url)
# Check web path availability
ynh_webpath_available $domain $path_url
# Register (book) web path
ynh_webpath_register $app $domain $path_url

View file

@ -23,9 +23,10 @@ port=$(ynh_app_setting_get $app port)
# REMOVE SERVICE FROM ADMIN PANEL
#=================================================
if yunohost service status | grep -q $app
# Remove a service from the admin panel, added by `yunohost service add`
if yunohost service status $app >/dev/null 2>&1
then
echo "Remove $app service"
ynh_print_info "Removing $app service"
yunohost service remove $app
fi

View file

@ -2,19 +2,19 @@
#=================================================
# GENERIC START
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit on command errors and treat access to unset variables as an error
set -eu
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================

View file

@ -23,7 +23,7 @@ port=$(ynh_app_setting_get $app port)
#=================================================
# If port doesn't exist, create it
if [ -z $port ]; then
if [ -z "$port" ]; then
port=4200
ynh_app_setting_set $app port $port
fi
@ -32,11 +32,14 @@ fi
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_backup_before_upgrade # Backup the current version of the app
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_restore_upgradebackup # restore it if the upgrade fails
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
ynh_abort_if_errors # Exit if an error occurs during the execution of the script
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CHECK THE PATH
@ -54,11 +57,6 @@ path_url=$(ynh_normalize_url_path $path_url)
# Create a dedicated nginx config
ynh_add_nginx_config
#=================================================
# RELOAD NGINX
#=================================================
systemctl reload nginx
#=================================================
# CONFIGURE SHELLINABOX
#=================================================
@ -81,3 +79,10 @@ systemctl restart shellinabox
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum "/etc/default/shellinabox"
#=================================================
# RELOAD NGINX
#=================================================
systemctl reload nginx