summary refs log tree commit diff
path: root/synapse/app/homeserver.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-08-26 13:43:55 +0100
committerErik Johnston <erik@matrix.org>2014-08-26 13:43:55 +0100
commit1291ac93f3df76914bf01243b31255718c8688da (patch)
treecd310529b800207ac0e63a330368a9871e565598 /synapse/app/homeserver.py
parentAdd a do_users_share_a_room method and use that in the presence handler. (diff)
downloadsynapse-1291ac93f3df76914bf01243b31255718c8688da.tar.xz
Add the ability to turn on the twisted manhole telnet service.
Diffstat (limited to 'synapse/app/homeserver.py')
-rwxr-xr-xsynapse/app/homeserver.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 40e3561ee5..f210d26629 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -31,6 +31,7 @@ from synapse.api.urls import (
 )
 
 from daemonize import Daemonize
+import twisted.manhole.telnet
 
 import argparse
 import logging
@@ -238,6 +239,8 @@ def setup():
                         default="hs.pid")
     parser.add_argument("-W", "--webclient", dest="webclient", default=True,
                         action="store_false", help="Don't host a web client.")
+    parser.add_argument("--manhole", dest="manhole", type=int, default=None,
+                        help="Turn on the twisted telnet manhole service.")
     args = parser.parse_args()
 
     verbosity = int(args.verbose) if args.verbose else None
@@ -281,6 +284,13 @@ def setup():
 
     hs.build_db_pool()
 
+    if args.manhole:
+        f = twisted.manhole.telnet.ShellFactory()
+        f.username = "matrix"
+        f.password = "rabbithole"
+        f.namespace['hs'] = hs
+        reactor.listenTCP(args.manhole, f, interface='127.0.0.1')
+
     if args.daemonize:
         daemon = Daemonize(
             app="synapse-homeserver",