config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

internal/config/config.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(envFilePath string) error

LoadConfig loads configuration from the specified .env file path and environment variables.

Types

type Config

type Config struct {
	APIPort                      string        `mapstructure:"API_PORT"`
	JWTSecret                    string        `mapstructure:"JWT_SECRET"`
	JWTExpiration                time.Duration `mapstructure:"JWT_EXPIRATION"`  // Renamed for clarity - uses time.Duration directly
	APIUserGroup                 string        `mapstructure:"API_USER_GROUP"`  // Group required for basic API login (alternative to clab_admins)
	SuperuserGroup               string        `mapstructure:"SUPERUSER_GROUP"` // Group for elevated privileges
	ClabRuntime                  string        `mapstructure:"CLAB_RUNTIME"`
	ClabLabsRoot                 string        `mapstructure:"CLAB_LABS_ROOT"`
	CapturePacketflixPort        int           `mapstructure:"CAPTURE_PACKETFLIX_PORT"`
	CaptureRemoteHostname        string        `mapstructure:"CAPTURE_REMOTE_HOSTNAME"`
	CaptureWiresharkDockerImage  string        `mapstructure:"CAPTURE_WIRESHARK_DOCKER_IMAGE"`
	CaptureWiresharkPullPolicy   string        `mapstructure:"CAPTURE_WIRESHARK_PULL_POLICY"`
	CaptureWiresharkSessionTTL   time.Duration `mapstructure:"CAPTURE_WIRESHARK_SESSION_TTL"`
	CaptureEdgesharkExtraEnvVars string        `mapstructure:"CAPTURE_EDGESHARK_EXTRA_ENV_VARS"`
	LogLevel                     string        `mapstructure:"LOG_LEVEL"`
	CORSAllowedOrigins           string        `mapstructure:"CORS_ALLOWED_ORIGINS"` // Comma-separated list of allowed browser origins
	TLSEnable                    bool          `mapstructure:"TLS_ENABLE"`
	TLSAutoCert                  bool          `mapstructure:"TLS_AUTO_CERT"`
	TLSCertFile                  string        `mapstructure:"TLS_CERT_FILE"`
	TLSKeyFile                   string        `mapstructure:"TLS_KEY_FILE"`
	GinMode                      string        `mapstructure:"GIN_MODE"`
	TrustedProxies               string        `mapstructure:"TRUSTED_PROXIES"`
	APIServerHost                string        `mapstructure:"API_SERVER_HOST"` // Host/IP/FQDN used for SSH access commands
	SSHBasePort                  int           `mapstructure:"SSH_BASE_PORT"`   // Base port for SSH proxy allocation
	SSHMaxPort                   int           `mapstructure:"SSH_MAX_PORT"`    // Maximum port for SSH proxy allocation
	TerminalMaxSessionsPerUser   int           `mapstructure:"TERMINAL_MAX_SESSIONS_PER_USER"`
}
var AppConfig Config

Jump to

Keyboard shortcuts

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