Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" Revision = "unknown" BuildTime = "unknown" )
Functions ¶
func ShortRevision ¶
func ShortRevision() string
ShortRevision returns the first 8 characters of the revision hash
Types ¶
type AppEnvironment ¶
type AppEnvironment string
const ( AppEnvironmentProduction AppEnvironment = "production" AppEnvironmentDevelopment AppEnvironment = "development" AppEnvironmentTest AppEnvironment = "test" )
func (AppEnvironment) IsProdEnvironment ¶
func (a AppEnvironment) IsProdEnvironment() bool
func (AppEnvironment) IsTestEnvironment ¶
func (a AppEnvironment) IsTestEnvironment() bool
type BuildablesConfig ¶
BuildablesConfig provides stub fields when buildables are not enabled. This keeps references compile-safe while avoiding env-based configuration.
type Config ¶
type Config struct {
AppUrl string `env:"APP_URL" default:"http://localhost:3552"`
DatabaseURL string `` /* 134-byte string literal not displayed */
Port string `env:"PORT" default:"3552"`
Listen string `env:"LISTEN" default:""`
Environment AppEnvironment `env:"ENVIRONMENT" default:"production"`
JWTSecret string `env:"JWT_SECRET" default:"default-jwt-secret-change-me" options:"file"` //nolint:gosec // configuration field name is part of stable config API
EncryptionKey string `env:"ENCRYPTION_KEY" default:"arcane-dev-key-32-characters!!!" options:"file"`
OidcEnabled bool `env:"OIDC_ENABLED" default:"false"`
OidcClientID string `env:"OIDC_CLIENT_ID" default:"" options:"file"`
OidcClientSecret string `env:"OIDC_CLIENT_SECRET" default:"" options:"file"`
OidcIssuerURL string `env:"OIDC_ISSUER_URL" default:""`
OidcScopes string `env:"OIDC_SCOPES" default:"openid email profile"`
OidcAdminClaim string `env:"OIDC_ADMIN_CLAIM" default:""`
OidcAdminValue string `env:"OIDC_ADMIN_VALUE" default:""`
OidcSkipTlsVerify bool `env:"OIDC_SKIP_TLS_VERIFY" default:"false"`
OidcAutoRedirectToProvider bool `env:"OIDC_AUTO_REDIRECT_TO_PROVIDER" default:"false"`
OidcProviderName string `env:"OIDC_PROVIDER_NAME" default:""`
OidcProviderLogoUrl string `env:"OIDC_PROVIDER_LOGO_URL" default:""`
DockerHost string `env:"DOCKER_HOST" default:"unix:///var/run/docker.sock"`
ProjectsDirectory string `env:"PROJECTS_DIRECTORY" default:"/app/data/projects"`
LogJson bool `env:"LOG_JSON" default:"false"`
LogLevel string `env:"LOG_LEVEL" default:"info" options:"toLower"`
AgentMode bool `env:"AGENT_MODE" default:"false"`
AgentToken string `env:"AGENT_TOKEN" default:"" options:"file"`
ManagerApiUrl string `env:"MANAGER_API_URL" default:""`
UpdateCheckDisabled bool `env:"UPDATE_CHECK_DISABLED" default:"false"`
UIConfigurationDisabled bool `env:"UI_CONFIGURATION_DISABLED" default:"false"`
AnalyticsDisabled bool `env:"ANALYTICS_DISABLED" default:"false"`
GPUMonitoringEnabled bool `env:"GPU_MONITORING_ENABLED" default:"false"`
GPUType string `env:"GPU_TYPE" default:"auto"`
EdgeAgent bool `env:"EDGE_AGENT" default:"false"`
EdgeReconnectInterval int `env:"EDGE_RECONNECT_INTERVAL" default:"5"` // seconds
FilePerm os.FileMode `env:"FILE_PERM" default:"0644"`
DirPerm os.FileMode `env:"DIR_PERM" default:"0755"`
GitWorkDir string `env:"GIT_WORK_DIR" default:"data/git"`
DockerAPITimeout int `env:"DOCKER_API_TIMEOUT" default:"0"`
DockerImagePullTimeout int `env:"DOCKER_IMAGE_PULL_TIMEOUT" default:"0"`
TrivyScanTimeout int `env:"TRIVY_SCAN_TIMEOUT" default:"0"`
GitOperationTimeout int `env:"GIT_OPERATION_TIMEOUT" default:"0"`
HTTPClientTimeout int `env:"HTTP_CLIENT_TIMEOUT" default:"0"`
RegistryTimeout int `env:"REGISTRY_TIMEOUT" default:"0"`
ProxyRequestTimeout int `env:"PROXY_REQUEST_TIMEOUT" default:"0"`
BackupVolumeName string `env:"ARCANE_BACKUP_VOLUME_NAME" default:"arcane-backups"`
// Timezone for cron job scheduling. Uses IANA timezone names (e.g., "America/New_York", "Europe/London").
// "Local" uses the system's local timezone, "UTC" for Coordinated Universal Time.
Timezone string `env:"TZ" default:"Local"`
// BuildablesConfig contains feature-specific configuration that can be conditionally compiled
BuildablesConfig
}
Config holds all application configuration. Fields tagged with `env` will be loaded from the corresponding environment variable. Fields with `options:"file"` support Docker secrets via the _FILE suffix. Available options: file, toLower, trimTrailingSlash
func (*Config) GetAppURL ¶
GetAppURL returns the effective application URL. If in agent mode and APP_URL is not explicitly set, it returns the manager's URL.
func (*Config) GetLocation ¶
GetLocation returns the timezone location for cron scheduling. It parses the Timezone config (TZ env var) into a *time.Location. Returns the system's local timezone if Timezone is "Local". Defaults to UTC if not set or if the timezone cannot be loaded.
func (*Config) GetManagerBaseURL ¶
GetManagerBaseURL returns the base URL of the manager application. It strips any trailing slashes or /api suffix from MANAGER_API_URL.
func (*Config) ListenAddr ¶
ListenAddr returns the effective address for the HTTP server to bind to. It uses LISTEN as the host (if set) and PORT for the port.
func (*Config) MaskSensitive ¶
MaskSensitive returns a copy of the config with sensitive fields masked. Useful for logging configuration without exposing secrets.