Environment variables
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
30sor5m. 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 validateandmyriarchd config print.myriarchd migrateapplies only the overrides of thedatabasesettings (MYRIARCH_DATABASE_*). - An override wins over the configuration file.
- Lists of objects and maps (
opamp.enrollmentTokens,notifications.channels,auth.devLogin.usersand theexecutorsmaps) cannot be set through the environment.
| Variable | Key | Type |
|---|---|---|
MYRIARCH_ARTIFACTS_AGENTBASEURLS | artifacts.agentBaseUrls | list of strings |
MYRIARCH_ARTIFACTS_ALLOWEDREDIRECTHOSTS | artifacts.allowedRedirectHosts | list of strings |
MYRIARCH_ARTIFACTS_ALLOWINSECUREAGENTBASEURLS | artifacts.allowInsecureAgentBaseUrls | boolean |
MYRIARCH_ARTIFACTS_ALLOWUNVERIFIED | artifacts.allowUnverified | boolean |
MYRIARCH_ARTIFACTS_DIR | artifacts.dir | string |
MYRIARCH_ARTIFACTS_DOWNLOADTOKENTTL | artifacts.downloadTokenTtl | duration |
MYRIARCH_ARTIFACTS_MAXCACHEBYTES | artifacts.maxCacheBytes | integer |
MYRIARCH_ARTIFACTS_PREFETCHPLATFORMS | artifacts.prefetchPlatforms | list of strings |
MYRIARCH_ARTIFACTS_PROXYURL | artifacts.proxyUrl | string |
MYRIARCH_ARTIFACTS_SOURCEAUTH_PASSWORDFILE | artifacts.sourceAuth.passwordFile | string |
MYRIARCH_ARTIFACTS_SOURCEAUTH_TOKENFILE | artifacts.sourceAuth.tokenFile | string |
MYRIARCH_ARTIFACTS_SOURCEAUTH_USERNAME | artifacts.sourceAuth.username | string |
MYRIARCH_ARTIFACTS_SOURCEBASEURL | artifacts.sourceBaseUrl | string |
MYRIARCH_ARTIFACTS_VERIFY_CERTIFICATEIDENTITYREGEXP | artifacts.verify.certificateIdentityRegexp | string |
MYRIARCH_ARTIFACTS_VERIFY_CERTIFICATEOIDCISSUER | artifacts.verify.certificateOidcIssuer | string |
MYRIARCH_ARTIFACTS_VERIFY_REQUIRECHECKSUM | artifacts.verify.requireChecksum | boolean |
MYRIARCH_ARTIFACTS_VERIFY_REQUIRESIGNATURE | artifacts.verify.requireSignature | boolean |
MYRIARCH_ARTIFACTS_VERIFY_TRUSTEDROOTFILE | artifacts.verify.trustedRootFile | string |
MYRIARCH_ARTIFACTS_VERIFY_TUFREPOSITORYURL | artifacts.verify.tufRepositoryUrl | string |
MYRIARCH_AUTH_APITOKENMAXTTL | auth.apiTokenMaxTtl | duration |
MYRIARCH_AUTH_BOOTSTRAPADMIN_ENABLED | auth.bootstrapAdmin.enabled | boolean |
MYRIARCH_AUTH_BOOTSTRAPADMIN_KEEPWITHOIDC | auth.bootstrapAdmin.keepWithOidc | boolean |
MYRIARCH_AUTH_BOOTSTRAPADMIN_PASSWORDHASHFILE | auth.bootstrapAdmin.passwordHashFile | string |
MYRIARCH_AUTH_BOOTSTRAPADMIN_TOKENFILE | auth.bootstrapAdmin.tokenFile | string |
MYRIARCH_AUTH_BOOTSTRAPADMIN_USERNAME | auth.bootstrapAdmin.username | string |
MYRIARCH_AUTH_COOKIESECURE | auth.cookieSecure | boolean |
MYRIARCH_AUTH_DEVLOGIN_ENABLED | auth.devLogin.enabled | boolean |
MYRIARCH_AUTH_DOWNLOADTOKENSECRETFILE | auth.downloadTokenSecretFile | string |
MYRIARCH_AUTH_OIDC_CLIENTCERTIFICATEFILE | auth.oidc.clientCertificateFile | string |
MYRIARCH_AUTH_OIDC_CLIENTID | auth.oidc.clientId | string |
MYRIARCH_AUTH_OIDC_CLIENTKEYFILE | auth.oidc.clientKeyFile | string |
MYRIARCH_AUTH_OIDC_CLIENTSECRET | auth.oidc.clientSecret | string |
MYRIARCH_AUTH_OIDC_CLIENTSECRETFILE | auth.oidc.clientSecretFile | string |
MYRIARCH_AUTH_OIDC_DEFAULTROLE | auth.oidc.defaultRole | string |
MYRIARCH_AUTH_OIDC_DISPLAYNAME | auth.oidc.displayName | string |
MYRIARCH_AUTH_OIDC_EMAILCLAIM | auth.oidc.emailClaim | string |
MYRIARCH_AUTH_OIDC_ENABLED | auth.oidc.enabled | boolean |
MYRIARCH_AUTH_OIDC_GROUPSCLAIM | auth.oidc.groupsClaim | string |
MYRIARCH_AUTH_OIDC_ISSUERURL | auth.oidc.issuerUrl | string |
MYRIARCH_AUTH_OIDC_NAMECLAIM | auth.oidc.nameClaim | string |
MYRIARCH_AUTH_OIDC_ROLEMAPPING_ADMIN | auth.oidc.roleMapping.admin | list of strings |
MYRIARCH_AUTH_OIDC_ROLEMAPPING_OPERATOR | auth.oidc.roleMapping.operator | list of strings |
MYRIARCH_AUTH_OIDC_ROLEMAPPING_USERS_ADMIN | auth.oidc.roleMapping.users.admin | list of strings |
MYRIARCH_AUTH_OIDC_ROLEMAPPING_USERS_OPERATOR | auth.oidc.roleMapping.users.operator | list of strings |
MYRIARCH_AUTH_OIDC_ROLEMAPPING_USERS_VIEWER | auth.oidc.roleMapping.users.viewer | list of strings |
MYRIARCH_AUTH_OIDC_ROLEMAPPING_VIEWER | auth.oidc.roleMapping.viewer | list of strings |
MYRIARCH_AUTH_OIDC_SCOPES | auth.oidc.scopes | list of strings |
MYRIARCH_AUTH_SESSIONMAXAGE | auth.sessionMaxAge | duration |
MYRIARCH_AUTH_SESSIONTTL | auth.sessionTtl | duration |
MYRIARCH_DATABASE_DSN | database.dsn | string |
MYRIARCH_DATABASE_DSNFILE | database.dsnFile | string |
MYRIARCH_DATABASE_MAXCONNS | database.maxConns | integer |
MYRIARCH_DATABASE_MIGRATEONSTART | database.migrateOnStart | boolean |
MYRIARCH_DATABASE_STATEMENTTIMEOUT | database.statementTimeout | duration |
MYRIARCH_DEV_DATADIR | dev.dataDir | string |
MYRIARCH_DEV_POSTGRESPORT | dev.postgresPort | integer |
MYRIARCH_DEV_SEEDENROLLMENTTOKEN | dev.seedEnrollmentToken | string |
MYRIARCH_EXECUTORS_ALLOWEDWEBHOOKHOSTS | executors.allowedWebhookHosts | list of strings |
MYRIARCH_EXECUTORS_DEFAULTTIMEOUT | executors.defaultTimeout | duration |
MYRIARCH_EXECUTORS_MAXTIMEOUT | executors.maxTimeout | duration |
MYRIARCH_EXECUTORS_SECRETDIR | executors.secretDir | string |
MYRIARCH_EXECUTORS_SECRETENVPREFIX | executors.secretEnvPrefix | string |
MYRIARCH_GITOPS_AUTH_CAFILE | gitops.auth.caFile | string |
MYRIARCH_GITOPS_AUTH_KNOWNHOSTSFILE | gitops.auth.knownHostsFile | string |
MYRIARCH_GITOPS_AUTH_SSHKEYFILE | gitops.auth.sshKeyFile | string |
MYRIARCH_GITOPS_AUTH_TOKENFILE | gitops.auth.tokenFile | string |
MYRIARCH_GITOPS_AUTH_USERNAME | gitops.auth.username | string |
MYRIARCH_GITOPS_BRANCH | gitops.branch | string |
MYRIARCH_GITOPS_CLONEDIR | gitops.cloneDir | string |
MYRIARCH_GITOPS_ENABLED | gitops.enabled | boolean |
MYRIARCH_GITOPS_MAXFILES | gitops.maxFiles | integer |
MYRIARCH_GITOPS_MAXREPOBYTES | gitops.maxRepoBytes | integer |
MYRIARCH_GITOPS_MAXYAMLBYTES | gitops.maxYamlBytes | integer |
MYRIARCH_GITOPS_PATH | gitops.path | string |
MYRIARCH_GITOPS_POLLINTERVAL | gitops.pollInterval | duration |
MYRIARCH_GITOPS_REPOURL | gitops.repoUrl | string |
MYRIARCH_GITOPS_UIREPOWEBURL | gitops.uiRepoWebUrl | string |
MYRIARCH_GITOPS_WEBHOOKSECRET | gitops.webhookSecret | string |
MYRIARCH_GITOPS_WEBHOOKSECRETFILE | gitops.webhookSecretFile | string |
MYRIARCH_HA_HEARTBEATINTERVAL | ha.heartbeatInterval | duration |
MYRIARCH_HA_LEADERLOCKKEY | ha.leaderLockKey | integer |
MYRIARCH_HA_LEADERSESSIONTIMEOUT | ha.leaderSessionTimeout | duration |
MYRIARCH_HA_REPLICAID | ha.replicaId | string |
MYRIARCH_INSTALL_BUNDLESOURCEBASEURL | install.bundleSourceBaseUrl | string |
MYRIARCH_INSTALL_ENABLED | install.enabled | boolean |
MYRIARCH_INSTALL_GRANTTTL | install.grantTtl | duration |
MYRIARCH_INSTALL_PLATFORMS | install.platforms | list of strings |
MYRIARCH_OPAMP_ALLOWUNBOUNDEDCOMPRESSION | opamp.allowUnboundedCompression | boolean |
MYRIARCH_OPAMP_AUTOREBINDONTOKENROTATION | opamp.autoRebindOnTokenRotation | boolean |
MYRIARCH_OPAMP_CLIENTCERTHEADER | opamp.clientCertHeader | string |
MYRIARCH_OPAMP_CONNECTRATELIMIT | opamp.connectRateLimit | number |
MYRIARCH_OPAMP_CONNECTRATEPERIP | opamp.connectRatePerIp | number |
MYRIARCH_OPAMP_ENABLECOMPRESSION | opamp.enableCompression | boolean |
MYRIARCH_OPAMP_LASTSEENFLUSHINTERVAL | opamp.lastSeenFlushInterval | duration |
MYRIARCH_OPAMP_MAXCONNECTIONSPERREPLICA | opamp.maxConnectionsPerReplica | integer |
MYRIARCH_OPAMP_MAXCONNECTIONSPERTOKEN | opamp.maxConnectionsPerToken | integer |
MYRIARCH_OPAMP_MAXEFFECTIVECONFIGBYTES | opamp.maxEffectiveConfigBytes | integer |
MYRIARCH_OPAMP_MAXMESSAGESIZE | opamp.maxMessageSize | integer |
MYRIARCH_OPAMP_OFFLINEAFTER | opamp.offlineAfter | duration |
MYRIARCH_OPAMP_PATH | opamp.path | string |
MYRIARCH_OPAMP_REQUIRECLIENTCERT | opamp.requireClientCert | boolean |
MYRIARCH_OPAMP_REQUIREENROLLMENTTOKEN | opamp.requireEnrollmentToken | boolean |
MYRIARCH_OPAMP_SENDTIMEOUT | opamp.sendTimeout | duration |
MYRIARCH_OPAMP_STALEAPPLYINGAFTER | opamp.staleApplyingAfter | duration |
MYRIARCH_OUTBOUND_ALLOWEDCIDRS | outbound.allowedCidrs | list of strings |
MYRIARCH_OUTBOUND_CAFILE | outbound.caFile | string |
MYRIARCH_RELEASES_CONTRIBREPO | releases.contribRepo | string |
MYRIARCH_RELEASES_COREREPO | releases.coreRepo | string |
MYRIARCH_RELEASES_DISTRIBUTIONS | releases.distributions | list of strings |
MYRIARCH_RELEASES_ENABLED | releases.enabled | boolean |
MYRIARCH_RELEASES_FIXTUREDIR | releases.fixtureDir | string |
MYRIARCH_RELEASES_GITHUBAPIURL | releases.githubApiUrl | string |
MYRIARCH_RELEASES_INCLUDEPRERELEASES | releases.includePrereleases | boolean |
MYRIARCH_RELEASES_MINVERSION | releases.minVersion | string |
MYRIARCH_RELEASES_POLLINTERVAL | releases.pollInterval | duration |
MYRIARCH_RELEASES_RAWBASEURL | releases.rawBaseUrl | string |
MYRIARCH_RELEASES_RELEASESREPO | releases.releasesRepo | string |
MYRIARCH_RELEASES_TOKENFILE | releases.tokenFile | string |
MYRIARCH_RETENTION_AGENTEVENTS | retention.agentEvents | duration |
MYRIARCH_RETENTION_AUDIT | retention.audit | duration |
MYRIARCH_RETENTION_FINISHEDROLLOUTS | retention.finishedRollouts | duration |
MYRIARCH_RETENTION_GITOPSSYNCHISTORY | retention.gitopsSyncHistory | duration |
MYRIARCH_RETENTION_OFFLINEAGENTS | retention.offlineAgents | duration |
MYRIARCH_RETENTION_UNREFERENCEDCONFIG | retention.unreferencedConfig | duration |
MYRIARCH_ROLLOUTS_AUTOSTART | rollouts.autoStart | boolean |
MYRIARCH_ROLLOUTS_DEFAULTTIMEZONE | rollouts.defaultTimezone | string |
MYRIARCH_ROLLOUTS_EXECUTORTIMEOUT | rollouts.executorTimeout | duration |
MYRIARCH_ROLLOUTS_TICKINTERVAL | rollouts.tickInterval | duration |
MYRIARCH_SERVER_LISTENADDR | server.listenAddr | string |
MYRIARCH_SERVER_METRICSLISTENADDR | server.metricsListenAddr | string |
MYRIARCH_SERVER_PUBLICURL | server.publicUrl | string |
MYRIARCH_SERVER_SHUTDOWNTIMEOUT | server.shutdownTimeout | duration |
MYRIARCH_SERVER_TLS_CERTFILE | server.tls.certFile | string |
MYRIARCH_SERVER_TLS_CLIENTCAFILE | server.tls.clientCaFile | string |
MYRIARCH_SERVER_TLS_KEYFILE | server.tls.keyFile | string |
MYRIARCH_SERVER_TLS_TERMINATEDUPSTREAM | server.tls.terminatedUpstream | boolean |
MYRIARCH_SERVER_TRUSTEDPROXIES | server.trustedProxies | list of strings |
MYRIARCH_TELEMETRY_LOGFORMAT | telemetry.logFormat | string |
MYRIARCH_TELEMETRY_LOGLEVEL | telemetry.logLevel | string |
MYRIARCH_TELEMETRY_METRICS | telemetry.metrics | boolean |
MYRIARCH_UI_DEFAULTLANGUAGE | ui.defaultLanguage | string |
MYRIARCH_UI_LANGUAGES | ui.languages | list of strings |
References inside configuration files
Two configuration files expand references to environment variables in their string values:
myriarchd.yamlaccepts${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-updateraccepts${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.
| Variable | Read by | Effect |
|---|---|---|
MYRIARCH_ENROLLMENT_TOKEN | myriarch-sim run | The 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_proxy | myriarchd (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_DIR | myriarchd, 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_DIR | myriarchd 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. |
PATH | myriarch-updater on Unix systems, when it runs as root | The 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.
| Variable | Templates | Meaning |
|---|---|---|
ENVIRONMENT | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml | Attribute deployment.environment.name that the supervisor in the Kubernetes template reports. |
K8S_CLUSTER_NAME | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml | Kubernetes attribute k8s.cluster.name that the supervisor in the Kubernetes template reports. |
K8S_NAMESPACE_NAME | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml | Kubernetes attribute k8s.namespace.name that the supervisor in the Kubernetes template reports (from the Downward API). |
K8S_NODE_NAME | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml | Kubernetes attribute k8s.node.name that the supervisor in the Kubernetes template reports (from the Downward API). |
K8S_POD_NAME | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml | Kubernetes attribute k8s.pod.name that the supervisor in the Kubernetes template reports (from the Downward API). |
MYRIARCH_ENROLLMENT_TOKEN | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml, contrib/legacy-kubernetes-collector/updater/updater.yaml, deploy/supervisor/linux/supervisor.yaml, deploy/supervisor/windows/supervisor.yaml | The 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_ENDPOINT | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml | The OpAMP endpoint of the server that the supervisor in the Kubernetes template connects to. |
SITE_COUNTRY | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml | Site attribute site.country that the supervisor in the Kubernetes template reports. |
SITE_ID | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml | Site attribute site.id that the supervisor in the Kubernetes template reports. |
SITE_NAME | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml | Site attribute site.name that the supervisor in the Kubernetes template reports. |
SITE_REGION | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml | Site attribute site.region that the supervisor in the Kubernetes template reports. |
SITE_TIMEZONE | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml | Site attribute site.timezone that the supervisor in the Kubernetes template reports. |
SITE_TYPE | contrib/legacy-kubernetes-collector/supervisor/supervisor.yaml | Site attribute site.type that the supervisor in the Kubernetes template reports. |