config

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SystemNamespace string `env:"SYSTEM_NAMESPACE,required"`
	// Root
	ExternalUIUrl  string `env:"EXTERNAL_UI_URL" envDefault:"http://localhost:3000"`
	ExternalAPIURL string `env:"EXTERNAL_API_URL" envDefault:"http://localhost:8089"`
	// This is for generating subdomains
	BootstrapWildcardBaseURL string `env:"BOOTSTRAP_WILDCARD_BASE_URL" envDefault:"http://localhost:8089"`
	ExternalOauth2URL        string `env:"EXTERNAL_OAUTH2_URL" envDefault:"http://localhost:8090"`
	// For unbind custom service definitions
	UnbindServiceDefVersion string `env:"UNBIND_SERVICE_DEF_VERSION" envDefault:"v0.1.52"`
	// Github Specific
	GithubURL        string `env:"GITHUB_URL" envDefault:"https://github.com"` // Override for github enterprise
	GithubWebhookURL string
	// By default we will just use the external URL for the bind and unbind suffixes
	UnbindSuffix string `env:"UNBIND_SUFFIX"`
	// Postgres
	PostgresHost     string `env:"POSTGRES_HOST" envDefault:"localhost"`
	PostgresPort     int    `env:"POSTGRES_PORT" envDefault:"5432"`
	PostgresUser     string `env:"POSTGRES_USER" envDefault:"postgres"`
	PostgresPassword string `env:"POSTGRES_PASSWORD" envDefault:"postgres"`
	PostgresDB       string `env:"POSTGRES_DB" envDefault:"unbind"`
	PostgresSSLMode  string `env:"POSTGRES_SSL_MODE" envDefault:"disable"`
	// Redis
	RedisURL string `env:"REDIS_URL" envDefault:"localhost:6379"`
	// Dex (OIDC provider)
	DexIssuerURL         string `env:"DEX_ISSUER_URL"`
	DexIssuerUrlExternal string `env:"DEX_ISSUER_URL_EXTERNAL"`
	DexClientID          string `env:"DEX_CLIENT_ID"`
	DexClientSecret      string `env:"DEX_CLIENT_SECRET"`
	// Kubernetes config, optional - if in cluster it will use the in-cluster config
	KubeConfig string `env:"KUBECONFIG"`
	// kube-oidc-proxy
	KubeProxyURL string `env:"KUBE_PROXY_URL" envDefault:"https://kube-oidc-proxy.unbind-system.svc.cluster.local:443"`
	// Registry specific
	BootstrapContainerRegistryHost     string `env:"BOOTSTRAP_CONTAINER_REGISTRY_HOST"`
	BootstrapContainerRegistryUser     string `env:"BOOTSTRAP_CONTAINER_REGISTRY_USER"`
	BootstrapContainerRegistryPassword string `env:"BOOTSTRAP_CONTAINER_REGISTRY_PASSWORD"`
	// Buildkit
	BuildkitHost string `env:"BUILDKIT_HOST" envDefault:"tcp://buildkitd.unbind-system:1234"`
	// Logging
	LokiEndpoint string `env:"LOKI_ENDPOINT" envDefault:"http://loki-unbind-gateway.unbind-system.svc.cluster.local"`
	// Metrics
	PrometheusEndpoint string `env:"PROMETHEUS_ENDPOINT" envDefault:"http://kube-prometheus-stack-prometheus.monitoring:9090"`
	// Oauth
	DexConnectorSecret string `env:"DEX_CONNECTOR_SECRET" envDefault:"dex-secret"`
	// Dev origins will inject localhost:3000 into cors, etc.
	InjectDevOrigins bool `env:"INJECT_DEV_ORIGINS" envDefault:"false"`
	// ! TODO - remove me some day, for bypassing oauth
	AdminTesterToken string `env:"ADMIN_TESTER_TOKEN"`
	SkipBootstrap    bool   `env:"SKIP_BOOTSTRAP" envDefault:"false"`
	// Builder to pass around
	BuildImage string
	// Enable dev login page
	EnableDevLoginPage bool `env:"ENABLE_DEV_LOGIN_PAGE" envDefault:"false"`
	// Override the release repository for testing
	ReleaseRepoOverride string `env:"RELEASE_REPO_OVERRIDE"`
}

func NewConfig

func NewConfig() *Config

Parse environment variables into a Config struct

func (*Config) GetBuildImage

func (self *Config) GetBuildImage() string

func (*Config) GetBuildkitHost

func (self *Config) GetBuildkitHost() string

func (*Config) GetKubeConfig

func (self *Config) GetKubeConfig() string

func (*Config) GetKubeProxyURL

func (self *Config) GetKubeProxyURL() string

func (*Config) GetPostgresDB

func (self *Config) GetPostgresDB() string

func (*Config) GetPostgresHost

func (self *Config) GetPostgresHost() string

func (*Config) GetPostgresPassword

func (self *Config) GetPostgresPassword() string

func (*Config) GetPostgresPort

func (self *Config) GetPostgresPort() int

func (*Config) GetPostgresSSLMode

func (self *Config) GetPostgresSSLMode() string

func (*Config) GetPostgresUser

func (self *Config) GetPostgresUser() string

func (*Config) GetSystemNamespace

func (self *Config) GetSystemNamespace() string

type ConfigInterface

type ConfigInterface interface {
	GetPostgresHost() string
	GetPostgresPort() int
	GetPostgresUser() string
	GetPostgresPassword() string
	GetPostgresDB() string
	GetPostgresSSLMode() string
	GetKubeConfig() string
	GetSystemNamespace() string
	GetKubeProxyURL() string
	GetBuildkitHost() string
	GetBuildImage() string
}

Jump to

Keyboard shortcuts

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