cmd/mi: allow disabling POSSE
This commit is contained in:
parent
1eb68e9caf
commit
9f0f1dbbc5
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue