Compare commits

..

No commits in common. "master" and "v2.18" have entirely different histories.

90 changed files with 151 additions and 539 deletions

1
.gitignore vendored Executable file → Normal file
View file

@ -9,7 +9,6 @@ aclocal.m4
autom4te.cache
certificate.pem
compile
config.cache
config.guess
config.h
config.h.in

0
AUTHORS Executable file → Normal file
View file

0
CHANGELOG.md Executable file → Normal file
View file

0
COPYING Executable file → Normal file
View file

0
GPL-2 Executable file → Normal file
View file

2
INSTALL.Debian Executable file → Normal file
View file

@ -41,7 +41,7 @@ you point your browser to the site.
At the very least, you need a file called "certificate.pem" that includes
both the private key and the public certificate in PEM (i.e. ASCII) format.
Additionally, you should create files for each of the publicly visible
Additionally, you should create files for each of the publically visible
hostnames that your machine has. These are named "certificate-${FQDN}.pem".
You probably also want "certificate-localhost.pem".

9
Makefile.am Executable file → Normal file
View file

@ -242,8 +242,7 @@ shellinaboxd.1: ${top_srcdir}/shellinabox/shellinaboxd.man.in \
clean-local: clean-demo
-rm -rf shellinaboxd.1 \
shellinaboxd.ps \
shellinaboxd.pdf
shellinaboxd.ps
-rm -rf debian/shellinabox \
debian/shellinabox*.debhelper* \
debian/shellinabox.substvars \
@ -365,9 +364,3 @@ clean-demo:
"(int)sizeof($${sym}Start);"; \
} >"$@"
shellinaboxd.ps: shellinaboxd.1
groff -man -T ps $^ >$@
shellinaboxd.pdf: shellinaboxd.ps
ps2pdf $^ $@

0
NEWS Executable file → Normal file
View file

0
README Executable file → Normal file
View file

0
README.Fedora Executable file → Normal file
View file

59
README.md Executable file → Normal file
View file

