Environment variables

The environment variables that the server, the updater and the tools read.

This page is generated from the configuration loader, the environment reads of the programs and the deployment templates by make docs-gen. Do not edit it by hand: make docs-check fails when it differs from the code.

Configuration overrides

Every setting of the server configuration except lists of objects and maps can be overridden with an environment variable. The name is MYRIARCH_ followed by the YAML path in upper case, joined with _. A camelCase key is not split: server.publicUrl becomes MYRIARCH_SERVER_PUBLICURL.

  • A list is given as comma separated values, for example MYRIARCH_AUTH_OIDC_SCOPES=openid,profile,email.
  • A duration uses Go syntax such as 30s or 5m. A plain integer is rejected.
  • An empty value is ignored for a boolean, a number and a duration. For a string it sets the empty string.
  • The overrides apply to myriarchd serve, myriarchd dev, myriarchd config validate and myriarchd config print. myriarchd migrate applies only the overrides of the database settings (MYRIARCH_DATABASE_*).
  • An override wins over the configuration file.
  • Lists of objects and maps (opamp.enrollmentTokens, notifications.channels, auth.devLogin.users and the executors maps) cannot be set through the environment.
VariableKeyType
MYRIARCH_ARTIFACTS_AGENTBASEURLSartifacts.agentBaseUrlslist of strings
MYRIARCH_ARTIFACTS_ALLOWEDREDIRECTHOSTSartifacts.allowedRedirectHostslist of strings
MYRIARCH_ARTIFACTS_ALLOWINSECUREAGENTBASEURLSartifacts.allowInsecureAgentBaseUrlsboolean
MYRIARCH_ARTIFACTS_ALLOWUNVERIFIEDartifacts.allowUnverifiedboolean
MYRIARCH_ARTIFACTS_DIRartifacts.dirstring
MYRIARCH_ARTIFACTS_DOWNLOADTOKENTTLartifacts.downloadTokenTtlduration
MYRIARCH_ARTIFACTS_MAXCACHEBYTESartifacts.maxCacheBytesinteger
MYRIARCH_ARTIFACTS_PREFETCHPLATFORMSartifacts.prefetchPlatformslist of strings
MYRIARCH_ARTIFACTS_PROXYURLartifacts.proxyUrlstring
MYRIARCH_ARTIFACTS_SOURCEAUTH_PASSWORDFILEartifacts.sourceAuth.passwordFilestring
MYRIARCH_ARTIFACTS_SOURCEAUTH_TOKENFILEartifacts.sourceAuth.tokenFilestring
MYRIARCH_ARTIFACTS_SOURCEAUTH_USERNAMEartifacts.sourceAuth.usernamestring
MYRIARCH_ARTIFACTS_SOURCEBASEURLartifacts.sourceBaseUrlstring
MYRIARCH_ARTIFACTS_VERIFY_CERTIFICATEIDENTITYREGEXPartifacts.verify.certificateIdentityRegexpstring
MYRIARCH_ARTIFACTS_VERIFY_CERTIFICATEOIDCISSUERartifacts.verify.certificateOidcIssuerstring
MYRIARCH_ARTIFACTS_VERIFY_REQUIRECHECKSUMartifacts.verify.requireChecksumboolean
MYRIARCH_ARTIFACTS_VERIFY_REQUIRESIGNATUREartifacts.verify.requireSignatureboolean
MYRIARCH_ARTIFACTS_VERIFY_TRUSTEDROOTFILEartifacts.verify.trustedRootFilestring
MYRIARCH_ARTIFACTS_VERIFY_TUFREPOSITORYURLartifacts.verify.tufRepositoryUrlstring
MYRIARCH_AUTH_APITOKENMAXTTLauth.apiTokenMaxTtlduration
MYRIARCH_AUTH_BOOTSTRAPADMIN_ENABLEDauth.bootstrapAdmin.enabledboolean
MYRIARCH_AUTH_BOOTSTRAPADMIN_KEEPWITHOIDCauth.bootstrapAdmin.keepWithOidcboolean
MYRIARCH_AUTH_BOOTSTRAPADMIN_PASSWORDHASHFILEauth.bootstrapAdmin.passwordHashFilestring
MYRIARCH_AUTH_BOOTSTRAPADMIN_TOKENFILEauth.bootstrapAdmin.tokenFilestring
MYRIARCH_AUTH_BOOTSTRAPADMIN_USERNAMEauth.bootstrapAdmin.usernamestring
MYRIARCH_AUTH_COOKIESECUREauth.cookieSecureboolean
MYRIARCH_AUTH_DEVLOGIN_ENABLEDauth.devLogin.enabledboolean
MYRIARCH_AUTH_DOWNLOADTOKENSECRETFILEauth.downloadTokenSecretFilestring
MYRIARCH_AUTH_OIDC_CLIENTCERTIFICATEFILEauth.oidc.clientCertificateFilestring
MYRIARCH_AUTH_OIDC_CLIENTIDauth.oidc.clientIdstring
MYRIARCH_AUTH_OIDC_CLIENTKEYFILEauth.oidc.clientKeyFilestring
MYRIARCH_AUTH_OIDC_CLIENTSECRETauth.oidc.clientSecretstring
MYRIARCH_AUTH_OIDC_CLIENTSECRETFILEauth.oidc.clientSecretFilestring
MYRIARCH_AUTH_OIDC_DEFAULTROLEauth.oidc.defaultRolestring
MYRIARCH_AUTH_OIDC_DISPLAYNAMEauth.oidc.displayNamestring
MYRIARCH_AUTH_OIDC_EMAILCLAIMauth.oidc.emailClaimstring
MYRIARCH_AUTH_OIDC_ENABLEDauth.oidc.enabledboolean
MYRIARCH_AUTH_OIDC_GROUPSCLAIMauth.oidc.groupsClaimstring
MYRIARCH_AUTH_OIDC_ISSUERURLauth.oidc.issuerUrlstring
MYRIARCH_AUTH_OIDC_NAMECLAIMauth.oidc.nameClaimstring
MYRIARCH_AUTH_OIDC_ROLEMAPPING_ADMINauth.oidc.roleMapping.adminlist of strings
MYRIARCH_AUTH_OIDC_ROLEMAPPING_OPERATORauth.oidc.roleMapping.operatorlist of strings
MYRIARCH_AUTH_OIDC_ROLEMAPPING_USERS_ADMINauth.oidc.roleMapping.users.adminlist of strings
MYRIARCH_AUTH_OIDC_ROLEMAPPING_USERS_OPERATORauth.oidc.roleMapping.users.operatorlist of strings
MYRIARCH_AUTH_OIDC_ROLEMAPPING_USERS_VIEWERauth.oidc.roleMapping.users.viewerlist of strings
MYRIARCH_AUTH_OIDC_ROLEMAPPING_VIEWERauth.oidc.roleMapping.viewerlist of strings
MYRIARCH_AUTH_OIDC_SCOPESauth.oidc.scopeslist of strings
MYRIARCH_AUTH_SESSIONMAXAGEauth.sessionMaxAgeduration
MYRIARCH_AUTH_SESSIONTTLauth.sessionTtlduration
MYRIARCH_DATABASE_DSNdatabase.dsnstring
MYRIARCH_DATABASE_DSNFILEdatabase.dsnFilestring
MYRIARCH_DATABASE_MAXCONNSdatabase.maxConnsinteger
MYRIARCH_DATABASE_MIGRATEONSTARTdatabase.migrateOnStartboolean
MYRIARCH_DATABASE_STATEMENTTIMEOUTdatabase.statementTimeoutduration
MYRIARCH_DEV_DATADIRdev.dataDirstring
MYRIARCH_DEV_POSTGRESPORTdev.postgresPortinteger
MYRIARCH_DEV_SEEDENROLLMENTTOKENdev.seedEnrollmentTokenstring
MYRIARCH_EXECUTORS_ALLOWEDWEBHOOKHOSTSexecutors.allowedWebhookHostslist of strings
MYRIARCH_EXECUTORS_DEFAULTTIMEOUTexecutors.defaultTimeoutduration
MYRIARCH_EXECUTORS_MAXTIMEOUTexecutors.maxTimeoutduration
MYRIARCH_EXECUTORS_SECRETDIRexecutors.secretDirstring
MYRIARCH_EXECUTORS_SECRETENVPREFIXexecutors.secretEnvPrefixstring
MYRIARCH_GITOPS_AUTH_CAFILEgitops.auth.caFilestring
MYRIARCH_GITOPS_AUTH_KNOWNHOSTSFILEgitops.auth.knownHostsFilestring
MYRIARCH_GITOPS_AUTH_SSHKEYFILEgitops.auth.sshKeyFilestring
MYRIARCH_GITOPS_AUTH_TOKENFILEgitops.auth.tokenFilestring
MYRIARCH_GITOPS_AUTH_USERNAMEgitops.auth.usernamestring
MYRIARCH_GITOPS_BRANCHgitops.branchstring
MYRIARCH_GITOPS_CLONEDIRgitops.cloneDirstring
MYRIARCH_GITOPS_ENABLEDgitops.enabledboolean
MYRIARCH_GITOPS_MAXFILESgitops.maxFilesinteger
MYRIARCH_GITOPS_MAXREPOBYTESgitops.maxRepoBytesinteger
MYRIARCH_GITOPS_MAXYAMLBYTESgitops.maxYamlBytesinteger
MYRIARCH_GITOPS_PATHgitops.pathstring
MYRIARCH_GITOPS_POLLINTERVALgitops.pollIntervalduration
MYRIARCH_GITOPS_REPOURLgitops.repoUrlstring
MYRIARCH_GITOPS_UIREPOWEBURLgitops.uiRepoWebUrlstring
MYRIARCH_GITOPS_WEBHOOKSECRETgitops.webhookSecretstring
MYRIARCH_GITOPS_WEBHOOKSECRETFILEgitops.webhookSecretFilestring
MYRIARCH_HA_HEARTBEATINTERVALha.heartbeatIntervalduration
MYRIARCH_HA_LEADERLOCKKEYha.leaderLockKeyinteger
MYRIARCH_HA_LEADERSESSIONTIMEOUTha.leaderSessionTimeoutduration
MYRIARCH_HA_REPLICAIDha.replicaIdstring
MYRIARCH_INSTALL_BUNDLESOURCEBASEURLinstall.bundleSourceBaseUrlstring
MYRIARCH_INSTALL_ENABLEDinstall.enabledboolean
MYRIARCH_INSTALL_GRANTTTLinstall.grantTtlduration
MYRIARCH_INSTALL_PLATFORMSinstall.platformslist of strings
MYRIARCH_OPAMP_ALLOWUNBOUNDEDCOMPRESSIONopamp.allowUnboundedCompressionboolean
MYRIARCH_OPAMP_AUTOREBINDONTOKENROTATIONopamp.autoRebindOnTokenRotationboolean
MYRIARCH_OPAMP_CLIENTCERTHEADERopamp.clientCertHeaderstring
MYRIARCH_OPAMP_CONNECTRATELIMITopamp.connectRateLimitnumber
MYRIARCH_OPAMP_CONNECTRATEPERIPopamp.connectRatePerIpnumber
MYRIARCH_OPAMP_ENABLECOMPRESSIONopamp.enableCompressionboolean
MYRIARCH_OPAMP_LASTSEENFLUSHINTERVALopamp.lastSeenFlushIntervalduration
MYRIARCH_OPAMP_MAXCONNECTIONSPERREPLICAopamp.maxConnectionsPerReplicainteger
MYRIARCH_OPAMP_MAXCONNECTIONSPERTOKENopamp.maxConnectionsPerTokeninteger
MYRIARCH_OPAMP_MAXEFFECTIVECONFIGBYTESopamp.maxEffectiveConfigBytesinteger
MYRIARCH_OPAMP_MAXMESSAGESIZEopamp.maxMessageSizeinteger
MYRIARCH_OPAMP_OFFLINEAFTERopamp.offlineAfterduration
MYRIARCH_OPAMP_PATHopamp.pathstring
MYRIARCH_OPAMP_REQUIRECLIENTCERTopamp.requireClientCertboolean
MYRIARCH_OPAMP_REQUIREENROLLMENTTOKENopamp.requireEnrollmentTokenboolean
MYRIARCH_OPAMP_SENDTIMEOUTopamp.sendTimeoutduration
MYRIARCH_OPAMP_STALEAPPLYINGAFTERopamp.staleApplyingAfterduration
MYRIARCH_OUTBOUND_ALLOWEDCIDRSoutbound.allowedCidrslist of strings
MYRIARCH_OUTBOUND_CAFILEoutbound.caFilestring
MYRIARCH_RELEASES_CONTRIBREPOreleases.contribRepostring
MYRIARCH_RELEASES_COREREPOreleases.coreRepostring
MYRIARCH_RELEASES_DISTRIBUTIONSreleases.distributionslist of strings
MYRIARCH_RELEASES_ENABLEDreleases.enabledboolean
MYRIARCH_RELEASES_FIXTUREDIRreleases.fixtureDirstring
MYRIARCH_RELEASES_GITHUBAPIURLreleases.githubApiUrlstring
MYRIARCH_RELEASES_INCLUDEPRERELEASESreleases.includePrereleasesboolean
MYRIARCH_RELEASES_MINVERSIONreleases.minVersionstring
MYRIARCH_RELEASES_POLLINTERVALreleases.pollIntervalduration
MYRIARCH_RELEASES_RAWBASEURLreleases.rawBaseUrlstring
MYRIARCH_RELEASES_RELEASESREPOreleases.releasesRepostring
MYRIARCH_RELEASES_TOKENFILEreleases.tokenFilestring
MYRIARCH_RETENTION_AGENTEVENTSretention.agentEventsduration
MYRIARCH_RETENTION_AUDITretention.auditduration
MYRIARCH_RETENTION_FINISHEDROLLOUTSretention.finishedRolloutsduration
MYRIARCH_RETENTION_GITOPSSYNCHISTORYretention.gitopsSyncHistoryduration
MYRIARCH_RETENTION_OFFLINEAGENTSretention.offlineAgentsduration
MYRIARCH_RETENTION_UNREFERENCEDCONFIGretention.unreferencedConfigduration
MYRIARCH_ROLLOUTS_AUTOSTARTrollouts.autoStartboolean
MYRIARCH_ROLLOUTS_DEFAULTTIMEZONErollouts.defaultTimezonestring
MYRIARCH_ROLLOUTS_EXECUTORTIMEOUTrollouts.executorTimeoutduration
MYRIARCH_ROLLOUTS_TICKINTERVALrollouts.tickIntervalduration
MYRIARCH_SERVER_LISTENADDRserver.listenAddrstring
MYRIARCH_SERVER_METRICSLISTENADDRserver.metricsListenAddrstring
MYRIARCH_SERVER_PUBLICURLserver.publicUrlstring
MYRIARCH_SERVER_SHUTDOWNTIMEOUTserver.shutdownTimeoutduration
MYRIARCH_SERVER_TLS_CERTFILEserver.tls.certFilestring
MYRIARCH_SERVER_TLS_CLIENTCAFILEserver.tls.clientCaFilestring
MYRIARCH_SERVER_TLS_KEYFILEserver.tls.keyFilestring
MYRIARCH_SERVER_TLS_TERMINATEDUPSTREAMserver.tls.terminatedUpstreamboolean
MYRIARCH_SERVER_TRUSTEDPROXIESserver.trustedProxieslist of strings
MYRIARCH_TELEMETRY_LOGFORMATtelemetry.logFormatstring
MYRIARCH_TELEMETRY_LOGLEVELtelemetry.logLevelstring
MYRIARCH_TELEMETRY_METRICStelemetry.metricsboolean
MYRIARCH_UI_DEFAULTLANGUAGEui.defaultLanguagestring
MYRIARCH_UI_LANGUAGESui.languageslist of strings

