Documentation
¶
Overview ¶
Package settings owns the user's persisted configuration (settings.json): base path, allowed hosts, auth token, masking policy, and compose-discovery config. It lives in its own package so both the server and the standalone `oriel mcp` process can read and atomically write it, the server is the usual writer, but MCP needs to set a stack alias.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bearer ¶ added in v0.6.0
Bearer extracts the token from an "Authorization: Bearer <token>" header value. The scheme is case-insensitive; the token is trimmed. Returns "" if absent.
func SetAlias ¶
SetAlias sets (or, with an empty alias, clears) the Oriel display alias for a compose project. Display only, the real project name is unchanged.
func TokenOK ¶ added in v0.6.0
TokenOK reports whether the provided bearer token matches the configured one, in constant time so a wrong token can't be guessed byte-by-byte via timing. An empty configured token means auth is off (always OK). The single source of the security-critical compare, shared by the GUI gate and the MCP-over-HTTP gate.
func Update ¶
Update performs a read-modify-write under a single hold of the lock, so concurrent in-process updates to different fields can't clobber one another. Across processes (server vs. `oriel mcp`) the atomic temp+rename prevents torn files; the last writer wins, acceptable for these low-stakes fields.
Types ¶
type Settings ¶
type Settings struct {
BasePath string `json:"basePath"` // reverse-proxy sub-path, e.g. /oriel ("" = root)
Discovery discovery.Config `json:"discovery"`
AllowedHosts []string `json:"allowedHosts"` // non-loopback Hosts allowed to reach /api
MaskEnv string `json:"maskEnv"` // inspect env masking: "all" (default) | "sensitive" | "off"
MaskLogs string `json:"maskLogs"` // UI log masking: "sensitive" (default, redact secrets) | "off". The MCP/agent path is always at least "sensitive".
EnvReveal string `json:"envReveal"` // where "reveal values" works: "local" (default) | "remote" | "off"
AuthToken string `json:"authToken"` // opt-in bearer token required for non-loopback /api ("" = off)
}
Settings is the single source of truth for everything the user configures (as opposed to colima/docker state). Persisted as settings.json and edited via the UI, the CLI, MCP, or by hand.