web

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 85 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package web is the `authama serve` command's localhost web UI.

Server-rendered html/template pages over the same services the CLI calls, with a little vanilla JavaScript and Tabler's CSS, all embedded in the binary: the page makes no network request beyond this server. It never imports internal/cli, which holds process-wide state a long-lived server cannot share (imports_test.go holds it to that).

Reading takes no lock. A change takes it only while it is checked and made (see services/change), never while a person reads its preview, so a running server does not hold up a CLI command.

Index

Constants

View Source
const (
	ExportFlat    = "ssh_config"
	ExportTermius = "termius-hosts.csv"
)

Exports a page can download. Each is rendered as `authama ssh config export --flat` and `authama export hosts --format termius` render it, and none is written anywhere.

View Source
const (
	LinkLifetime = 10 * time.Minute
	SessionIdle  = 8 * time.Hour
	SessionMax   = 24 * time.Hour
)

A sign-in link works once, and only for LinkLifetime after it was made: the address `authama serve` prints, or one it asks the running server for later. A session ends after SessionIdle without a request, or SessionMax after it began, whichever comes first. The owner chose these on 2026-11-13 ("review and fix"); before, a link signed in any number of browsers for as long as the server ran, and a session never ended.

View Source
const APIPrefix = "/api/v1"

APIPrefix is where the read API is served, when api.enabled is on.

View Source
const ContentSecurityPolicy = "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; " +
	"connect-src 'self'; font-src 'self'; form-action 'self'; frame-ancestors 'none'; base-uri 'none'"

ContentSecurityPolicy is sent on every response. Everything is same-origin; nothing is inline. img-src allows data: because Tabler's CSS draws its checkboxes and selects with data: SVG URLs.

View Source
const ControlHeader = "X-Authama-Control"

ControlHeader carries the control key on a request for a new sign-in link.

View Source
const DefaultPort = 7822

DefaultPort is where serve listens unless told otherwise.

View Source
const DefaultPortAttempts = 20

DefaultPortAttempts bounds how far past a taken default port Listen looks.

View Source
const LinkPath = "/auth/link"

LinkPath is where `authama serve` asks a running server for a new link.

View Source
const MaxBodyBytes = 1 << 20

MaxBodyBytes is the largest request body the server reads.

View Source
const MaxSelection = 16 << 10

MaxSelection caps the encoded selection a URL may carry.

View Source
const PermissionsPolicy = "camera=(), microphone=(), geolocation=(), usb=(), serial=(), bluetooth=(), payment=(), clipboard-read=(), display-capture=()"

PermissionsPolicy turns off every device API for these pages.

View Source
const PreviewRows = 25

PreviewRows is how many rows a CSV preview shows.

View Source
const SessionCookie = "authama_session"

SessionCookie is the cookie a valid token is exchanged for.

Variables

View Source
var BinaryCheckEvery = 2 * time.Second

BinaryCheckEvery is how often a server with AutoRestart looks at its binary.

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is a name that matches nothing in the manifest, the snapshots or the history. Handlers turn it into a 404.

View Source
var StreamEvery = 5 * time.Second

StreamEvery is how often the event stream looks for new events.

Functions

func AllowedHosts

func AllowedHosts(bindHost string, port int, extra []string) []string

AllowedHosts is the set of Host header values the server answers to.

For a loopback bind that is the three spellings of this machine at the bound port. Anything else is refused, which is the DNS-rebinding defence: a page on evil.example that rebinds its name to 127.0.0.1 still sends Host: evil.example. With a remote bind the bound host and any explicitly allowed names are added.

func CleanBasePath added in v0.1.6

func CleanBasePath(p string) (string, error)

CleanBasePath normalises the path the web UI is served under (web.base_path): "" or "/" mean the root and give "", anything else gives "/a" or "/a/b" with no trailing slash. A segment that is empty, "." or "..", or holds anything but letters, digits and . _ ~ -, is refused.

func IsAddrInUse

func IsAddrInUse(err error) bool

IsAddrInUse reports whether a listen error means the port is taken.

func IsLoopback

func IsLoopback(host string) bool