References inside configuration files

Two configuration files expand references to environment variables in their string values:

  • myriarchd.yaml accepts ${VAR} and ${VAR:-default}. A variable that is unset or empty gives the default, or the empty string when there is none.
  • The configuration of myriarch-updater accepts ${env:VAR} and ${env:VAR:-default}. A variable that is unset and has no default stops the updater with an error.

Executor secrets

An Executor object in Git can name an environment variable of the server for a secret (secretEnv, tokenEnv), see the Executor reference. The name must start with executors.secretEnvPrefix (default MYRIARCH_EXEC_), so Git cannot read arbitrary variables. Each such variable needs a destination binding in executors.secretEnvHosts or an entry in executors.secrets; myriarchd serve refuses an executor secret without one.

Variables that the programs read

These variables are not part of the configuration overrides.

VariableRead byEffect
MYRIARCH_ENROLLMENT_TOKENmyriarch-sim runThe enrollment token of the simulated collectors when --token is not given. Prefer it to the flag: arguments are visible in process listings.
HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy, NO_PROXY, no_proxymyriarchd (every outbound connection except artifact downloads while artifacts.proxyUrl is set), myriarch-updater and myriarch-sim (package downloads)Forward proxy for outbound HTTP and HTTPS connections, as the Go standard library reads it (NO_PROXY lists the hosts that bypass the proxy). myriarchd exempts the host and port of the proxy from the address check (outbound.allowedCidrs). While a proxy is in use, myriarchd still refuses a destination that is given as an address in a denied range, and localhost; other host names are left to the egress policy of the proxy. ALL_PROXY is not used.
SSL_CERT_FILE, SSL_CERT_DIRmyriarchd, myriarch-updater, myriarch-sim and myrctl (Go standard library, on Linux and other Unix systems except macOS)The CA bundle file and the CA directories that replace the default locations of the system trust store. myriarchd, myriarch-sim and myrctl carry an embedded copy of the Mozilla roots that Go uses only when the system provides no roots at all; myriarch-updater relies on the system trust store only, so on a host without CA certificates its TLS connections fail. outbound.caFile adds CA certificates on top of whichever roots are in use, and applies to myriarchd only.
PGTEST_CACHE_DIRmyriarchd dev, in builds with the devpg build tag (make build, make dev; the release binaries are built without it)The directory that caches the PostgreSQL binaries of the embedded database (default: myriarch/embedded-postgres below the user cache directory of the operating system). The test helper shares it.
PATHmyriarch-updater on Unix systems, when it runs as rootThe only variable of its own environment that the updater passes to the configuration check that it runs under the account of the supervisor (with HOME and USER of that account).

