Labelgate

Configuration Overview

Learn about the different ways to configure Labelgate.

Labelgate supports three configuration modes. All options follow the same naming convention — see the Configuration Reference for the complete list.

Configuration Modes

No config file needed. Set environment variables with the LABELGATE_ prefix:

LABELGATE_CLOUDFLARE_API_TOKEN=your-token
LABELGATE_CLOUDFLARE_ACCOUNT_ID=your-account-id
LABELGATE_CLOUDFLARE_TUNNEL_ID=your-tunnel-id

This is the simplest approach and is used in the Getting Started guide.

2. Config File

Use a YAML config file for more complex setups (e.g., multi-credential, multi-tunnel).

# labelgate.yaml
cloudflare:
  api_token: your-cloudflare-api-token
  account_id: your-account-id
  tunnel_id: your-tunnel-id

Specify the config file path via the LABELGATE_CONFIG environment variable:

LABELGATE_CONFIG=/path/to/labelgate.yaml

If LABELGATE_CONFIG is not set, Labelgate also checks ./labelgate.yaml and /etc/labelgate/labelgate.yaml.

3. Hybrid Mode

Combine both: use a config file for non-sensitive settings and environment variables for secrets.

Priority: Environment Variables > Config File > Defaults

# labelgate.yaml - config file for non-sensitive settings
cloudflare:
  account_id: your-account-id
  tunnel_id: your-tunnel-id
# Secrets via environment variables (override config file values)
LABELGATE_CLOUDFLARE_API_TOKEN=your-token

Next Steps

On this page