aboutsummaryrefslogtreecommitdiffstats
path: root/community/tinyssh
diff options
context:
space:
mode:
authorStuart Cardall <developer@it-offshore.co.uk>2016-08-18 20:46:53 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2016-08-21 22:24:04 +0200
commit5c9f3ca3e307be53b45beeed2ce1626f38008625 (patch)
tree919836fe454e953f46685adf8228b0401280d4b6 /community/tinyssh
parent6a00a953ba02bab6440a2c784e7db37c6eaeace1 (diff)
downloadaports-5c9f3ca3e307be53b45beeed2ce1626f38008625.tar.bz2
aports-5c9f3ca3e307be53b45beeed2ce1626f38008625.tar.xz
testing/[various]: move to community
albatross-themes apk-post-messages autossh bitcoin btrbk entr ffmpegthumbnailer firejail firetools fwsnort gnome-colors imapsync inetutils-syslogd inotify-tools-inc isync junit ktsuss letsencrypt-nosudo libmbim libndp libqmi libteam mini-sendmail modemmanager namecoin networkmanager nginx-naxsi numix-themes nxapi opencl-headers opencl-icd-loader opus-tools perl-authen-ntlm perl-bit-vector perl-data-uniqid perl-file-copy-recursive perl-getopt-argvfile perl-io-tee perl-iptables-chainmgr perl-iptables-parse perl-module-scandeps perl-par-dist perl-par-packer perl-par perl-uri-escape psad py-crcmod py-graphviz py-lz4 py-opencl py-opengl-accelerate runit secpwgen secure-delete socklog spacefm tinyssh udevil virt-viewer virtualbricks whois wrk xpra zram-init
Diffstat (limited to 'community/tinyssh')
-rw-r--r--community/tinyssh/APKBUILD62
-rw-r--r--community/tinyssh/tinyssh.confd8
-rw-r--r--community/tinyssh/tinyssh.initd43
3 files changed, 113 insertions, 0 deletions
diff --git a/community/tinyssh/APKBUILD b/community/tinyssh/APKBUILD
new file mode 100644
index 0000000000..a0e29d0133
--- /dev/null
+++ b/community/tinyssh/APKBUILD
@@ -0,0 +1,62 @@
+# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
+# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
+pkgname=tinyssh
+pkgver=20160809
+pkgrel=0
+pkgdesc="Small SSH server using NaCl / TweetNaCl (no dependency on OpenSSL)"
+url="http://tinyssh.org/"
+arch="all"
+license="CC0 1.0"
+makedepends="$depends_dev libsodium-dev"
+subpackages="$pkgname-doc"
+source="$pkgname-$pkgver.tar.gz::https://github.com/janmojzis/$pkgname/archive/$pkgver.tar.gz
+ $pkgname.initd
+ $pkgname.confd
+ "
+
+builddir="$srcdir"/$pkgname-$pkgver
+build() {
+ cd "$builddir"
+ export LIBS="-lsodium"
+ export CFLAGS="$CFLAGS -I/usr/include/sodium"
+ export LDFLAGS="-L/usr/lib"
+ make || return 1
+}
+
+package() {
+ cd "$builddir"
+ make install DESTDIR="${pkgdir}" || return 1
+
+ mkdir -p "$pkgdir"/etc/$pkgname
+ install -m755 -D "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/tinysshd || return 1
+ install -m644 -D "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/tinysshd || return 1
+
+ # post-install message
+ mkdir -p "$pkgdir/usr/share/doc/$pkgname"
+ cat > $pkgdir/usr/share/doc/$pkgname/README.alpine <<EOF
+TinySSH can be run in 3 different ways:
+--------------------------------------
+(1) /etc/init.d/tinysshd (requires tcpserver & takes care of key generation)
+
+(2) via inetd (you will need to 'tinysshd-makekeys <dir>' manually):
+
+echo '22 stream tcp nowait root /usr/sbin/tinysshd tinysshd -l -v /etc/tinyssh/sshkeys' >> /etc/inetd.conf
+rc-service inetd start
+
+(3) Using runit with either (1) or (2)
+
+Stealth SSH with FWKNOP: https://it-offshore.co.uk/security/53-stealth-your-ssh-port-ssh-into-lxc-containers
+EOF
+}
+
+md5sums="32606be2301eac9a1c295827b70c319a tinyssh-20160809.tar.gz
+78ec724804035bae29e1c47abec737d8 tinyssh.initd
+83e705f0f71db5ae0d8530edafa63497 tinyssh.confd"
+sha256sums="3f910f8aa505bd6101f62975c775e81cdf235b2eb9d143d36daff2820f0b3940 tinyssh-20160809.tar.gz
+b3584c463f6ba0de6a5fe2e28fb98cd8ef65a55f17a0f4c877f61f54019ef34c tinyssh.initd
+c6c67395e7230d75077734f0b08d5f8c76f11aaef27878b013b7bd68dd7ba774 tinyssh.confd"
+sha512sums="d7e55359eef2ca4ab8864a4c8b66d8cc852aed8b693beb9a40b892af862cdab174e9023bf933b7ace37d0c0e264798e34f139d6a2aba78eb7c3df4efe85c3ac4 tinyssh-20160809.tar.gz
+d10f995c6687e706453e51d06b3466427d476036efdbd86db2f9330281e46049bf2e3698208524b3f70cdbd30373f5bf46c7164dd626d22b3fa9a75ca5d8d478 tinyssh.initd
+4513bd0d43ef0825fbd77365a8a7adefcd99211102df76003becf7e3a09a47ad9bbd16a68c3fadfb7868e0562f8d42a26106b7582cb70490a7e52a7d1e6110e9 tinyssh.confd"
diff --git a/community/tinyssh/tinyssh.confd b/community/tinyssh/tinyssh.confd
new file mode 100644
index 0000000000..d7ba22a5ce
--- /dev/null
+++ b/community/tinyssh/tinyssh.confd
@@ -0,0 +1,8 @@
+# TinySSH conf.d file for Alpine Linux
+
+# Specify daemon options here:
+# OPTIONS="-l -v"
+
+# override config directory / port here:
+# CONFDIR=/etc/tinyssh
+# PORT=22
diff --git a/community/tinyssh/tinyssh.initd b/community/tinyssh/tinyssh.initd
new file mode 100644
index 0000000000..364ffb21c5
--- /dev/null
+++ b/community/tinyssh/tinyssh.initd
@@ -0,0 +1,43 @@
+#!/sbin/openrc-run
+# Alpine Linux init.d for TinySSH
+# Copyright 2015 Stuart Cardall (developer@it-offshore.co.uk)
+# Distributed under the terms of the GNU General Public License, v2 or later #
+
+name=tinysshd
+daemon=/usr/sbin/$name
+keygen=$daemon-makekey
+CONFDIR=${CONFDIR:-/etc/tinyssh}
+keydir=${CONFDIR}/sshkeys
+OPTIONS=${OPTIONS:-\-v -l}
+PORT=${PORT:-22}
+pidfile=/var/run/$name.pid
+server_opts="-HRDl0 0.0.0.0 ${PORT} $daemon ${OPTIONS} $keydir"
+
+depend() {
+ use net
+ after logger firewall
+}
+
+checkconfig() {
+ checkpath --directory ${CONFDIR}
+ eval $keygen $keydir 2>/dev/null
+ # tinyssh also runs from inetd without tcpserver
+ if [ ! -f /usr/bin/tcpserver ]; then
+ apk add --quiet ucspi-tcp
+ fi
+}
+
+start() {
+ checkconfig
+ ebegin "Starting ${name}"
+ start-stop-daemon --start --make-pidfile --background --pidfile $pidfile \
+ --exec tcpserver -- $server_opts
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${name}"
+ start-stop-daemon --stop --quiet \
+ --pidfile $pidfile
+ eend $?
+}