Merge branch 'master' into new-proto
This commit is contained in:
commit
c5b174dd6a
|
@ -24,6 +24,8 @@ sp_start.add_argument("--transit", default="tcp:3001", metavar="tcp:PORT",
|
||||||
help="endpoint specification for the transit-relay port")
|
help="endpoint specification for the transit-relay port")
|
||||||
sp_start.add_argument("--advertise-version", metavar="VERSION",
|
sp_start.add_argument("--advertise-version", metavar="VERSION",
|
||||||
help="version to recommend to clients")
|
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,
|
sp_start.add_argument("--blur-usage", default=None, type=int,
|
||||||
metavar="SECONDS",
|
metavar="SECONDS",
|
||||||
help="round logged access times to improve privacy")
|
help="round logged access times to improve privacy")
|
||||||
|
@ -47,6 +49,8 @@ sp_restart.add_argument("--transit", default="tcp:3001", metavar="tcp:PORT",
|
||||||
help="endpoint specification for the transit-relay port")
|
help="endpoint specification for the transit-relay port")
|
||||||
sp_restart.add_argument("--advertise-version", metavar="VERSION",
|
sp_restart.add_argument("--advertise-version", metavar="VERSION",
|
||||||
help="version to recommend to clients")
|
help="version to recommend to clients")
|
||||||
|
sp_restart.add_argument("--signal-error", metavar="ERROR",
|
||||||
|
help="force all clients to fail with a message")
|
||||||
sp_restart.add_argument("--blur-usage", default=None, type=int,
|
sp_restart.add_argument("--blur-usage", default=None, type=int,
|
||||||
metavar="SECONDS",
|
metavar="SECONDS",
|
||||||
help="round logged access times to improve privacy")
|
help="round logged access times to improve privacy")
|
||||||
|
|
|
@ -13,7 +13,9 @@ class MyPlugin:
|
||||||
from .server import RelayServer
|
from .server import RelayServer
|
||||||
return RelayServer(self.args.rendezvous, self.args.transit,
|
return RelayServer(self.args.rendezvous, self.args.transit,
|
||||||
self.args.advertise_version,
|
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):
|
class MyTwistdConfig(twistd.ServerOptions):
|
||||||
subCommands = [("XYZ", None, usage.Options, "node")]
|
subCommands = [("XYZ", None, usage.Options, "node")]
|
||||||
|
|
|
@ -25,7 +25,8 @@ class PrivacyEnhancedSite(server.Site):
|
||||||
|
|
||||||
class RelayServer(service.MultiService):
|
class RelayServer(service.MultiService):
|
||||||
def __init__(self, rendezvous_web_port, transit_port,
|
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)
|
service.MultiService.__init__(self)
|
||||||
self._blur_usage = blur_usage
|
self._blur_usage = blur_usage
|
||||||
|
|
||||||
|
@ -41,6 +42,8 @@ class RelayServer(service.MultiService):
|
||||||
}
|
}
|
||||||
if advertise_version:
|
if advertise_version:
|
||||||
welcome["current_version"] = advertise_version
|
welcome["current_version"] = advertise_version
|
||||||
|
if signal_error:
|
||||||
|
welcome["error"] = signal_error
|
||||||
|
|
||||||
rendezvous = Rendezvous(db, welcome, blur_usage)
|
rendezvous = Rendezvous(db, welcome, blur_usage)
|
||||||
rendezvous.setServiceParent(self) # for the pruning timer
|
rendezvous.setServiceParent(self) # for the pruning timer
|
||||||
|
|
Loading…
Reference in New Issue
Block a user