From 7e17dcfef1ae802e940eb0d4ba7b24860d986c45 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 13 Nov 2017 12:07:38 -0800 Subject: [PATCH] more Transit-removal changes --- MANIFEST.in | 2 -- docs/welcome.md | 2 ++ misc/munin/wormhole_active | 9 -------- misc/munin/wormhole_errors | 5 ----- misc/munin/wormhole_transit | 33 ----------------------------- misc/munin/wormhole_transit_alltime | 33 ----------------------------- 6 files changed, 2 insertions(+), 82 deletions(-) delete mode 100755 misc/munin/wormhole_transit delete mode 100644 misc/munin/wormhole_transit_alltime diff --git a/MANIFEST.in b/MANIFEST.in index e6cd1b9..c42f3c6 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -11,5 +11,3 @@ include misc/munin/wormhole_errors include misc/munin/wormhole_event_rate include misc/munin/wormhole_events include misc/munin/wormhole_events_alltime -include misc/munin/wormhole_transit -include misc/munin/wormhole_transit_alltime diff --git a/docs/welcome.md b/docs/welcome.md index abedf7c..65d74da 100644 --- a/docs/welcome.md +++ b/docs/welcome.md @@ -184,6 +184,8 @@ addresses of each client with the other (inside the encrypted message), and both clients first attempt to connect directly. If this fails, they fall back to using the transit relay. As before, the host/port of a public server is baked into the library, and should be sufficient to handle moderate traffic. +Code for the Transit Relay is provided a separate package named +`magic-wormhole-transit-relay`. The protocol includes provisions to deliver notices and error messages to clients: if either relay must be shut down, these channels will be used to diff --git a/misc/munin/wormhole_active b/misc/munin/wormhole_active index a9d1db7..132ce86 100755 --- a/misc/munin/wormhole_active +++ b/misc/munin/wormhole_active @@ -22,12 +22,6 @@ mailboxes.type GAUGE messages.label Messages messages.draw LINE1 messages.type GAUGE -transit_waiting.label Transit Waiting -transit_waiting.draw LINE1 -transit_waiting.type GAUGE -transit_connected.label Transit Connected -transit_connected.draw LINE1 -transit_connected.type GAUGE """ if len(sys.argv) > 1 and sys.argv[1] == "config": @@ -45,6 +39,3 @@ ra = data["rendezvous"]["active"] print "nameplates.value", ra["nameplates_total"] print "mailboxes.value", ra["mailboxes_total"] print "messages.value", ra["messages_total"] -ta = data["transit"]["active"] -print "transit_waiting.value", ta["waiting"] -print "transit_connected.value", ta["connected"] diff --git a/misc/munin/wormhole_errors b/misc/munin/wormhole_errors index 5ad312f..d3f4a86 100755 --- a/misc/munin/wormhole_errors +++ b/misc/munin/wormhole_errors @@ -22,9 +22,6 @@ mailboxes.type GAUGE mailboxes_scary.label Mailboxes (scary) mailboxes_scary.draw LINE1 mailboxes_scary.type GAUGE -transit.label Transit -transit.draw LINE1 -transit.type GAUGE """ if len(sys.argv) > 1 and sys.argv[1] == "config": @@ -44,5 +41,3 @@ print "nameplates.value", (r["nameplates_total"] print "mailboxes.value", (r["mailboxes_total"] - r["mailbox_moods"].get("happy", 0)) print "mailboxes_scary.value", r["mailbox_moods"].get("scary", 0) -t = data["transit"]["since_reboot"] -print "transit.value", (t["total"] - t["moods"].get("happy", 0)) diff --git a/misc/munin/wormhole_transit b/misc/munin/wormhole_transit deleted file mode 100755 index e7ba14f..0000000 --- a/misc/munin/wormhole_transit +++ /dev/null @@ -1,33 +0,0 @@ -#! /usr/bin/env python - -""" -Use the following in /etc/munin/plugin-conf.d/wormhole : - -[wormhole_*] -env.serverdir /path/to/your/wormhole/server -""" - -import os, sys, time, json - -CONFIG = """\ -graph_title Magic-Wormhole Transit Usage (since reboot) -graph_vlabel Bytes Since Reboot -graph_category network -bytes.label Transit Bytes -bytes.draw LINE1 -bytes.type GAUGE -""" - -if len(sys.argv) > 1 and sys.argv[1] == "config": - print CONFIG.rstrip() - sys.exit(0) - -serverdir = os.environ["serverdir"] -fn = os.path.join(serverdir, "stats.json") -with open(fn) as f: - data = json.load(f) -if time.time() > data["valid_until"]: - sys.exit(1) # expired - -t = data["transit"]["since_reboot"] -print "bytes.value", t["bytes"] diff --git a/misc/munin/wormhole_transit_alltime b/misc/munin/wormhole_transit_alltime deleted file mode 100644 index 459116b..0000000 --- a/misc/munin/wormhole_transit_alltime +++ /dev/null @@ -1,33 +0,0 @@ -#! /usr/bin/env python - -""" -Use the following in /etc/munin/plugin-conf.d/wormhole : - -[wormhole_*] -env.serverdir /path/to/your/wormhole/server -""" - -import os, sys, time, json - -CONFIG = """\ -graph_title Magic-Wormhole Transit Usage (all time) -graph_vlabel Bytes Since DB Creation -graph_category network -bytes.label Transit Bytes -bytes.draw LINE1 -bytes.type GAUGE -""" - -if len(sys.argv) > 1 and sys.argv[1] == "config": - print CONFIG.rstrip() - sys.exit(0) - -serverdir = os.environ["serverdir"] -fn = os.path.join(serverdir, "stats.json") -with open(fn) as f: - data = json.load(f) -if time.time() > data["valid_until"]: - sys.exit(1) # expired - -t = data["transit"]["all_time"] -print "bytes.value", t["bytes"]