diff options
Diffstat (limited to 'cmd/gotosocial/server.go')
-rw-r--r-- | cmd/gotosocial/server.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/gotosocial/server.go b/cmd/gotosocial/server.go index 80efc7486..da571ec3f 100644 --- a/cmd/gotosocial/server.go +++ b/cmd/gotosocial/server.go @@ -41,5 +41,19 @@ func serverCommands() *cobra.Command { } config.AddServerFlags(serverStartCmd) serverCmd.AddCommand(serverStartCmd) + + serverMaintenanceCmd := &cobra.Command{ + Use: "maintenance", + Short: "start the gotosocial server in maintenance mode (returns 503 for almost all requests)", + PreRunE: func(cmd *cobra.Command, args []string) error { + return preRun(preRunArgs{cmd: cmd}) + }, + RunE: func(cmd *cobra.Command, args []string) error { + return run(cmd.Context(), server.Maintenance) + }, + } + config.AddServerFlags(serverMaintenanceCmd) + serverCmd.AddCommand(serverMaintenanceCmd) + return serverCmd } |