config

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port        string `default:"8080"`
	Environment string `default:"development"`
	LogLevel    string `default:"info"`

	// Database
	DatabaseURL    string `default:"postgresql://regen:secret@localhost:5432/regen?sslmode=disable"`
	DBMaxOpenConns int    `default:"25"`
	DBMaxIdleConns int    `default:"5"`
	DBConnMaxLife  string `default:"5m"`

	// Redis — single instance (default) or Sentinel (HA)
	// Set REDIS_SENTINEL_ADDRS to a comma-separated list of sentinel addresses
	// (e.g. "sentinel1:26379,sentinel2:26379,sentinel3:26379") to enable Sentinel mode.
	// REDIS_URL is ignored when Sentinel is active.
	RedisURL            string `default:"redis://localhost:6379"`
	RedisSentinelAddrs  string // REDIS_SENTINEL_ADDRS — comma-separated sentinel host:port list
	RedisSentinelMaster string // REDIS_SENTINEL_MASTER — master name (default: "mymaster")
	RedisPassword       string // REDIS_PASSWORD — used in both single and Sentinel mode

	// Slack
	SlackBotToken      string
	SlackSigningSecret string
	SlackAppToken      string

	// OpenAI (optional — AI features disabled if APIKey is empty)
	OpenAIAPIKey              string
	OpenAIModel               string `default:"gpt-4o-mini"`
	OpenAIMaxTokens           int    `default:"1000"`
	OpenAIPostMortemMaxTokens int    `default:"3000"`

	// Multi-provider AI connector (OPE-113)
	// AI_PROVIDER selects the active backend; existing OPENAI_API_KEY deployments work unchanged.
	AIProvider      string // AI_PROVIDER — "openai" | "anthropic" | "ollama" (default: "openai")
	AnthropicAPIKey string // ANTHROPIC_API_KEY
	AnthropicModel  string // ANTHROPIC_MODEL (default: claude-haiku-4-5-20251001)
	OllamaBaseURL   string // OLLAMA_BASE_URL — e.g. http://localhost:11434
	OllamaModel     string // OLLAMA_MODEL (default: llama3)

	// Microsoft Teams (optional — Teams features disabled if AppID is empty)
	TeamsAppID       string
	TeamsAppPassword string
	TeamsTenantID    string
	TeamsTeamID      string // ID of the Team where incident channels are created
	TeamsBotUserID   string // AAD object ID of the bot user; required for direct messages
	TeamsServiceURL  string // Bot Framework relay URL for this tenant (e.g. https://smba.trafficmanager.net/amer/)

	// OSS team size limit — max active human users (AI agents and deactivated
	// users never count). Override via OSS_USER_LIMIT env var (e.g. set higher
	// for a Pro/SaaS deployment). Default: 7.
	OSSUserLimit int

	// Frontend URL (used by agents to build deep links)
	FrontendURL string `env:"FRONTEND_URL" envDefault:"http://localhost:3000"`

	// Pro licence key (optional — OSS mode when absent)
	LicenceKey string // REGEN_LICENCE_KEY

	// Telemetry — enabled by default; set REGEN_NO_TELEMETRY=1 to disable globally
	TelemetryDisabled bool // REGEN_NO_TELEMETRY=1

	// SAML SSO (optional — SSO disabled if SAMLIDPMetadataURL is empty)
	// When disabled all routes are open (backwards-compatible with existing deployments).
	SAMLIDPMetadataURL    string // SAML_IDP_METADATA_URL — IdP metadata endpoint
	SAMLEntityID          string // SAML_ENTITY_ID — SP EntityID (defaults to <base_url>/saml/metadata)
	SAMLBaseURL           string // SAML_BASE_URL — externally reachable base URL of this instance
	SAMLCertFile          string // SAML_CERT_FILE — path to SP certificate PEM (self-signed generated if empty)
	SAMLKeyFile           string // SAML_KEY_FILE — path to SP private key PEM
	SAMLAllowIDPInitiated bool   // SAML_ALLOW_IDP_INITIATED — allow IdP-initiated flows (Okta tile click)
}

Config holds all application configuration

func Load

func Load() (*Config, error)

Load reads configuration from environment variables

func (*Config) IsDevelopment

func (c *Config) IsDevelopment() bool

IsDevelopment returns true if running in development mode

func (*Config) IsProduction

func (c *Config) IsProduction() bool

IsProduction returns true if running in production mode

Jump to

Keyboard shortcuts

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