// backend\server.go package main import ( "fmt" "net/http" "os" ) // --- main --- func main() { loadSettings() fixKeepRootFilesIntoModelSubdirs() postWorkQ.StartWorkers(1) startPostWorkStatusRefresher() go startGeneratedGarbageCollector() mux := http.NewServeMux() // ✅ AuthManager erstellen (Beispiel) // Du brauchst hier typischerweise: // - ein Secret/Key (Cookie signen / Sessions) // - Username+Pass Hash oder config // - optional 2FA store auth, err := NewAuthManager() if err != nil { fmt.Println("❌ auth init:", err) os.Exit(1) } store := registerRoutes(mux, auth) go startChaturbateOnlinePoller(store) go startChaturbateAutoStartWorker(store) go startMyFreeCamsAutoStartWorker(store) go startDiskSpaceGuard() if _, err := ensureCoversDir(); err != nil { fmt.Println("⚠️ covers dir:", err) } fmt.Println("🌐 HTTP-API aktiv: http://localhost:9999") handler := withCORS(mux) if err := http.ListenAndServe(":9999", handler); err != nil { fmt.Println("❌ HTTP-Server Fehler:", err) os.Exit(1) } }