Configuration precedence when ngrok YAML and CLI define the same tunnel
0 reputation · 07 May 2023, 01:53 UTC
The goal is to define multiple tunnels with custom domains for local services using ngrok's configuration mechanisms. The agent is documented to support both a YAML configuration file and command-line arguments for tunnel definitions, and it establishes a secure connection to the ngrok cloud edge to route ingress traffic to the local port.
There is uncertainty about how the agent resolves overlapping definitions when the same tunnel name, port, or domain is specified in both the YAML file and the CLI invocation. The interaction between file-based configuration and CLI overrides is a design decision that may vary with agent version, and the documented merge behavior is not clearly established for all protocol types including HTTP, HTTPS and raw TCP.
Which configuration source takes precedence for a tunnel when both YAML and CLI specify the same name? Does the agent merge settings from both sources or does one source fully override the other? When duplicate definitions are present, is the result deterministic across agent versions?