config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package config loads ShellGuard settings from file and environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoConnectConfig added in v0.6.0

type AutoConnectConfig struct {
	Host         string
	User         string
	Port         int
	IdentityFile string
	Transport    string
}

AutoConnectConfig holds auto-connect parameters set via environment variables. When Host is non-empty, ShellGuard connects during MCP initialization.

type Config

type Config struct {
	Timeout          *int               `yaml:"timeout"`
	MaxOutputBytes   *int               `yaml:"max_output_bytes"`
	MaxDownloadBytes *int               `yaml:"max_download_bytes"`
	DownloadDir      *string            `yaml:"download_dir"`
	MaxSleepSeconds  *int               `yaml:"max_sleep_seconds"`
	DisabledTools    []string           `yaml:"disabled_tools"`
	SSH              *SSHConfig         `yaml:"ssh"`
	ManifestDir      *string            `yaml:"manifest_dir"`
	AutoConnect      *AutoConnectConfig `yaml:"-"` // env-only, not from config file
}

Config for ShellGuard. Pointer fields; nil = unset.

func Load

func Load() (Config, error)

func LoadFrom

func LoadFrom(path string) (Config, error)

LoadFrom loads config from path. Missing files return zero Config, nil.

type SSHConfig

type SSHConfig struct {
	Mode            *string   `yaml:"mode"`
	ConnectTimeout  *duration `yaml:"connect_timeout"`
	Retries         *int      `yaml:"retries"`
	RetryBackoff    *duration `yaml:"retry_backoff"`
	HostKeyChecking *string   `yaml:"host_key_checking"`
	KnownHostsFile  *string   `yaml:"known_hosts_file"`
}

SSHConfig holds SSH-specific configuration.

Jump to

Keyboard shortcuts

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