Skip to main content

Module env_vars

Module env_vars 

Source
Expand description

Environment variable constants for WiseGate configuration.

This module centralizes all environment variable names used by WiseGate, making it easy to document and maintain configuration options.

§Categories

  • Proxy Security: Control trusted proxy IPs and validation
  • Filtering: Block IPs, HTTP methods, and URL patterns
  • Rate Limiting: Configure request limits and cleanup
  • Proxy Behavior: Timeouts and size limits

§Example

export CC_REVERSE_PROXY_IPS="192.168.1.1,10.0.0.1"
export BLOCKED_IPS="malicious.ip.here"
export RATE_LIMIT_REQUESTS=100

Constants§

ALLOWED_PROXY_IPS
Comma-separated list of trusted proxy/load balancer IPs.
BLOCKED_IPS
Comma-separated list of blocked client IP addresses.
BLOCKED_METHODS
Comma-separated list of blocked HTTP methods.
BLOCKED_PATTERNS
Comma-separated list of blocked URL patterns.
CC_BEARER_TOKEN
Bearer token for API authentication (RFC 6750).
CC_HTTP_BASIC_AUTH
HTTP Basic Authentication credentials.
CC_HTTP_BASIC_AUTH_N
Additional HTTP Basic Authentication credentials (numbered).
CC_HTTP_BASIC_AUTH_REALM
Custom realm for HTTP Basic Authentication.
MAX_BODY_SIZE_MB
Maximum request body size in megabytes.
MAX_CONNECTIONS
Maximum number of concurrent connections.
PROXY_TIMEOUT_SECS
Timeout for upstream requests in seconds.
RATE_LIMIT_CLEANUP_INTERVAL_SECS
Minimum interval between cleanup operations in seconds.
RATE_LIMIT_CLEANUP_THRESHOLD
Number of rate limit entries before triggering automatic cleanup.
RATE_LIMIT_REQUESTS
Maximum requests allowed per IP within the time window.
RATE_LIMIT_WINDOW_SECS
Duration of the rate limiting window in seconds.
TRUSTED_PROXY_IPS_VAR
Alternative environment variable name for trusted proxy IPs.

Functions§

all_env_vars
Returns a slice containing all environment variable names.