Skip to main content

Configuration

Lunar Interceptor Configuration

The following table describes the environment variables that can be used to configure Lunar Interceptor.

VARIABLEDescriptionRequired?Default ValueExample
LUNAR_PROXY_HOSTConfigure Lunar Proxy IP and PortYes--lunar-proxy:8000
LUNAR_HEALTHCHECK_PORTConfigure Lunar Proxy Healthcheck PortNo80409292
LUNAR_INTERCEPTOR_LOG_LEVELConfigure the log level of the InterceptorNoERRORDEBUG
LUNAR_ALLOW_LISTWhen this variable is set, only requests to domains that are in LUNAR_ALLOW_LIST are forwarded to Lunar Proxy (any other request is sent directly to the API provider)No1use.com,192.168.1.1
LUNAR_BLOCK_LISTWhen this variable is set, requests to domains that are in LUNAR_BLOCK_LIST are not forwarded to Lunar Proxy (instead they are sent directly to the API provider)No2do_not_use.com,192.168.1.2
LUNAR_ENTER_COOLDOWN_AFTER_ATTEMPTSConfigure the number of successive failed connection attempts that trigger a Failsafe mechanismNo510
LUNAR_EXIT_COOLDOWN_AFTER_SECConfigure the cooldown time in seconds for turning back Proxy availabilityNo1020

To apply a configuration to Lunar Interceptor or Proxy, simply export the relevant env var with the desired value before running them.

export VARIABLE=Value

Lunar Proxy Configuration

VariableK8S VariableDescriptionRequired?Default ValuePossible Values
TENANT_NAMEtenantNameConfigure the name for your organizationYes--The name of your organization, e.g. Acme, Google
BIND_PORTservice.portConfigure the bind port Lunar Proxy listens onNo8000Any accessible port
LUNAR_HEALTHCHECK_PORT service.healthCheckPortConfigure the port Lunar Proxy listens onNo8040Any accessible port
LOG_LEVELlogLevelConfigure the log levelNoERRORDEBUG, INFO, WARN, ERROR
ENVenvTo set the environments stageNoprodprod, dev
LUNAR_TELEMETRYtelemetryEnabledAllow the user to disable telemetry reportNotruetrue, false
note
  • Port must be accessible by Lunar Interceptor
  • The default port is 8000
  • The default port for healthcheck is 8040
  • When BIND_PORT or LUNAR_HEALTHCHECK_PORT are changed, then Lunar Interceptor should be updated as well.

Configuration Example

docker run -d --rm --env TENANT_NAME="Acme Corp." --env LOG_LEVEL=DEBUG --env BIND_PORT=8000 -p 8000:8000 --name lunar-proxy lunarapi/lunar-proxy:v0.8.15

  1. If LUNAR_ALLOW_LIST is empty, the Interceptor will forward all domains to Lunar Proxy except the ones in LUNAR_BLOCK_LIST.
  2. If both LUNAR_BLOCK_LIST and LUNAR_ALLOW_LIST are empty, the Interceptor will forward all domains to Lunar Proxy.
Click me for guidance 😀