⛳ alerts for any ctfd instance via ntfy

chore: move command over to serve subpath

dunkirk.sh 91a58498 5eaba51a

verified
Changed files
+5 -6
cmd
serve
+3 -4
cmd/server/server.go cmd/serve/serve.go
···
-
package server
import (
"encoding/json"
···
return nil
}
-
// ServerCmd represents the server command
-
var ServerCmd = &cobra.Command{
-
Use: "server",
Short: "Run monitoring server",
Long: "Continuously monitors CTFd for leaderboard changes and new challenges, sending alerts when events occur",
Run: runServer,
···
+
package serve
import (
"encoding/json"
···
return nil
}
+
var ServeCmd = &cobra.Command{
+
Use: "serve",
Short: "Run monitoring server",
Long: "Continuously monitors CTFd for leaderboard changes and new challenges, sending alerts when events occur",
Run: runServer,
+2 -2
main.go
···
"github.com/charmbracelet/fang"
"github.com/spf13/cobra"
"github.com/taciturnaxolotl/ctfd-alerts/clients"
-
"github.com/taciturnaxolotl/ctfd-alerts/cmd/server"
"github.com/taciturnaxolotl/ctfd-alerts/cmd/status"
)
···
// Add commands
cmd.AddCommand(status.StatusCmd)
-
cmd.AddCommand(server.ServerCmd)
}
func main() {
···
"github.com/charmbracelet/fang"
"github.com/spf13/cobra"
"github.com/taciturnaxolotl/ctfd-alerts/clients"
+
"github.com/taciturnaxolotl/ctfd-alerts/cmd/serve"
"github.com/taciturnaxolotl/ctfd-alerts/cmd/status"
)
···
// Add commands
cmd.AddCommand(status.StatusCmd)
+
cmd.AddCommand(serve.ServeCmd)
}
func main() {