cmdweb

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Overview

Package cmdweb implements the "web" subcommand.

Index

Constants

This section is empty.

Variables

View Source
var Command = &command.C{
	Name:     "web",
	Help:     "Run a server for the keyfish web app.",
	SetFlags: command.Flags(flax.MustBind, &serverFlags),
	Run:      command.Adapt(runServer),
}

Functions

This section is empty.

Types

type UI

type UI struct {

	// Store returns the active instance of the store to serve.
	Store func() *kfdb.Store

	// Static is the filesystem containing static file assets.
	Static fs.FS

	// Templates are the compiled UI templates.
	Templates *template.Template

	// LockPIN, if non-empty, is the PIN used to unlock a locked UI.
	LockPIN string

	// Locked, if true, is whether the UI is (currently) locked.
	Locked bool

	// LockTimeout is the duration after unlocking the UI before it will be
	// automatically locked. If zero, the UI will not auto-lock.
	LockTimeout time.Duration

	// Expert, if true, enables expert settings.
	Expert bool
	// contains filtered or unexported fields
}

UI implements the HTTP endpoints for the Keyfish web UI.

func (*UI) ServeMux

func (s *UI) ServeMux() http.Handler

ServeMux returns a router for the UI endpoints:

GET /static/  -- serve static assets
GET /         -- serve the main UI page
GET /search   -- serve search results (partial)
GET /view     -- serve a single record view (partial)
GET /detail   -- serve a single record detail (partial)
GET /password -- serve a single record password (partial)
GET /totp     -- serve a single record TOTP code (partial)
GET /unlock   -- request an unlock of the UI

Jump to

Keyboard shortcuts

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