server

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package server implements `hive serve <archive.db>` — the HTTP + WUI frontend. Runs the read-only API alongside a Lit-based single-page shell.

v0 is deliberately narrow: read-only endpoints, localhost bind, no authentication. Non-loopback binds without configured auth are refused (see CLAUDE.md § Authentication and collaboration). Editing endpoints and ORCID SSO land in follow-up slices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(archivePath string, opts Options) error

Run opens the archive and blocks serving HTTP until the process receives SIGINT/SIGTERM (or the listener errors).

Types

type Options

type Options struct {
	// Bind is the "host:port" pair the server listens on. Empty →
	// 127.0.0.1:2365. Non-loopback binds require auth to be configured
	// (unimplemented in v0) and are refused with an explicit error.
	Bind string

	// AllowUnauthenticated is the escape hatch for non-loopback binds
	// without auth. Off by default; the caller must opt in explicitly.
	AllowUnauthenticated bool

	// ReadOnly opens the archive with hive.ReadOnly, refusing writes at
	// the core layer. Default is read-write so hive serve can host both
	// browsing and editing. Set true for public-view deployments.
	ReadOnly bool

	// Actor is the ORCID iD (or other identifier) stamped into
	// col__modified_by on every mutation. Loaded from --orcid flag or
	// HIVE_ORCID env var by the main package; falls back to "local" when
	// nothing is configured (with a single-line warning at startup).
	// In hosted SSO mode this will be overwritten per-request by the
	// auth middleware; for v0 it's a process-wide stamp.
	Actor string
}

Options configures Run without positional-argument sprawl.

Jump to

Keyboard shortcuts

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