add option to diable SSL

This commit is contained in:
Derek Macias 2016-01-07 14:17:06 -07:00
parent 693b338dd1
commit bb7787a76c
5 changed files with 33 additions and 15 deletions

View File

@ -3,7 +3,7 @@
<!DOCTYPE PLUGIN [ <!DOCTYPE PLUGIN [
<!ENTITY name "shellinabox-plugin"> <!ENTITY name "shellinabox-plugin">
<!ENTITY author "dmacias72"> <!ENTITY author "dmacias72">
<!ENTITY version "2016.01.07b"> <!ENTITY version "2016.01.07c">
<!ENTITY launch "Settings/Shellinabox"> <!ENTITY launch "Settings/Shellinabox">
<!ENTITY gitURL "https://raw.githubusercontent.com/&author;/unRAID-plugins/master"> <!ENTITY gitURL "https://raw.githubusercontent.com/&author;/unRAID-plugins/master">
<!ENTITY pluginURL "&gitURL;/plugins/&name;.plg"> <!ENTITY pluginURL "&gitURL;/plugins/&name;.plg">
@ -20,6 +20,8 @@ This Plugin installs and controls shellinabox for unRaid 6.1 All dependencies a
--> -->
<CHANGES> <CHANGES>
###2016.01.07c
- add option to disable SSL
###2016.01.07b ###2016.01.07b
- remove install cert button for now - remove install cert button for now
###2016.01.07a ###2016.01.07a

View File

@ -13,6 +13,8 @@ Shell In A Box implements a web server that can export arbitrary command line to
<Icon>https://raw.githubusercontent.com/dmacias72/unRAID-plugins/master/plugins/shellinabox-plugin.png</Icon> <Icon>https://raw.githubusercontent.com/dmacias72/unRAID-plugins/master/plugins/shellinabox-plugin.png</Icon>
<Date>2016-01-07</Date> <Date>2016-01-07</Date>
<Changes> <Changes>
###2016.01.07c
- add option to disable SSL
###2016.01.07b ###2016.01.07b
- remove install cert button for now - remove install cert button for now
###2016.01.07a ###2016.01.07a

View File

@ -20,7 +20,7 @@ iframe {
</style> </style>
<div> <div>
<iframe id="shell" src="https://<?=$shellinabox_host?>:<?=$shellinabox_port;?>"> <iframe id="shell" src="http://<?=$shellinabox_host?>:<?=$shellinabox_port;?>">
</iframe> </iframe>
</div> </div>

View File

@ -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_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 = shell_exec( "/usr/sbin/shellinaboxd --version 2>&1 | grep ShellInABox | sed -e 's/^ShellInABox version //'" );
$shellinabox_version = ($shellinabox_running == "yes") ? $shellinabox_version = ($shellinabox_running == "yes") ?
"<a style='color:green;' target='_blank' href='https://".$shellinabox_host.":".$shellinabox_port."' title='Click on link then accept security, then /Tools/CommandLine will work'><b>$shellinabox_version</b></a>": "<a style='color:green;' target='_blank' href='http://".$shellinabox_host.":".$shellinabox_port."' title='Click on link then accept security, then /Tools/CommandLine will work'><b>$shellinabox_version</b></a>":
"<b><font style='color:orange;'>$shellinabox_version</font></b>"; "<b><font style='color:orange;'>$shellinabox_version</font></b>";
?> ?>
@ -34,6 +34,12 @@ Connect by IP Address:
<?=mk_option($shellinabox_ipaddr, "enable", "Yes");?> <?=mk_option($shellinabox_ipaddr, "enable", "Yes");?>
</select> </select>
Enable SSL connection:
: <select id="SSL" name="SSL" size="1" class="stopped">
<?=mk_option($shellinabox_ssl, "disable", "No");?>
<?=mk_option($shellinabox_ssl, "enable", "Yes");?>
</select>
Port: Port:
: <input style="width:135px" id="PORT" type="text" class="stopped" name="PORT" maxlength="40" value="<?=$shellinabox_port;?>" title="port must be 0-65535" placeholder="Default Port is 8000" > : <input style="width:135px" id="PORT" type="text" class="stopped" name="PORT" maxlength="40" value="<?=$shellinabox_port;?>" title="port must be 0-65535" placeholder="Default Port is 8000" >
@ -57,6 +63,7 @@ $(function(){
function resetDATA(form) { function resetDATA(form) {
form.IPADDR.value = "disable"; form.IPADDR.value = "disable";
form.SSL.value = "disable";
form.PORT.value = "4200"; form.PORT.value = "4200";
form.RUNAS.value = "nobody"; form.RUNAS.value = "nobody";
form.USERS.value = "nobody"; form.USERS.value = "nobody";
@ -110,6 +117,7 @@ function verifyDATA(form) {
} }
form.SERVICE.value = form.SERVICE.value.replace(/ /g,"_"); form.SERVICE.value = form.SERVICE.value.replace(/ /g,"_");
form.IPADDR.value = form.IPADDR.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.PORT.value = form.PORT.value.replace(/ /g,"_");
form.RUNAS.value = form.RUNAS.value.replace(/ /g,"_"); form.RUNAS.value = form.RUNAS.value.replace(/ /g,"_");
} }

View File

@ -12,16 +12,22 @@ USER_CSS="Color:+$STYLES/color.css,Monochrome:-$STYLES/monochrome.css;White:+$ST
# no-op if already running # no-op if already running
if [ ! -r $PIDFILE ]; then 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 & SSL_CONFIG=""
touch $LOCKFILE if [ $SSL == "disable" ]; then
TIMER=0 SSL_CONFIG="--disable-ssl"
while [ ! -e $PIDFILE ]; do fi
sleep 1 sleep 1
let TIMER=$TIMER+1 nohup /usr/sbin/$prog --user=$RUNAS --background=$PIDFILE --port=$PORT --cert=$CONFIG --user-css=$USER_CSS $SSL_CONFIG > /dev/null 2>&1 | logger -tshellinaboxd &
if [ $TIMER -gt 5 ]; then touch $LOCKFILE
echo -n "$PIDFILE not created" TIMER=0
break while [ ! -e $PIDFILE ]; do
fi sleep 1
done let TIMER=$TIMER+1
if [ $TIMER -gt 5 ]; then
echo -n "$PIDFILE not created"
break
fi
done
fi fi