config

package
v3.0.0-...-a8f5813 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version          = "dev"
	Revision         = "unknown"
	BuildTime        = "unknown"
	NodeVersion      = "unknown"
	SvelteKitVersion = "unknown"
)
View Source
var ErrDirectAgentRemoved = errors.New("direct agents were removed in v3; set ARCANE_AGENT=true and ARCANE_MANAGER_API_URL, then re-enroll from the manager")

Functions

func DirectAgentRequested

func DirectAgentRequested(getenv func(string) string) bool

func EnvNames

func EnvNames() []string

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:"ARCANE_APP_URL" default:""`
	DatabaseURL       string         `` /* 142-byte string literal not displayed */
	ActorPort         string         `env:"ARCANE_ACTOR_PORT" default:"3551"`
	Port              string         `env:"ARCANE_PORT" default:"3552"`
	Listen            string         `env:"ARCANE_LISTEN" default:""`
	TLSCertFile       string         `env:"ARCANE_TLS_CERT_FILE" default:""`
	TLSKeyFile        string         `env:"ARCANE_TLS_KEY_FILE" default:""`
	Environment       AppEnvironment `env:"ARCANE_ENVIRONMENT" default:"production"`
	EncryptionKey     string         `env:"ARCANE_ENCRYPTION_KEY" default:"" options:"file"`
	AdminStaticAPIKey string         `env:"ARCANE_ADMIN_STATIC_API_KEY" default:"" options:"file"`
	ApnsRelayUrl      string         `env:"ARCANE_APNS_RELAY_URL" default:"https://apns.getarcane.app" options:"trimTrailingSlash"`
	ApnsKeyAlgorithm  string         `env:"ARCANE_APNS_KEY_ALGORITHM" default:"ed25519" options:"toLower"`

	OidcRoleMappings string `env:"ARCANE_OIDC_ROLE_MAPPINGS" default:"" options:"file"`

	PUID                string `env:"PUID" default:""`
	PGID                string `env:"PGID" default:""`
	DockerConfig        string `env:"DOCKER_CONFIG" default:""`
	LogLevel            string `env:"ARCANE_LOG_LEVEL" default:"info" options:"toLower"`
	AgentToken          string `env:"ARCANE_AGENT_TOKEN" default:"" options:"file"`
	ManagerApiUrl       string `env:"ARCANE_MANAGER_API_URL" default:""`
	AgentTransport      string `env:"ARCANE_AGENT_TRANSPORT" default:"auto" options:"toLower"`
	AgentMTLSMode       string `env:"ARCANE_AGENT_MTLS_MODE" default:"disabled" options:"toLower"`
	AgentMTLSCAFile     string `env:"ARCANE_AGENT_MTLS_CA_FILE" default:""`
	AgentMTLSCertFile   string `env:"ARCANE_AGENT_MTLS_CERT_FILE" default:""`
	AgentMTLSKeyFile    string `env:"ARCANE_AGENT_MTLS_KEY_FILE" default:""`
	AgentMTLSServerName string `env:"ARCANE_AGENT_MTLS_SERVER_NAME" default:""`
	AgentMTLSAssetsDir  string `env:"ARCANE_AGENT_MTLS_ASSETS_DIR" default:""`

	TrustedProxies          string        `env:"ARCANE_TRUSTED_PROXIES" default:""`
	GitWorkDir              string        `env:"ARCANE_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"`
	JWTRefreshExpiry        time.Duration `env:"ARCANE_JWT_REFRESH_EXPIRY" default:"168h"`
	AgentReconnectInterval  int           `env:"ARCANE_AGENT_RECONNECT_INTERVAL" default:"5"` // seconds
	FilePerm                os.FileMode   `env:"ARCANE_FILE_PERM" default:"0644"`
	DirPerm                 os.FileMode   `env:"ARCANE_DIR_PERM" default:"0755"`
	AllowDowngrade          bool          `env:"ARCANE_ALLOW_DOWNGRADE" default:"false"`
	AllowCLIPasswordReset   bool          `env:"ARCANE_ALLOW_CLI_PASSWORD_RESET" default:"false"`
	AllowCLIMFAReset        bool          `env:"ARCANE_ALLOW_CLI_MFA_RESET" default:"false"`
	TLSEnabled              bool          `env:"ARCANE_TLS_ENABLED" default:"false"`
	InContainer             bool          `env:"ARCANE_IN_CONTAINER" default:"false"`
	LogJson                 bool          `env:"ARCANE_LOG_JSON" default:"false"`
	UIConfigurationDisabled bool          `env:"ARCANE_UI_CONFIGURATION_DISABLED" default:"false"`

	AgentEnabled         bool `env:"ARCANE_AGENT" default:"false"`
	UpgradeKeepContainer bool `env:"ARCANE_UPGRADE_KEEP_CONTAINER" default:"false"`
}

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.

func Load

func Load() (*Config, error)

func (*Config) GetAppURL

func (c *Config) GetAppURL() string

GetAppURL returns the effective application 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.

func (*Config) TimezoneName

func (c *Config) TimezoneName() string

func (*Config) Validate

func (c *Config) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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