config

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 9 Imported by: ? 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 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"`
	WinRM            *WinRMConfig       `yaml:"winrm"`
	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.

type WinRMConfig added in v0.7.0

type WinRMConfig struct {
	ConnectTimeout *duration `yaml:"connect_timeout"`
	UseTLS         *bool     `yaml:"use_tls"`
	Insecure       *bool     `yaml:"insecure"`
}

WinRMConfig holds WinRM-specific configuration.

Jump to

Keyboard shortcuts

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