diff options
-rw-r--r-- | debian/TODO | 6 | ||||
-rw-r--r-- | debian/changelog | 5 | ||||
-rw-r--r-- | debian/control | 26 | ||||
-rw-r--r-- | debian/copyright | 60 | ||||
-rw-r--r-- | debian/local/apache2/ttyd.conf | 25 | ||||
-rw-r--r-- | debian/local/examples/apache2-authbasic-file.conf | 10 | ||||
-rw-r--r-- | debian/local/examples/apache2-authbasic-ip.conf | 8 | ||||
-rwxr-xr-x | debian/rules | 7 | ||||
-rw-r--r-- | debian/source/format | 1 | ||||
-rw-r--r-- | debian/ttyd.examples | 1 | ||||
-rw-r--r-- | debian/ttyd.install | 1 | ||||
-rwxr-xr-x | debian/ttyd.postinst | 28 | ||||
-rwxr-xr-x | debian/ttyd.postrm | 27 | ||||
-rw-r--r-- | debian/ttyd.service | 16 | ||||
-rw-r--r-- | debian/watch | 3 |
15 files changed, 224 insertions, 0 deletions
diff --git a/debian/TODO b/debian/TODO new file mode 100644 index 0000000..f1d9200 --- /dev/null +++ b/debian/TODO @@ -0,0 +1,6 @@ +complete debian/copyright wrt/ html/* +-> use libjs-xterm? + +add README.Debian + +write logs to own logfile diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..c5fb3b4 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +ttyd (1.6.3-1) sid; urgency=medium + + * Initial upload to sid (Closes: #972863). + + -- Daniel Baumann <daniel.baumann@progress-linux.org> Sun, 25 Oct 2020 13:36:25 +0100 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..221ecaf --- /dev/null +++ b/debian/control @@ -0,0 +1,26 @@ +Source: ttyd +Section: web +Priority: optional +Maintainer: Daniel Baumann <daniel.baumann@progress-linux.org> +Build-Depends: + cmake, + debhelper-compat (= 13), + libjson-c-dev, + libwebsockets-dev, + zlib1g-dev, +Rules-Requires-Root: no +Standards-Version: 4.5.1 +Homepage: https://tsl0922.github.io/ttyd/ +Vcs-Browser: https://git.progress-linux.org/users/daniel.baumann/debian/packages/ttyd +Vcs-Git: https://git.progress-linux.org/users/daniel.baumann/debian/packages/ttyd + +Package: ttyd +Section: web +Architecture: any +Depends: + ${misc:Depends}, + ${shlibs:Depends}, +Recommends: + apache2 | httpd, +Description: Share your terminal over the web + ttyd is a command-line tool for sharing a terminal over the web. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..fc7dce9 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,60 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ttyd +Upstream-Contact: Shuanglei Tao <tsl0922@gmail.com> +Source: https://github.com/tsl0922/ttyd/releases + +Files: * +Copyright: 2016-2020 Shuanglei Tao <tsl0922@gmail.com> +License: MIT + +Files: src/queue.h +Copyright: 1991-1993 The Regents of the University of California +License: BSD-3 + +Files: debian/* +Copyright: 2020 Daniel Baumann <daniel.baumann@progress-linux.org> +License: MIT + +License: BSD-3 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/debian/local/apache2/ttyd.conf b/debian/local/apache2/ttyd.conf new file mode 100644 index 0000000..66b1850 --- /dev/null +++ b/debian/local/apache2/ttyd.conf @@ -0,0 +1,25 @@ +# /etc/apache2/conf-available/ttyd.conf + +<IfModule rewrite_module> + <IfModule proxy_http_module> + <IfModule proxy_wstunnel_module> + ProxyPreserveHost On + ProxyRequests Off + + ProxyPass /ttyd/token ws://localhost:7681/token + ProxyPassReverse /ttyd/token ws://localhost:7681/token + + ProxyPass /ttyd/ws ws://localhost:7681/ws + ProxyPassReverse /ttyd/ws ws://localhost:7681/ws + + ProxyPass /ttyd http://localhost:7681 + ProxyPassReverse /ttyd http://localhost:7681 + + <IfFile /etc/ttyd/apache2-auth.conf> + <Location /ttyd> + Include /etc/ttyd/apache2-auth.conf + </Location> + </IfFile> + </IfModule> + </IfModule> +</IfModule> diff --git a/debian/local/examples/apache2-authbasic-file.conf b/debian/local/examples/apache2-authbasic-file.conf new file mode 100644 index 0000000..5f28cb9 --- /dev/null +++ b/debian/local/examples/apache2-authbasic-file.conf @@ -0,0 +1,10 @@ +# /etc/ttyd/apache2-auth.conf + +<IfFile /etc/ttyd/htpasswd> + AuthName "ttyd" + AuthBasicProvider file + AuthType basic + + AuthUserFile /etc/ttyd/htpasswd + Require valid-user +</IfFile> diff --git a/debian/local/examples/apache2-authbasic-ip.conf b/debian/local/examples/apache2-authbasic-ip.conf new file mode 100644 index 0000000..8507a20 --- /dev/null +++ b/debian/local/examples/apache2-authbasic-ip.conf @@ -0,0 +1,8 @@ +# /etc/ttyd/apache2-auth.conf + +Order deny,allow +Deny from all + +Allow from 10.0.0.0/8 +Allow from 172.16.0.0/12 +Allow from 192.168.0.0/16 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..453d005 --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh ${@} --builddirectory=build + +override_dh_auto_build: + mkdir -p build && cd build && cmake .. && make diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/ttyd.examples b/debian/ttyd.examples new file mode 100644 index 0000000..891fdca --- /dev/null +++ b/debian/ttyd.examples @@ -0,0 +1 @@ +debian/local/examples/* diff --git a/debian/ttyd.install b/debian/ttyd.install new file mode 100644 index 0000000..a658e0d --- /dev/null +++ b/debian/ttyd.install @@ -0,0 +1 @@ +debian/local/apache2/*.conf /etc/apache2/conf-available diff --git a/debian/ttyd.postinst b/debian/ttyd.postinst new file mode 100755 index 0000000..b3a83c8 --- /dev/null +++ b/debian/ttyd.postinst @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e + +case "${1}" in + configure) + a2enmod rewrite + a2enmod proxy + a2enmod proxy_http + a2enmod proxy_http2 + a2enmod proxy_wstunnel + + a2enconf ttyd + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/ttyd.postrm b/debian/ttyd.postrm new file mode 100755 index 0000000..0c12e8c --- /dev/null +++ b/debian/ttyd.postrm @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +case "${1}" in + purge) + # apache2 + rm -f /etc/apache2/conf-enabled/ttyd.conf + + # httpasswd + rm -f /etc/ttyd/htpasswd + rmdir /etc/ttyd > /dev/null 2>&1 || true + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postrm called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/ttyd.service b/debian/ttyd.service new file mode 100644 index 0000000..516d851 --- /dev/null +++ b/debian/ttyd.service @@ -0,0 +1,16 @@ +[Unit] +Description=ttyd daemon +Documentation=man:ttyd(1) +After=network.target systemd-tmpfiles-clean.service + +[Service] +Type=simple +ExecStart=/bin/ttyd -i lo -p 7681 -O login +ExecReload=/bin/kill -HUP $MAINPID +KillMode=process +LimitNOFILE=512 +LimitMEMLOCK=infinity +LimitSTACK=infinity + +[Install] +WantedBy=multi-user.target diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..904a16d --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=4 +opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/ttyd-$1\.tar\.gz/ \ +https://github.com/tsl0922/ttyd/releases .*/v?(\d\S+)\.tar\.gz |