IsLoopback reports whether host only accepts connections from this machine: localhost, or an address in 127.0.0.0/8 or ::1.

func Listen

func Listen(listen ListenFunc, host string, port int, pinned bool, attempts int) (net.Listener, error)

Listen binds host:port.

When pinned is false and the port is in use, it tries the next port up, up to attempts ports in all, and returns the first that binds: the default port being taken by another process is ordinary, and the caller prints the URL actually bound. When pinned is true -- the user asked for this port -- a taken port is an error, because silently serving elsewhere would leave whatever they pointed at this port talking to something else. Any error other than "address in use" stops the search at once.

func NewToken

func NewToken() string

NewToken returns 32 random bytes, base64url-encoded.

Types

type AboutView added in v0.1.6

type AboutView struct {
	Name, Summary, Command, Version string
	GoVersion, OS, Arch             string
	Revision, BuiltAt               string
	Modified                        bool
	ConfigHome, StateHome, SSHDir   string
	DevRoot                         string
	Repository, Docs, Issues        string
	User, Host                      string
	Licences                        []licence
	// System is the computer the server runs on: OS, model, processor,
	// memory, uptime. Fields this OS does not expose are empty.
	System platform.SystemInfo
}

AboutView is the about page: what this build is and where it keeps things.

func (AboutView) CoresText added in v0.1.6

func (v AboutView) CoresText() string

CoresText says how many cores and threads the processor has, splitting Apple silicon's performance and efficiency cores.

func (AboutView) MemoryText added in v0.1.6

func (v AboutView) MemoryText() string

MemoryText is the computer's memory in GB, or "" when unknown.

func (AboutView) UptimeText added in v0.1.6

func (v AboutView) UptimeText() string

UptimeText is how long the computer has been up, or "" when unknown.

type AppEngine

type AppEngine struct {
	P paths.Paths
	// Retain is how many snapshots a change keeps, as the CLI's
	// $AUTHAMA_SNAPSHOT_RETAIN; zero means 10.
	Retain int
}

AppEngine reads one authama home through the same services the CLI uses. It loads the manifest and inventory on every call: the CLI may change them at any moment, and a page must show what is there now.

func (AppEngine) Apply

func (e AppEngine) Apply(ch change.Change, hash string) (change.Plan, change.Result, error)

Apply makes ch if it would still do what was confirmed.

func (AppEngine) Audit

func (e AppEngine) Audit(now time.Time) (AuditView, error)

Audit is `authama ssh audit` as data: deployments, expiry, recent activity.

func (AppEngine) Bundles

func (e AppEngine) Bundles() ([]BundleView, error)

Bundles lists the bundles in dist/, newest first.

func (AppEngine) Doctor

func (e AppEngine) Doctor() (doctor.Report, error)

Doctor runs the same checks as `authama doctor`, without --fix.

func (AppEngine) Export

func (e AppEngine) Export(name string, includeGit bool) (string, error)

Export renders one of the exports for download.

func (AppEngine) History

func (e AppEngine) History(f history.Filter) ([]history.Op, error)

History reads the operation history without writing to it: a page view must not create the database or run the first import.

func (AppEngine) Home

func (e AppEngine) Home() paths.Paths

Home is the paths this engine reads.

func (AppEngine) Host

func (e AppEngine) Host(alias string) (HostView, error)

Host is one host as `authama ssh show <alias>` reports it.

func (AppEngine) Hosts

func (e AppEngine) Hosts() ([]query.ProfileGroup, error)

Hosts lists every host, grouped by profile, as `authama ssh list` does.

func (AppEngine) Key

func (e AppEngine) Key(ref string) (KeyView, error)

Key is one key by its profile/key reference.

func (AppEngine) Keys

func (e AppEngine) Keys() (KeysView, error)

Keys lists every key, as `authama ssh key list` does.

func (AppEngine) Op

func (e AppEngine) Op(id string) (OpView, error)

Op is one operation and the manifest diff across it.

func (AppEngine) Overview

func (e AppEngine) Overview(now time.Time) (Overview, error)

