From 9f0f1dbbc5896ca84baa36f4b42b67ab27fca94b Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sun, 12 Jan 2020 00:36:49 +0000 Subject: [PATCH] cmd/mi: allow disabling POSSE --- cmd/mi/main.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cmd/mi/main.go b/cmd/mi/main.go index 6987c2f..d9add87 100644 --- a/cmd/mi/main.go +++ b/cmd/mi/main.go @@ -33,6 +33,9 @@ var ( // Port port = flag.String("port", "5000", "HTTP port") domain = flag.String("domain", "mi.within.website", "domain this is being served on") + + // meta + noPush = flag.Bool("no-push", false, "if set, don't push content") ) func main() { @@ -86,10 +89,6 @@ func main() { mux: mux, } mi.RegisterRoutes() - mi.RegisterPusher(mi.PushDiscordWebhook) - mi.RegisterPusher(mi.PushReddit) - mi.RegisterPusher(mi.PushMastodon) - mi.RegisterPusher(mi.PushTwitter) ctx, cancel := context.WithCancel(ctx) go func(cf func()) { @@ -103,8 +102,15 @@ func main() { go mi.StreamMastodon(ctx) go mi.StreamReddit(ctx) - go mi.StreamMastodonToTwitter(ctx) - go mi.BlogPOSSE(ctx) + + if !*noPush { + mi.RegisterPusher(mi.PushDiscordWebhook) + mi.RegisterPusher(mi.PushReddit) + mi.RegisterPusher(mi.PushMastodon) + mi.RegisterPusher(mi.PushTwitter) + go mi.StreamMastodonToTwitter(ctx) + go mi.BlogPOSSE(ctx) + } h := &http.Server{ Addr: ":" + *port,