summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevaev Maxim2018-11-18 02:42:38 +0300
committerDevaev Maxim2018-11-18 02:50:01 +0300
commitf39d9ca4c496a193d0aaee0f8d0f456d0067b92f (patch)
tree0fb38f4f0d8278177224385bbfe483ab9528df31
downloadaur-f39d9ca4c496a193d0aaee0f8d0f456d0067b92f.tar.gz
Update to 0.1-1
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD25
-rw-r--r--http-ctx.conf3
-rw-r--r--kvmd-webterm.install7
-rw-r--r--kvmd-webterm.service14
-rw-r--r--manifest.json8
-rw-r--r--server-ctx.conf13
-rw-r--r--terminal.svg74
8 files changed, 160 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..7de739d07550
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = kvmd-webterm
+ pkgdesc = Pi-KVM Web Terminal (GoTTY)
+ pkgver = 0.1
+ pkgrel = 1
+ url = https://github.com/pi-kvm/kvmd-webterm
+ install = kvmd-webterm.install
+ arch = any
+ license = GPL
+ makedepends = go
+ depends = kvmd
+ depends = gotty
+ source = https://github.com/pi-kvm/kvmd-webterm/archive/v0.1.tar.gz
+ md5sums = SKIP
+
+pkgname = kvmd-webterm
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..02349ee174fe
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,25 @@
+# Contributor: Maxim Devaev <mdevaev@gmail.com>
+# Author: Maxim Devaev <mdevaev@gmail.com>
+
+
+pkgname=kvmd-webterm
+pkgver=0.1
+pkgrel=1
+pkgdesc="Pi-KVM Web Terminal (GoTTY)"
+url="https://github.com/pi-kvm/kvmd-webterm"
+license=(GPL)
+arch=(any)
+depends=(kvmd gotty)
+makedepends=(go)
+source=("$url/archive/v$pkgver.tar.gz")
+md5sums=(SKIP)
+install=$pkgname.install
+
+
+package() {
+ install -Dm644 kvmd-webterm.service "$pkgdir/usr/lib/systemd/system/kvmd-webterm.service"
+ mkdir -p "$pkgdir/usr/share/kvmd/web/apps/webterm"
+ cp -r terminal.svg "$pkgdir/usr/share/kvmd/apps/webterm"
+ mkdir -p "$pkgdir/usr/share/kvmd/configs/nginx/apps/webterm"
+ cp -r http-ctx.conf server-ctx.conf manifest.json "$pkgdir/usr/share/kvmd/configs/nginx/apps/webterm"
+}
diff --git a/http-ctx.conf b/http-ctx.conf
new file mode 100644
index 000000000000..3938e2ec2cdb
--- /dev/null
+++ b/http-ctx.conf
@@ -0,0 +1,3 @@
+upstream gotty {
+ server 127.0.0.1:8090 fail_timeout=0s max_fails=0;
+}
diff --git a/kvmd-webterm.install b/kvmd-webterm.install
new file mode 100644
index 000000000000..b6f5b833e5d1
--- /dev/null
+++ b/kvmd-webterm.install
@@ -0,0 +1,7 @@
+post_install() {
+ id kvmd-webterm &>/dev/null || useradd -r -m -c "Pi-KVM Web Terminal (GoTTY)" -s /bin/bash kvmd-webterm
+}
+
+post_remove() {
+ userdel -r kvmd-webterm &>/dev/null
+}
diff --git a/kvmd-webterm.service b/kvmd-webterm.service
new file mode 100644
index 000000000000..d4cacfb8042d
--- /dev/null
+++ b/kvmd-webterm.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Pi-KVM Web Terminal (GoTTY)
+After=network.target
+
+[Service]
+User=kvmd-webterm
+Group=kvmd-webterm
+WorkingDirectory=/home/kvmd-webterm
+
+Environment=TERM=xterm-256color
+ExecStart=/usr/bin/gotty --title-format="GoTTY / {{ .hostname }}" --address=127.0.0.1 --port=8090 --permit-write /bin/bash
+
+[Install]
+WantedBy=multi-user.target
diff --git a/manifest.json b/manifest.json
new file mode 100644
index 000000000000..108705c9295b
--- /dev/null
+++ b/manifest.json
@@ -0,0 +1,8 @@
+{
+ "name": "Terminal",
+ "description": "Open Pi-KVM terminal in a web browser",
+ "icon": "/apps/webterm/terminal.svg",
+ "path": "/apps/webterm/gotty",
+ "place": 10,
+ "keyboard_cap": true
+}
diff --git a/server-ctx.conf b/server-ctx.conf
new file mode 100644
index 000000000000..436795c566e3
--- /dev/null
+++ b/server-ctx.conf
@@ -0,0 +1,13 @@
+location /apps/webterm/gotty {
+ rewrite ^([^.\?]*[^/(/ws)])$ $1/ permanent;
+ rewrite ^/apps/webterm/gotty$ / break;
+ rewrite ^/apps/webterm/gotty\?(.*)$ ?$1 break;
+ rewrite ^/apps/webterm/gotty/(.*)$ /$1 break;
+ proxy_pass http://gotty;
+ include /etc/nginx/proxy-params.conf;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+ proxy_connect_timeout 7d;
+ proxy_send_timeout 7d;
+ proxy_read_timeout 7d;
+}
diff --git a/terminal.svg b/terminal.svg
new file mode 100644
index 000000000000..9aeaec619807
--- /dev/null
+++ b/terminal.svg
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 31.586 31.586" style="enable-background:new 0 0 31.586 31.586;" xml:space="preserve">
+<g>
+ <path d="M29.331,2.256H2.259C1.01,2.256,0,3.265,0,4.511v22.565c0,1.244,1.01,2.255,2.259,2.255h27.072
+ c1.242,0,2.255-1.011,2.255-2.255V4.511C31.586,3.265,30.573,2.256,29.331,2.256z M10.788,3.95c0.623,0,1.126,0.502,1.126,1.128
+ c0,0.623-0.503,1.125-1.126,1.125S9.659,5.701,9.659,5.078C9.659,4.452,10.165,3.95,10.788,3.95z M7.334,3.95
+ c0.623,0,1.129,0.502,1.129,1.128c0,0.623-0.506,1.125-1.129,1.125c-0.625,0-1.131-0.503-1.131-1.125
+ C6.203,4.452,6.709,3.95,7.334,3.95z M3.947,3.95c0.623,0,1.129,0.502,1.129,1.128c0,0.623-0.506,1.125-1.129,1.125
+ c-0.621,0-1.126-0.503-1.126-1.125C2.821,4.452,3.326,3.95,3.947,3.95z M29.331,27.076H2.259V7.922h27.072
+ C29.331,7.922,29.331,27.076,29.331,27.076z M29.331,5.665H13.536V4.537h15.795C29.331,4.537,29.331,5.665,29.331,5.665z"/>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+ <g>
+ </g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+<g>
+</g>
+</svg>