Documentation
¶
Index ¶
Constants ¶
const ( AuthTokenSourceNone = "" AuthTokenSourceConfig = "config" AuthTokenSourceEnv = "env" AuthTokenSourceFile = "file" )
Variables ¶
This section is empty.
Functions ¶
func LegacyVaultConfigExists ¶
func LegacyVaultConfigPath ¶
func NormalizeBasePath ¶
NormalizeBasePath coerces a raw base-path string into the form the server uses everywhere: empty (meaning "serve at root") or a path that starts with `/` and has no trailing slash, e.g. "/zennotes". Multiple adjacent slashes are collapsed.
func SessionsPath ¶
func SessionsPath() string
SessionsPath is where opt-in persisted browser sessions live — next to the host config file (e.g. /data/sessions.json alongside /data/server.json).
Types ¶
type Config ¶
type Config struct {
VaultPath string `json:"vaultPath"`
DefaultVaultPath string `json:"-"`
BrowseRoots []string `json:"-"`
AllowedOrigins []string `json:"-"`
Bind string `json:"bind"`
BasePath string `json:"basePath"`
AuthToken string `json:"authToken"`
AuthTokenSource string `json:"-"`
AllowUnscopedBrowse bool `json:"-"`
AllowInsecureNoAuth bool `json:"-"`
DevMode bool `json:"-"`
// DisableWatcher turns off the inotify file watcher (ZENNOTES_DISABLE_WATCHER).
// Live updates stop; the vault is still fully served. Useful where inotify is
// restricted and can hang the process (e.g. unprivileged LXC). (#179)
DisableWatcher bool `json:"-"`
// Limits and security knobs.
MaxAssetBytes int64 `json:"-"`
MaxNoteBytes int64 `json:"-"`
BehindTLS bool `json:"-"`
// PersistSessions saves browser sessions to <data>/sessions.json so they
// survive a server restart. Opt-in via ZENNOTES_PERSIST_SESSIONS.
PersistSessions bool `json:"-"`
TrustedProxies []net.IPNet `json:"-"`
VaultFileMode fs.FileMode `json:"-"`
VaultDirMode fs.FileMode `json:"-"`
// AllowedHosts are Host names a loopback bind with no auth token answers to
// besides localhost and IP addresses (ZENNOTES_ALLOWED_HOSTS), such as the
// public name a proxy on the same machine forwards.
AllowedHosts []string `json:"-"`
}
type MCPConfig ¶
type MCPConfig struct {
Enabled bool
Credentials []MCPCredential
AllowedOrigins []string
}
MCPConfig is the built-in MCP endpoint. It is off unless ZENNOTES_MCP_ENABLED says otherwise, and with it off nothing below is read.