diff options
author | mara <mara@fail.pp.ua> | 2014-03-09 09:26:49 +0700 |
---|---|---|
committer | Erik Hanson <erik@slackbuilds.org> | 2014-03-12 12:42:49 -0500 |
commit | d4fbceaeec3671400446bf848356cede01c8b19a (patch) | |
tree | 81b6c27347af0cee96850e09b19880763cfddb47 /network/sslh | |
parent | 9e546755c07c8ad0c3d8b3189a1ac6c9e029c587 (diff) |
network/sslh: Added (Applicative protocol multiplexer).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/sslh')
-rw-r--r-- | network/sslh/README | 11 | ||||
-rw-r--r-- | network/sslh/doinst.sh | 26 | ||||
-rw-r--r-- | network/sslh/rc.sslh | 47 | ||||
-rw-r--r-- | network/sslh/slack-desc | 19 | ||||
-rw-r--r-- | network/sslh/sslh.SlackBuild | 86 | ||||
-rw-r--r-- | network/sslh/sslh.info | 10 |
6 files changed, 199 insertions, 0 deletions
diff --git a/network/sslh/README b/network/sslh/README new file mode 100644 index 000000000000..085d021b2802 --- /dev/null +++ b/network/sslh/README @@ -0,0 +1,11 @@ +sslh accepts connections on specified ports, and forwards +them further based on tests performed on the first data +packet sent by the remote client. + +Probes for HTTP, SSL, SSH, OpenVPN, tinc, XMPP are +implemented, and any other protocol that can be tested using +a regular expression, can be recognised. A typical use case +is to allow serving several services on port 443 (e.g. to +connect to SSH from inside a corporate firewall, which +almost never block port 443) while still serving HTTPS on +that port. diff --git a/network/sslh/doinst.sh b/network/sslh/doinst.sh new file mode 100644 index 000000000000..40511642749f --- /dev/null +++ b/network/sslh/doinst.sh @@ -0,0 +1,26 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.sslh.new +config etc/sslh/sslh.conf.new diff --git a/network/sslh/rc.sslh b/network/sslh/rc.sslh new file mode 100644 index 000000000000..38b4a027a48c --- /dev/null +++ b/network/sslh/rc.sslh @@ -0,0 +1,47 @@ +#! /bin/sh + +# The prefix is normally filled by make install. If +# installing by hand, fill it in yourself! +NAME=sslh +PREFIX=/usr +DAEMON=$PREFIX/bin/${NAME} +CONFIG=/etc/sslh/sslh.conf + +start() +{ + pid=`pidof -o %PPID sslh` + if [[ -z $pid ]]; then + echo "Start services: sslh" + $DAEMON -F ${CONFIG} + logger -t ${tag} -p ${facility} -i 'Started sslh' + else + echo "Service is running." + fi +} + +stop() +{ + echo "Stop services: sslh" + killall -9 ${NAME} + logger -t ${tag} -p ${facility} -i 'Stopped sslh' +} + + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + sleep 5 + start + ;; + *) + echo "Usage: /etc/rc.d/rc.sslh {start|stop|restart}" >&2 + ;; +esac + +exit 0 diff --git a/network/sslh/slack-desc b/network/sslh/slack-desc new file mode 100644 index 000000000000..0c90805d1e84 --- /dev/null +++ b/network/sslh/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +sslh: sslh (Applicative protocol multiplexer) +sslh: +sslh: sslh accepts connections on specified ports, and forwards them +sslh: further based on tests performed on the first data packet sent by +sslh: the remote client. +sslh: +sslh: Probes for HTTP, SSL, SSH, OpenVPN, tinc, XMPP are implemented, and +sslh: any other protocol that can be tested using a regular expression, +sslh: can be recognised. +sslh: +sslh: diff --git a/network/sslh/sslh.SlackBuild b/network/sslh/sslh.SlackBuild new file mode 100644 index 000000000000..8461b9a37710 --- /dev/null +++ b/network/sslh/sslh.SlackBuild @@ -0,0 +1,86 @@ +#!/bin/sh + +# Slackware build script for sslh + +# +# Script created by mara <mara@fail.pp.ua> +# + +PRGNAM=sslh +VERSION=${VERSION:-1.16} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-v$VERSION +tar xvf $CWD/$PRGNAM-v$VERSION.tar.gz +cd $PRGNAM-v$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# fix slackware path in manpage +sed -i 's/init.d/rc.d/' sslh.pod +sed -i 's+/etc/default+/etc/sslh+' sslh.pod +make VERSION=\"v$VERSION\" + +# install initscripts +install -Dm 755 $CWD/rc.sslh $PKG/etc/rc.d/rc.sslh.new +# install example file +install -Dm 0644 example.cfg $PKG/etc/sslh/sslh.conf.new +# manually install to have both ssl-fork and ssl-select +install -Dm 0755 sslh-fork $PKG/usr/bin/sslh-fork +install -Dm 0755 sslh-select $PKG/usr/bin/sslh-select +ln -s sslh-fork $PKG/usr/bin/sslh +# install manpage +install -Dm 0644 sslh.8.gz $PKG/usr/man/man8/sslh.8.gz + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/sslh/sslh.info b/network/sslh/sslh.info new file mode 100644 index 000000000000..c6501c24fdd6 --- /dev/null +++ b/network/sslh/sslh.info @@ -0,0 +1,10 @@ +PRGNAM="sslh" +VERSION="1.16" +HOMEPAGE="http://www.rutschle.net/tech/sslh.shtml" +DOWNLOAD="http://www.rutschle.net/tech/sslh-v1.16.tar.gz" +MD5SUM="1e85b84eb82a96b81de9b1e637a3e795" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="libconfig" +MAINTAINER="mara" +EMAIL="mara@fail.pp.ua" |