Overview reads the state rows through overview.Rows, the one place that decides what needs attention and the command that fixes it.

func (AppEngine) Preview

func (e AppEngine) Preview(ch change.Change) (change.Plan, error)

Preview shows what ch would do, without doing it.

func (AppEngine) Profiles

func (e AppEngine) Profiles() ([]ProfileView, error)

Profiles lists every profile with its counts.

func (AppEngine) SnapshotDiff

func (e AppEngine) SnapshotDiff(id, against string) (SnapshotDiff, error)

SnapshotDiff compares snapshot id with another snapshot, or with ~/.ssh as it is now when against is "". A snapshot holding key material is refused, not opened: showing a diff would put the key on the page.

func (AppEngine) Snapshots

func (e AppEngine) Snapshots() ([]SnapshotView, error)

Snapshots lists the snapshots, newest first.

func (AppEngine) Tokens

func (e AppEngine) Tokens() (TokensView, error)

Tokens is `authama token list` and `authama token audit` as data. The secrets never leave the service: Inventory is asked not to reveal them, and the view drops them again in case it ever does.

func (AppEngine) VMs added in v0.1.3

func (e AppEngine) VMs(checkDocker bool) (VMsView, error)

VMs builds the /vms page. It asks the hypervisors but connects to no guest.

type AuditKey

type AuditKey struct {
	Path, Fingerprint, Status string
	Deployments               []inventory.Deployment
}

AuditKey is one inventory record and where it is deployed.

type AuditView

type AuditView struct {
	Keys   []AuditKey
	Expiry []expiry.Status
	Recent []history.Op
}

AuditView is the audit report, as data.

type BundleView

type BundleView struct {
	Name    string
	Written time.Time
	Size    int64
}

BundleView is one encrypted bundle in the state home's dist/.

type DevboxView added in v0.1.3

type DevboxView struct {
	Alias string
	settings.Devbox
}

DevboxView is one devbox authama.json declares.

type DriverView added in v0.1.3

type DriverView struct {
	Name, Kind, CLI string
	Enabled         bool
	VMs             []hypervisor.VM
	Err             string
}

DriverView is one hypervisor driver and the VMs it lists.

type Engine

type Engine interface {
	Home() paths.Paths
	Overview(now time.Time) (Overview, error)
	Profiles() ([]ProfileView, error)
	Hosts() ([]query.ProfileGroup, error)
	Host(alias string) (HostView, error)
	Keys() (KeysView, error)
	Key(ref string) (KeyView, error)
	Snapshots() ([]SnapshotView, error)
	Bundles() ([]BundleView, error)
	SnapshotDiff(id, against string) (SnapshotDiff, error)
	History(f history.Filter) ([]history.Op, error)
	Op(id string) (OpView, error)
	Doctor() (doctor.Report, error)
	VMs(checkDocker bool) (VMsView, error)
	Audit(now time.Time) (AuditView, error)
	Export(name string, includeGit bool) (string, error)
	Tokens() (TokensView, error)

	// Preview runs a change on a private copy of the home; Apply makes it
	// if a fresh preview under the lock still has the confirmed hash.
	Preview(ch change.Change) (change.Plan, error)
	Apply(ch change.Change, hash string) (change.Plan, change.Result, error)
}

Engine is everything the pages read. Every argument is a name - a profile, a host alias, a key, a snapshot id, an operation id - resolved here against what exists, never a filesystem path. AppEngine is the real one; tests pass their own.

type EventRow added in v0.1.6

type EventRow struct {
	events.Event
	OpID, Command string
}

EventRow is one file event, with the authama operation that made it when one was running then.

type EventsView added in v0.1.6

type EventsView struct {
	Rows       []EventRow
	Area, Kind string
	Tracking   bool // the server tracks files; false when it was started without roots
	Counts     map[string]int
	Integrity  events.Integrity
}

EventsView is the events page.

type FileDiff

type FileDiff struct {
	Path  string
	State string // added | removed | changed
	Lines []history.DiffLine
	// Checked is set when the file's new content was validated (JSON, see
	// util/highlight.Check), and Problem holds what failed, if anything.
	Checked bool
	Problem string
}

