summaryrefslogtreecommitdiff
path: root/net-misc/tinyssh/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-07-26 10:30:48 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-07-26 10:30:48 +0100
commit96cc0713998c294a9440f03dfa8c4adc9cb71f92 (patch)
treec51c399e2ac466345931e32f9bb465534a74f828 /net-misc/tinyssh/files
parent390bde0d9e0b055c7e87ede2f6b3546ec7da02c7 (diff)
gentoo auto-resync : 26:07:2023 - 10:30:48
Diffstat (limited to 'net-misc/tinyssh/files')
-rw-r--r--net-misc/tinyssh/files/tinyssh-makekey.service8
-rw-r--r--net-misc/tinyssh/files/tinyssh.confd7
-rw-r--r--net-misc/tinyssh/files/tinyssh.initd30
-rw-r--r--net-misc/tinyssh/files/tinyssh.service9
-rw-r--r--net-misc/tinyssh/files/tinyssh.socket13
5 files changed, 67 insertions, 0 deletions
diff --git a/net-misc/tinyssh/files/tinyssh-makekey.service b/net-misc/tinyssh/files/tinyssh-makekey.service
new file mode 100644
index 000000000000..841a516ce390
--- /dev/null
+++ b/net-misc/tinyssh/files/tinyssh-makekey.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=TinySSH Key Generation
+ConditionPathIsDirectory=!/etc/tinyssh/keys
+
+[Service]
+ExecStart=/usr/sbin/tinysshd-makekey /etc/tinyssh/keys
+Type=oneshot
+RemainAfterExit=true
diff --git a/net-misc/tinyssh/files/tinyssh.confd b/net-misc/tinyssh/files/tinyssh.confd
new file mode 100644
index 000000000000..d1aefde2be9f
--- /dev/null
+++ b/net-misc/tinyssh/files/tinyssh.confd
@@ -0,0 +1,7 @@
+# TinySSH config file for /etc/init.d/tinyssh
+
+#TINYSSH_PORT="22"
+#TINYSSH_IP="0.0.0.0"
+#TINYSSH_CONFDIR="/etc/tinyssh"
+#TINYSSH_KEYDIR="${TINYSSH_CONFDIR}/keys"
+#TINYSSH_OPTS="-l -v"
diff --git a/net-misc/tinyssh/files/tinyssh.initd b/net-misc/tinyssh/files/tinyssh.initd
new file mode 100644
index 000000000000..095a7f4e1056
--- /dev/null
+++ b/net-misc/tinyssh/files/tinyssh.initd
@@ -0,0 +1,30 @@
+#!/sbin/openrc-run
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+TINYSSH_CONFDIR="${TINYSSH_CONFDIR:-/etc/tinyssh}"
+TINYSSH_KEYDIR="${TINYSSH_KEYDIR:-${TINYSSH_CONFDIR}/keys}"
+
+TINYSSHD="/usr/sbin/tinysshd"
+MAKEKEY="${TINYSSHD}-makekey"
+PRINTKEY="/usr/bin/tinysshd-printkey"
+
+command="/usr/bin/tcpserver"
+command_args="-HRDl0 ${TINYSSH_IP:-0.0.0.0} ${TINYSSH_PORT:-22}
+ ${TINYSSHD} ${TINYSSH_OPTS:--l -v} ${TINYSSH_KEYDIR}"
+command_background=yes
+pidfile="/run/${RC_SVCNAME}.pid"
+start_stop_daemon_args="${SSD_OPTS}"
+
+depend() {
+ use net
+}
+
+start_pre() {
+ if [ "${RC_CMD}" != "restart" ]; then
+ checkpath -d "${TINYSSH_CONFDIR}"
+ if ! ${PRINTKEY} "${TINYSSH_KEYDIR}" >/dev/null 2>&1; then
+ ${MAKEKEY} "${TINYSSH_KEYDIR}" || return 1
+ fi
+ fi
+}
diff --git a/net-misc/tinyssh/files/tinyssh.service b/net-misc/tinyssh/files/tinyssh.service
new file mode 100644
index 000000000000..f0fe93be778b
--- /dev/null
+++ b/net-misc/tinyssh/files/tinyssh.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=TinySSH Per-Connection Daemon
+Documentation=https://tinyssh.org
+After=tinyssh-makekey.service
+
+[Service]
+ExecStart=/usr/sbin/tinysshd /etc/tinyssh/keys
+StandardInput=socket
+StandardError=journal
diff --git a/net-misc/tinyssh/files/tinyssh.socket b/net-misc/tinyssh/files/tinyssh.socket
new file mode 100644
index 000000000000..9ca2b16b3fa4
--- /dev/null
+++ b/net-misc/tinyssh/files/tinyssh.socket
@@ -0,0 +1,13 @@
+[Unit]
+Description=TinySSH service (socket-activated)
+Documentation=https://tinyssh.org
+Wants=tinyssh-makekey.service
+
+[Socket]
+ListenStream=%i
+Accept=true
+KeepAlive=true
+IPTOS=low-delay
+
+[Install]
+WantedBy=sockets.target