Documentation
¶
Index ¶
- type AuthConfig
- type AuthIdentity
- type Config
- type DocsetSpec
- type FilesConfig
- type FolderConfig
- type Option
- func WithAllowKeyless(allow bool) Option
- func WithAllowedPatterns(patterns []string) Option
- func WithAuthFile(path string) Option
- func WithCAKeysFile(path string) Option
- func WithConfigFile(path string) Option
- func WithDefaultCwd(cwd string) Option
- func WithEmbeddedConfig(data []byte, motdFallback string) Option
- func WithHTTPPort(port int) Option
- func WithHostCertFile(path string) Option
- func WithHostKeyPath(path string) Option
- func WithIgnorePatterns(patterns []string) Option
- func WithLogger(logger *slog.Logger) Option
- func WithMOTD(motd string) Option
- func WithMOTDFile(path string) Option
- func WithMetricsPort(port int) Option
- func WithPasskeys(pk PasskeysConfig) Option
- func WithPort(port int) Option
- func WithSkillsDir(dir string) Option
- func WithTLS(cert, key string) Option
- type PasskeysConfig
- type PathMapping
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct {
AllowKeyless *bool `json:"allow_keyless,omitempty"`
UnknownIdentity string `json:"unknown_identity,omitempty"`
DefaultCwd string `json:"default_cwd,omitempty"`
Docsets map[string]DocsetSpec `json:"docsets"`
Lore map[string][]string `json:"lore"`
Identities []AuthIdentity `json:"identities"`
}
AuthConfig is loaded from lore.json.
func LoadAuthConfig ¶
func LoadAuthConfig(path string) (*AuthConfig, error)
LoadAuthConfig loads auth configuration from a JSON file.
type AuthIdentity ¶
type AuthIdentity struct {
Name string `json:"name"`
Comment string `json:"comment,omitempty"`
PublicKey string `json:"public_key"`
Lore string `json:"lore"`
Publish []string `json:"publish,omitempty"` // writable docsets; empty = all in lore
}
AuthIdentity defines a user identity with access to a lore spec.
type Config ¶
type Config struct {
ConfigVersion string
Port int
MetricsPort int
HostKeyPath string
AllowKeyless bool
UnknownIdentity string // "allow" (default) or "deny"
DefaultCwd string
MOTD string
AuthFile string
SkillsDir string
HTTPPort int
ExternalSSHPort int // advertised SSH port (for X-SSH-Port header behind a LB)
TLSCert string
TLSKey string
CAKeysFile string
HostCertFile string
Files FilesConfig
Folders []FolderConfig
Passkeys PasskeysConfig
Logger *slog.Logger
// contains filtered or unexported fields
}
Config holds the resolved server configuration.
type DocsetSpec ¶
type DocsetSpec struct {
Paths []PathMapping `json:"paths"`
PublishDir string `json:"publish_dir,omitempty"`
MaxPublishSize int64 `json:"max_publish_size,omitempty"` // bytes; 0 = use default (2.5MB)
}
DocsetSpec defines a named set of path mappings.
type FilesConfig ¶
FilesConfig controls which files are served.
type FolderConfig ¶
FolderConfig defines an additional named folder mount.
type Option ¶
Option is a functional option for configuring the server.
func WithAllowKeyless ¶
WithAllowKeyless controls whether keyless SSH connections are allowed.
func WithAllowedPatterns ¶
WithAllowedPatterns sets the file patterns to serve.
func WithAuthFile ¶
WithAuthFile sets the path to the auth.json file.
func WithCAKeysFile ¶
WithCAKeysFile sets the path to a file containing trusted CA public keys for SSH certificate authentication (analogous to OpenSSH TrustedUserCAKeys).
func WithConfigFile ¶
WithConfigFile loads configuration from a YAML file. Fields in the file override defaults. If the file does not exist, no error is returned and the config is unchanged.
func WithDefaultCwd ¶
WithDefaultCwd sets the default working directory for shell sessions.
func WithEmbeddedConfig ¶
WithEmbeddedConfig loads config from an embedded YAML byte slice. The MOTD fallback is set separately from the config fields.
func WithHTTPPort ¶
WithHTTPPort sets the HTTP front page server port. 0 disables it.
func WithHostCertFile ¶
WithHostCertFile sets the path to the SSH host certificate file (signed by a CA, analogous to OpenSSH HostCertificate).
func WithHostKeyPath ¶
WithHostKeyPath sets the path to the SSH host key.
func WithIgnorePatterns ¶
WithIgnorePatterns sets the ignore patterns.
func WithLogger ¶
WithLogger sets the structured logger.
func WithMOTDFile ¶
WithMOTDFile loads the MOTD from a file path, replacing any previous value.
func WithMetricsPort ¶
WithMetricsPort sets the metrics HTTP port. 0 disables metrics.
func WithPasskeys ¶
func WithPasskeys(pk PasskeysConfig) Option
WithPasskeys sets the passkeys configuration.
func WithSkillsDir ¶
WithSkillsDir sets the directory for loading runtime skills.
type PasskeysConfig ¶
type PasskeysConfig struct {
Enabled bool
RPID string
RPName string
RPOrigins []string
LorePath string
PasskeysFile string
SessionTTL string // parsed as time.Duration
}
PasskeysConfig holds WebAuthn passkey configuration.
type PathMapping ¶
type PathMapping struct {
Source string // the real path (relative to root dir or assets/lore)
Display string // the path shown in bashfs (empty = same as Source)
}
PathMapping represents a path entry — either a simple string path or a source→display mapping.
func (*PathMapping) UnmarshalJSON ¶
func (p *PathMapping) UnmarshalJSON(data []byte) error
UnmarshalJSON supports both string and {"source": "display"} forms.