config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package config holds Console's runtime configuration. Configuration is read from environment variables with sensible defaults; the CLI layers flags on top. Keeping this dependency-free (env + defaults, no YAML parser) keeps the binary small and the config surface obvious.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Addr is the HTTP listen address. Defaults to loopback (127.0.0.1:8080)
	// because the API and dashboard have no built-in authentication yet —
	// exposing them requires an authenticating reverse proxy. Set ":8080" (all
	// interfaces) deliberately, behind such a proxy. See docs/security/.
	Addr string
	// DB is the storage DSN. For SQLite this is a file path ("console.db") or
	// "" / ":memory:" for an in-memory database.
	DB string
	// StorePlugin is the path to an out-of-process storage-backend plugin
	// executable (e.g. console-plugin-postgres). When set, it replaces the
	// built-in SQLite store; the plugin inherits this process's environment.
	StorePlugin string
	// NotifyPlugins are paths to out-of-process notifier plugin executables
	// (e.g. console-plugin-slack). Each is launched and registered as a sink;
	// plugins inherit this process's environment (e.g. CONSOLE_SLACK_WEBHOOK_URL).
	NotifyPlugins []string
	// StatusPlugins are paths to out-of-process status-provider plugin
	// executables (e.g. console-plugin-cloudflare). Each is launched and
	// registered with the status engine; plugins inherit this process's
	// environment (e.g. CLOUDFLARE_API_TOKEN).
	StatusPlugins []string
	// LLMPlugin is the path to an out-of-process LLM provider plugin executable
	// (e.g. console-plugin-anthropic). When set, it supplies the AI-Assisted
	// onboarding provider over gRPC; empty disables AI-Assisted mode. The plugin
	// inherits this process's environment (e.g. ANTHROPIC_API_KEY).
	LLMPlugin string
}

Config is the resolved runtime configuration.

func Default

func Default() Config

Default returns the baseline configuration before env/flag overrides.

func FromEnv

func FromEnv() Config

FromEnv returns the default config with any CONSOLE_* environment overrides applied. Recognized variables:

CONSOLE_ADDR          HTTP listen address (default "127.0.0.1:8080", loopback)
CONSOLE_DB            storage DSN / SQLite path (default "console.db")
CONSOLE_STORE_PLUGIN   path to an out-of-process storage-backend plugin
CONSOLE_NOTIFY_PLUGINS comma/space-separated notifier plugin paths
CONSOLE_STATUS_PLUGINS comma/space-separated status-provider plugin paths
CONSOLE_LLM_PLUGIN     path to an out-of-process LLM provider plugin

Provider-specific variables (e.g. ANTHROPIC_API_KEY, CLOUDFLARE_API_TOKEN, CONSOLE_SLACK_WEBHOOK_URL, CONSOLE_MODEL) are read by the relevant plugin, which inherits this process's environment — the host does not consume them.

Jump to

Keyboard shortcuts

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