Skip to main content

Environment Variables

mac env shows, sets, and clears the variables that drive MAC's behavior — registry, master IP, switch credentials, and more.

mac env

~$ mac env # List managed variables and their sources
~$ mac env set KEY=VAL [...] # Save to ~/.mac/env (per-user, persistent)
~$ mac env unset KEY [...] # Remove from ~/.mac/env

File Priority

MAC reads variables from the following files, highest priority first:

  1. ~/.mac/env — Per-user overrides (written by mac env set)
  2. /etc/mango/mac/env — Global defaults (written by the installer; edit as root)

Any variable set in your shell environment when you call mac also takes precedence.

If your $HOME is shared across hosts (e.g. NFS-mounted), keep per-host values like NODE_NAME out of ~/.mac/env; put them in /etc/mango/mac/env instead.

Variable Reference

Common

VariableUsed byPurpose
MASTER_IPAgentMaster node IP (required; no default)
MAC_REGISTRYAllContainer image registry (public default repo.mangoboost.io/public-docker/mac)
MAC_CONFIG_DIRAllCompose file directory (default /etc/mango/mac)
MAC_AUTH_ENABLEDMasterEnable JWT auth (default true)
MAC_ADMIN_PASSWORDMasterInitial admin password on first start (default admin)
NODE_NAMEAgentOverride node name (default: hostname)
SDK_AGENT_IMAGEAgentmango-sdk-agent image (public default repo.mangoboost.io/public-docker/mango-sdk-agent:latest)
TZAllContainer timezone, IANA name (auto-detected from the host if unset)

Service Ports

VariableUsed byPurpose
MASTER_API_PORTMasterAPI server published port (default 28080)
MASTER_WEB_PORTMasterWeb UI published port (default 23000)
PROMETHEUS_PORTMasterPrometheus published port (default 29090)
LOKI_PORTMasterLoki published port (default 29210)
SNMP_PORTMasterswitch-exporter SNMP port (default 161)
ALERT_RULES_PATHMasterOverride Prometheus alert-rules JSON file path

TLS (HTTPS)

VariableUsed byPurpose
MAC_TLS_ENABLEDMasterEnable HTTPS for api-server and web-ui (default false)
MAC_TLS_CERT_DIRMasterHost directory holding server.crt and server.key
MAC_TLS_PORTMasterAPI server HTTPS port (default 28443)
MAC_WEB_TLS_PORTMasterWeb UI HTTPS port (default 23443)
MAC_TLS_CERT_FILEMasterIn-container path to TLS cert (default /etc/mac/certs/server.crt)
MAC_TLS_KEY_FILEMasterIn-container path to TLS key (default /etc/mac/certs/server.key)

Switch Access

VariableUsed byPurpose
SWITCH_USERMasterSSH username for switch CLI (default admin)
SWITCH_PASSWD_LISTMasterComma-separated SSH password list (tried in order)
SWITCH_PASSWDMasterLegacy single SSH password (used only if _LIST unset)
SNMP_COMMUNITYMasterDefault SNMP community

LLMBoost

VariableUsed byPurpose
LLMBOOST_API_ENDPOINTMasterOverride LLMBoost API endpoint (auto-discovered if unset)
LLMBOOST_K8S_API_URLMasterOverride K8s API URL
LLMBOOST_K8S_TOKENMasterK8s service-account token for full LLMBoost view
LLMBOOST_DASHBOARD_URLMasterOverride LLMBoost management UI URL

Inspecting Current State

Run mac env to print every managed variable with its current value and source (user for ~/.mac/env, global for /etc/mango/mac/env).