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
1. Environment Variables Only (Recommended for Simple Setups)
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-idThis 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-idSpecify the config file path via the LABELGATE_CONFIG environment variable:
LABELGATE_CONFIG=/path/to/labelgate.yamlIf 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-tokenNext Steps
- Configuration Reference - Complete list of all options, naming convention, and multi-credential setup