aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/clef/docs/qubes/qubes-client.py
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2018-05-02 18:31:05 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-05-02 18:31:05 +0800
commit5d4d79ae2672b295a539cf3ce0163b2cb10eb2b2 (patch)
treed56b5e8aa13a14d27aa3ce52b8f59cff304927ea /cmd/clef/docs/qubes/qubes-client.py
parent6a01363d1ddb15fa79817c425de472066e72a094 (diff)
downloaddexon-5d4d79ae2672b295a539cf3ce0163b2cb10eb2b2.tar
dexon-5d4d79ae2672b295a539cf3ce0163b2cb10eb2b2.tar.gz
dexon-5d4d79ae2672b295a539cf3ce0163b2cb10eb2b2.tar.bz2
dexon-5d4d79ae2672b295a539cf3ce0163b2cb10eb2b2.tar.lz
dexon-5d4d79ae2672b295a539cf3ce0163b2cb10eb2b2.tar.xz
dexon-5d4d79ae2672b295a539cf3ce0163b2cb10eb2b2.tar.zst
dexon-5d4d79ae2672b295a539cf3ce0163b2cb10eb2b2.zip
cmd/clef: documentation about setup (#16568)
clef: documentation about setup
Diffstat (limited to 'cmd/clef/docs/qubes/qubes-client.py')
-rw-r--r--cmd/clef/docs/qubes/qubes-client.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/cmd/clef/docs/qubes/qubes-client.py b/cmd/clef/docs/qubes/qubes-client.py
new file mode 100644
index 000000000..93a74b899
--- /dev/null
+++ b/cmd/clef/docs/qubes/qubes-client.py
@@ -0,0 +1,23 @@
+"""
+This implements a dispatcher which listens to localhost:8550, and proxies
+requests via qrexec to the service qubes.EthSign on a target domain
+"""
+
+import http.server
+import socketserver,subprocess
+
+PORT=8550
+TARGET_DOMAIN= 'debian-work'
+
+class Dispatcher(http.server.BaseHTTPRequestHandler):
+ def do_POST(self):
+ post_data = self.rfile.read(int(self.headers['Content-Length']))
+ p = subprocess.Popen(['/usr/bin/qrexec-client-vm',TARGET_DOMAIN,'qubes.Clefsign'],stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+ output = p.communicate(post_data)[0]
+ self.wfile.write(output)
+
+
+with socketserver.TCPServer(("",PORT), Dispatcher) as httpd:
+ print("Serving at port", PORT)
+ httpd.serve_forever()
+