config

package
v0.22.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const CONFIG_DIR = "knot"
View Source
const CONFIG_ENV_PREFIX = "KNOT"
View Source
const CONFIG_FILE = "knot.toml"

Variables

This section is empty.

Functions

func InitCommonConfig added in v0.18.0

func InitCommonConfig(cmd *cli.Command)

func SaveConnection added in v0.18.0

func SaveConnection(alias string, server string, token string, cmd *cli.Command) error

func SetAgentConfig added in v0.18.0

func SetAgentConfig(config *AgentConfig)

SetAgentConfig sets the global agent configuration

func SetServerConfig added in v0.18.0

func SetServerConfig(config *ServerConfig)

SetServerConfig sets the global server configuration

Types

type AgentConfig added in v0.18.0

type AgentConfig struct {
	Endpoint             string
	SpaceID              string
	UpdateAuthorizedKeys bool
	ServicePassword      string
	VSCodeTunnel         string
	SyslogPort           int
	APIPort              int
	DisableTerminal      bool
	DisableSpaceIO       bool
	Port                 PortConfig
	TLS                  TLSConfig
}

func GetAgentConfig added in v0.18.0

func GetAgentConfig() *AgentConfig

GetAgentConfig returns the global agent configuration

type AuditConfig added in v0.18.0

type AuditConfig struct {
	Retention int
}

type BadgerDBConfig added in v0.18.0

type BadgerDBConfig struct {
	Enabled bool
	Path    string
}

type ChatConfig added in v0.19.0

type ChatConfig struct {
	Enabled          bool
	OpenAIAPIKey     string
	OpenAIBaseURL    string
	Model            string
	MaxTokens        int
	Temperature      float32
	SystemPromptFile string
	SystemPrompt     string
	ReasoningEffort  string
	UIStyle          string
}

type ClusterConfig added in v0.18.0

type ClusterConfig struct {
	Key            string
	AdvertiseAddr  string
	BindAddr       string
	Peers          []string
	AllowLeafNodes bool
	Compression    bool
}

type DockerConfig added in v0.18.0

type DockerConfig struct {
	Host string
}

type MCPConfig added in v0.19.0

type MCPConfig struct {
	Enabled bool
}

type MySQLConfig added in v0.18.0

type MySQLConfig struct {
	Enabled               bool
	Host                  string
	Port                  int
	User                  string
	Password              string
	Database              string
	ConnectionMaxIdle     int
	ConnectionMaxOpen     int
	ConnectionMaxLifetime int
}

type NomadConfig added in v0.18.0

type NomadConfig struct {
	Host  string
	Token string
}

type OriginConfig added in v0.18.0

type OriginConfig struct {
	Server string
	Token  string
}

type PodmanConfig added in v0.18.0

type PodmanConfig struct {
	Host string
}

type PortConfig added in v0.18.0

type PortConfig struct {
	CodeServer int
	VNCHttp    int
	SSH        int
	TCPPorts   []string
	HTTPPorts  []string
	HTTPSPorts []string
}

type RedisConfig added in v0.18.0

type RedisConfig struct {
	Enabled    bool
	Hosts      []string
	Password   string
	DB         int
	MasterName string
	KeyPrefix  string
}

type ServerAddr added in v0.12.2

type ServerAddr struct {
	HttpServer string
	WsServer   string
	ApiToken   string
}

func GetServerAddr added in v0.12.2

func GetServerAddr(alias string, cmd *cli.Command) *ServerAddr

Read the server configuration information and generate the websocket address

type ServerConfig added in v0.18.0

type ServerConfig struct {
	Listen                    string
	ListenAgent               string
	URL                       string
	AgentEndpoint             string
	WildcardDomain            string
	HTMLPath                  string
	TemplatePath              string
	AgentPath                 string
	PrivateFilesPath          string
	PublicFilesPath           string
	DownloadPath              string
	DisableSpaceCreate        bool
	ListenTunnel              string
	TunnelDomain              string
	TunnelServer              string
	TerminalWebGL             bool
	EncryptionKey             string
	Zone                      string
	Hostname                  string
	Timezone                  string
	LeafNode                  bool
	AuthIPRateLimiting        bool
	LocalContainerRuntimePref []string
	Origin                    OriginConfig
	TOTP                      TOTPConfig
	UI                        UIConfig
	Cluster                   ClusterConfig
	MySQL                     MySQLConfig
	BadgerDB                  BadgerDBConfig
	Redis                     RedisConfig
	Audit                     AuditConfig
	Docker                    DockerConfig
	Podman                    PodmanConfig
	Nomad                     NomadConfig
	TLS                       TLSConfig
	MCP                       MCPConfig
	Chat                      ChatConfig
	SkillsPath                string
}

func GetServerConfig added in v0.18.0

func GetServerConfig() *ServerConfig

GetServerConfig returns the global server configuration

type TLSConfig added in v0.18.0

type TLSConfig struct {
	CertFile    string
	KeyFile     string
	UseTLS      bool
	AgentUseTLS bool
	SkipVerify  bool
}

type TOTPConfig added in v0.18.0

type TOTPConfig struct {
	Enabled bool
	Window  int
	Issuer  string
}

type UIConfig added in v0.18.0

type UIConfig struct {
	HideSupportLinks   bool
	HideAPITokens      bool
	EnableGravatar     bool
	LogoURL            string
	LogoInvert         bool
	EnableBuiltinIcons bool
	Icons              []string
}

Jump to

Keyboard shortcuts

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