config

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CIDRConfig

type CIDRConfig struct {
	Allow []string `yaml:"allow"`
	Deny  []string `yaml:"deny"`
}

type CommandConfig

type CommandConfig struct {
	Allow []string `yaml:"allow"`
	Deny  []string `yaml:"deny"`
}

type Config

type Config struct {
	RestrictedNetworkConfig    `yaml:"network"`
	RestrictedFileAccessConfig `yaml:"files"`
	RestrictedMountConfig      `yaml:"mount"`
	DNSProxyConfig             `yaml:"dns_proxy"`
	Log                        LogConfig
}

func DefaultConfig added in v0.0.4

func DefaultConfig() *Config

func NewConfig

func NewConfig(configPath string) (*Config, error)

func (*Config) EnableDNSProxy added in v0.0.9

func (c *Config) EnableDNSProxy() bool

func (*Config) IsOnlyContainer

func (c *Config) IsOnlyContainer(target string) bool

func (*Config) IsRestrictedMode added in v0.0.4

func (c *Config) IsRestrictedMode(target string) bool

func (*Config) Validate added in v0.0.9

func (c *Config) Validate() error

type DNSProxyConfig added in v0.0.9

type DNSProxyConfig struct {
	Enable        bool     `yaml:"enable"`
	Upstreams     []string `yaml:"upstreams"`
	BindAddresses []string `yaml:"bind"`
}

type DomainConfig added in v0.0.4

type DomainConfig struct {
	Allow    []string `yaml:"allow"`
	Deny     []string `yaml:"deny"`
	Interval uint     `yaml:"interval"` // deprecated
}

type GIDConfig

type GIDConfig struct {
	Allow []uint `yaml:"allow"`
	Deny  []uint `yaml:"deny"`
}

type LogConfig

type LogConfig struct {
	Format  string            `yaml:"format"`
	Output  string            `yaml:"output"`
	MaxSize int               `yaml:"max_size"`
	MaxAge  int               `yaml:"max_age"`
	Labels  map[string]string `yaml:"labels"`
}

type RestrictedFileAccessConfig added in v0.0.4

type RestrictedFileAccessConfig struct {
	Enable bool
	Mode   string   `yaml:"mode"`
	Target string   `yaml:"target"`
	Allow  []string `yaml:"allow"`
	Deny   []string `yaml:"deny"`
}

type RestrictedMountConfig added in v0.0.5

type RestrictedMountConfig struct {
	Enable         bool
	Mode           string   `yaml:"mode"`
	Target         string   `yaml:"target"`
	DenySourcePath []string `yaml:"deny"`
}

type RestrictedNetworkConfig added in v0.0.4

type RestrictedNetworkConfig struct {
	Enable  bool
	Mode    string        `yaml:"mode"`
	Target  string        `yaml:"target"`
	Command CommandConfig `yaml:"command"`
	CIDR    CIDRConfig    `yaml:"cidr"`
	Domain  DomainConfig  `yaml:"domain"`
	UID     UIDConfig     `yaml:"uid"`
	GID     GIDConfig     `yaml:"gid"`
}

type UIDConfig

type UIDConfig struct {
	Allow []uint `yaml:"allow"`
	Deny  []uint `yaml:"deny"`
}

Jump to

Keyboard shortcuts

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