Variables in the deployment templates

The templates under deploy/supervisor and deploy/updater (and the deprecated Kubernetes templates under contrib/legacy-kubernetes-collector) reference these variables as ${env:NAME}. They are resolved by the OpAMP Supervisor or by myriarch-updater when they load their configuration, not by myriarchd.

VariableTemplatesMeaning
ENVIRONMENTcontrib/legacy-kubernetes-collector/supervisor/supervisor.yamlAttribute deployment.environment.name that the supervisor in the Kubernetes template reports.
K8S_CLUSTER_NAMEcontrib/legacy-kubernetes-collector/supervisor/supervisor.yamlKubernetes attribute k8s.cluster.name that the supervisor in the Kubernetes template reports.
K8S_NAMESPACE_NAMEcontrib/legacy-kubernetes-collector/supervisor/supervisor.yamlKubernetes attribute k8s.namespace.name that the supervisor in the Kubernetes template reports (from the Downward API).
K8S_NODE_NAMEcontrib/legacy-kubernetes-collector/supervisor/supervisor.yamlKubernetes attribute k8s.node.name that the supervisor in the Kubernetes template reports (from the Downward API).
K8S_POD_NAMEcontrib/legacy-kubernetes-collector/supervisor/supervisor.yamlKubernetes attribute k8s.pod.name that the supervisor in the Kubernetes template reports (from the Downward API).
MYRIARCH_ENROLLMENT_TOKENcontrib/legacy-kubernetes-collector/supervisor/supervisor.yaml, contrib/legacy-kubernetes-collector/updater/updater.yaml, deploy/supervisor/linux/supervisor.yaml, deploy/supervisor/windows/supervisor.yamlThe enrollment token. The supervisor sends it in the Authorization: Bearer header to the OpAMP endpoint; in container mode myriarch-updater sends it for the updater itself.
MYRIARCH_OPAMP_ENDPOINTcontrib/legacy-kubernetes-collector/supervisor/supervisor.yamlThe OpAMP endpoint of the server that the supervisor in the Kubernetes template connects to.
SITE_COUNTRYcontrib/legacy-kubernetes-collector/supervisor/supervisor.yamlSite attribute site.country that the supervisor in the Kubernetes template reports.
SITE_IDcontrib/legacy-kubernetes-collector/supervisor/supervisor.yamlSite attribute site.id that the supervisor in the Kubernetes template reports.
SITE_NAMEcontrib/legacy-kubernetes-collector/supervisor/supervisor.yamlSite attribute site.name that the supervisor in the Kubernetes template reports.
SITE_REGIONcontrib/legacy-kubernetes-collector/supervisor/supervisor.yamlSite attribute site.region that the supervisor in the Kubernetes template reports.
SITE_TIMEZONEcontrib/legacy-kubernetes-collector/supervisor/supervisor.yamlSite attribute site.timezone that the supervisor in the Kubernetes template reports.
SITE_TYPEcontrib/legacy-kubernetes-collector/supervisor/supervisor.yamlSite attribute site.type that the supervisor in the Kubernetes template reports.