initial commit of file from CVS for smeserver-shellinabox on Sat Sep 7 16:41:40 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 16:41:40 +10:00
parent 097d60d1a9
commit 9fcd6b9cda
51 changed files with 1068 additions and 2 deletions

View File

@@ -0,0 +1 @@
reserved

View File

@@ -0,0 +1 @@
shell

View File

@@ -0,0 +1 @@
local

View File

@@ -0,0 +1 @@
1870

View File

@@ -0,0 +1 @@
disabled

View File

@@ -0,0 +1 @@
enabled

View File

@@ -0,0 +1 @@
service

View File

@@ -0,0 +1,9 @@
##bash
#!/bin/bash
# No longer required as this is done by e-smith services
#expand-template /etc/sysconfig/shellinaboxd >/dev/null 2>&1
#expand-template /etc/httpd/conf/httpd.conf >/dev/null 2>&1
#service httpd-e-smith sigusr1 >/dev/null 2>&1
#service shellinaboxd restart >/dev/null 2>&1

View File

@@ -0,0 +1,6 @@
<lexicon lang="bg">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="da">
<entry>
<base>ShellInaBox</base>
<trans>SSH via en web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="de">
<entry>
<base>ShellInaBox</base>
<trans>SSH über einen Web-Browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="el">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,7 @@
<lexicon lang="en-us">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="es">
<entry>
<base>ShellInaBox</base>
<trans>SSH a través de un navegador web</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="et">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="fr">
<entry>
<base>ShellInaBox</base>
<trans>SSH dans le navigateur</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="he">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="hu">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="id">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="it">
<entry>
<base>ShellInaBox</base>
<trans>SSH via browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="ja">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="nb">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="nl">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="pl">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="pt-br">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="pt">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="ro">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="ru">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="sl">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="sv">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="th">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="tr">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="zh-cn">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,6 @@
<lexicon lang="zh-tw">
<entry>
<base>ShellInaBox</base>
<trans>SSH via a web browser</trans>
</entry>
</lexicon>

View File

@@ -0,0 +1,57 @@
{
my $status = $shellinaboxd{'status'} || "disabled";
return " # shellinabox is disabled in this VirtualHost"
unless $status eq 'enabled';
{
$OUT .= "###########################################################\n";
$OUT .= "######## shellinabox reverse proxy ##########\n";
$OUT .= "###########################################################\n";
{
if ( $port ne "443" ) {
$OUT .= "# Redirect shellinabox Address to Secure Address\n";
$OUT .= " RewriteEngine On\n";
$OUT .= " RewriteCond %{HTTPS} off\n";
$OUT .= " RewriteRule \/$shellinaboxd{'Name'} https:\/\/%{HTTP_HOST}:443\/$shellinaboxd{'Name'}\n";
$OUT .= "## End Of Redirect\n";
}
$OUT .= "##########\n";
$OUT .= " AddExternalAuth pwauth /usr/bin/pwauth\n";
$OUT .= " SetExternalAuthMethod pwauth pipe\n";
$OUT .= "#########\n";
$OUT .= "\n";
$OUT .= "#########\n";
$OUT .= "\<Location \/$shellinaboxd{'Name'}\>\n";
$OUT .= " ProxyPass http://localhost:$shellinaboxd{'TcpPort'}/" . "\n";
$OUT .= " Require all denied\n";
$OUT .= " SSLRequireSSL\n";
if ( $shellinaboxd{'PublicAccess'} eq 'local' ) {
$OUT .= " Require ip $localAccess\n";
}
elsif ( $shellinaboxd{'PublicAccess'} eq 'global' ) {
$OUT .= " Require all granted\n";
}
elsif ( $shellinaboxd{'PublicAccess'} eq 'IP' ) {
my $fixedip = $shellinaboxd{'FixedIP'} || "";
$OUT .= " Require ip $fixedip\n";
}
elsif ( ( $shellinaboxd{'PublicAccess'} ne 'global' ) && ( $shellinaboxd{'PublicAccess'} ne 'local' ) ) {
$OUT .= " Require all denied\n";
}
$OUT .= " AuthName \"$shellinaboxd{'Name'}\"\n";
$OUT .= " AuthBasicProvider external\n";
$OUT .= " AuthType Basic\n";
$OUT .= " AuthExternal pwauth\n";
if ( ( $shellinaboxd{'PublicAccess'} ne 'local' ) || ( $shellinaboxd{'WebAuth'} eq 'enabled' ) ) {
my @users = split( ",", ( $shellinaboxd{ShellUsers} || "" ) );
$OUT .= " Require valid-user admin @users\n";
}
$OUT .= "\<\/Location\>\n";
$OUT .= "#########\n";
}
}
}

View File

@@ -0,0 +1,28 @@
# Shell in a box daemon configuration
# For details see shellinaboxd man page
# Basic options
USER=shellinabox
GROUP=shellinabox
CERTDIR=/var/lib/shellinabox
{
return "PORT=${'shellinaboxd'}{'TcpPort'}";
}
#OPTS="--disable-ssl-menu -s /:LOGIN"
#for root login
{
my $port = ${'sshd'}{'TCPPort'};
$OUT .= "OPTS=\"--no-beep --localhost-only --disable-ssl --service=\/:SSH\:localhost\:$port\" ";
}
# Additional examples with custom options:
# Fancy configuration with right-click menu choice for black-on-white:
# OPTS="--user-css Normal:+black-on-white.css,Reverse:-white-on-black.css --disable-ssl-menu -s /:LOGIN"
# Simple configuration for running it as an SSH console with SSL disabled:
# OPTS="-t -s /:SSH:host.example.com"

View File

@@ -0,0 +1,2 @@
[Install]
WantedBy=sme-server.target

View File

@@ -0,0 +1,33 @@
#!/usr/bin/perl
#----------------------------------------------------------------------
# heading : Administration
# description : ShellInaBox
# navigation : 4000 4200
#----------------------------------------------------------------------
use strict;
use CGI':all';
use CGI::Carp qw(fatalsToBrowser);
use esmith::ConfigDB;
BEGIN
{
$ENV {'PATH'} = '/bin:/usr/bin:/sbin';
$ENV {'SHELL'} = '/bin/bash';
delete $ENV {'ENV'};
}
my $DB = esmith::ConfigDB->open() ||
die esmith::ConfigDB->error;
my $url_Name = $DB->get_prop( 'shellinaboxd', 'Name' ) || '';
my $q = new CGI;
my $content="0; url=https://".$ENV {'HTTP_X_FORWARDED_HOST'}."/"."$url_Name";
$q->default_dtd('-//W3C//DTD XHTML 1.0 Transitional//EN');
print $q->header ('text/html');
print $q->start_html (-head=>meta({-http_equiv=>'refresh', -content=>$content}));
print $q->end_html;