## Issue The [documentation for creating a tunnel's configuration file](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-local-tunnel/#4-create-a-configuration-file) does not specify that the `credentials-file` field in `config.yml` needs to be an absolute path. A user (E.G. me 🤦) might add a path like `~/.cloudflared/<uuid>.json` and wonder why the `cloudflared tunnel run` command is throwing a credentials file not found error. Although one might consider it intuitive, it's not a fair assumption as a lot of CLI tools allow file paths with `~` for specifying files. P.S. The tunnel ID in the following snippet is not a real tunnel ID, I just generated it. ``` url: http://localhost:8000 tunnel: 958a1ef6-ff8c-4455-825a-5aed91242135 credentials-file: ~/.cloudflared/958a1ef6-ff8c-4455-825a-5aed91242135.json ``` Furthermore, the error has a confusing message for the user as the file at the logged path actually exists, it is just that `os.Stat` failed because it could not expand the `~`. ## Solution This commit fixes the above issue by running a `homedir.Expand` on the `credentials-file` path in the `credentialFinder` function. |
||
---|---|---|
.. | ||
access | ||
cliutil | ||
flags | ||
proxydns | ||
tail | ||
tunnel | ||
updater | ||
app_forward_service.go | ||
app_resolver_service.go | ||
app_service.go | ||
common_service.go | ||
generic_service.go | ||
linux_service.go | ||
macos_service.go | ||
main.go | ||
service_template.go | ||
windows_service.go |