b394a6d5d9
- Kamon logo (crest ring around the ghost) as favicon.svg, 180 px apple-touch-icon.png and the brand lockup in sidebar and login page, with the katakana reading ゴーストワイヤー - /favicon.ico redirects to /favicon.svg - Client configs no longer set an MTU; each device picks its own, as pivpn does. Server MTU changes no longer require reissued configs. - Fix "null" rendered on the dashboard, wrapping activity times, and show log lines as readable text instead of raw JSON Claude-Session: https://claude.ai/code/session_01RAnLbyQZ5ZTA7KqwXP98nw
29 lines
773 B
Go
29 lines
773 B
Go
package main
|
|
|
|
import (
|
|
"embed"
|
|
"net/http"
|
|
)
|
|
|
|
// The web UI and its icons are built into the binary. The UI talks only to
|
|
// /api/v1, the same API the iOS app uses.
|
|
//
|
|
//go:embed index.html app.js app.css favicon.svg apple-touch-icon.png
|
|
var webFiles embed.FS
|
|
|
|
func webHandler() http.Handler {
|
|
files := http.FileServerFS(webFiles)
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
switch r.URL.Path {
|
|
case "/", "/app.js", "/app.css", "/favicon.svg", "/apple-touch-icon.png":
|
|
w.Header().Set("Cache-Control", "no-cache")
|
|
files.ServeHTTP(w, r)
|
|
case "/favicon.ico":
|
|
// Browsers ask for this by default; point them to the SVG.
|
|
http.Redirect(w, r, "/favicon.svg", http.StatusMovedPermanently)
|
|
default:
|
|
http.NotFound(w, r)
|
|
}
|
|
})
|
|
}
|