From 1d3b22a0b4b52eb1ebb4d500e8830e3566aa8f41 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 26 Jun 2016 17:40:18 -0700 Subject: [PATCH] server: hard-code --stats-file=stats.json We already hard-code 'relay.sqlite', so I don't see a lot of value in making making the stats file configurable too. That said, if it makes life easier for packagers (e.g. start-stop-daemon or systemd wanting these files to go into /var/run/something/ , and if it isn't sufficient to just use /var/run/something/ as the CWD), I'd accept a patch to add it back. --- src/wormhole/server/cli.py | 14 ++------------ src/wormhole/server/cmd_server.py | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/wormhole/server/cli.py b/src/wormhole/server/cli.py index ae99760..5398da7 100644 --- a/src/wormhole/server/cli.py +++ b/src/wormhole/server/cli.py @@ -48,13 +48,9 @@ def server(ctx): "--signal-error", is_flag=True, help="force all clients to fail with a message", ) -@click.option( - "--stats-file", default=None, type=type(u""), metavar="stats.json", - help="periodically write stats to a file for monitoring tools like Munin", -) @click.pass_obj def start(cfg, signal_error, no_daemon, blur_usage, advertise_version, - transit, rendezvous, stats_file): + transit, rendezvous): """ Start a relay server """ @@ -65,7 +61,6 @@ def start(cfg, signal_error, no_daemon, blur_usage, advertise_version, cfg.transit = str(transit) cfg.rendezvous = str(rendezvous) cfg.signal_error = signal_error - cfg.stats_file = stats_file start_server(cfg) @@ -98,13 +93,9 @@ def start(cfg, signal_error, no_daemon, blur_usage, advertise_version, "--signal-error", is_flag=True, help="force all clients to fail with a message", ) -@click.option( - "--stats-file", default=None, type=type(u""), metavar="stats.json", - help="periodically write stats to a file for monitoring tools like Munin", -) @click.pass_obj def restart(cfg, signal_error, no_daemon, blur_usage, advertise_version, - transit, rendezvous, stats_file): + transit, rendezvous): """ Re-start a relay server """ @@ -115,7 +106,6 @@ def restart(cfg, signal_error, no_daemon, blur_usage, advertise_version, cfg.transit = str(transit) cfg.rendezvous = str(rendezvous) cfg.signal_error = signal_error - cfg.stats_file = stats_file restart_server(cfg) diff --git a/src/wormhole/server/cmd_server.py b/src/wormhole/server/cmd_server.py index 19035c4..7abbf0f 100644 --- a/src/wormhole/server/cmd_server.py +++ b/src/wormhole/server/cmd_server.py @@ -15,7 +15,7 @@ class MyPlugin: self.args.advertise_version, "relay.sqlite", self.args.blur_usage, signal_error=self.args.signal_error, - stats_file=self.args.stats_file, + stats_file="stats.json", ) class MyTwistdConfig(twistd.ServerOptions):