Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v2.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version          = "dev"
	Revision         = "unknown"
	BuildTime        = "unknown"
	NodeVersion      = "unknown"
	SvelteKitVersion = "unknown"
)

Functions

func GoVersion

func GoVersion() string

GoVersion returns the Go runtime version

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

type BuildablesConfig struct {
	AutoLoginUsername string
	AutoLoginPassword string
}

BuildablesConfig provides stub fields when buildables are not enabled. This keeps references compile-safe while avoiding env-based configuration.

type Config

type Config struct {
	BuildablesConfig

	AppUrl                string         `env:"APP_URL" default:"http://localhost:3552"`
	DatabaseURL           string         `` /* 135-byte string literal not displayed */
	AllowDowngrade        bool           `env:"ALLOW_DOWNGRADE" default:"false"`
	AllowCLIPasswordReset bool           `env:"ALLOW_CLI_PASSWORD_RESET" default:"false"`
	AllowCLIMFAReset      bool           `env:"ALLOW_CLI_MFA_RESET" default:"false"`
	ActorPort             string         `env:"ACTOR_PORT" default:"3551"`
	Port                  string         `env:"PORT" default:"3552"`
	Listen                string         `env:"LISTEN" default:""`
	TLSEnabled            bool           `env:"TLS_ENABLED" default:"false"`
	TLSCertFile           string         `env:"TLS_CERT_FILE" default:""`
	TLSKeyFile            string         `env:"TLS_KEY_FILE" default:""`
	Environment           AppEnvironment `env:"ENVIRONMENT" default:"production"`
	JWTSecret             string         `env:"JWT_SECRET" options:"file,deprecated"`
	JWTRefreshExpiry      time.Duration  `env:"JWT_REFRESH_EXPIRY" default:"168h"`
	EncryptionKey         string         `env:"ENCRYPTION_KEY" default:"arcane-dev-key-32-characters!!!" options:"file"`
	AdminStaticAPIKey     string         `env:"ADMIN_STATIC_API_KEY" default:"" options:"file"`
	ApnsRelayUrl          string         `env:"APNS_RELAY_URL" default:"https://apns.getarcane.app" options:"trimTrailingSlash"`
	ApnsKeyAlgorithm      string         `env:"APNS_KEY_ALGORITHM" default:"ed25519" options:"toLower"`

	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"`
	OidcGroupsClaim            string `env:"OIDC_GROUPS_CLAIM" default:"groups"`
	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:""`
	OidcMobileRedirectUris     string `env:"OIDC_MOBILE_REDIRECT_URIS" default:"arcane-mobile://oidc-callback"`
	OidcRoleMappings           string `env:"OIDC_ROLE_MAPPINGS" default:"" options:"file"`

	PUID                          string `env:"PUID" default:""`
	PGID                          string `env:"PGID" default:""`
	DockerHost                    string `env:"DOCKER_HOST" default:"unix:///var/run/docker.sock"`
	DockerConfig                  string `env:"DOCKER_CONFIG" default:""`
	ProjectsDirectory             string `env:"PROJECTS_DIRECTORY" default:"/app/data/projects"`
	TemplatesDirectory            string `env:"TEMPLATES_DIRECTORY" default:"/app/data/templates"`
	ProjectScanMaxDepth           int    `env:"PROJECT_SCAN_MAX_DEPTH" default:"3"`
	ProjectWorkspaceMaxDepth      int    `env:"PROJECT_WORKSPACE_MAX_DEPTH" default:"20"`
	ProjectWorkspaceMaxEntries    int    `env:"PROJECT_WORKSPACE_MAX_ENTRIES" default:"2000"`
	ProjectWorkspaceMaxFileSizeMB int    `env:"PROJECT_WORKSPACE_MAX_FILE_SIZE_MB" default:"10"`
	ProjectScanSkipDirs           string `` /* 135-byte string literal not displayed */
	VolumeWorkspaceMaxDepth       int    `env:"VOLUME_WORKSPACE_MAX_DEPTH" default:"50"`
	VolumeWorkspaceMaxEntries     int    `env:"VOLUME_WORKSPACE_MAX_ENTRIES" default:"10000"`
	VolumeWorkspaceMaxFileSizeMB  int    `env:"VOLUME_WORKSPACE_MAX_FILE_SIZE_MB" default:"10"`
	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"`
	EdgeTransport         string `env:"EDGE_TRANSPORT" default:"auto" options:"toLower"`
	EdgeReconnectInterval int    `env:"EDGE_RECONNECT_INTERVAL" default:"5"` // seconds
	EdgeMuxDisabled       bool   `env:"EDGE_MUX_DISABLED" default:"false"`   // keeps the legacy edge message protocol; remove in v3
	EdgeMTLSMode          string `env:"EDGE_MTLS_MODE" default:"disabled" options:"toLower"`
	EdgeMTLSCAFile        string `env:"EDGE_MTLS_CA_FILE" default:""`
	EdgeMTLSCertFile      string `env:"EDGE_MTLS_CERT_FILE" default:""`
	EdgeMTLSKeyFile       string `env:"EDGE_MTLS_KEY_FILE" default:""`
	EdgeMTLSServerName    string `env:"EDGE_MTLS_SERVER_NAME" default:""`
	EdgeMTLSAssetsDir     string `env:"EDGE_MTLS_ASSETS_DIR" default:""`

	TrustedProxies   string      `env:"TRUSTED_PROXIES" default:""`
	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"`
	BackupVolumeName string      `env:"ARCANE_BACKUP_VOLUME_NAME" default:"arcane-backups"`
	HTTPProxy        string      `env:"HTTP_PROXY" default:""`
	HTTPSProxy       string      `env:"HTTPS_PROXY" default:""`
	NoProxy          string      `env:"NO_PROXY" default:""`
	Timezone         string      `env:"TZ" default:"Local"`
}

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, deprecated

func Load

func Load() *Config

func (*Config) DeprecatedEnvVarsSet added in v2.10.0

func (c *Config) DeprecatedEnvVarsSet() []string

DeprecatedEnvVarsSet returns the env names of fields tagged deprecated that still carry a value, so bootstrap can warn once logging is configured.

func (*Config) GetAppURL

func (c *Config) GetAppURL() string

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

func (c *Config) GetLocation() *time.Location

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) ListenAddr

func (c *Config) ListenAddr() string

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

func (c *Config) MaskSensitive() map[string]any

MaskSensitive returns a copy of the config with sensitive fields masked. Useful for logging configuration without exposing secrets.

type ProjectWorkspaceConfig added in v2.8.0

type ProjectWorkspaceConfig struct {
	ProjectScanMaxDepth           int
	ProjectWorkspaceMaxDepth      int
	ProjectWorkspaceMaxEntries    int
	ProjectWorkspaceMaxFileSizeMB int
	ProjectScanSkipDirs           string
}

func LoadProjectWorkspaceConfig added in v2.8.0

func LoadProjectWorkspaceConfig() ProjectWorkspaceConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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