FileDiff is one file's change.

type HostView

type HostView struct {
	Detail *query.HostDetail
	Block  string
	Pins   []knownhosts.Entry
	Token  string
	VM     bool // a VM host, which can have a Docker context
}

HostView is one host: the manifest entry and what it resolves to.

type ImportSource added in v0.1.6

type ImportSource struct {
	Key   string
	Label string
	Path  string
}

ImportSource is one ssh config the web offers to import, chosen by Key. A form names the key, never the path, so no path arrives from a browser.

type ImportView added in v0.1.6

type ImportView struct {
	Sources  []ImportSource
	Profiles int
}

ImportView is /import: where an import could read from, and whether it would replace a manifest that has profiles.

type KeyView

type KeyView struct {
	Detail keysvc.Detail
	// PublicKey is the key's public key line, "" when there is none to show.
	PublicKey string
	// Revoked is the date the key was revoked, "" when it was not; DefaultDays
	// the lifetime a key without its own inherits.
	Revoked     string
	DefaultDays int
	Expiry      *expiry.Status
	Ops         []history.Op
	// Checklist is where the key is used and what is left to rotate or
	// revoke it; nil when it could not be worked out.
	Checklist *checklist.Checklist
}

KeyView is one key: its row, its detail, and its expiry.

type KeysView added in v0.1.6

type KeysView struct {
	Rows     []keysvc.Row
	Reserved []keyaudit.Reserved
	Loose    []keyaudit.LooseKey
	// Public is each key's public key line, by its ref, for the copy action:
	// only a line that is a public key, so a mislabelled file never reaches
	// the page.
	Public map[string]string
	// Profiles are the profiles that have a key, once each, in manifest order.
	Profiles []string
	// KeyRoot is the directory under ~/.ssh that holds the profile directories.
	KeyRoot string
	// Picker is the keys by profile, for choosing which to rotate, revoke or
	// delete; Categories are the categories profiles are filed under.
	Picker     []PickerProfile
	Categories []string
}

KeysView is the /keys page: every key, as `authama ssh key list` shows them, the loose ~/.ssh keys kept on purpose, and the loose keys that could be.

type LinkState added in v0.1.6

type LinkState struct {
	Token   string    `json:"token"`
	Expires time.Time `json:"expires"`
}

LinkState is a sign-in link not yet used, handed to the server replacing this one so a link already given out still works after a restart.

func NewLink(s *Server) LinkState

NewLink makes a sign-in link on s that works once, for LinkLifetime.

func PendingLinks(s *Server) []LinkState

PendingLinks is every sign-in link s gave out and nobody used yet, for the server replacing it. A function, not a method: Server is held to 24.

type ListenFunc

type ListenFunc func(network, address string) (net.Listener, error)

ListenFunc is net.Listen's signature, injectable so the port fallback can be tested without binding a socket.

type NamingForm added in v0.1.6

type NamingForm struct {
	ID, Title string
	// Profile is "" for the manifest's rules.
	Profile string
	// Inherit names what an empty field falls back to: "the default" for the
	// manifest, "the manifest" for a profile.
	Inherit        string
	Own, Effective NamingRules
	CSRF           string
}

