cmd/mi: allow disabling POSSE

This commit is contained in:
Cadey Ratio 2020-01-12 00:36:49 +00:00
parent 1eb68e9caf
commit 9f0f1dbbc5
1 changed files with 12 additions and 6 deletions

View File

@ -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)
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,