config

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 4 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 config loads vellum configuration from environment variables. vellum has no config database: everything is env (and later vellum.yaml).

Index

Constants

View Source
const (
	// SharingOff registers no public route and no share tool.
	SharingOff = "off"
	// SharingUI serves public links, but only the workspace can mint them.
	SharingUI = "ui"
	// SharingOn additionally gives agents the share_note/unshare_note tools.
	SharingOn = "on"
)

Sharing modes for VELLUM_SHARING. Sharing is the only feature that answers an unauthenticated request, so it is off unless asked for, and the middle setting exists to keep the decision to publish with the human.

View Source
const DefaultHost = "127.0.0.1"

DefaultHost is the HTTP listen address when VELLUM_HOST is unset: loopback only, so a vault without auth is never exposed to the network by accident.

View Source
const DefaultRescan = 5 * time.Second

DefaultRescan is the VELLUM_RESCAN default. Measured: a rescan of an unchanged 5,000-note vault costs a few milliseconds of stat calls, so checking at most every five seconds is invisible next to a search.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Host is the HTTP listen address (env VELLUM_HOST, default 127.0.0.1).
	// The default keeps a bare binary reachable only from its own machine,
	// since auth is off by default; the Docker image sets 0.0.0.0.
	Host string
	// Port is the HTTP listen port (env PORT).
	Port string
	// VaultPath is the root directory of the markdown vault (env VELLUM_VAULT_PATH).
	VaultPath string

	// InitStructure creates inbox/projects/archive in an empty vault at
	// startup (env VELLUM_INIT_STRUCTURE, default true).
	InitStructure bool
	// InboxDir, ProjectsDir, ArchiveDir name the conventional directories
	// (env VELLUM_INBOX_DIR / VELLUM_PROJECTS_DIR / VELLUM_ARCHIVE_DIR).
	InboxDir    string
	ProjectsDir string
	ArchiveDir  string
	// ContextFile is the file name of a folder's description note
	// (env VELLUM_CONTEXT_FILE, default _index.md).
	ContextFile string
	// Ranker picks the search ranking while BM25F rolls out (env
	// VELLUM_RANKER=bm25f|legacy, default bm25f). Goes once the legacy
	// ranker is removed.
	Ranker string

	// Rescan is how often the in-memory index checks the disk for notes
	// changed outside vellum (env VELLUM_RESCAN, a Go duration such as 5s
	// or 1m, or a plain number of seconds; off or 0 disables; default 5s).
	// The check is lazy: it runs before an index read once the interval has
	// passed, never in the background. 0 means off.
	Rescan time.Duration
	// RescanInvalid holds an unparseable VELLUM_RESCAN value, so main can
	// warn about it; Rescan then falls back to the default.
	RescanInvalid string

	// Curator enables the suggest_*/find_* MCP tools
	// (env VELLUM_CURATOR=on|off, default off).
	Curator bool

	// Sharing controls public, read-only links to single notes
	// (env VELLUM_SHARING, default off). See the Sharing* constants.
	Sharing string

	// Notify enables the periodic SMTP task digest (env VELLUM_NOTIFY=on|off,
	// default off). SMTP_* settings are read by the notify package.
	Notify bool

	// Sentry error reporting (off unless SENTRY_DSN is set). SentryEnvironment
	// tags events (env SENTRY_ENVIRONMENT, default "production").
	SentryDSN         string
	SentryEnvironment string

	// AllowedOrigins are browser origins allowed to reach /mcp
	// (env VELLUM_ALLOWED_ORIGINS, comma-separated).
	AllowedOrigins []string

	// CORSOrigins get CORS response headers (env CORS_ORIGINS; defaults to
	// AllowedOrigins). Kept separate to recycle openclaw-mcp env names.
	CORSOrigins []string

	// OAuth (PHY-112, env names recycled from openclaw-mcp).
	AuthEnabled  bool     // AUTH_ENABLED (default false — warn loudly)
	ClientID     string   // VELLUM_CLIENT_ID (default "vellum")
	ClientSecret string   // VELLUM_CLIENT_SECRET (>= 32 chars when auth on)
	IssuerURL    string   // VELLUM_ISSUER_URL (public URL behind a proxy)
	RedirectURIs []string // VELLUM_REDIRECT_URIS (empty = allow any)
	TrustProxy   bool     // TRUST_PROXY (behind Caddy/Traefik)
}

Config holds the runtime configuration.

func Load

func Load() Config

Load reads configuration from the environment, applying defaults.

func (Config) ShareTools added in v1.13.0

func (c Config) ShareTools() bool

ShareTools reports whether agents may mint links over MCP.

func (Config) SharingEnabled added in v1.13.0

func (c Config) SharingEnabled() bool

SharingEnabled reports whether public share links are served at all.

Jump to

Keyboard shortcuts

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