diff --git a/main.go b/main.go index e078b68..7a8784a 100644 --- a/main.go +++ b/main.go @@ -75,6 +75,7 @@ func main() { // Parse arguments parser := argparse.NewParser("lapisdeploy", "Easily deploy Lapis web applications through Gitea webhooks") config_path := parser.String("c", "config", &argparse.Options{Required: false, Help: "Configuration file", Default: "./config.json"}) + disable_matrix := parser.Flag("M", "disable-matrix", &argparse.Options{Required: false, Help: "Disable Matrix chat bot", Default: false}) if err := parser.Parse(os.Args); err != nil { // Parse arguments fmt.Print(parser.Usage(err)) // Show usage if there's an error return @@ -95,7 +96,11 @@ func main() { }) log.Printf("Starting Lapis Deploy on port %d...", configuration.port) - startAllSites() // Start all the servers - go initMatrix() // Start Matrix stuff in a goroutine + startAllSites() // Start all the servers + if !*disable_matrix { // Only start Matrix bot if --disable-matrix isn't passed + go initMatrix() // Start Matrix stuff in a goroutine + } else { + log.Print("Matrix bot is disabled!") + } log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", configuration.port), nil)) // Start HTTP server }