summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-apps/ttyd/files')
-rw-r--r--www-apps/ttyd/files/ttyd.confd36
-rw-r--r--www-apps/ttyd/files/ttyd.initd14
-rw-r--r--www-apps/ttyd/files/ttyd.service10
3 files changed, 60 insertions, 0 deletions
diff --git a/www-apps/ttyd/files/ttyd.confd b/www-apps/ttyd/files/ttyd.confd
new file mode 100644
index 000000000000..8e614522b436
--- /dev/null
+++ b/www-apps/ttyd/files/ttyd.confd
@@ -0,0 +1,36 @@
+# conf.d file for ttyd
+
+# Please check man 1 ttyd for more information about the options
+#
+# Some of the meaningful options are:
+# -p, --port Port to listen (default: 7681, use `0` for random port)
+# -i, --interface Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock)
+# -U, --socket-owner User owner of the UNIX domain socket file, when enabled (eg: user:group)
+# -c, --credential Credential for basic authentication (format: username:password)
+# -H, --auth-header HTTP Header name for auth proxy, this will configure ttyd to let a HTTP reverse proxy handle authentication
+# -u, --uid User id to run with
+# -g, --gid Group id to run with
+# -s, --signal Signal to send to the command when exit it (default: 1, SIGHUP)
+# -w, --cwd Working directory to be set for the child program
+# -a, --url-arg Allow client to send command line arguments in URL (eg: http://localhost:7681?arg=foo&arg=bar)
+# -W, --writable Allow clients to write to the TTY (readonly by default)
+# -t, --client-option Send option to client (format: key=value), repeat to add more options
+# -T, --terminal-type Terminal type to report, default: xterm-256color
+# -O, --check-origin Do not allow websocket connection from different origin
+# -m, --max-clients Maximum clients to support (default: 0, no limit)
+# -o, --once Accept only one client and exit on disconnection
+# -B, --browser Open terminal with the default system browser
+# -I, --index Custom index.html path
+# -b, --base-path Expected base path for requests coming from a reverse proxy (eg: /mounted/here, max length: 128)
+# -P, --ping-interval Websocket ping interval(sec) (default: 5)
+# -6, --ipv6 Enable IPv6 support
+# -S, --ssl Enable SSL
+# -C, --ssl-cert SSL certificate file path
+# -K, --ssl-key SSL key file path
+# -A, --ssl-ca SSL CA file path for client certificate verification
+# -d, --debug Set log level (default: 7)
+# -v, --version Print the version and exit
+# -h, --help Print this text and exit
+
+
+TTYD_OPTS="-W login"
diff --git a/www-apps/ttyd/files/ttyd.initd b/www-apps/ttyd/files/ttyd.initd
new file mode 100644
index 000000000000..9d1afdec19da
--- /dev/null
+++ b/www-apps/ttyd/files/ttyd.initd
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+name="ttyd daemon"
+pidfile="/var/run/ttyd.pid"
+command="/usr/bin/ttyd"
+command_args="${TTYD_OPTS}"
+command_background="true"
+start_stop_daemon_args="-b"
+
+depend() {
+ use logger
+}
diff --git a/www-apps/ttyd/files/ttyd.service b/www-apps/ttyd/files/ttyd.service
new file mode 100644
index 000000000000..d1d7e92461a4
--- /dev/null
+++ b/www-apps/ttyd/files/ttyd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Terminal over HTTP
+
+[Service]
+User=root
+ExecStart=/usr/bin/ttyd -W -p 9000 login
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target