Documentation
¶
Index ¶
- func NormalizeSubscribePath(value string) (string, error)
- func PrepareSubscribePath(c *Config) string
- func Set(c *Config)
- type AdminConfig
- type AppConfig
- type AuthConfig
- type CORSConfig
- type CacheConfig
- type Config
- type DatabaseConfig
- type ForwardRuntimeAnsibleConfig
- type ForwardRuntimeCleanAgentConfig
- type ForwardRuntimeConfig
- type ForwardRuntimeGostStatsConfig
- type ForwardRuntimeJobsConfig
- type ForwardRuntimeLatencyConfig
- type ForwardRuntimeNodeXConfig
- type FrontendConfig
- type GRPCConfig
- type JWTConfig
- type LogConfig
- type LoginRateLimitConfig
- type PluginConfig
- type RegistrationAuthConfig
- type ServerConfig
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeSubscribePath ¶
NormalizeSubscribePath cleans the public subscription path and rejects values that could overlap the versioned API namespace.
func PrepareSubscribePath ¶
PrepareSubscribePath normalizes the configured public subscription path, updates the in-memory configuration when present, and fails before route registration if the path could overlap the versioned API namespace.
Types ¶
type AdminConfig ¶
AdminConfig defines the bootstrap admin account.
type AppConfig ¶
type AppConfig struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
APIToken string `yaml:"api_token"`
TrafficLogEnable bool `yaml:"traffic_log_enable"`
SubscribePath string `yaml:"subscribe_path"`
}
AppConfig defines generic app settings.
type AuthConfig ¶
type AuthConfig struct {
LoginRateLimit LoginRateLimitConfig `yaml:"login_rate_limit"`
RegisterRateLimit LoginRateLimitConfig `yaml:"register_rate_limit"`
Registration RegistrationAuthConfig `yaml:"registration"`
}
AuthConfig defines authentication security settings.
type CORSConfig ¶
type CORSConfig struct {
AllowedOrigins []string `yaml:"allowed_origins"`
AllowedMethods []string `yaml:"allowed_methods"`
AllowedHeaders []string `yaml:"allowed_headers"`
AllowCredentials bool `yaml:"allow_credentials"`
MaxAge int `yaml:"max_age"` // preflight cache duration in seconds
}
CORSConfig defines Cross-Origin Resource Sharing settings.
type CacheConfig ¶
type CacheConfig struct {
Driver string `yaml:"driver"`
RedisHost string `yaml:"redis_host"`
RedisPort int `yaml:"redis_port"`
RedisPassword string `yaml:"redis_password"`
RedisDB int `yaml:"redis_db"`
}
CacheConfig defines cache settings.
type Config ¶
type Config struct {
Env string `yaml:"env"`
Server ServerConfig `yaml:"server"`
Frontend FrontendConfig `yaml:"frontend"`
Database DatabaseConfig `yaml:"database"`
Cache CacheConfig `yaml:"cache"`
Log LogConfig `yaml:"log"`
JWT JWTConfig `yaml:"jwt"`
Auth AuthConfig `yaml:"auth"`
App AppConfig `yaml:"app"`
Admin AdminConfig `yaml:"admin"`
TLS TLSConfig `yaml:"tls"`
ForwardRuntime ForwardRuntimeConfig `yaml:"forward_runtime"`
Plugins PluginConfig `yaml:"plugins"`
GRPC GRPCConfig `yaml:"grpc"`
}
Config is the root application configuration loaded from config.yaml.
type DatabaseConfig ¶
type DatabaseConfig struct {
Driver string `yaml:"driver"`
Database string `yaml:"database"`
Host string `yaml:"host"`
Port int `yaml:"port"`
Username string `yaml:"username"`
Password string `yaml:"password"`
LogLevel string `yaml:"log_level"`
MaxIdleConns int `yaml:"max_idle_conns"`
MaxOpenConns int `yaml:"max_open_conns"`
ConnMaxLifetime int `yaml:"conn_max_lifetime"`
}
DatabaseConfig defines database connection settings.
type ForwardRuntimeAnsibleConfig ¶
type ForwardRuntimeAnsibleConfig struct {
Inventory string `yaml:"inventory"`
ApplyPlaybook string `yaml:"apply_playbook"`
RemovePlaybook string `yaml:"remove_playbook"`
Become bool `yaml:"become"`
ExtraVars map[string]any `yaml:"extra_vars"`
Command string `yaml:"command"`
WorkingDir string `yaml:"working_dir"`
TargetPattern string `yaml:"target_pattern"`
Environment map[string]string `yaml:"environment"`
TimeoutSeconds int `yaml:"timeout_seconds"`
}
ForwardRuntimeAnsibleConfig stores local ansible runtime settings.
type ForwardRuntimeCleanAgentConfig ¶
type ForwardRuntimeCleanAgentConfig struct {
PublicURL string `yaml:"public_url"`
HeartbeatIntervalSeconds int `yaml:"heartbeat_interval_seconds"`
ActionTimeoutSeconds int `yaml:"action_timeout_seconds"`
TokenExpireSeconds int `yaml:"token_expire_seconds"`
LegacyBridgeEnabled bool `yaml:"legacy_bridge_enabled"`
}
ForwardRuntimeCleanAgentConfig stores clean-room forward agent defaults.
type ForwardRuntimeConfig ¶
type ForwardRuntimeConfig struct {
NodeXMode *bool `yaml:"nodex_mode"`
Backend string `yaml:"backend"`
NodeX ForwardRuntimeNodeXConfig `yaml:"nodex"`
CleanAgent ForwardRuntimeCleanAgentConfig `yaml:"clean_agent"`
NftablesAnsible ForwardRuntimeAnsibleConfig `yaml:"nftables_ansible"`
Jobs ForwardRuntimeJobsConfig `yaml:"jobs"`
GostStats ForwardRuntimeGostStatsConfig `yaml:"gost_stats"`
Latency ForwardRuntimeLatencyConfig `yaml:"latency"`
}
ForwardRuntimeConfig stores the canonical forward runtime settings from config.yaml.
type ForwardRuntimeGostStatsConfig ¶
type ForwardRuntimeGostStatsConfig struct {
PollInterval string `yaml:"poll_interval"`
IdlePollInterval string `yaml:"idle_poll_interval"`
ErrorLogInterval string `yaml:"error_log_interval"`
}
ForwardRuntimeGostStatsConfig stores gost stats polling settings.
type ForwardRuntimeJobsConfig ¶
type ForwardRuntimeJobsConfig struct {
PollInterval string `yaml:"poll_interval"`
IdlePollInterval string `yaml:"idle_poll_interval"`
ErrorLogInterval string `yaml:"error_log_interval"`
BatchSize int `yaml:"batch_size"`
TimeoutSeconds int `yaml:"timeout_seconds"`
}
ForwardRuntimeJobsConfig stores local ansible job executor polling settings.
type ForwardRuntimeLatencyConfig ¶
type ForwardRuntimeLatencyConfig struct {
PollInterval string `yaml:"poll_interval"`
IdlePollInterval string `yaml:"idle_poll_interval"`
ErrorLogInterval string `yaml:"error_log_interval"`
Dials int `yaml:"dials"`
DialTimeout string `yaml:"dial_timeout"`
Concurrency int `yaml:"concurrency"`
RetentionDays int `yaml:"retention_days"`
}
ForwardRuntimeLatencyConfig stores latency prober (TCPing) settings.
type ForwardRuntimeNodeXConfig ¶
type ForwardRuntimeNodeXConfig struct {
BaseURL string `yaml:"base_url"`
Token string `yaml:"token"`
TimeoutSeconds int `yaml:"timeout_seconds"`
}
ForwardRuntimeNodeXConfig stores NodeX or gost runtime settings.
type FrontendConfig ¶
type FrontendConfig struct {
Enable bool `yaml:"enable"`
Port int `yaml:"port"`
Path string `yaml:"path"`
}
FrontendConfig defines static frontend serving settings.
type GRPCConfig ¶
type GRPCConfig struct {
Enable bool `yaml:"enabled"`
Host string `yaml:"host"`
Port int `yaml:"port"`
APIToken string `yaml:"api_token"`
TLSCertFile string `yaml:"tls_cert_file"`
TLSKeyFile string `yaml:"tls_key_file"`
}
GRPCConfig controls the node-facing gRPC server (AnixOps Agent nodes connect here).
type LogConfig ¶
type LogConfig struct {
Level string `yaml:"level"`
Output string `yaml:"output"`
FilePath string `yaml:"file_path"`
MaxSize int `yaml:"max_size"`
MaxBackups int `yaml:"max_backups"`
MaxAge int `yaml:"max_age"`
}
LogConfig defines log settings.
type LoginRateLimitConfig ¶
type LoginRateLimitConfig struct {
Enabled *bool `yaml:"enabled"`
MaxAttempts int `yaml:"max_attempts"`
WindowSeconds int `yaml:"window_seconds"`
LockoutSeconds int `yaml:"lockout_seconds"`
}
LoginRateLimitConfig controls brute-force protection for login.
type PluginConfig ¶
type PluginConfig struct {
OfficialPublicKey string `yaml:"official_public_key"`
IdentityBootstrapPackageDir string `yaml:"identity_bootstrap_package_dir"`
ControlExecutionEnabled bool `yaml:"control_execution_enabled"`
ControlPollInterval string `yaml:"control_poll_interval"`
ControlHostRuntimeDir string `yaml:"control_host_runtime_dir"`
ControlHostArtifactDir string `yaml:"control_host_artifact_dir"`
ControlHostStartupTimeout string `yaml:"control_host_startup_timeout"`
ControlHostRequestTimeout string `yaml:"control_host_request_timeout"`
ControlHostWebSocketSessionTimeout string `yaml:"control_host_websocket_session_timeout"`
DispatchEnabled bool `yaml:"dispatch_enabled"`
DispatchPollInterval string `yaml:"dispatch_poll_interval"`
TopologyExecutionEnabled bool `yaml:"topology_execution_enabled"`
TopologyPollInterval string `yaml:"topology_poll_interval"`
}
PluginConfig controls the official plugin trust root and the opt-in durable lifecycle dispatcher. Third-party plugin execution is intentionally unsupported by the control kernel.
type RegistrationAuthConfig ¶
type RegistrationAuthConfig struct {
Enabled *bool `yaml:"enabled"`
RequireInvite bool `yaml:"require_invite"`
AllowedEmailDomains []string `yaml:"allowed_email_domains"`
BlockedEmailDomains []string `yaml:"blocked_email_domains"`
}
RegistrationAuthConfig controls public account registration policy.
type ServerConfig ¶
type ServerConfig struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
Mode string `yaml:"mode"`
ReadTimeout int `yaml:"read_timeout"`
WriteTimeout int `yaml:"write_timeout"`
TrustedProxies []string `yaml:"trusted_proxies"`
CORS CORSConfig `yaml:"cors"`
}
ServerConfig defines backend server settings.