Adds a `yoink serve` command that starts an HTTP server with a Sonarr/MeTube-inspired dark UI. Features a URL input bar for triggering downloads, a 150x300 cover grid with filter and sort controls, a live download queue strip, and toast notifications. Includes Dockerfile (multi-stage, distroless runtime) and docker-compose.yml for easy deployment.
29 lines
631 B
Go
29 lines
631 B
Go
package cli
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var healthcheckCmd = &cobra.Command{
|
|
Use: "healthcheck",
|
|
Short: "Check if the web server is running (used by Docker HEALTHCHECK)",
|
|
Args: cobra.NoArgs,
|
|
Hidden: true,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
port, _ := cmd.Flags().GetString("port")
|
|
resp, err := http.Get(fmt.Sprintf("http://localhost:%s/health", port))
|
|
if err != nil || resp.StatusCode != http.StatusOK {
|
|
os.Exit(1)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
healthcheckCmd.Flags().StringP("port", "p", "8080", "Port the server is listening on")
|
|
cli.AddCommand(healthcheckCmd)
|
|
}
|