diff --git a/src/wormhole/server/cli_args.py b/src/wormhole/server/cli_args.py index 4bc87e1..f6b32b5 100644 --- a/src/wormhole/server/cli_args.py +++ b/src/wormhole/server/cli_args.py @@ -24,6 +24,8 @@ sp_start.add_argument("--transit", default="tcp:3001", metavar="tcp:PORT", help="endpoint specification for the transit-relay port") sp_start.add_argument("--advertise-version", metavar="VERSION", help="version to recommend to clients") +sp_start.add_argument("--signal-error", metavar="ERROR", + help="force all clients to fail with a message") sp_start.add_argument("--blur-usage", default=None, type=int, metavar="SECONDS", help="round logged access times to improve privacy") diff --git a/src/wormhole/server/cmd_server.py b/src/wormhole/server/cmd_server.py index 938d451..02e6c66 100644 --- a/src/wormhole/server/cmd_server.py +++ b/src/wormhole/server/cmd_server.py @@ -13,7 +13,9 @@ class MyPlugin: from .server import RelayServer return RelayServer(self.args.rendezvous, self.args.transit, self.args.advertise_version, - "relay.sqlite", self.args.blur_usage) + "relay.sqlite", self.args.blur_usage, + signal_error=self.args.signal_error, + ) class MyTwistdConfig(twistd.ServerOptions): subCommands = [("XYZ", None, usage.Options, "node")] diff --git a/src/wormhole/server/server.py b/src/wormhole/server/server.py index 166a6ba..e182e1d 100644 --- a/src/wormhole/server/server.py +++ b/src/wormhole/server/server.py @@ -26,7 +26,8 @@ class PrivacyEnhancedSite(server.Site): class RelayServer(service.MultiService): def __init__(self, rendezvous_web_port, transit_port, - advertise_version, db_url=":memory:", blur_usage=None): + advertise_version, db_url=":memory:", blur_usage=None, + signal_error=None): service.MultiService.__init__(self) self._blur_usage = blur_usage @@ -42,6 +43,8 @@ class RelayServer(service.MultiService): } if advertise_version: welcome["current_version"] = advertise_version + if signal_error: + welcome["error"] = signal_error rendezvous = Rendezvous(db, welcome, blur_usage) rendezvous.setServiceParent(self) # for the pruning timer