NamingForm is one rules form: what its scope stores now (each field prefilled with it) and what applies when a field is left empty (shown as the field's placeholder). The template shares one body between the manifest's form and every profile's.

type NamingProfile added in v0.1.6

type NamingProfile struct {
	Name string
	// Code is what {code} is for the profile; CodeOwn is its own code,
	// "" when it has none and Code comes from the fallback (or is empty).
	Code, CodeOwn string
	// HasOwn is true when the profile overrides the manifest's rules; Own is
	// what it sets, Rules what is in effect.
	HasOwn     bool
	Own, Rules NamingRules
	Form       NamingForm
}

NamingProfile is one profile's code and rules.

type NamingRules added in v0.1.6

type NamingRules struct {
	Alias, KeyName, Envs, Roles, Enforce, CodeFallback string
	// Start is "" when the rules leave it unset, else "0" or "1".
	Start string
}

NamingRules is one set of rules, worded for the page: lists joined with ", " and the start as its first number.

type NamingView added in v0.1.6

type NamingView struct {
	// Rules are the manifest's rules in effect; Own is what defaults.naming
	// holds, empty where it inherits the built-in default.
	Rules NamingRules
	Own   NamingRules
	// Profiles are every profile, in manifest order.
	Profiles []NamingProfile
	// Violations are the servers whose alias breaks the rules, as `naming
	// check` lists them.
	Violations []NamingViolation
	// Servers counts the hosts checked (VM hosts are devboxes, not checked).
	Servers int
	// Form is the manifest's rules form; each profile carries its own.
	Form NamingForm
}

NamingView is the /naming page: `ssh naming show` and `ssh naming check`, with the forms for `naming set`, `naming key-template` and a profile's code.

type NamingViolation added in v0.1.6

type NamingViolation struct{ Profile, Message string }

NamingViolation is one server whose alias breaks its profile's rules.

type NetRow added in v0.1.6

type NetRow struct {
	Profile, Alias, Message string
	Online, RequiresVPN     bool
	VPNName                 string
}

NetRow is one host's reachability, worded as `ssh net` words it.

type NetView added in v0.1.6

type NetView struct {
	// Selector is the host alias or profile the page was asked for; "" is every host.
	Selector string
	// IsProfile is true when Selector names a profile rather than a host.
	IsProfile bool
	Command   string
	Rows      []NetRow
	// GatedDown counts the unreachable hosts that need a VPN, the rows that make
	// `ssh net` exit non-zero.
	GatedDown int
	Online    int
}

NetView is the /net page: `ssh net [selector]`, run when it is asked for. The Hosts, host and Overview pages link here and never probe themselves, so no page waits on the network to load.

type OpView

type OpView struct {
	Op       history.Op
	Diff     []history.DiffLine
	DiffNote string
}

OpView is one operation and its manifest diff.

type Options

type Options struct {
	// Engine reads the authama home. Required.
	Engine Engine

	// Token is the first sign-in link's token, printed in the URL. It works
	// once, for LinkLifetime. Required.
	Token string
	// Control is the key `authama serve` presents at LinkPath for a new
	// sign-in link. Empty: no link is made that way.
	Control string
	// Links are sign-in links a restarted server gave out and nobody used yet.
	Links []LinkState

	// AllowedHosts are the Host header values answered (see AllowedHosts).
	AllowedHosts []string

	// AllowRemote records that the bind is not loopback; it lets a TLS
	// reverse proxy's X-Forwarded-Proto mark the session cookie Secure.
	AllowRemote bool

	// ReadOnly registers no route that changes anything, and hides the forms.
	ReadOnly bool

	// API serves the read API at /api/v1/ for API tokens (api.enabled).
	API bool

	// Version and BindAddr are shown in the footer.
	Version  string
	BindAddr string

	// BasePath is the path the UI is served under (web.base_path), as
	// CleanBasePath gives it: "" for the root, else "/authama". Every link,
	// form, asset, redirect and the session cookie carry it.
	BasePath string
	// HideExport leaves Export out of the menu (web.menu_export false); the
	// page itself stays reachable, as each list's download does.
	HideExport bool

	// Settings reads the settings page for a home. The values in effect were
	// settled at start-up, which the command that started the server owns,
	// so it passes this in. Nil shows the files only, with no values.
	Settings func(paths.Paths) SettingsView

	// EventRoots names the files whose changes the events page records:
	// ~/.ssh, the config home, the tools' credential files. Nil tracks
	// nothing. The server scans them every EventInterval while it runs, and
	// when the events page or the overview opens.
	EventRoots    func(paths.Paths) []events.Tracked
	EventInterval time.Duration

	// Retain is how many snapshots a snapshot restore keeps when it snapshots
	// first, as AUTHAMA_SNAPSHOT_RETAIN sets for the CLI. 0 means 10.
	Retain int

	// Now is the clock. Nil means time.Now.
	Now func() time.Time

	// Instance is a random id /healthz answers with, so `authama serve` can
	// tell a running server it started from another process holding the port
	// (see cli's serve record). Empty answers with none.
	Instance string
	// Restart relaunches this server from the binary now installed at its
	// path, on the same address and with the same sign-in token, and stops
	// this one; nil when the server cannot (a test, an embedded use). The
	// stale-build banner offers it as "Restart now".
	Restart func() error
	// AutoRestart restarts the server by itself when its binary is rebuilt
	// or reinstalled (web.auto_restart, on by default), and every open page
	// reloads into the new build. Off, the page says it is older and offers
	// "Restart now".
	AutoRestart bool
	// Sessions are signed-in sessions a restarting server handed over.
	Sessions []SessionState
}

Options configures a Server.

type Overview

type Overview struct {
	Rows     []overview.Row
	Problems int
	Profiles int
	Hosts    int
	Keys     int
	Expiry   []expiry.Status
	Recent   []history.Op
	DevRoot  string
}

Overview is the first page: the banner's rows, and the counts behind them.

type PickerKey added in v0.1.6

type PickerKey struct {
	Ref      string
	Name     string
	Wired    bool
	Recorded bool
	Status   string
	// Type, Hosts and ExpiresOn are shown beside the name, so a key can be
	// told apart from its neighbours without leaving the picker.
	Type      string
	Hosts     []string
	ExpiresOn string
}

PickerKey is one key in the key picker: what it is, and whether a host uses it (a used key cannot be deleted) or it was minted (one never minted cannot be revoked).

type PickerProfile added in v0.1.6

type PickerProfile struct {
	Name     string
	Category string
	Keys     []PickerKey
}

PickerProfile is one profile's keys in the key picker.

type ProfileView

type ProfileView struct {
	Name, Category, KeyScope, KeyStore string
	Hosts, Keys                        int
	// KeyComment is the profile's own key_comment template; empty inherits
	// defaults.key_comment.
	KeyComment string
}

ProfileView is one profile in the profiles list.

type SSHConfigView added in v0.1.6

type SSHConfigView struct {
	Rendered string
	Check    string
	InSync   bool
	Problem  string // the manifest could not be read or rendered
}

SSHConfigView is the SSH config page: what `authama ssh config show` prints (every file the manifest renders) and what `authama ssh config check` says of ~/.ssh against it.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the web UI.

func New

func New(opts Options) (*Server, error)

New builds a Server. It parses every template once, so a template error is a startup error rather than a 500 on first visit.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the full middleware chain and routes.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, ln net.Listener) error

