config

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Type               string `mapstructure:"type"`                  // "basic" or "oidc"
	JWTSecret          string `mapstructure:"jwt_secret"`            // Secret for JWT signing
	OIDCIssuerURL      string `mapstructure:"oidc_issuer_url"`       // OIDC provider issuer URL (e.g., https://accounts.google.com)
	OIDCClientID       string `mapstructure:"oidc_client_id"`        // OIDC client ID
	OIDCClientSecret   string `mapstructure:"oidc_client_secret"`    // OIDC client secret
	OIDCRedirectURL    string `mapstructure:"oidc_redirect_url"`     // OIDC redirect URL (e.g., http://localhost:8460/auth/oidc/callback)
	ProxyAdminGroups   string `mapstructure:"proxy_admin_groups"`    // Comma-separated Keycloak/OIDC groups that grant admin (e.g., "admin,nebi-admin")
	ProxyDefaultRole   string `mapstructure:"proxy_default_role"`    // Default role for proxy-authenticated users (default: "editor")
	DeviceFlowClientID string `mapstructure:"device_flow_client_id"` // OIDC device flow public client ID (for RFC 8628 CLI login)
}

AuthConfig holds authentication configuration

type Config

type Config struct {
	Mode           string               `mapstructure:"mode"` // "local" or "team" (default: "team")
	Server         ServerConfig         `mapstructure:"server"`
	Database       DatabaseConfig       `mapstructure:"database"`
	Auth           AuthConfig           `mapstructure:"auth"`
	Queue          QueueConfig          `mapstructure:"queue"`
	Log            LogConfig            `mapstructure:"log"`
	PackageManager PackageManagerConfig `mapstructure:"package_manager"`
	Storage        StorageConfig        `mapstructure:"storage"`
}

Config holds all application configuration

func Load

func Load() (*Config, error)

Load reads configuration from file and environment variables

func (*Config) IsLocalMode

func (c *Config) IsLocalMode() bool

IsLocalMode returns true when the server is running in local/desktop mode.

type DatabaseConfig

type DatabaseConfig struct {
	Driver          string `mapstructure:"driver"`            // "sqlite" or "postgres"
	DSN             string `mapstructure:"dsn"`               // Connection string
	MaxIdleConns    int    `mapstructure:"max_idle_conns"`    // Maximum idle connections (Postgres)
	MaxOpenConns    int    `mapstructure:"max_open_conns"`    // Maximum open connections (Postgres)
	ConnMaxLifetime int    `mapstructure:"conn_max_lifetime"` // Connection max lifetime in minutes (Postgres)
}

DatabaseConfig holds database configuration

type LogConfig

type LogConfig struct {
	Format string `mapstructure:"format"` // "json" or "text"
	Level  string `mapstructure:"level"`  // "debug", "info", "warn", "error"
}

LogConfig holds logging configuration

type PackageManagerConfig

type PackageManagerConfig struct {
	DefaultType string `mapstructure:"default_type"` // "pixi" or "uv"
	PixiPath    string `mapstructure:"pixi_path"`    // Custom pixi binary path (optional)
	UvPath      string `mapstructure:"uv_path"`      // Custom uv binary path (optional)
}

PackageManagerConfig holds package manager configuration

type QueueConfig

type QueueConfig struct {
	Type       string `mapstructure:"type"`        // "memory" or "valkey"
	ValkeyAddr string `mapstructure:"valkey_addr"` // Valkey address (if type=valkey), e.g., "localhost:6379"
}

QueueConfig holds job queue configuration

type ServerConfig

type ServerConfig struct {
	Host     string `mapstructure:"host"` // Bind host/IP (e.g. "127.0.0.1", "0.0.0.0")
	Port     int    `mapstructure:"port"`
	Mode     string `mapstructure:"mode"`      // "development" or "production"
	BasePath string `mapstructure:"base_path"` // URL path prefix (e.g. "/nebi")
}

ServerConfig holds HTTP server configuration Host may be empty to allow "all interfaces" bind behavior.

type StorageConfig

type StorageConfig struct {
	WorkspacesDir string `mapstructure:"workspaces_dir"` // Directory where workspaces are stored
}

StorageConfig holds storage configuration

Jump to

Keyboard shortcuts

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