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:
~/.mac/env— Per-user overrides (written bymac env set)/etc/mango/mac/env— Global defaults (written by the installer; edit as root)
Shell environment variables are ignored for managed variables — always use mac env set
so the value survives restarts. The two exceptions are MAC_CONFIG_DIR and
MAC_IMAGE_SOURCE, which may be exported in the shell to scope a value to a single
invocation or node (useful when $HOME is NFS-shared).
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.
Image Source
MAC_IMAGE_SOURCE selects where MAC images come from: registry (default — pull
published images) or local (build from a source checkout via the .build.yml compose
overrides). Resolution order is deliberately different from other variables so a
per-node build choice can't be masked by an NFS-shared ~/.mac/env:
- Process environment (
MAC_IMAGE_SOURCE=local mac start master) /etc/mango/mac/env(global)~/.mac/env(user)
The --local / --registry flags on mac pull, mac start, and mac restart
override all of the above for one invocation.
Variable Reference
Common
| Variable | Used by | Purpose |
|---|---|---|
MASTER_IP | Agent | Master node IP (required; no default) |
MAC_REGISTRY | All | Container image registry (public default repo.mangoboost.io/public-docker/mac) |
MAC_CONFIG_DIR | All | Compose file directory (default /etc/mango/mac) |
MAC_IMAGE_SOURCE | All | registry (default) or local — see Image Source |
MAC_AUTH_ENABLED | Master | Enable JWT auth (default true) |
MAC_ADMIN_PASSWORD | Master | Initial admin password on first start (default admin) |
NODE_NAME | Agent | Override node name (default: hostname) |
SDK_AGENT_IMAGE | Agent | mango-sdk-agent image (public default repo.mangoboost.io/public-docker/mango-sdk-agent:latest) |
TZ | All | Container timezone, IANA name (auto-detected from the host if unset) |
Service Ports
| Variable | Used by | Purpose |
|---|---|---|
MASTER_API_PORT | Master | API server published port (default 28080) |
MASTER_WEB_PORT | Master | Web UI published port (default 23000) |
PROMETHEUS_PORT | Master | Prometheus published port (default 29090) |
LOKI_PORT | Master | Loki published port (default 29210) |
SNMP_PORT | Master | switch-exporter SNMP port (default 161) |
ALERT_RULES_PATH | Master | Override Prometheus alert-rules JSON file path |
TLS (HTTPS)
| Variable | Used by | Purpose |
|---|---|---|
MAC_TLS_ENABLED | Master | Enable HTTPS for api-server and web-ui (default false) |
MAC_TLS_CERT_DIR | Master | Host directory holding server.crt and server.key |
MAC_TLS_PORT | Master | API server HTTPS port (default 28443) |
MAC_WEB_TLS_PORT | Master | Web UI HTTPS port (default 23443) |
MAC_TLS_CERT_FILE | Master | In-container path to TLS cert (default /etc/mac/certs/server.crt) |
MAC_TLS_KEY_FILE | Master | In-container path to TLS key (default /etc/mac/certs/server.key) |
Switch Access
| Variable | Used by | Purpose |
|---|---|---|
SWITCH_USER | Master | SSH username for switch CLI (default admin) |
SWITCH_PASSWD_LIST | Master | Comma-separated SSH password list (tried in order) |
SWITCH_PASSWD | Master | Legacy single SSH password (used only if _LIST unset) |
SNMP_COMMUNITY | Master | SNMP community string (default public) |
gNMI Streaming Telemetry
switch-exporter streams counters, oper state, and transceiver presence over gNMI from
SONiC switches that pass the gNMI capability probe; Dell OS10 and non-gNMI SONiC stay on
SNMP automatically, and LLDP topology discovery always remains on SNMP. These knobs are
commented out in /etc/mango/mac/env by default (streaming is enabled out of the box):
| Variable | Used by | Purpose |
|---|---|---|
GNMI_ENABLED | Master | Enable gNMI streaming (default true; set false to force SNMP-only) |
GNMI_PORT | Master | sonic-gnmi server port (default 8080) |
GNMI_USERNAME | Master | gNMI auth username (empty by default — noTLS/--allow_no_client_auth) |
GNMI_PASSWORD | Master | gNMI auth password (empty by default) |
GNMI_TLS_MODE | Master | Transport security: none (default), skip-verify, or ca |
GNMI_SAMPLE_INTERVAL_SEC | Master | Counter SAMPLE subscription interval (default 5) |
GNMI_PATH_MODE | Master | Path profile: auto (default), sonic-db, or openconfig |
LLMBoost
| Variable | Used by | Purpose |
|---|---|---|
LLMBOOST_API_ENDPOINT | Master | Override the LLMBoost model-serving API endpoint (auto-discovered from agents on port 30080 if unset; can also be set at runtime from the LLMBoost page, admin-only) |
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).