feat(web): add dockerized web UI with comic library browser
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.
This commit is contained in:
36
cli/serve.go
Normal file
36
cli/serve.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"yoink/web"
|
||||
)
|
||||
|
||||
var serveCmd = &cobra.Command{
|
||||
Use: "serve",
|
||||
Short: "Start the Yoink web UI",
|
||||
Args: cobra.NoArgs,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
library, ok := os.LookupEnv("YOINK_LIBRARY")
|
||||
if !ok {
|
||||
userHome, _ := os.UserHomeDir()
|
||||
library = filepath.Join(userHome, ".yoink")
|
||||
}
|
||||
|
||||
port, _ := cmd.Flags().GetString("port")
|
||||
addr := fmt.Sprintf(":%s", port)
|
||||
|
||||
if err := web.Listen(addr, library); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
serveCmd.Flags().StringP("port", "p", "8080", "Port to listen on")
|
||||
cli.AddCommand(serveCmd)
|
||||
}
|
||||
Reference in New Issue
Block a user