Environment Variables
Environment variables provide a convenient way to configure the agent, especially in containerized environments.
Agent Configuration
Section titled “Agent Configuration”EPOCH_ACTIVATION_CODE
Section titled “EPOCH_ACTIVATION_CODE”The activation code for first-time agent registration.
export EPOCH_ACTIVATION_CODE=ABC123XYZepoch-agentEPOCH_STATE_FILE
Section titled “EPOCH_STATE_FILE”Path to store the agent’s persisted state (ID and auth token).
export EPOCH_STATE_FILE=/var/lib/epoch-agent/state.jsonepoch-agentDefault locations:
- Linux/macOS:
~/.config/epoch-agent/state.json - Windows:
%PROGRAMDATA%\epoch-agent\state.json
EPOCH_API_ADDR
Section titled “EPOCH_API_ADDR”Address of the EpochProxy API server.
export EPOCH_API_ADDR=https://api.epochproxy.cloudepoch-agentLogging Configuration
Section titled “Logging Configuration”RUST_LOG
Section titled “RUST_LOG”Controls log verbosity using the standard Rust logging format.
# Debug logging for the agentexport RUST_LOG=epoch_agent=debugepoch-agent
# Trace logging (very verbose)export RUST_LOG=epoch_agent=traceepoch-agent
# Info level for everythingexport RUST_LOG=infoepoch-agent
# Multiple directivesexport RUST_LOG=info,epoch_agent=debug,hyper=warnepoch-agentLog levels (least to most verbose):
error- Only errorswarn- Warnings and errorsinfo- General information (default)debug- Debug informationtrace- Very detailed tracing
System Environment Variables
Section titled “System Environment Variables”The agent also respects these standard environment variables:
Used to determine the default state file location on Unix systems.
XDG_CONFIG_HOME
Section titled “XDG_CONFIG_HOME”If set, the agent stores its state file in $XDG_CONFIG_HOME/epoch-agent/state.json instead of ~/.config/epoch-agent/state.json.
The default shell on Unix systems. The agent uses this if --shell is not specified.
COMSPEC
Section titled “COMSPEC”The default command interpreter on Windows. The agent uses this if --shell is not specified.
Docker Example
Section titled “Docker Example”FROM debian:bookworm-slim
COPY epoch-agent /usr/local/bin/
ENV EPOCH_API_ADDR=https://api.epochproxy.cloudENV EPOCH_STATE_FILE=/var/lib/epoch-agent/state.jsonENV RUST_LOG=info
ENTRYPOINT ["epoch-agent"]docker run -e EPOCH_ACTIVATION_CODE=ABC123XYZ \ -v epoch-state:/var/lib/epoch-agent \ epoch-agentPrecedence
Section titled “Precedence”Configuration values are applied in this order (later overrides earlier):
- Default values
- Configuration file (
--config) - Environment variables
- Command-line arguments
For example, --activation-code on the command line overrides EPOCH_ACTIVATION_CODE.