summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevaev Maxim2019-05-11 11:31:07 +0300
committerDevaev Maxim2019-05-11 11:31:07 +0300
commit7d7e89d7de388ee1b28f5819ed7b2b1009e2c33b (patch)
tree8fc4beb28bd4415f976539590051943f83d0d7c2
parentd85ac0f6136389b64b94840f6efe683715b8c28d (diff)
downloadaur-7d7e89d7de388ee1b28f5819ed7b2b1009e2c33b.tar.gz
Update to 0.19-1
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD13
-rw-r--r--index.html26
-rw-r--r--index.sed2
-rw-r--r--kvmd-webterm.install3
-rw-r--r--kvmd-webterm.service12
-rw-r--r--manifest.yaml2
-rw-r--r--nginx.ctx-http.conf4
-rw-r--r--nginx.ctx-server.conf10
9 files changed, 29 insertions, 54 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 59da9c24c900..f937df4e2798 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,20 +1,20 @@
pkgbase = kvmd-webterm
- pkgdesc = Pi-KVM Web Terminal (GoTTY)
- pkgver = 0.18
+ pkgdesc = Pi-KVM - Web terminal (ttyd)
+ pkgver = 0.19
pkgrel = 1
url = https://github.com/pi-kvm/kvmd-webterm
install = kvmd-webterm.install
arch = any
license = GPL
- makedepends = go
depends = kvmd
- depends = gotty
+ depends = ttyd
source = kvmd-webterm.install
source = kvmd-webterm.service
+ source = https://raw.githubusercontent.com/tsl0922/ttyd/master/src/index.html
+ source = index.sed
source = terminal.svg
source = nginx.ctx-http.conf
source = nginx.ctx-server.conf
- source = index.html
source = manifest.yaml
md5sums = SKIP
md5sums = SKIP
@@ -23,6 +23,7 @@ pkgbase = kvmd-webterm
md5sums = SKIP
md5sums = SKIP
md5sums = SKIP
+ md5sums = SKIP
pkgname = kvmd-webterm
diff --git a/PKGBUILD b/PKGBUILD
index da18036a05fd..cc2c5a248cd5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,25 +3,25 @@
pkgname=kvmd-webterm
-pkgver=0.18
+pkgver=0.19
pkgrel=1
-pkgdesc="Pi-KVM Web Terminal (GoTTY)"
+pkgdesc="Pi-KVM - Web terminal (ttyd)"
url="https://github.com/pi-kvm/kvmd-webterm"
license=(GPL)
arch=(any)
-depends=(kvmd gotty)
-makedepends=(go)
+depends=(kvmd ttyd)
install=$pkgname.install
source=(
$pkgname.install
$pkgname.service
+ https://raw.githubusercontent.com/tsl0922/ttyd/master/src/index.html
+ index.sed
terminal.svg
nginx.ctx-http.conf
nginx.ctx-server.conf
- index.html
manifest.yaml
)
-md5sums=(SKIP SKIP SKIP SKIP SKIP SKIP SKIP)
+md5sums=(SKIP SKIP SKIP SKIP SKIP SKIP SKIP SKIP)
package() {
@@ -33,4 +33,5 @@ package() {
mkdir -p "$pkgdir/usr/share/kvmd/extras/webterm"
cp nginx.*.conf index.html manifest.yaml "$pkgdir/usr/share/kvmd/extras/webterm"
+ sed -i -f index.sed "$pkgdir/usr/share/kvmd/extras/webterm/index.html"
}
diff --git a/index.html b/index.html
deleted file mode 100644
index 03a709b92e35..000000000000
--- a/index.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>{{ .title }}</title>
- <link rel="icon" type="image/png" href="favicon.png">
- <link rel="stylesheet" href="./css/index.css" />
- <link rel="stylesheet" href="./css/xterm.css" />
- <link rel="stylesheet" href="./css/xterm_customize.css" />
-</head>
-<body>
- <a style="display: inline-block; margin-top: 4px; color:#5c90bc; text-decoration: none;" href="/">
- &nbsp;&nbsp;&larr;&nbsp;&nbsp; [ Pi-KVM Index ]
- </a>
- <div id="terminal" style="height: 95%; height: calc(100% - 30px);"></div>
- <script src="./auth_token.js"></script>
- <script src="./config.js"></script>
- <script src="./js/gotty-bundle.js"></script>
- <script type="text/javascript">
- window.onbeforeunload = function(event) {
- var text = "Are you sure you want to close terminal session?";
- event.returnValue = text;
- return text;
- };
- </script>
-</body>
-</html>
diff --git a/index.sed b/index.sed
new file mode 100644
index 000000000000..7d084f33401c
--- /dev/null
+++ b/index.sed
@@ -0,0 +1,2 @@
+s|<body><div id="terminal-container">|<body bgcolor="#2b2b2b"><a style="display: inline-block; margin-top: 4px; color:#5c90bc; text-decoration: none;" href="/">\&nbsp;\&nbsp;\&larr;\&nbsp;\&nbsp; [ Pi-KVM Index ]</a><div id="terminal-container" style="height: 95%; height: calc(100% - 30px);">|g
+s|<script src="auth_token\.js"></script>||g
diff --git a/kvmd-webterm.install b/kvmd-webterm.install
index b6f5b833e5d1..dac009375bd7 100644
--- a/kvmd-webterm.install
+++ b/kvmd-webterm.install
@@ -1,5 +1,6 @@
post_install() {
- id kvmd-webterm &>/dev/null || useradd -r -m -c "Pi-KVM Web Terminal (GoTTY)" -s /bin/bash kvmd-webterm
+ id kvmd-webterm &>/dev/null || useradd -r -m -c "Pi-KVM - Web terminal (ttyd)" -s /bin/bash kvmd-webterm
+ (groupmems -l -g kvmd-webterm | grep kvmd-nginx >/dev/null) || groupmems -g kvmd-webterm -a kvmd-nginx
}
post_remove() {
diff --git a/kvmd-webterm.service b/kvmd-webterm.service
index fbf54c57bdc7..8d5b8ed1503d 100644
--- a/kvmd-webterm.service
+++ b/kvmd-webterm.service
@@ -1,5 +1,5 @@
[Unit]
-Description=Pi-KVM Web Terminal (GoTTY)
+Description=Pi-KVM - Web terminal (ttyd)
After=network.target
[Service]
@@ -7,14 +7,10 @@ User=kvmd-webterm
Group=kvmd-webterm
WorkingDirectory=/home/kvmd-webterm
-Environment=TERM=xterm-256color
-ExecStart=/usr/bin/gotty \
- --title-format="Pi-KVM Terminal: {{ .hostname }} (GoTTY)" \
- --address=127.0.0.1 \
- --port=8090 \
+ExecStart=/usr/bin/ttyd \
+ --interface=/run/kvmd/ttyd.sock \
--index=/usr/share/kvmd/extras/webterm/index.html \
- --permit-write \
- /bin/bash -c 'cat /etc/motd; bash'
+ /bin/bash -c 'echo -ne "\033]0;Pi-KVM Terminal: `hostname -f` (ttyd)\007"; cat /etc/motd; bash'
[Install]
WantedBy=multi-user.target
diff --git a/manifest.yaml b/manifest.yaml
index 0816276cba6b..ee0d7e88d564 100644
--- a/manifest.yaml
+++ b/manifest.yaml
@@ -1,7 +1,7 @@
name: Terminal
description: Open terminal in a web browser
icon: extras/webterm/terminal.svg
-path: extras/webterm/gotty
+path: extras/webterm/ttyd
keyboard_cap: true
daemon: kvmd-webterm
place: 10
diff --git a/nginx.ctx-http.conf b/nginx.ctx-http.conf
index 3938e2ec2cdb..103e288ff5c0 100644
--- a/nginx.ctx-http.conf
+++ b/nginx.ctx-http.conf
@@ -1,3 +1,3 @@
-upstream gotty {
- server 127.0.0.1:8090 fail_timeout=0s max_fails=0;
+upstream ttyd {
+ server unix:/run/kvmd/ttyd.sock fail_timeout=0s max_fails=0;
}
diff --git a/nginx.ctx-server.conf b/nginx.ctx-server.conf
index 8ccd60930dd5..876a71925969 100644
--- a/nginx.ctx-server.conf
+++ b/nginx.ctx-server.conf
@@ -1,9 +1,9 @@
-location /extras/webterm/gotty {
+location /extras/webterm/ttyd {
rewrite ^([^.\?]*[^/(/ws)])$ $1/ permanent;
- rewrite ^/extras/webterm/gotty$ / break;
- rewrite ^/extras/webterm/gotty\?(.*)$ ?$1 break;
- rewrite ^/extras/webterm/gotty/(.*)$ /$1 break;
- proxy_pass http://gotty;
+ rewrite ^/extras/webterm/ttyd$ / break;
+ rewrite ^/extras/webterm/ttyd\?(.*)$ ?$1 break;
+ rewrite ^/extras/webterm/ttyd/(.*)$ /$1 break;
+ proxy_pass http://ttyd;
include /etc/kvmd/nginx/loc-proxy.conf;
include /etc/kvmd/nginx/loc-websocket.conf;
include /etc/kvmd/nginx/loc-login.conf;