aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2017-04-06 09:44:09 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2017-04-06 09:44:14 +0000
commitc6de00c5d5ea3f3112a76cf787a1d64a188414d5 (patch)
tree9703b90edf5b0b12c00a660cc46257895e7e34fa /testing
parenteff85e8c6163511b40826467e5d7890ac4e99ff8 (diff)
downloadaports-c6de00c5d5ea3f3112a76cf787a1d64a188414d5.tar.bz2
aports-c6de00c5d5ea3f3112a76cf787a1d64a188414d5.tar.xz
testing/shellinabox: new aport
Diffstat (limited to 'testing')
-rw-r--r--testing/shellinabox/APKBUILD53
-rw-r--r--testing/shellinabox/shellinabox.confd78
-rw-r--r--testing/shellinabox/shellinabox.initd33
-rw-r--r--testing/shellinabox/shellinabox.pre-install4
4 files changed, 168 insertions, 0 deletions
diff --git a/testing/shellinabox/APKBUILD b/testing/shellinabox/APKBUILD
new file mode 100644
index 0000000000..0f7516f52f
--- /dev/null
+++ b/testing/shellinabox/APKBUILD
@@ -0,0 +1,53 @@
+# Contributor: Francesco Colista <fcolista@alpinelinux.org>
+# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
+pkgname=shellinabox
+_daemonname=${pkgname}d
+pkgver=2.20
+pkgrel=0
+pkgdesc="Implementation of a web server that can export arbitrary command line tools to a web based terminal emulator"
+url="https://github.com/shellinabox/shellinabox"
+arch="all"
+license="GPL2"
+makedepends="autoconf automake m4 libtool libressl-dev zlib-dev"
+subpackages="$pkgname-doc"
+pkgusers="$_daemonname"
+pkggroups="$_daemonname"
+install="$pkgname.pre-install"
+source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/v$pkgver.tar.gz
+ $pkgname.initd
+ $pkgname.confd"
+builddir="$srcdir/$pkgname-$pkgver"
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+prepare() {
+ cd "$builddir"
+ autoreconf -i
+ default_prepare
+}
+
+build() {
+ cd "$builddir"
+ export CPPFLAGS="${CPPFLAGS/-D_FORTIFY_SOURCE=2/}"
+ ./configure \
+ --prefix=/usr \
+ --disable-static \
+ --disable-utmp
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir/" install
+ install -D -m 755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$_daemonname"
+ install -D -m 644 "$srcdir/$pkgname.confd" "$pkgdir/etc/conf.d/$_daemonname"
+ mkdir -p "$pkgdir"/var/run/$_daemonname
+ chown $pkgusers:$pkggroups "$pkgdir"/var/run/$_daemonname
+}
+
+sha512sums="369fb6e0041fc3eb52a533f14d1f856a71ec1bf166441e25a5d61bb129f2db5de6b61205ddd0cb08d53384baaf4e087bd2c549f7919b96ee465d4cc3318d2237 shellinabox-2.20.tar.gz
+47206ce991f642e474387c5c00ee4fd8cae0c71da6075e3c62381bb75b46085c35767e817932da64a112b58535516fc620d089434e478c844b4cd7c62bdae654 shellinabox.initd
+2e0ef340d88cd62cac4c7c073bdcb79e2e88c77aab7e310daa4ae8b27c297b6138262762dae1f054928f02b38d4a8185dd9b357fd3f59a635c04697fd620cfef shellinabox.confd"
diff --git a/testing/shellinabox/shellinabox.confd b/testing/shellinabox/shellinabox.confd
new file mode 100644
index 0000000000..e3b7be8748
--- /dev/null
+++ b/testing/shellinabox/shellinabox.confd
@@ -0,0 +1,78 @@
+# conf.d file for shellinaboxd
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Options available (copied from the man page):
+#
+# Sometimes, it is not necessary to replace the entire style sheet using the
+# --static-file option. But instead a small incremental change should be made to
+# the visual appearance of the terminal. The --css option provides a means to
+# append additional style rules to the end of the default styles.css sheet. More
+# than one --css option can be given on the same command line.
+#
+# You shouldn't need to change this value
+# unless you want to load your own style sheets.
+SIAB_CSS_DIR="/usr/share/shellinabox-resources"
+
+# If built with SSL/TLS support enabled, the daemon will look in SIAB_CERT_DIR for any
+# certificates. If unspecified, this defaults to the current working directory.
+#
+# If the browser negotiated a Server Name Identification the daemon will look for
+# a matching certificate-SERVERNAME.pem file. This allows for virtual hosting
+# of multiple server names on the same IP address and port.
+#
+# If no SNI handshake took place, it falls back on using the certificate in the
+# certificate.pem file.
+#
+# The administrator should make sure that there are matching certificates for
+# each of the virtual hosts on this server, and that there is a generic certifiā€
+# cate.pem file.
+#
+# If no suitable certificate is installed, shellinaboxd will attempt to invoke
+# /usr/bin/openssl and create a new self-signed certificate. This only
+# succeeds if, after dropping privileges, shellinaboxd has write
+# permissions for SIAB_CERT_DIR.
+#
+# Most browsers show a warning message when encountering a self-signed
+# certificate and then allow the user the option of accepting the certificate.
+# Due to this usability problem, and due to the perceived security
+# implications, the use of auto-generated self-signed certificates is intended
+# for testing or in intranet deployments, only.
+#
+SIAB_CERT_DIR="/etc/shellinabox/cert"
+
+# By default, shellinaboxd redirectes all incoming HTTP requests to their
+# equivalent HTTPS URLs. If promoting of connections to encrypted SSL/TLS
+# sessions is undesired, this behavior can be disabled.
+#
+# This option is also useful during testing or for deployment in trusted
+# intranets, if SSL certificates are unavailable.
+#
+# SIAB_DISABLE_SSL and SIAB_CERT_DIR are mutually exclusive options.
+#
+# Add this option to SIAB_OPTS if you don't want SSL support.
+SIAB_DISABLE_SSL="--disable-ssl"
+
+# Default port to listen on.
+SIAB_HTTP_PORT="4200"
+
+# Run shellinabox as this user.
+SIAB_USER="shellinaboxd"
+
+# Run shellinabox as this group.
+SIAB_GROUP="shellinaboxd"
+
+# Default service to launch
+SIAB_SERVICE="/:LOGIN"
+
+# Beeps are disabled because of reports of the VLC plugin crashing
+# Firefox on Linux/x86_64.
+SIAB_OPTS="--no-beep"
+
+# Do not add both SIAB_CSS_DIR or SIAB_CERT_DIR to SIAB_OPTS.
+
+# Default setup turns off SSL.
+SIAB_OPTS="${SIAB_OPTS} ${SIAB_DISABLE_SSL} --port=${SIAB_HTTP_PORT} --user=${SIAB_USER} --group=${SIAB_GROUP} --service=${SIAB_SERVICE}"
+
+# Uncomment this line to activate SSL.
+# SIAB_OPTS="--cert=${SIAB_CERT_DIR} --port=${SIAB_HTTP_PORT} --user=${SIAB_USER} --group=${SIAB_GROUP} --service=${SIAB_SERVICE}"
diff --git a/testing/shellinabox/shellinabox.initd b/testing/shellinabox/shellinabox.initd
new file mode 100644
index 0000000000..8ef176fa96
--- /dev/null
+++ b/testing/shellinabox/shellinabox.initd
@@ -0,0 +1,33 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Removed start_pre since full of bashism
+
+my_daemon="shellinaboxd"
+pidfile="/var/run/${my_daemon}/${my_daemon}.pid"
+command="/usr/bin/${my_daemon}"
+command_args="${SIAB_OPTS}"
+
+depend() {
+ use net
+}
+
+start() {
+ ebegin "Starting ${my_daemon}"
+ start-stop-daemon \
+ --start \
+ --background \
+ --pidfile ${pidfile} \
+ --make-pidfile \
+ --exec ${command} \
+ -- ${command_args}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${my_daemon}"
+ start-stop-daemon \
+ --stop \
+ --pidfile ${pidfile}
+ eend $?
+}
diff --git a/testing/shellinabox/shellinabox.pre-install b/testing/shellinabox/shellinabox.pre-install
new file mode 100644
index 0000000000..6ff04eb481
--- /dev/null
+++ b/testing/shellinabox/shellinabox.pre-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+addgroup shellinaboxd 2>/dev/null
+adduser -S -H -h /var/run/shellinaboxd -s /sbin/nologin -g shellinaboxd shellinaboxd 2>/dev/null
+exit 0