[feature] Basic config validation (#562)

* add optional config validation

* clarify that host and protocol are required

* add validation for host and protocol

* pass prerunArgs as a struct (validate by default)
This commit is contained in:
tobi 2022-05-16 14:13:19 +02:00 committed by GitHub
commit b915a41811
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 180 additions and 15 deletions

View file

@ -36,7 +36,7 @@ func serverCommands() *cobra.Command {
Use: "start",
Short: "start the gotosocial server",
PreRunE: func(cmd *cobra.Command, args []string) error {
return preRun(cmd)
return preRun(preRunArgs{cmd: cmd})
},
RunE: func(cmd *cobra.Command, args []string) error {
return run(cmd.Context(), server.Start)