Some checks are pending
Go / build-and-release (push) Waiting to run
Add runtime-customizable branding allowing relay operators to fully customize UI appearance without rebuilding: - Custom logo, favicon, and PWA icons - Full CSS override capability (colors, themes, components) - Custom app name, title, and NIP-11 relay info - init-branding command with --style generic|orly options - Transparent PNG generation for generic branding New files: - app/branding/ package (branding.go, init.go, types.go) - docs/BRANDING_GUIDE.md Environment variables: - ORLY_BRANDING_DIR: branding directory path - ORLY_BRANDING_ENABLED: enable/disable custom branding Usage: ./orly init-branding --style generic Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
32 lines
782 B
Go
32 lines
782 B
Go
package app
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed web/dist
|
|
var reactAppFS embed.FS
|
|
|
|
// GetReactAppFS returns a http.FileSystem from the embedded React app
|
|
func GetReactAppFS() http.FileSystem {
|
|
webDist, err := fs.Sub(reactAppFS, "web/dist")
|
|
if err != nil {
|
|
panic("Failed to load embedded web app: " + err.Error())
|
|
}
|
|
return http.FS(webDist)
|
|
}
|
|
|
|
// ServeEmbeddedWeb serves the embedded web application
|
|
func ServeEmbeddedWeb(w http.ResponseWriter, r *http.Request) {
|
|
// Serve the embedded web app
|
|
http.FileServer(GetReactAppFS()).ServeHTTP(w, r)
|
|
}
|
|
|
|
// GetEmbeddedWebFS returns the raw embedded filesystem for branding initialization.
|
|
// This is used by the init-branding command to extract default assets.
|
|
func GetEmbeddedWebFS() embed.FS {
|
|
return reactAppFS
|
|
}
|