summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pagano <mpagano@gentoo.org>2023-05-04 18:49:38 -0400
committerMike Pagano <mpagano@gentoo.org>2023-05-04 18:49:38 -0400
commit97ee15648f49af75108356a4a8033b61de46ef58 (patch)
tree94fe2a28971bb86e84743b682dec2eeb77ee151f /www-apps
parentRevert "app-arch/brotli: Set DISTUTILS_EXT=1" (diff)
downloadgentoo-97ee15648f49af75108356a4a8033b61de46ef58.tar.gz
gentoo-97ee15648f49af75108356a4a8033b61de46ef58.tar.bz2
gentoo-97ee15648f49af75108356a4a8033b61de46ef58.zip
www-apps/ttyd: new package, add 1.7.3, 9999
ttyd, a simple command-line tool for sharing terminal over the web Signed-off-by: Mike Pagano <mpagano@gentoo.org>
Diffstat (limited to 'www-apps')
-rw-r--r--www-apps/ttyd/Manifest1
-rw-r--r--www-apps/ttyd/files/ttyd.confd29
-rw-r--r--www-apps/ttyd/files/ttyd.initd14
-rw-r--r--www-apps/ttyd/files/ttyd.service10
-rw-r--r--www-apps/ttyd/metadata.xml10
-rw-r--r--www-apps/ttyd/ttyd-1.7.3.ebuild41
-rw-r--r--www-apps/ttyd/ttyd-9999.ebuild42
7 files changed, 147 insertions, 0 deletions
diff --git a/www-apps/ttyd/Manifest b/www-apps/ttyd/Manifest
new file mode 100644
index 000000000000..4039ce4e90bd
--- /dev/null
+++ b/www-apps/ttyd/Manifest
@@ -0,0 +1 @@
+DIST ttyd-1.7.3.tar.gz 579492 BLAKE2B 14b66dbe83c0ccb601a6e3bf35a804f69f679387c9aca2f55a055dda85b2e3a396ddb4f9a3fb56575d0554837faf1d5c090cf66f4e7571201323659db3feb0b7 SHA512 e0900e2b4620095717d0f32206d08177ce74bc2f24cd9c20793cc2e370a8ee961272b73698b0dda857360703df20378c080293dfdfd287ae863801d338c8b2a4
diff --git a/www-apps/ttyd/files/ttyd.confd b/www-apps/ttyd/files/ttyd.confd
new file mode 100644
index 000000000000..57d24e3fb394
--- /dev/null
+++ b/www-apps/ttyd/files/ttyd.confd
@@ -0,0 +1,29 @@
+# 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)
+# -c, --credential Credential for Basic Authentication (format: username:password)
+# -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)
+# -r, --reconnect Time to reconnect for the client in seconds (default: 10)
+# -R, --readonly Do not allow clients to write to the TTY
+# -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
+# -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)
+# login --- Login with system accounts
+
+TTYD_OPTS="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..caa95ab1a910
--- /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 -p 9000 login
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-apps/ttyd/metadata.xml b/www-apps/ttyd/metadata.xml
new file mode 100644
index 000000000000..cbc3ff79c423
--- /dev/null
+++ b/www-apps/ttyd/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mpagano@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">tsl0922/ttyd</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-apps/ttyd/ttyd-1.7.3.ebuild b/www-apps/ttyd/ttyd-1.7.3.ebuild
new file mode 100644
index 000000000000..80b189a914d4
--- /dev/null
+++ b/www-apps/ttyd/ttyd-1.7.3.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake systemd
+
+MY_PV="$(ver_rs 3 '-')"
+
+DESCRIPTION="ttyd, a simple command-line tool for sharing terminal over the web"
+HOMEPAGE="https://github.com/tsl0922/ttyd"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="https://github.com/tsl0922/ttyd.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/tsl0922/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+
+BDEPEND="dev-util/cmake"
+
+DEPEND="
+ dev-libs/json-c:=
+ dev-libs/libuv:=
+ net-libs/libwebsockets:=[libuv,ssl]
+ sys-libs/zlib:=
+ "
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+src_install() {
+ dobin ../${P}_build/${PN}
+ doman man/*.1
+ newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+ newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+ systemd_dounit "${FILESDIR}"/${PN}.service
+}
diff --git a/www-apps/ttyd/ttyd-9999.ebuild b/www-apps/ttyd/ttyd-9999.ebuild
new file mode 100644
index 000000000000..14c795388490
--- /dev/null
+++ b/www-apps/ttyd/ttyd-9999.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake systemd
+
+MY_PV="$(ver_rs 3 '-')"
+
+DESCRIPTION="ttyd, a simple command-line tool for sharing terminal over the web"
+HOMEPAGE="https://github.com/tsl0922/ttyd"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="https://github.com/tsl0922/ttyd.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/tsl0922/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+
+BDEPEND="dev-util/cmake"
+
+DEPEND="
+ dev-vcs/git:=
+ dev-libs/json-c:=
+ dev-libs/libuv:=
+ net-libs/libwebsockets:=[libuv,ssl]
+ sys-libs/zlib:=
+ "
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+src_install() {
+ dobin ../${P}_build/${PN}
+ doman man/*.1
+ newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+ newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+ systemd_dounit "${FILESDIR}"/${PN}.service
+}