cmd/mi: allow disabling POSSE
This commit is contained in:
parent
1eb68e9caf
commit
9f0f1dbbc5
|
@ -33,6 +33,9 @@ var (
|
||||||
// Port
|
// Port
|
||||||
port = flag.String("port", "5000", "HTTP port")
|
port = flag.String("port", "5000", "HTTP port")
|
||||||
domain = flag.String("domain", "mi.within.website", "domain this is being served on")
|
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() {
|
func main() {
|
||||||
|
@ -86,10 +89,6 @@ func main() {
|
||||||
mux: mux,
|
mux: mux,
|
||||||
}
|
}
|
||||||
mi.RegisterRoutes()
|
mi.RegisterRoutes()
|
||||||
mi.RegisterPusher(mi.PushDiscordWebhook)
|
|
||||||
mi.RegisterPusher(mi.PushReddit)
|
|
||||||
mi.RegisterPusher(mi.PushMastodon)
|
|
||||||
mi.RegisterPusher(mi.PushTwitter)
|
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(ctx)
|
ctx, cancel := context.WithCancel(ctx)
|
||||||
go func(cf func()) {
|
go func(cf func()) {
|
||||||
|
@ -103,8 +102,15 @@ func main() {
|
||||||
|
|
||||||
go mi.StreamMastodon(ctx)
|
go mi.StreamMastodon(ctx)
|
||||||
go mi.StreamReddit(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{
|
h := &http.Server{
|
||||||
Addr: ":" + *port,
|
Addr: ":" + *port,
|
||||||
|
|
Loading…
Reference in New Issue