Serve answers on ln until ctx is cancelled, then shuts down with a ten-second grace for requests in flight.

func (*Server) Sessions added in v0.1.6

func (s *Server) Sessions() []SessionState

Sessions is every signed-in session, for the server replacing this one.

type SessionState added in v0.1.6

type SessionState struct {
	ID      string    `json:"id"`
	CSRF    string    `json:"csrf"`
	Created time.Time `json:"created"`
	// Seen is when it last made a request; a server before this field hands
	// over none, and the session counts as seen when it is adopted.
	Seen time.Time `json:"seen,omitempty"`
}

SessionState is a signed-in session handed to the server that replaces this one, so a page signed in before a restart is still signed in after it. The PIN unlock is not handed over: owner-only changes ask again.

type SettingRow added in v0.1.6

type SettingRow struct{ Key, Variable, Value, Source string }

SettingRow is one setting, as `authama settings show --effective` prints it.

type SettingsView added in v0.1.6

type SettingsView struct {
	ConfigHome, ConfigSource string
	StateHome                string
	Dotenv, DotenvState      string
	Settings, SettingsState  string
	HasSettings              bool
	Effective                []SettingRow
	Problems                 []string
}

SettingsView is the settings page: where the settings files are, every setting's value in effect and where it came from, and what `authama settings validate` reports. None of the settings is a secret: tokens live in .env and the credential files, and this view never reads their values.

type Setup added in v0.1.6

type Setup struct {
	Steps []SetupStep
	Done  int
}

Setup is the "Get started" card: each step a new home goes through, judged from what the home already holds, so the card fills in by itself and stops showing once every step is done.

