Compare commits

...

2 Commits

Author SHA1 Message Date
96276f2fc4 putting a proper favicon in 2025-10-10 10:25:50 +01:00
14a94feed6 add favicon 2025-10-10 09:44:25 +01:00
4 changed files with 24 additions and 1 deletions

View File

@@ -179,6 +179,9 @@ func (s *Server) UserInterface() {
s.challengeMutex.Unlock() s.challengeMutex.Unlock()
} }
// Serve favicon.ico by serving orly.png
s.mux.HandleFunc("/favicon.ico", s.handleFavicon)
// Serve the main login interface (and static assets) or proxy in dev mode // Serve the main login interface (and static assets) or proxy in dev mode
s.mux.HandleFunc("/", s.handleLoginInterface) s.mux.HandleFunc("/", s.handleLoginInterface)
@@ -203,6 +206,26 @@ func (s *Server) UserInterface() {
s.mux.HandleFunc("/api/sprocket/config", s.handleSprocketConfig) s.mux.HandleFunc("/api/sprocket/config", s.handleSprocketConfig)
} }
// handleFavicon serves orly.png as favicon.ico
func (s *Server) handleFavicon(w http.ResponseWriter, r *http.Request) {
// In dev mode with proxy configured, forward to dev server
if s.devProxy != nil {
s.devProxy.ServeHTTP(w, r)
return
}
// Serve orly.png as favicon.ico from embedded web app
w.Header().Set("Content-Type", "image/png")
w.Header().Set("Cache-Control", "public, max-age=86400") // Cache for 1 day
// Create a request for orly.png and serve it
faviconReq := &http.Request{
Method: "GET",
URL: &url.URL{Path: "/orly.png"},
}
ServeEmbeddedWeb(w, faviconReq)
}
// handleLoginInterface serves the main user interface for login // handleLoginInterface serves the main user interface for login
func (s *Server) handleLoginInterface(w http.ResponseWriter, r *http.Request) { func (s *Server) handleLoginInterface(w http.ResponseWriter, r *http.Request) {
// In dev mode with proxy configured, forward to dev server // In dev mode with proxy configured, forward to dev server

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 514 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 KiB

View File

@@ -1 +1 @@
v0.13.1 v0.13.2