@ -6,16 +6,16 @@ shellinabox
[![Join the chat at https://gitter.im/shellinabox/shellinabox](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/shellinabox/shellinabox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
This is an unofficial fork of the project **Shell In A Box**. The fork was created because
the original project was not maintained anymore and we cannot contact the original
This is unofficial fork of project **Shell In A Box**. Fork was created because
original project is not maintained anymore and we cannot contact original
repository owners.
Our aim is to continue with maintenance of the shellinabox project. For a list of
recent changes, please see [CHANGELOG.md](/CHANGELOG.md).
Our aim is to continue with maintanince of shellinabox project. For list of
recent changes please see [CHANGELOG.md](/CHANGELOG.md).
If you have any questions, issues, or patches, please feel free to submit a pull
request or report an issue. You can also drop an email to the original project
[issue #261](https://code.google.com/p/shellinabox/issues/detail?id=261) discussion
If you have any questions, issues or patches, please fell free to submit pull
request or report an issue. You can also drop an email to original project
[issue #261](https://code.google.com/p/shellinabox/issues/detail?id=261) discusion
from where this fork started.
@ -27,7 +27,7 @@ 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.
![Shell In A Box preview](/misc/preview.gif?raw=true)
![Shell In A Box preview](/misc/preview.png?raw=true)
More information:
@ -42,17 +42,34 @@ Build
For building **shellinabox** from source on Debian or RHEL based systems use commands
listed below. This will create executable file `shellinaboxd` in project directory.
1. Clone the autotools
1. Install dependencies
```
wget https://raw.githubusercontent.com/simono41/shellinabox/master/auto.sh
apt-get install git libssl-dev libpam0g-dev zlib1g-dev dh-autoreconf
```
or
```
yum install git openssl-devel pam-devel zlib-devel autoconf automake libtool
```
3. Run autotools
2. Clone source files and move to project directory
```
chmod +x auto.sh
./auto.sh
git clone https://github.com/shellinabox/shellinabox.git && cd shellinabox
```
3. Run autotools in project directory
```
autoreconf -i
```
4. Run configure and make in project directory
```
./configure && make
```
#### Debian package
@ -86,19 +103,5 @@ created from our sources. In new issue report please include following things:
* Version of shellinabox
* Steps to reproduce the problem
Also feel free to post any questions or comments in [shellinabox chat room](https://gitter.im/shellinabox/shellinabox)
Also feel free to post any questions or comments in [shellianbox chat room](https://gitter.im/shellinabox/shellinabox)
on Gitter.
Known Issues
------------
* The openssl package is required for HTTP/SSL support.
Shell-in-a-box may be used without SSL such that the login session
is not encrypted. To enable automatic creation of self-signed
certificates or to use a generated certificate, install openssl.
* On Debian Jessie, the default openssl package does not include the
utilities necessary for Shell-in-a-box to generate self-signed
certificates. Upgrade openssl to install a version of the tools
that support certificate creation.

0
TODO Executable file → Normal file
View file

56
auto.sh
View file

@ -1,56 +0,0 @@
#!/bin/bash
set -ex
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
echo "Als root Angemeldet"
if [ -f /usr/bin/apt ]; then
apt update
apt install git libssl-dev libpam0g-dev zlib1g-dev dh-autoreconf
fi
if [ -f /usr/bin/pacman ]; then
pacman -Sy git openssl autoconf automake make gcc
fi
cd /opt/
git clone https://github.com/simono41/shellinabox.git
cd shellinabox
autoreconf -i
./configure && make
cp shellinabox.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable shellinabox.service
# adduser
echo adduser webssh
useradd webssh
mkdir /home/webssh
cp shellinabox_sshwrapper.sh /home/webssh/
chmod 770 -R /home/webssh/
chown -cR webssh:webssh /home/webssh/
passwd webssh <<EOT
webssh
webssh
EOT
systemctl start shellinabox.service &

35
configure.ac Executable file → Normal file
View file

@ -2,7 +2,7 @@ AC_PREREQ(2.57)
dnl This is one of the locations where the authoritative version
dnl number is stored. The other is in the debian/changelog.
AC_INIT(shellinabox, 2.20, markus@shellinabox.com)
AC_INIT(shellinabox, 2.18, markus@shellinabox.com)
if test -e .git; then
VCS_REVISION=" (revision `cd $srcdir && git log -1 --format=format:%h`)"
else
@ -32,7 +32,7 @@ AC_SUBST(AR_FLAGS, [cr])
dnl Check for header files that do not exist on all platforms
AC_CHECK_HEADERS([libutil.h pthread.h pty.h strings.h syslog.h sys/prctl.h \
sys/uio.h util.h])
sys/uio.h util.h utmp.h utmpx.h])
dnl Most systems require linking against libutil.so in order to get login_tty()
AC_CHECK_FUNCS(login_tty, [],
@ -75,6 +75,15 @@ AC_TRY_LINK([#include <math.h>],
[AC_DEFINE(HAVE_ISNAN, 1,
Define to 1 if you have support for isnan)])
dnl Even if utmpx.h exists, not all systems have support for updwtmpx()
AC_TRY_LINK([#include <utmp.h>],
[updwtmp(0, 0);],
[AC_DEFINE(HAVE_UPDWTMP, 1,
Define to 1 if you have support for updwtmp)])
AC_TRY_LINK([#include <utmpx.h>],
[updwtmpx(0, 0);],
[AC_DEFINE(HAVE_UPDWTMPX, 1,
Define to 1 if you have support for updwtmpx)])
dnl Check if the compiler supports aliasing of symbols
AC_TRY_LINK([void x(void) { };
@ -138,28 +147,6 @@ AC_ARG_ENABLE(runtime-loading,
these libraries into the binary, thus making them a
hard dependency, then disable runtime-loading.])
dnl This is feature is not suported in some standard C libs. So users can use
dnl this switch to avoid compile and runtime problems. Note that utmp must
dnl disabled on systems with musl libc.
AC_ARG_ENABLE(utmp,
[ --disable-utmp Disable support for login records. Note
that for systems with musl libc utmp must
be disabled.])
if test "x$enable_utmp" != xno; then
AC_CHECK_HEADERS([utmp.h utmpx.h])
dnl Even if utmpx.h exists, not all systems have support for updwtmpx()
AC_TRY_LINK([#include <utmp.h>],
[updwtmp(0, 0);],
[AC_DEFINE(HAVE_UPDWTMP, 1,
Define to 1 if you have support for updwtmp)])
AC_TRY_LINK([#include <utmpx.h>],
[updwtmpx(0, 0);],
[AC_DEFINE(HAVE_UPDWTMPX, 1,
Define to 1 if you have support for updwtmpx)])
fi
dnl Only test for OpenSSL headers, if not explicitly disabled
if test "x$enable_ssl" != xno; then
AC_CHECK_HEADERS([openssl/bio.h openssl/err.h openssl/ssl.h])

0
contrib/README-siab.rb Executable file → Normal file
View file

0
contrib/siab.rb Executable file → Normal file
View file

0
debian/README.available vendored Executable file → Normal file
View file

0
debian/README.enabled vendored Executable file → Normal file
View file

0
debian/README.source vendored Executable file → Normal file
View file

47
debian/changelog vendored Executable file → Normal file
View file

@ -1,50 +1,3 @@
shellinabox (2.20) unstable; urgency=medium
* Fixed issue #222, LOGIN service
* Fixed issue #360, ignore escape sequences to fix dir listing
* Fix for function key presses
* Adjusting scale on IE
* New option to disable peer check (#364)
* Add option for custom SSH port
* Support for APL characters
* PDF documentation
* Fix for BSD build
* New ready event support
* OpenSSL 1.1 fixes (Closes: #828542)
* May build with MUSL library
* Documentation added that SSL support is optional and requires
installation of openssl on Debian. (Closes: #839067)
* Jessie requires explicit installation of openssl because the default
package does not include the necessary utilities to support creation
of certificates. (Closes: #839066)
-- Marc Singer <elf@debian.org> Wed, 09 Nov 2016 09:52:24 -0800
shellinabox (2.19) unstable; urgency=high
* Added support for middle-click paste, #350.
* Improved iOS support, #354.
* New logic to enable soft keyboard icon, #119, #321, #354.
* Disable HTTP fallback using the URL /plain. Consequently disables
automatic upgrades from HTTP to HTTPS, #355. (CVE-2015-8400).
-- Marc Singer <elf@debian.org> Sat, 05 Dec 2015 10:24:12 -0800
shellinabox (2.18) unstable; urgency=low
* Fixed reverse vide rendering, #341.
* Using stdout for version information, #344.
* Added CGI session key in HTTP response.
* Child process cleanup, #103.
* Merged #340.
* Autoconf updates.
* Disabled utmp logging.
* Merge #338, killing children with HUP.
* Fixed handling of large HTTP requests.
* Enhanced logging clarity with prefix.
-- Marc Singer <elf@debian.org> Sat, 10 Oct 2015 10:53:38 -0700
shellinabox (2.17) unstable; urgency=medium
* Generally, SSL updates.

0
debian/compat vendored Executable file → Normal file
View file

6
debian/control vendored Executable file → Normal file
View file

@ -16,7 +16,5 @@ Suggests: openssl
Description: publish command line shell through AJAX interface
Shellinabox can export arbitrary command line programs to any JavaScript
enabled web browser. By default, it prompts for username and password
and then exports a login shell. Shellinabox provides a VT100
compatible terminal emulator that runs within any modern
browser. Support for HTTPS protocol (SSL/TLS encryption) is optional
and requires installation of openssl.
and then exports a SSL/TLS encrypted login shell. Shellinabox provides
a VT100 compatible terminal emulator that runs within any modern browser.

0
debian/copyright vendored Executable file → Normal file
View file

0
debian/docs vendored Executable file → Normal file
View file

0
debian/shellinabox.default vendored Executable file → Normal file
View file

0
debian/shellinabox.dirs vendored Executable file → Normal file
View file

0
debian/shellinabox.examples vendored Executable file → Normal file
View file

0
debian/shellinabox.lintian-overrides vendored Executable file → Normal file
View file

0
debian/shellinabox.preinst vendored Executable file → Normal file
View file

0
debian/shellinabox.prerm vendored Executable file → Normal file
View file

0
debian/source/format vendored Executable file → Normal file
View file

0
debian/source/include-binaries vendored Executable file → Normal file
View file

0
debian/source/options vendored Executable file → Normal file
View file

0
demo/demo.html Executable file → Normal file
View file

0
demo/demo.jspp Executable file → Normal file
View file

0
demo/demo.xml Executable file → Normal file
View file

0
demo/keyboard.html Executable file → Normal file
View file

0
etc-pam.d-shellinabox-example Executable file → Normal file
View file

0
libhttp/hashmap.c Executable file → Normal file
View file

0
libhttp/hashmap.h Executable file → Normal file
View file

2
libhttp/http.h Executable file → Normal file
View file

@ -102,7 +102,7 @@ short serverConnectionSetEvents(Server *server, ServerConnection *connection,
void serverExitLoop(Server *server, int exitAll);
void serverLoop(Server *server);
int serverSupportsSSL();
void serverSetupSSL(Server *server, int enable, int force);
void serverEnableSSL(Server *server, int flag);
void serverSetCertificate(Server *server, const char *filename,
int autoGenerateMissing);
void serverSetCertificateFd(Server *server, int fd);

9
libhttp/httpconnection.c Executable file → Normal file
View file

@ -430,7 +430,7 @@ void destroyHttpConnection(struct HttpConnection *http) {
http->peerName ? http->peerName : "???", http->peerPort);
}
httpShutdown(http, http->closed ? SHUT_WR : SHUT_RDWR);
dcheck(!close(http->fd) || errno != EBADF);
dcheck(!close(http->fd));
free(http->peerName);
free(http->url);
free(http->method);
@ -1480,13 +1480,6 @@ int httpHandleConnection(struct ServerConnection *connection, void *http_,
*events |= POLLIN;
continue;
}
} else {
if (http->ssl && http->ssl->enabled && http->ssl->force) {
debug("[http] Non-SSL connections not allowed!");
httpCloseRead(http);
bytes = 0;
eof = 1;
}
}
}

0
libhttp/httpconnection.h Executable file → Normal file
View file

0
libhttp/libhttp.sym Executable file → Normal file
View file

7
libhttp/server.c Executable file → Normal file
View file

@ -670,12 +670,11 @@ void serverLoop(struct Server *server) {
server->looping = loopDepth - 1;
}
void serverSetupSSL(struct Server *server, int enable, int force) {
if (enable) {
void serverEnableSSL(struct Server *server, int flag) {
if (flag) {
check(serverSupportsSSL());
}
sslEnable(&server->ssl, enable);
sslForce(&server->ssl, force);
sslEnable(&server->ssl, flag);
}
void serverSetCertificate(struct Server *server, const char *filename,

2
libhttp/server.h Executable file → Normal file
View file

@ -118,7 +118,7 @@ short serverConnectionSetEvents(struct Server *server,
short events);
void serverExitLoop(struct Server *server, int exitAll);
void serverLoop(struct Server *server);
void serverSetupSSL(struct Server *server, int enable, int force);
void serverEnableSSL(struct Server *server, int flag);
void serverSetCertificate(struct Server *server, const char *filename,
int autoGenerateMissing);
void serverSetCertificateFd(struct Server *server, int fd);

50
libhttp/ssl.c Executable file → Normal file
View file

@ -100,7 +100,6 @@ BIO_METHOD * (*BIO_f_buffer)(void);
void (*BIO_free_all)(BIO *);
BIO * (*BIO_new)(BIO_METHOD *);
BIO * (*BIO_new_socket)(int, int);
BIO * (*BIO_next)(BIO *);
BIO * (*BIO_pop)(BIO *);
BIO * (*BIO_push)(BIO *, BIO *);
#if defined(HAVE_OPENSSL_EC)
@ -168,7 +167,6 @@ struct SSLSupport *newSSL(void) {
void initSSL(struct SSLSupport *ssl) {
ssl->enabled = serverSupportsSSL();
ssl->force = 0;
ssl->sslContext = NULL;
ssl->sniCertificatePattern = NULL;
ssl->generateMissing = 0;
@ -281,7 +279,6 @@ static void loadSSL(void) {
{ { &BIO_free_all }, "BIO_free_all" },
{ { &BIO_new }, "BIO_new" },
{ { &BIO_new_socket }, "BIO_new_socket" },
{ { &BIO_next }, "BIO_next" },
{ { &BIO_pop }, "BIO_pop" },
{ { &BIO_push }, "BIO_push" },
{ { &ERR_clear_error }, "ERR_clear_error" },
@ -413,7 +410,7 @@ static void sslGenerateCertificate(const char *certificate,
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
warn("[ssl] Failed to generate self-signed certificate \"%s\"!", certificate);
} else {
info("[ssl] Certificate successfully generated.");
info("[ssl] Certificate succesfully generated.");
}
}
}
@ -677,7 +674,7 @@ static SSL_CTX *sslMakeContext(void) {
SSL_CTX_set_info_callback(context, sslInfoCallback);
debug("[ssl] Server context successfully initialized...");
debug("[ssl] Server context succesfully initialized...");
return context;
}
#endif
@ -897,12 +894,6 @@ int sslEnable(struct SSLSupport *ssl, int enabled) {
return old;
}
int sslForce(struct SSLSupport *ssl, int force) {
int old = ssl->force;
ssl->force = force;
return old;
}
void sslBlockSigPipe(void) {
sigset_t set;
sigemptyset(&set);
@ -1015,14 +1006,6 @@ int sslPromoteToSSL(struct SSLSupport *ssl, SSL **sslHndl, int fd,
#endif
}
BIO *sslGetNextBIO(BIO *b) {
#if OPENSSL_VERSION_NUMBER <= 0x10100000L
return b->next_bio;
#else
return BIO_next(b);
#endif
}
void sslFreeHndl(SSL **sslHndl) {
#if defined(HAVE_OPENSSL)
if (*sslHndl) {
@ -1030,23 +1013,24 @@ void sslFreeHndl(SSL **sslHndl) {
// BIOs. This is particularly a problem if an SSL connection has two
// different BIOs for the read and the write end, with one being a stacked
// derivative of the other. Unfortunately, this is exactly the scenario
// that we set up with call to "BIO_push(readBIO, writeBIO)" in function
// "sslPromoteToSSL()".
// that we set up.
// As a work-around, we un-stack the BIOs prior to freeing the SSL
// connection.
debug("[ssl] Freeing SSL handle.");
ERR_clear_error();
BIO *writeBIO, *readBIO;
check(writeBIO = SSL_get_wbio(*sslHndl));
check(readBIO = SSL_get_rbio(*sslHndl));
if (writeBIO != readBIO) {
if (sslGetNextBIO(readBIO) == writeBIO) {
// OK, that's exactly the bug we are looking for. We know that
// writeBIO needs to be removed from readBIO chain.
debug("[ssl] Removing stacked write BIO!");
if (readBIO->next_bio == writeBIO) {
// OK, that's exactly the bug we are looking for. We know how to
// fix it.
check(BIO_pop(readBIO) == writeBIO);
check(!sslGetNextBIO(readBIO));
} else if (sslGetNextBIO(readBIO) == sslGetNextBIO(writeBIO)) {
check(readBIO->references == 1);
check(writeBIO->references == 1);
check(!readBIO->next_bio);
check(!writeBIO->prev_bio);
} else if (readBIO->next_bio == writeBIO->next_bio &&
writeBIO->next_bio->prev_bio == writeBIO) {
// Things get even more confused, if the SSL handshake is aborted
// prematurely.
// OpenSSL appears to internally stack a BIO onto the read end that
@ -1055,13 +1039,15 @@ void sslFreeHndl(SSL **sslHndl) {
// reading and one for writing). In this case, not only is the
// reference count wrong, but the chain of next_bio/prev_bio pairs
// is corrupted, too.
warn("[ssl] Removing stacked socket BIO!");
BIO *sockBIO;
check(sockBIO = BIO_pop(readBIO));
check(sockBIO == BIO_pop(writeBIO));
check(!sslGetNextBIO(readBIO));
check(!sslGetNextBIO(writeBIO));
check(!sslGetNextBIO(sockBIO));
check(readBIO->references == 1);
check(writeBIO->references == 1);
check(sockBIO->references == 1);
check(!readBIO->next_bio);
check(!writeBIO->next_bio);
check(!sockBIO->prev_bio);
BIO_free_all(sockBIO);
} else {
// We do not know, how to fix this situation. Something must have

4
libhttp/ssl.h Executable file → Normal file
View file

@ -82,7 +82,6 @@ extern BIO_METHOD *(*x_BIO_f_buffer)(void);
extern void (*x_BIO_free_all)(BIO *);
extern BIO *(*x_BIO_new)(BIO_METHOD *);
extern BIO *(*x_BIO_new_socket)(int, int);
extern BIO *(*x_BIO_next)(BIO *);
extern BIO *(*x_BIO_pop)(BIO *);
extern BIO *(*x_BIO_push)(BIO *, BIO *);
#if defined(HAVE_OPENSSL_EC)
@ -132,7 +131,6 @@ extern void *(*x_SSL_COMP_get_compression_methods)(void);
#define BIO_free_all x_BIO_free_all
#define BIO_new x_BIO_new
#define BIO_new_socket x_BIO_new_socket
#define BIO_next x_BIO_next
#define BIO_pop x_BIO_pop
#define BIO_push x_BIO_push
#define EC_KEY_free x_EC_KEY_free
@ -200,7 +198,6 @@ extern void *(*x_SSL_COMP_get_compression_methods)(void);
struct SSLSupport {
int enabled;
int force;
SSL_CTX *sslContext;
char *sniCertificatePattern;
int generateMissing;
@ -217,7 +214,6 @@ void sslSetCertificate(struct SSLSupport *ssl, const char *filename,
int autoGenerateMissing);
void sslSetCertificateFd(struct SSLSupport *ssl, int fd);
int sslEnable(struct SSLSupport *ssl, int enabled);
int sslForce(struct SSLSupport *ssl, int force);
void sslBlockSigPipe();
int sslUnblockSigPipe();
int sslPromoteToSSL(struct SSLSupport *ssl, SSL **sslHndl, int fd,

0
libhttp/trie.c Executable file → Normal file
View file

0
libhttp/trie.h Executable file → Normal file
View file

0
libhttp/url.c Executable file → Normal file
View file

0
libhttp/url.h Executable file → Normal file
View file

12
logging/logging.c Executable file → Normal file
View file

@ -100,11 +100,7 @@ void error(const char *fmt, ...) {
va_start(ap, fmt);
debugMsg(MSG_ERROR, fmt, ap);
#ifdef HAVE_SYSLOG_H
va_list apSyslog;
va_copy(apSyslog, ap);
va_start(apSyslog, fmt);
vsyslog(LOG_ERR, fmt, apSyslog);
va_end(apSyslog);
vsyslog(LOG_ERR, fmt, ap);
#endif
va_end(ap);
}
@ -121,11 +117,7 @@ void fatal(const char *fmt, ...) {
va_start(ap, fmt);
debugMsg(MSG_QUIET, fmt, ap);
#ifdef HAVE_SYSLOG_H
va_list apSyslog;
va_copy(apSyslog, ap);
va_start(apSyslog, fmt);
vsyslog(LOG_CRIT, fmt, apSyslog);
va_end(apSyslog);
vsyslog(LOG_CRIT, fmt, ap);
syslog(LOG_CRIT, "[server] Aborting...");
#endif
va_end(ap);

0
logging/logging.h Executable file → Normal file
View file

0
m4/.gitignore vendored Executable file → Normal file
View file

23
misc/embedded.html Executable file → Normal file
View file

@ -14,7 +14,7 @@
For communication with Shell In A Box we need to set '-m' (messages-origin)
command line option with appropriate messages origin. Origin should be set to
URL of parent (this) window. If origin is set to '*' Shell In A Box won't check
URL of parent (this) window. If origin is set to '*' Shell In A Box won't checki
origin on received messages. This is usually unsafe option.
Command line example:
@ -25,7 +25,7 @@
# Client Side
#
Shell In A Box accepts messages formatted as JSON strings with 'type' and 'data'
Shell In A Box accepts messages formated as JSON strings with 'type' and 'data'
fields. Messages with same format can be passed back to parent (this) window.
Message example:
@ -59,9 +59,6 @@
Following types of messages can be received from shellinabox:
* ready
signals that shellinabox is ready to send and receive messages
* output
data field contains terminal output
@ -143,6 +140,10 @@
var output = document.getElementById("output");
var session = document.getElementById("session");
// Add url to our iframe. We do this, only that variable 'url' can be used
// throughout the whole code where needed.
iframe.src = url;
document.getElementById("execute").addEventListener("click", function() {
// Send input to shellinabox
var message = JSON.stringify({
@ -208,15 +209,6 @@
// Handle response according to response type
var decoded = JSON.parse(message.data);
switch (decoded.type) {
case "ready":
// Shellinabox is ready to communicate and we will enable console output
// by default.
var message = JSON.stringify({
type : 'output',
data : 'enable'
});
iframe.contentWindow.postMessage(message, url);
break;
case "output" :
// Append new output
output.innerHTML = output.innerHTML + decoded.data;
@ -228,9 +220,6 @@
}
}, false);
// Add url to our iframe after the event listener is installed.
iframe.src = url;
</script>
</body>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 930 KiB

0
misc/preview.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

22
sgit
View file

@ -1,22 +0,0 @@
#!/bin/bash
set -ex
if [[ "--help" == "${1}" ]]; then
echo "bash ./sgit user.email commit"
fi
if [[ -z "${2}" ]]; then
echo "Bitte email und commit angeben!!!"
exit 1
fi
git config --global user.email "${1}"
git config --global user.name "${1}"
git status
git pull
git add --all
git commit --all -m "${2}"
git show
git push
git status

View file

@ -1,9 +0,0 @@
[Unit]
Description=shellinabox
[Service]
Type=oneshot
ExecStart=/opt/shellinabox/shellinaboxd -t --service=/:webssh:webssh:HOME:'/home/webssh/shellinabox_sshwrapper.sh'
[Install]
WantedBy=multi-user.target

0
shellinabox/beep.wav Executable file → Normal file
View file

16
shellinabox/black-on-white.css Executable file → Normal file
View file

@ -1,16 +0,0 @@
#vt100 .ansiDefR {
color: #ffffff;
}
#vt100 .bgAnsiDefR {
background-color: #000000;
}
#vt100 #scrollable.inverted .ansiDefR {
color: #000000;
}
#vt100 #scrollable.inverted .bgAnsiDefR {
background-color: #ffffff;
}

0
shellinabox/cgi_root.html Executable file → Normal file
View file

2
shellinabox/color.css Executable file → Normal file
View file

@ -2,7 +2,6 @@
/* SYSTEM colors */
#vt100 .ansiDef { }
#vt100 .ansiDefR { }
#vt100 .ansi0 { color: #000000; }
#vt100 .ansi1 { color: #cd0000; }
@ -265,7 +264,6 @@
/* SYSTEM colors */
#vt100 .bgAnsiDef { }
#vt100 .bgAnsiDefR { }
#vt100 .bgAnsi0 { background-color: #000000; }
#vt100 .bgAnsi1 { background-color: #cd0000; }

0
shellinabox/enabled.gif Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 847 B

After

Width:  |  Height:  |  Size: 847 B

0
shellinabox/externalfile.c Executable file → Normal file
View file

0
shellinabox/externalfile.h Executable file → Normal file
View file

0
shellinabox/favicon.ico Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
shellinabox/keyboard-layout.html Executable file → Normal file
View file

0
shellinabox/keyboard.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

1
shellinabox/launcher.c Executable file → Normal file
View file

@ -63,7 +63,6 @@
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/ttydefaults.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/utsname.h>

0
shellinabox/launcher.h Executable file → Normal file
View file

0
shellinabox/monochrome.css Executable file → Normal file
View file

0
shellinabox/print-styles.css Executable file → Normal file
View file

0
shellinabox/privileges.c Executable file → Normal file
View file

0
shellinabox/privileges.h Executable file → Normal file
View file

0
shellinabox/root_page.html Executable file → Normal file
View file

41
shellinabox/service.c Executable file → Normal file
View file

@ -121,29 +121,18 @@ void initService(struct Service *service, const char *arg) {
service->group = NULL;
check(service->cwd = strdup("/"));
char *host;
char *sshPort;
check(host = strdup("localhost"));
check(sshPort = strdup("22"));
if ((ptr = strchr(arg, ':')) != NULL) {
ptr = ptr + 1;
check(ptr = strdup(ptr + 1));
char *end;
if ((end = strchr(ptr, ':')) != NULL) {
*end = '\000';
}
if (*ptr) {
char *tmp = strchr(ptr, ':');
if (tmp == NULL) {
// If the second ":" is not found, keep as host whatever is after first ":".
free(host);
check(host = strdup(ptr));
} else {
// If we find a second ":", keep as a host whatever is in between first ":"
// and second ":" and as sshPort whatever is after second ":".
int size = (tmp - ptr + 1);
free(host);
free(sshPort);
check(host = malloc(size));
memset(host, 0, size);
memcpy(host, ptr, size - 1);
check(sshPort = strdup(tmp + 1));
}
free(host);
host = ptr;
} else {
free(ptr);
}
}
@ -159,15 +148,6 @@ void initService(struct Service *service, const char *arg) {
}
}
// Don't allow manipulation of the SSH command line through "creative" use
// of the port.
for (char *h = sshPort; *h; h++) {
char ch = *h;
if (!(ch >= '0' && ch <= '9')) {
fatal("[config] Invalid port \"%s\" in service definition!", sshPort);
}
}
service->cmdline = stringPrintf(NULL,
"ssh -a -e none -i /dev/null -x -oChallengeResponseAuthentication=no "
"-oCheckHostIP=no -oClearAllForwardings=yes -oCompression=no "
@ -182,9 +162,8 @@ void initService(struct Service *service, const char *arg) {
// feature, we cannot be sure that it is available on the
// target server. Removing it for the sake of Centos.
// "-oVisualHostKey=no"
" -oLogLevel=FATAL -p%s %%s@%s",sshPort, host);
" -oLogLevel=FATAL %%s@%s", host);
free(host);
free(sshPort);
} else {
service->useLogin = 0;

0
shellinabox/service.h Executable file → Normal file
View file

2
shellinabox/session.c Executable file → Normal file
View file

@ -116,11 +116,9 @@ void initSession(struct Session *session, const char *sessionKey,
session->http = NULL;
session->done = 0;
session->pty = -1;
session->ptyFirstRead = 1;
session->width = 0;
session->height = 0;
session->buffered = NULL;
session->useLogin = 0;
session->len = 0;
session->pid = 0;
session->cleanup = 0;

2
shellinabox/session.h Executable file → Normal file
View file

@ -58,11 +58,9 @@ struct Session {
HttpConnection *http;
int done;
int pty;
int ptyFirstRead;
int width;
int height;
char *buffered;
int useLogin;
int len;
pid_t pid;
int cleanup;

3
shellinabox/shell_in_a_box.jspp Executable file → Normal file
View file

@ -406,9 +406,6 @@ ShellInABox.prototype.messageInit = function() {
}
}
// After message mechanisms are in place "ready" message is sent to parent
// window.
parent.postMessage(JSON.stringify({type : 'ready', data : ''}), '*');
};
ShellInABox.prototype.messageReceive = function (message) {

61
shellinabox/shellinaboxd.c Executable file → Normal file
View file

@ -63,7 +63,7 @@
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <time.h>
#include <unistd.h>
#ifdef HAVE_SYS_PRCTL_H
@ -110,10 +110,8 @@ static int portMax;
static int localhostOnly = 0;
static int noBeep = 0;
static int numericHosts = 0;
static int peerCheckEnabled = 1;
static int enableSSL = 1;
static int enableSSLMenu = 1;
static int forceSSL = 1; // TODO enable http fallback with commandline option
int enableUtmpLogging = 1;
static char *messagesOrigin = NULL;
static int linkifyURLs = 1;
@ -292,13 +290,6 @@ static void sessionDone(void *arg) {
completePendingRequest(session, "", 0, INT_MAX);
}
static void delaySession(void) {
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 200 * 1000; // Delay for 0.2 ms
nanosleep(&ts, NULL);
}
static int handleSession(struct ServerConnection *connection, void *arg,
short *events, short revents) {
struct Session *session = (struct Session *)arg;
@ -318,7 +309,7 @@ static int handleSession(struct ServerConnection *connection, void *arg,
int timedOut = serverGetTimeout(connection) < 0;
if (bytes || timedOut) {
if (!session->http && timedOut) {
debug("[server] Timeout. Closing session %s!", session->sessionKey);
debug("[server] Timeout. Closing session!");
session->cleanup = 1;
return 0;
}
@ -332,26 +323,8 @@ static int handleSession(struct ServerConnection *connection, void *arg,
*events = 0;
}
serverSetTimeout(connection, AJAX_TIMEOUT);
session->ptyFirstRead = 0;
return 1;
} else {
if (revents & POLLHUP) {
if (session->useLogin && session->ptyFirstRead) {
// Workaround for random "Session closed" issues related to /bin/login
// closing and reopening our pty during initialization. This happens only
// on some systems like Fedora for example.
// Here we allow that our pty is closed by ignoring POLLHUP on first read.
// Delay is also needed so that login process has some time to reopen pty.
// Note that the issue may occur anyway but with workaround we reduce the
// chances.
debug("[server] POLLHUP received on login PTY first read!");
session->ptyFirstRead = 0;
delaySession();
return 1;
}
debug("[server] POLLHUP received on PTY! Closing session %s!",
session->sessionKey);
}
return 0;
}
}
@ -394,7 +367,7 @@ static int dataHandler(HttpConnection *http, struct Service *service,
}
// Sanity check
if (!sessionIsNew && peerCheckEnabled && strcmp(session->peerName, httpGetPeerName(http))) {
if (!sessionIsNew && strcmp(session->peerName, httpGetPeerName(http))) {
error("[server] Peername changed from %s to %s",
session->peerName, httpGetPeerName(http));
httpSendReply(http, 400, "Bad Request", NO_MSG);
@ -428,7 +401,6 @@ static int dataHandler(HttpConnection *http, struct Service *service,
goto bad_new_session;
}
session->http = http;
session->useLogin = service->useLogin;
if (launchChild(service->id, session,
rootURL && *rootURL ? rootURL : urlGetURL(url)) < 0) {
abandonSession(session);
@ -796,7 +768,7 @@ static void usage(void) {
const char *user = getUserName(r_uid);
const char *group = getGroupName(r_gid);
printf("Usage: shellinaboxd [OPTIONS]...\n"
message("Usage: shellinaboxd [OPTIONS]...\n"
"Starts an HTTP server that serves terminal emulators to AJAX "
"enabled browsers.\n"
"\n"
@ -809,7 +781,7 @@ static void usage(void) {
" -f, --static-file=URL:FILE serve static file from URL path\n"
" -g, --group=GID switch to this group (default: %s)\n"
" -h, --help print this message\n"
" --linkify=[none|normal|aggressive] default is \"normal\"\n"
" --linkify=[none|normal|agressive] default is \"normal\"\n"
" --localhost-only only listen on 127.0.0.1\n"
" --no-beep suppress all audio output\n"
" -n, --numeric do not resolve hostnames\n"
@ -825,7 +797,6 @@ static void usage(void) {
" --user-css=STYLES defines user-selectable CSS options\n"
" -v, --verbose enable logging messages\n"
" --version prints version information\n"
" --disable-peer-check disable peer check on a session\n"
"\n"
"Debug, quiet, and verbose are mutually exclusive.\n"
"\n"
@ -864,8 +835,7 @@ static void usage(void) {
"\n"
"OPTIONs that make up a GROUP are mutually exclusive. But "
"individual GROUPs are\n"
"independent of each other.\n"
"\n",
"independent of each other.\n",
!serverSupportsSSL() ? "" :
" -c, --cert=CERTDIR set certificate dir "
"(default: $PWD)\n"
@ -897,7 +867,6 @@ static void parseArgs(int argc, char * const argv[]) {
int hasSSL = serverSupportsSSL();
if (!hasSSL) {
enableSSL = 0;
forceSSL = 0;
}
int demonize = 0;
int cgi = 0;
@ -936,7 +905,6 @@ static void parseArgs(int argc, char * const argv[]) {
{ "user-css", 1, 0, 0 },
{ "verbose", 0, 0, 'v' },
{ "version", 0, 0, 0 },
{ "disable-peer-check", 0, 0, 0 },
{ 0, 0, 0, 0 } };
int idx = -1;
int c = getopt_long(argc, argv, optstring, options, &idx);
@ -1156,7 +1124,6 @@ static void parseArgs(int argc, char * const argv[]) {
warn("[config] Ignoring disable-ssl option, as SSL support is unavailable.");
}
enableSSL = 0;
forceSSL = 0;
} else if (!idx--) {
// Disable SSL Menu
if (!hasSSL) {
@ -1244,22 +1211,18 @@ static void parseArgs(int argc, char * const argv[]) {
logSetLogLevel(verbosity);
} else if (!idx--) {
// Version
printf("ShellInABox version " VERSION VCS_REVISION "\n");
message("ShellInABox version " VERSION VCS_REVISION);
exit(0);
} else if (!idx--) {
// disable-peer-check
peerCheckEnabled = 0;
}
}
if (optind != argc) {
usage();
fatal("[config] Failed to parse command line!");
}
char *buf = NULL;
check(argc >= 1);
info("[server] Version " VERSION VCS_REVISION);
for (int i = 0; i < argc; i++) {
buf = stringPrintf(buf, "%s ", argv[i]);
buf = stringPrintf(buf, " %s", argv[i]);
}
info("[server] Command line: %s", buf);
free(buf);
@ -1337,8 +1300,7 @@ static void removeLimits() {
}
static void setUpSSL(Server *server) {
serverSetupSSL(server, enableSSL, forceSSL);
serverEnableSSL(server, enableSSL);
// Enable SSL support (if available)
if (enableSSL) {
@ -1410,9 +1372,8 @@ int main(int argc, char * const argv[]) {
check(port = serverGetListeningPort(server));
printf("X-ShellInABox-Port: %d\r\n"
"X-ShellInABox-Pid: %d\r\n"
"X-ShellInABox-Session: %s\r\n"
"Content-type: text/html; charset=utf-8\r\n\r\n",
port, getpid(), cgiSessionKey);
port, getpid());
UNUSED(cgiRootSize);
printfUnchecked(cgiRootStart, port, cgiSessionKey);
fflush(stdout);

2
shellinabox/shellinaboxd.man.in Executable file → Normal file
View file

@ -282,7 +282,7 @@ Display a brief usage message showing the valid command line parameters.
.TP
\fB--linkify\fP=[\fBnone\fP|\fBnormal\fP|\fBaggressive\fP]
the daemon attempts to recognize URLs in the terminal output and makes them
clickable. This is not necessarily a fool-proof process and both false
clickable. This is not neccessarily a fool-proof process and both false
negatives and false positives are possible. By default, only URLs starting
with a well known protocol of
.BR http:// ,\ https:// ,\ ftp:// ,\ or\ mailto:

View file

@ -243,12 +243,9 @@
[else DEFINES_COLORS]
/* SYSTEM colors */
#vt100 .ansiDef { color: #000000; }
#vt100 .ansiDefR { color: #ffffff; }
#vt100 #scrollable.inverted .ansiDef
{ color: #ffffff; }
#vt100 #scrollable.inverted .ansiDefR
{ color: #000000; }
#vt100 .ansi0 { color: #000000; }
#vt100 .ansi1 { color: #cd0000; }
@ -511,13 +508,9 @@
/* SYSTEM colors */
#vt100 .bgAnsiDef { background-color: #ffffff; }
#vt100 .bgAnsiDefR
{ background-color: #000000; }
#vt100 #scrollable.inverted .bgAnsiDef
{ background-color: #000000; }
#vt100 #scrollable.inverted .bgAnsiDefR
{ background-color: #ffffff; }
#vt100 .bgAnsi0 { background-color: #000000; }
#vt100 .bgAnsi1 { background-color: #cd0000; }

0
shellinabox/usercss.c Executable file → Normal file
View file

0
shellinabox/usercss.h Executable file → Normal file
View file

View file

@ -83,7 +83,6 @@
#define EStitle 17
#define ESss2 18
#define ESss3 19
#define ESVTEtitle 20
#define ATTR_DEFAULT 0x60F0
#define ATTR_REVERSE 0x0100
@ -298,12 +297,6 @@ VT100.prototype.getUserSettings = function() {
this.disableAlt = true;
}
// Enable soft keyboard icon on some clients by default.
if (navigator.userAgent.match(/iPad|iPhone|iPod/i) != null ||
navigator.userAgent.match(/PlayStation Vita|Kindle/i) != null) {
this.softKeyboard = true;
}
if (this.visualBell) {
this.signature = Math.floor(16807*this.signature + 1) %
((1 << 31) - 1);
@ -1205,8 +1198,8 @@ VT100.prototype.resizer = function() {
document.documentElement.clientHeight ||
document.body.clientHeight))-1;
// Prevent ever growing console on some iOS clients.
if (navigator.userAgent.match(/iPad|iPhone|iPod/i) != null) {
// Prevent ever growing consoles on iPad.
if (navigator.userAgent.match(/iPad/i) != null) {
height -= 1;
}
@ -1436,25 +1429,6 @@ VT100.prototype.mouseEvent = function(event, type) {
return this.cancelEvent(event);
}
// Simulate middle click pasting from inside of current window. Note that
// pasting content from other programs will not work in this way, since we
// don't have access to native clipboard.
if ((event.which || event.button) == 2 && selection.length) {
if (type == MOUSE_UP) {
// Use timeout to prevent double paste on Chrome/Linux.
setTimeout(function (vt100) {
return function() {
vt100.keysPressed(selection);
vt100.input.focus();
}
}(this), 10);
}
if (type == MOUSE_DOWN) {
// Prevent middle click scroll on Windows systems.
return this.cancelEvent(event);
}
}
if (this.mouseReporting) {
try {
event.shiftKey = false;
@ -1604,10 +1578,7 @@ VT100.prototype.updateWidth = function() {
this.terminalWidth = Math.floor(this.console[this.currentScreen].offsetWidth/this.cursorWidth*this.scale);
}
} else {
if ("ActiveXObject" in window)
this.terminalWidth = Math.floor(this.console[this.currentScreen].offsetWidth/this.cursorWidth*this.scale*0.95);
else
this.terminalWidth = Math.floor(this.console[this.currentScreen].offsetWidth/this.cursorWidth*this.scale);
this.terminalWidth = Math.floor(this.console[this.currentScreen].offsetWidth/this.cursorWidth*this.scale);
}
return this.terminalWidth;
@ -2844,7 +2815,7 @@ VT100.prototype.handleKey = function(event) {
ch = part1 +
((event.shiftKey ? 1 : 0) +
(event.altKey|event.metaKey ? 2 : 0) +
(event.ctrlKey ? 4 : 0) + 1) +
(event.ctrlKey ? 4 : 0)) +
part2;
} else if (ch.length == 1 && (event.altKey || event.metaKey)
&& !this.disableAlt) {
@ -2914,9 +2885,9 @@ VT100.prototype.fixEvent = function(event) {
// Some browsers fail to translate keys, if both shift and alt/meta is
// pressed at the same time. We try to translate those cases, but that
// only works for US keyboard layouts.
var u = undefined;
var s = undefined;
if (event.shiftKey) {
var u = undefined;
var s = undefined;
switch (this.lastNormalKeyDownEvent.keyCode) {
case 39: /* ' -> " */ u = 39; s = 34; break;
case 44: /* , -> < */ u = 44; s = 60; break;
@ -2957,23 +2928,17 @@ VT100.prototype.fixEvent = function(event) {
case 222: /* ' -> " */ u = 39; s = 34; break;
default: break;
}
} else {
var c = this.lastNormalKeyDownEvent.keyCode;
if (c >= 65 && c <= 90) {
u = c;
s = u | 32;
if (s && (event.charCode == u || event.charCode == 0)) {
var fake = [ ];
fake.charCode = s;
fake.keyCode = event.keyCode;
fake.ctrlKey = event.ctrlKey;
fake.shiftKey = event.shiftKey;
fake.altKey = event.altKey;
fake.metaKey = event.metaKey;
return fake;
}
}
if (s && (event.charCode == u || event.charCode == 0)) {
var fake = [ ];
fake.charCode = s;
fake.keyCode = event.keyCode;
fake.ctrlKey = event.ctrlKey;
fake.shiftKey = event.shiftKey;
fake.altKey = event.altKey;
fake.metaKey = event.metaKey;
return fake;
}
return event;
};
@ -3058,8 +3023,10 @@ VT100.prototype.keyDown = function(event) {
} else {
fake.charCode = 0;
fake.keyCode = event.keyCode;
if (!alphNumKey && event.shiftKey) {
fake = this.fixEvent(fake);
}
}
fake = this.fixEvent(fake);
this.handleKey(fake);
this.lastNormalKeyDownEvent = undefined;
@ -3174,9 +3141,9 @@ VT100.prototype.keyUp = function(event) {
} else {
fake.charCode = 0;
fake.keyCode = event.keyCode;
}
if (event.ctrlKey || event.altKey || event.metaKey) {
fake = this.fixEvent(fake);
if (!alphNumKey && (event.ctrlKey || event.altKey || event.metaKey)) {
fake = this.fixEvent(fake);
}
}
this.lastNormalKeyDownEvent = undefined;
this.handleKey(fake);
@ -3384,50 +3351,44 @@ VT100.prototype.respondSecondaryDA = function() {
VT100.prototype.updateStyle = function() {
var fg = '';
var bg = '';
this.style = '';
this.style = '';
if (this.attr & ATTR_UNDERLINE) {
this.style += 'text-decoration: underline;';
this.style = 'text-decoration: underline;';
}
var bg = (this.attr >> 4) & 0xF;
var fg = this.attr & 0xF;
if (this.attr & ATTR_REVERSE) {
var tmp = bg;
bg = fg;
fg = tmp;
}
if ((this.attr & (ATTR_REVERSE | ATTR_DIM)) == ATTR_DIM) {
fg = 8; // Dark grey
} else if (this.attr & ATTR_BRIGHT) {
fg |= 8;
this.style = 'font-weight: bold;';
}
if (this.attr & ATTR_BLINK) {
this.style += 'text-decoration: blink;';
this.style = 'text-decoration: blink;';
}
// Forground color
// Default colors
if (this.attr & ATTR_DEF_FG) {
fg = 'Def';
}
if (this.attr & ATTR_DEF_BG) {
bg = 'Def';
}
// Extended color mode support (256 colors).
if (this.attrFg) {
// 256 color mode
fg = this.attrFg
} else if (this.attr & ATTR_DEF_FG) {
fg = 'Def';
} else {
fg = this.attr & 0xF;
if (this.attr & ATTR_BRIGHT) {
fg |= 8;
this.style += 'font-weight: bold;';
}
fg = this.attrFg;
}
// Background color
if (this.attrBg) {
// 256 color mode
bg = this.attrBg
} else if (this.attr & ATTR_DEF_BG) {
bg = 'Def';
} else {
bg = (this.attr >> 4) & 0xF;
bg = this.attrBg;
}
// Reverse colors
if (this.attr & ATTR_REVERSE) {
var tmpFg = fg;
var tmpBg = bg;
fg = (tmpBg == 'Def') ? 'DefR' : tmpBg;
bg = (tmpFg == 'Def') ? 'DefR' : tmpFg;
}
this.color = 'ansi' + fg + ' bgAnsi' + bg;
this.color = 'ansi' + fg + ' bgAnsi' + bg;
};
VT100.prototype.setAttrColors = function(attr) {
@ -3908,7 +3869,7 @@ VT100.prototype.csim = function() {
case 27: this.attr &= ~ ATTR_REVERSE; break;
case 38:
if (this.npar >= (i+2) && this.par[i+1] == 5) {
// Foreground color for extended color mode (256 colors). Escape code is formatted
// Foreground color for extended color mode (256 colors). Escape code is formated
// as: ESC 38; 5; 0-255. Last parameter is color code in range [0-255]. This is
// not VT100 standard.
this.attrFg = (this.par[i+2] >= 0 && this.par[i+2] <= 255) ? this.par[i+2] : false;
@ -3924,7 +3885,7 @@ VT100.prototype.csim = function() {
break;
case 48:
if (this.npar >= (i+2) && this.par[i+1] == 5) {
// Background color for extended color mode (256 colors). Escape code is formatted
// Background color for extended color mode (256 colors). Escape code is formated
// as: ESC 48; 5; 0-255. Last parameter is color code in range [0-255]. This is
// not VT100 standard.
this.attrBg = (this.par[i+2] >= 0 && this.par[i+2] <= 255) ? this.par[i+2] : false;
@ -4054,8 +4015,6 @@ VT100.prototype.doControl = function(ch) {
/*0*/ case 0x30:
/*1*/ case 0x31:
/*2*/ case 0x32: this.isEsc = EStitle; this.titleString = ''; break;
/*6*/ case 0x36: this.isEsc = ESVTEtitle; break;
/*7*/ case 0x37: this.isEsc = ESVTEtitle; break;
/*P*/ case 0x50: this.npar = 0; this.par = [ 0, 0, 0, 0, 0, 0, 0 ];
this.isEsc = ESpalette; break;
/*R*/ case 0x52: // Palette support is not implemented
@ -4283,13 +4242,6 @@ VT100.prototype.doControl = function(ch) {
this.lastCharacter = String.fromCharCode(ch);
lineBuf += this.lastCharacter;
this.isEsc = ESnormal; break;
case ESVTEtitle:
// Ignores VTE escape sequences for current directory (OSC6) and current
// file (OSC7).
if (ch == 0x07 || ch == 0x5C) {
this.isEsc = ESnormal;
}
break;
default:
this.isEsc = ESnormal; break;
}

View file

@ -24,30 +24,14 @@
color: #ffffff;
}
#vt100 .ansiDefR {
color: #000000;
}
#vt100 .bgAnsiDef {
background-color: #000000;
}
#vt100 .bgAnsiDefR {
background-color: #ffffff;
}
#vt100 #scrollable.inverted .ansiDef {
color: #000000;
}
#vt100 #scrollable.inverted .ansiDefR {
color: #ffffff;
}
#vt100 #scrollable.inverted .bgAnsiDef {
background-color: #ffffff;
}
#vt100 #scrollable.inverted .bgAnsiDefR {
background-color: #000000;
}

View file

@ -1,32 +0,0 @@
#!/bin/bash
#
set -ex
# 
read -p "SSH remote host (hostname or ip address) [localhost] : " host;
[[ -z "${host}" ]] && host=localhost;
#
read -p "If a puplic_key authentification?: [y/N] : " puplic;
#
read -p "SSH remote port [22] : " port;
[[ -z "${port}" ]] && port=22;
#
read -p "SSH remote username [pi] : " username;
[[ -z "${username}" ]] && username=pi;
#
if [ "$puplic" == "y" ];
then
read -p "How is your public_key?: " key;
echo $key > ~/.ssh/id_rsa.pub;
rm ~/.ssh/id_rsa;
echo "Enter your private id here and press the enter key for a new line !!!";
id=null
while [ "$id" != "" ];
do
read -p "How is your id_rsa key?: " id;
echo $id >> ~/.ssh/id_rsa;
done
exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p $port $username@$host;
else
exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p $port $username@$host;
fi