ui

package
v0.7.19 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ui serves memini's embedded single-page admin UI (Preact + Vite). dist/ is a build artifact (gitignored; only .gitkeep is tracked) embedded at compile time. The Docker image builds it; locally use `mise run ui`. Without it the binary still boots and serves a placeholder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler added in v0.5.10

func Handler() (http.Handler, error)

Handler returns the SPA handler that Mount installs as a catch-all. It is exposed so the server can serve the shell on a dedicated listener (see MEMINI_UI_ADDR) instead of the main API port. The shell is token-free either way; the dedicated listener also serves /v1 so the same-origin SPA can reach the API it authenticates against.

func Mount

func Mount(r chi.Router) error

Mount serves the SPA at / on r. Requests for real built assets are served from the embedded filesystem; everything else falls back to index.html so client-side routing works on deep links and reloads.

The shell is intentionally public (no bearer auth) and carries no credential of its own: it never contains MEMINI_API_KEY. The SPA authenticates in-app — the operator signs in once at the Login gate, the token is verified against GET /v1/self and persisted in the browser's localStorage, and every /v1 call carries it as a bearer. Serving the shell to an anonymous GET / therefore leaks nothing; the API it calls still enforces the token when MEMINI_API_KEY is set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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