From bb7787a76c85bbddb51baf554a698b1570c8fba5 Mon Sep 17 00:00:00 2001 From: Derek Macias Date: Thu, 7 Jan 2016 14:17:06 -0700 Subject: [PATCH] add option to diable SSL --- plugins/shellinabox-plugin.plg | 4 ++- plugins/shellinabox-plugin.xml | 2 ++ .../shellinabox-plugin/CommandLine.page | 2 +- .../shellinabox-plugin/Shellinabox.page | 10 ++++++- .../plugins/shellinabox-plugin/scripts/start | 30 +++++++++++-------- 5 files changed, 33 insertions(+), 15 deletions(-) diff --git a/plugins/shellinabox-plugin.plg b/plugins/shellinabox-plugin.plg index c4b3c7a8..7bb6044a 100755 --- a/plugins/shellinabox-plugin.plg +++ b/plugins/shellinabox-plugin.plg @@ -3,7 +3,7 @@ - + @@ -20,6 +20,8 @@ This Plugin installs and controls shellinabox for unRaid 6.1 All dependencies a --> +###2016.01.07c +- add option to disable SSL ###2016.01.07b - remove install cert button for now ###2016.01.07a diff --git a/plugins/shellinabox-plugin.xml b/plugins/shellinabox-plugin.xml index 7b91e3ad..ec8bc736 100644 --- a/plugins/shellinabox-plugin.xml +++ b/plugins/shellinabox-plugin.xml @@ -13,6 +13,8 @@ Shell In A Box implements a web server that can export arbitrary command line to https://raw.githubusercontent.com/dmacias72/unRAID-plugins/master/plugins/shellinabox-plugin.png 2016-01-07 +###2016.01.07c +- add option to disable SSL ###2016.01.07b - remove install cert button for now ###2016.01.07a diff --git a/source/shellinabox-plugin/usr/local/emhttp/plugins/shellinabox-plugin/CommandLine.page b/source/shellinabox-plugin/usr/local/emhttp/plugins/shellinabox-plugin/CommandLine.page index 24b719b3..8de79a02 100644 --- a/source/shellinabox-plugin/usr/local/emhttp/plugins/shellinabox-plugin/CommandLine.page +++ b/source/shellinabox-plugin/usr/local/emhttp/plugins/shellinabox-plugin/CommandLine.page @@ -20,7 +20,7 @@ iframe {
-
diff --git a/source/shellinabox-plugin/usr/local/emhttp/plugins/shellinabox-plugin/Shellinabox.page b/source/shellinabox-plugin/usr/local/emhttp/plugins/shellinabox-plugin/Shellinabox.page index 862d474c..c4e37dfc 100644 --- a/source/shellinabox-plugin/usr/local/emhttp/plugins/shellinabox-plugin/Shellinabox.page +++ b/source/shellinabox-plugin/usr/local/emhttp/plugins/shellinabox-plugin/Shellinabox.page @@ -14,7 +14,7 @@ $shellinabox_cert = isset($shellinabox_cfg['CERT']) ? $shellinabox_cfg['CERT' $shellinabox_running = trim(shell_exec( "[ -f /proc/`cat /var/run/shellinaboxd.pid 2> /dev/null`/exe ] && echo 'yes' || echo 'no' 2> /dev/null" )); $shellinabox_version = shell_exec( "/usr/sbin/shellinaboxd --version 2>&1 | grep ShellInABox | sed -e 's/^ShellInABox version //'" ); $shellinabox_version = ($shellinabox_running == "yes") ? - "$shellinabox_version": + "$shellinabox_version": "$shellinabox_version"; ?> @@ -34,6 +34,12 @@ Connect by IP Address: +Enable SSL connection: +: + Port: : @@ -57,6 +63,7 @@ $(function(){ function resetDATA(form) { form.IPADDR.value = "disable"; + form.SSL.value = "disable"; form.PORT.value = "4200"; form.RUNAS.value = "nobody"; form.USERS.value = "nobody"; @@ -110,6 +117,7 @@ function verifyDATA(form) { } form.SERVICE.value = form.SERVICE.value.replace(/ /g,"_"); form.IPADDR.value = form.IPADDR.value.replace(/ /g,"_"); + form.SSL.value = form.SSL.value.replace(/ /g,"_"); form.PORT.value = form.PORT.value.replace(/ /g,"_"); form.RUNAS.value = form.RUNAS.value.replace(/ /g,"_"); } diff --git a/source/shellinabox-plugin/usr/local/emhttp/plugins/shellinabox-plugin/scripts/start b/source/shellinabox-plugin/usr/local/emhttp/plugins/shellinabox-plugin/scripts/start index 597275ec..ef2ecbed 100755 --- a/source/shellinabox-plugin/usr/local/emhttp/plugins/shellinabox-plugin/scripts/start +++ b/source/shellinabox-plugin/usr/local/emhttp/plugins/shellinabox-plugin/scripts/start @@ -12,16 +12,22 @@ USER_CSS="Color:+$STYLES/color.css,Monochrome:-$STYLES/monochrome.css;White:+$ST # no-op if already running if [ ! -r $PIDFILE ]; then -sleep 1 -nohup /usr/sbin/$prog --user=$RUNAS --background=$PIDFILE --port=$PORT --cert=$CONFIG --user-css=$USER_CSS > /dev/null 2>&1 | logger -tshellinaboxd & -touch $LOCKFILE -TIMER=0 -while [ ! -e $PIDFILE ]; do + + SSL_CONFIG="" + if [ $SSL == "disable" ]; then + SSL_CONFIG="--disable-ssl" + fi + sleep 1 - let TIMER=$TIMER+1 - if [ $TIMER -gt 5 ]; then - echo -n "$PIDFILE not created" - break - fi -done -fi \ No newline at end of file + nohup /usr/sbin/$prog --user=$RUNAS --background=$PIDFILE --port=$PORT --cert=$CONFIG --user-css=$USER_CSS $SSL_CONFIG > /dev/null 2>&1 | logger -tshellinaboxd & + touch $LOCKFILE + TIMER=0 + while [ ! -e $PIDFILE ]; do + sleep 1 + let TIMER=$TIMER+1 + if [ $TIMER -gt 5 ]; then + echo -n "$PIDFILE not created" + break + fi + done +fi