Configuration
Lunar Interceptor Configuration
The following table describes the environment variables that can be used to configure Lunar Interceptor.
VARIABLE | Description | Required? | Default Value | Example |
---|---|---|---|---|
LUNAR_PROXY_HOST | Configure Lunar Proxy IP and Port | Yes | -- | lunar-proxy:8000 |
LUNAR_HEALTHCHECK_PORT | Configure Lunar Proxy Healthcheck Port | No | 8040 | 9292 |
LUNAR_INTERCEPTOR_LOG_LEVEL | Configure the log level of the Interceptor | No | ERROR | DEBUG |
LUNAR_ALLOW_LIST | When 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) | No | 1 | use.com,192.168.1.1 |
LUNAR_BLOCK_LIST | When 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) | No | 2 | do_not_use.com,192.168.1.2 |
LUNAR_ENTER_COOLDOWN_AFTER_ATTEMPTS | Configure the number of successive failed connection attempts that trigger a Failsafe mechanism | No | 5 | 10 |
LUNAR_EXIT_COOLDOWN_AFTER_SEC | Configure the cooldown time in seconds for turning back Proxy availability | No | 10 | 20 |
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
Variable | K8S Variable | Description | Required? | Default Value | Possible Values |
---|---|---|---|---|---|
TENANT_NAME | tenantName | Configure the name for your organization | Yes | -- | The name of your organization, e.g. Acme , Google |
BIND_PORT | service.port | Configure the bind port Lunar Proxy listens on | No | 8000 | Any accessible port |
LUNAR_HEALTHCHECK_PORT | service.healthCheckPort | Configure the port Lunar Proxy listens on | No | 8040 | Any accessible port |
LOG_LEVEL | logLevel | Configure the log level | No | ERROR | DEBUG , INFO , WARN , ERROR |
ENV | env | To set the environments stage | No | prod | prod , dev |
LUNAR_TELEMETRY | telemetryEnabled | Allow the user to disable telemetry report | No | true | true , false |
note
- Port must be accessible by Lunar Interceptor
- The default port is
8000
- The default port for healthcheck is
8040
- When
BIND_PORT
orLUNAR_HEALTHCHECK_PORT
are changed, then Lunar Interceptor should be updated as well.
Configuration Example
- Docker
- K8S
- Local
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
helm install lunar-proxy lunar/lunar-proxy --set bindPort=8000 --set service.port=8000 --set logLevel=DEBUG --set tenantName="Acme Corp."
export BIND_PORT="8000"
export LOG_LEVEL="DEBUG"
export TENANT_NAME="Acme Corp."