relay pull-hosts command (for public bootstrapping) (#1047)
This helper command queries an existing relay instance for known hosts,
and adds them to the local instance (if they aren't already). The
intention is to make bootstrapping a new full-network relay easier (eg,
avoid wrangling bash script pipelines and admin API requests).
It does some filtering and checks to try and skip inactive/stale hosts:
only "active" (or "idle") hosts which have seen at least one event
remotely (aka, `seq` is positive), and does an (optional) HTTP request
to `describeServer` on the host to check it is live.
This command should only be run if the overall relay isn't already
running as a daemon. It is safe to run it multiple times, or after the
relay has been running for some time.
(this code is pretty off-the-cuff; I've run it a few times to test, and
it isn't critical to our prod use, but could definitely use eyes)
authored by
bnewbold.net
and committed by