func (Setup) Complete added in v0.1.6

func (s Setup) Complete() bool

Complete reports whether every step is done.

func (Setup) Percent added in v0.1.6

func (s Setup) Percent() int

Percent is how much of the setup is done, 0 to 100.

type SetupStep added in v0.1.6

type SetupStep struct {
	Title, Why, Href, Icon string
	Done                   bool
}

SetupStep is one step of the Overview's "Get started" card: what to do, why, where the form for it is, and whether this home has done it already.

type SnapshotDiff

type SnapshotDiff struct {
	ID, Against string // Against "" means the current ~/.ssh
	Files       []FileDiff
	Refused     string // why the snapshot was not opened
}

SnapshotDiff compares a snapshot with the tree now, or with another snapshot.

type SnapshotView

type SnapshotView struct {
	ID         string
	Taken      time.Time
	Size       int64
	KeyBearing bool
}

SnapshotView is one snapshot in the list.

type TokenService added in v0.1.6

type TokenService struct {
	Name, Mechanism string
	Basic           bool // http-basic: a user name and a password
}

TokenService is a Composer service and the kind of secret it takes.

type TokensView

type TokensView struct {
	Items    []tokens.Installed
	Findings []tokensvc.Finding
	Failed   bool
	Config   string // the token config `token apply` would read, or "" for the built-in default
	Legacy   bool
	// Status is `authama token status`: per tool its file, mode, and how many
	// entries are installed, configured and resolvable now.
	Status tokensvc.Status
	// HasConfig says the config home already holds a tokens.json, which
	// `token init` and `token import` never overwrite.
	HasConfig bool
	// Targets are the tools a token can be set for; Services the Composer
	// services the token form offers (those taking one secret).
	Targets  []string
	Services []TokenService
	// ConfigText is the config home's tokens.json, for the editor, when it
	// holds variable names only; ConfigRefused says why it is not shown
	// otherwise. A file that holds a value never reaches a page.
	ConfigText, ConfigRefused string
}

TokensView is the token page: what is installed, secrets masked, and the checkup of the files that hold it.

type VMsView added in v0.1.3

type VMsView struct {
	Hosts    []vmsync.Host
	Pending  []string
	Notes    []string
	Drivers  []DriverView
	Unknown  []string // enabled names that match no driver
	Devboxes []DevboxView
	Loose    []keyaudit.LooseKey
	// Reserved are the loose keys kept on purpose; they can still be adopted.
	Reserved []keyaudit.Reserved
	Profiles []string
	// Schedule is the command the daily schedule runs.
	Schedule string
	// Docker is false when the docker CLI is not installed.
	Docker bool
	// Contexts are the Docker contexts of VM hosts; Checked says the engines
	// behind the running ones were asked (the page's "Check the engines").
	Contexts []vmsync.ContextStatus
	Checked  bool
}

VMsView is the /vms page: the VM hosts as their hypervisors see them, what a sync would do (worked out without connecting to a guest), the drivers, the declared devboxes, and the loose keys that could be adopted.

type ValidateKey added in v0.1.6

type ValidateKey struct {
	Profile, Name, Fingerprint string
	OK                         bool
	Issues, Notes              []string
}

ValidateKey is one keypair's check, worded as `ssh validate` words it.

type ValidateSection added in v0.1.6

type ValidateSection struct {
	ID, Title, What, Command string
	// Link is the page that shows more, or "".
	Link, LinkLabel string
	OK              bool
	Problems        []string
	// Detail is the command's own report, shown as it prints it, when it says
	// more than the problem lines (the ssh config check's diffs).
	Detail string
	// Keys is the key check's rows; the other sections have none.
	Keys []ValidateKey
}

ValidateSection is one check: what it covers, the command that runs the same check, and what it found.

type ValidateView added in v0.1.6

type ValidateView struct {
	Sections []ValidateSection
	// Failed counts the sections that found a problem.
	Failed int
}

ValidateView is the /validate page: every check the validate commands run, on one page, run when it is asked for. It reads only.

Jump to

Keyboard shortcuts

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