mirror of
https://github.com/YunoHost-Apps/shellinabox_ynh.git
synced 2024-09-03 20:26:12 +02:00
Init
This commit is contained in:
commit
5ac6e408b6
7 changed files with 109 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
*.swp
|
3
README.md
Normal file
3
README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# Shell In A Box for YunoHost
|
||||||
|
|
||||||
|
https://code.google.com/p/shellinabox/
|
10
conf/nginx.conf
Normal file
10
conf/nginx.conf
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
location PATHTOCHANGE {
|
||||||
|
if ($scheme = http) {
|
||||||
|
rewrite ^ https://$server_name$request_uri? permanent;
|
||||||
|
}
|
||||||
|
proxy_pass http://127.0.0.1:4200/;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_buffering off;
|
||||||
|
tcp_nodelay on;
|
||||||
|
access_log off;
|
||||||
|
}
|
19
conf/shellinabox
Normal file
19
conf/shellinabox
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
hould shellinaboxd start automatically
|
||||||
|
SHELLINABOX_DAEMON_START=1
|
||||||
|
|
||||||
|
# TCP port that shellinboxd's webserver listens on
|
||||||
|
SHELLINABOX_PORT=4200
|
||||||
|
|
||||||
|
# Parameters that are managed by the system and usually should not need
|
||||||
|
# changing:
|
||||||
|
# SHELLINABOX_DATADIR=/var/lib/shellinabox
|
||||||
|
# SHELLINABOX_USER=shellinabox
|
||||||
|
# SHELLINABOX_GROUP=shellinabox
|
||||||
|
|
||||||
|
# Any optional arguments (e.g. extra service definitions). Make sure
|
||||||
|
# that that argument is quoted.
|
||||||
|
#
|
||||||
|
# Beeps are disabled because of reports of the VLC plugin crashing
|
||||||
|
# Firefox on Linux/x86_64.
|
||||||
|
SHELLINABOX_ARGS="--no-beep --localhost-only"
|
||||||
|
|
34
scripts/install
Normal file
34
scripts/install
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Retrieve arguments
|
||||||
|
domain=$1
|
||||||
|
path=$2
|
||||||
|
|
||||||
|
# Check domain/path availability
|
||||||
|
sudo yunohost app checkurl $domain$path -a shellinabox
|
||||||
|
|
||||||
|
# Check port availability
|
||||||
|
sudo yunohost app checkport 4200
|
||||||
|
|
||||||
|
# Remove trailing "/" for next commands
|
||||||
|
if [[ ! "$path" == "/" ]]; then
|
||||||
|
path=${path%/}
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install shellinabox -y -qq
|
||||||
|
|
||||||
|
sudo yunohost service add shellinabox
|
||||||
|
|
||||||
|
# Copy shellinabox default configuration and restart
|
||||||
|
sudo cp ../conf/shellinabox /etc/default/shellinabox
|
||||||
|
sudo service shellinabox restart
|
||||||
|
|
||||||
|
# Configure Nginx and reload
|
||||||
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
||||||
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/shellinabox.conf
|
||||||
|
sudo service nginx reload
|
||||||
|
|
||||||
|
sudo yunohost app ssowatconf
|
18
scripts/remove
Normal file
18
scripts/remove
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Retrieve arguments
|
||||||
|
domain=$(sudo yunohost app setting shellinabox domain)
|
||||||
|
path=$(sudo yunohost app setting shellinabox path)
|
||||||
|
|
||||||
|
# Stop and remove shellinabox
|
||||||
|
sudo service shellinabox stop || echo "ShellInABox already stopped"
|
||||||
|
sudo apt-get remove --purge shellinabox || echo "ShellInABox already uninstalled"
|
||||||
|
|
||||||
|
# Remove Nginx proxy configuration
|
||||||
|
sudo rm -f sudo rm /etc/nginx/conf.d/$domain.d/shellinabox.conf
|
||||||
|
|
||||||
|
sudo service nginx reload
|
||||||
|
|
||||||
|
sudo yunohost app ssowatconf
|
24
scripts/upgrade
Normal file
24
scripts/upgrade
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Retrieve arguments
|
||||||
|
domain=$(sudo yunohost app setting shellinabox domain)
|
||||||
|
path=$(sudo yunohost app setting shellinabox path)
|
||||||
|
|
||||||
|
# Remove trailing "/" for next commands
|
||||||
|
if [[ ! "$path" == "/" ]]; then
|
||||||
|
path=${path%/}
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install shellinabox -y -qq
|
||||||
|
|
||||||
|
# Copy shellinabox default configuration and restart
|
||||||
|
sudo cp ../conf/shellinabox /etc/default/shellinabox
|
||||||
|
sudo service shellinabox restart
|
||||||
|
|
||||||
|
# Configure Nginx and reload
|
||||||
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
||||||
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/shellinabox.conf
|
||||||
|
sudo service nginx reload
|
Loading…
Reference in a new issue