webui

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package webui serves the Panelarr web app next to the API, following the web app's embedding contract: files at the root, a single-page fallback to index.html (never for API, feed, asset or probe paths), long caching for content-hashed assets, and the app's security headers.

Index

Constants

View Source
const (
	ContentSecurityPolicy = "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; " +
		"img-src 'self' data: blob:; font-src 'self'; connect-src 'self'; manifest-src 'self'; " +
		"worker-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'"
)

Security headers sent with every app response. They must match the web app's csp.config.mjs: its tests fail on any violation of this policy.

Variables

This section is empty.

Functions

func Files

func Files(dir string) (fs.FS, error)

Files returns the app's files: dir when set (a local build, for development), else the build embedded in the binary.

func Handler

func Handler(files fs.FS) http.Handler

Handler serves the app. Mount it as the router's last resort.

func IsPlaceholder

func IsPlaceholder(files fs.FS) bool

IsPlaceholder reports whether files are the placeholder page, not a web app build.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL