Skip to content

Environment Variables

GripMock reads configuration from environment variables on startup.

Core

VariableDefaultDescription
LOG_LEVELinfoLog level (trace, debug, info, warn, error).

gRPC server

VariableDefaultDescription
GRPC_NETWORKtcpNetwork type for gRPC listener.
GRPC_HOST0.0.0.0gRPC bind host.
GRPC_PORT4770gRPC bind port.
GRPC_ADDR$GRPC_HOST:$GRPC_PORTFull gRPC bind address.

HTTP admin server

VariableDefaultDescription
HTTP_HOST0.0.0.0HTTP bind host (admin API + UI).
HTTP_PORT4771HTTP bind port.
HTTP_ADDR$HTTP_HOST:$HTTP_PORTFull HTTP bind address.

Stub watcher

VariableDefaultDescription
STUB_WATCHER_ENABLEDtrueEnable automatic file watch/reload for stubs.
STUB_WATCHER_INTERVAL1sPolling interval for timer-based watcher.
STUB_WATCHER_TYPEfsnotifyWatcher backend (fsnotify, timer).

History

VariableDefaultDescription
HISTORY_ENABLEDtrueEnable call history recording.
HISTORY_LIMIT64MIn-memory history size cap.
HISTORY_MESSAGE_MAX_BYTES262144Max stored payload size per message.
HISTORY_REDACT_KEYS(empty)Comma-separated keys to redact in history.

Session GC

VariableDefaultDescription
SESSION_GC_INTERVAL30sSession cleanup loop interval.
SESSION_GC_TTL60sSession time-to-live.

Plugins

VariableDefaultDescription
TEMPLATE_PLUGIN_PATHS(empty)Comma-separated paths to template plugins.

gRPC TLS

VariableDefaultDescription
GRPC_TLS_CERT_FILE(empty)gRPC server TLS certificate file.
GRPC_TLS_KEY_FILE(empty)gRPC server TLS private key file.
GRPC_TLS_CLIENT_AUTHfalseRequire client certs for gRPC (mTLS).
GRPC_TLS_CA_FILE(empty)CA file for validating gRPC client certs.
GRPC_TLS_MIN_VERSION1.2Minimum TLS version (1.2, 1.3).

HTTP TLS

VariableDefaultDescription
HTTP_TLS_CERT_FILE(empty)HTTP server TLS certificate file.
HTTP_TLS_KEY_FILE(empty)HTTP server TLS private key file.
HTTP_TLS_CLIENT_AUTHfalseRequire client certs for HTTP (mTLS).
HTTP_TLS_CA_FILE(empty)CA file for validating HTTP client certs.

OpenTelemetry

VariableDefaultDescription
OTEL_ENABLEDfalseEnable OpenTelemetry export.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317OTLP collector endpoint.
OTEL_EXPORTER_OTLP_INSECUREtrueUse insecure OTLP transport.

Buf Schema Registry (BSR)

Supported profiles:

  • BSR_BUF_*
  • BSR_SELF_*

Variables per profile:

Variable suffixDefaultDescription
BASE_URL(empty)BSR API base URL.
TOKEN(empty)BSR token (private modules).
TIMEOUT5sBSR request timeout.

Examples:

  • BSR_BUF_BASE_URL, BSR_BUF_TOKEN, BSR_BUF_TIMEOUT
  • BSR_SELF_BASE_URL, BSR_SELF_TOKEN, BSR_SELF_TIMEOUT

Notes for CLI utilities

dump

gripmock dump reads HTTP_ADDR for the admin API host/port.

  • Default scheme is http. Use --scheme https for TLS.
  • Override address via env: HTTP_ADDR=10.0.0.5:4771 gripmock dump.