summary refs log tree commit diff
path: root/synapse/util/manhole.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2016-04-26 10:35:51 +0100
committerMark Haines <mjark@negativecurvature.net>2016-04-26 10:35:51 +0100
commit9843f2a657333efbafd837fb18ff50c286c24224 (patch)
tree2b1b45e5aa2bc4739875925a8e8da6739abdfae7 /synapse/util/manhole.py
parentMerge pull request #749 from matrix-org/markjh/split_manhole (diff)
parentRemove the uncomments from the comments (diff)
downloadsynapse-9843f2a657333efbafd837fb18ff50c286c24224.tar.xz
Merge pull request #751 from matrix-org/markjh/pusher_metrics_manhole
Add a metrics listener and a ssh listener to the pusher
Diffstat (limited to 'synapse/util/manhole.py')
-rw-r--r--synapse/util/manhole.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/synapse/util/manhole.py b/synapse/util/manhole.py
index 9b106cdf47..97e0f00b67 100644
--- a/synapse/util/manhole.py
+++ b/synapse/util/manhole.py
@@ -16,6 +16,26 @@ from twisted.conch.manhole import ColoredManhole
 from twisted.conch.insults import insults
 from twisted.conch import manhole_ssh
 from twisted.cred import checkers, portal
+from twisted.conch.ssh.keys import Key
+
+PUBLIC_KEY = (
+    "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAGEArzJx8OYOnJmzf4tfBEvLi8DVPrJ3/c9k2I/Az"
+    "64fxjHf9imyRJbixtQhlH9lfNjUIx+4LmrJH5QNRsFporcHDKOTwTTYLh5KmRpslkYHRivcJS"
+    "kbh/C+BR3utDS555mV"
+)
+
+PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY-----
+MIIByAIBAAJhAK8ycfDmDpyZs3+LXwRLy4vA1T6yd/3PZNiPwM+uH8Yx3/YpskSW
+4sbUIZR/ZXzY1CMfuC5qyR+UDUbBaaK3Bwyjk8E02C4eSpkabJZGB0Yr3CUpG4fw
+vgUd7rQ0ueeZlQIBIwJgbh+1VZfr7WftK5lu7MHtqE1S1vPWZQYE3+VUn8yJADyb
+Z4fsZaCrzW9lkIqXkE3GIY+ojdhZhkO1gbG0118sIgphwSWKRxK0mvh6ERxKqIt1
+xJEJO74EykXZV4oNJ8sjAjEA3J9r2ZghVhGN6V8DnQrTk24Td0E8hU8AcP0FVP+8
+PQm/g/aXf2QQkQT+omdHVEJrAjEAy0pL0EBH6EVS98evDCBtQw22OZT52qXlAwZ2
+gyTriKFVoqjeEjt3SZKKqXHSApP/AjBLpF99zcJJZRq2abgYlf9lv1chkrWqDHUu
+DZttmYJeEfiFBBavVYIF1dOlZT0G8jMCMBc7sOSZodFnAiryP+Qg9otSBjJ3bQML
+pSTqy7c3a2AScC/YyOwkDaICHnnD3XyjMwIxALRzl0tQEKMXs6hH8ToUdlLROCrP
+EhQ0wahUTCk1gKA4uPD6TMTChavbh4K63OvbKg==
+-----END RSA PRIVATE KEY-----"""
 
 
 def manhole(username, password, globals):
@@ -43,4 +63,8 @@ def manhole(username, password, globals):
         dict(globals, __name__="__console__")
     )
 
-    return manhole_ssh.ConchFactory(portal.Portal(rlm, [checker]))
+    factory = manhole_ssh.ConchFactory(portal.Portal(rlm, [checker]))
+    factory.publicKeys['ssh-rsa'] = Key.fromString(PUBLIC_KEY)
+    factory.privateKeys['ssh-rsa'] = Key.fromString(PRIVATE_KEY)
+
+    return factory