cloudflare / cloudflare/cloudflared

🐛Insufficient warning about the `USERPROFILE` variable on Windows Service

Open
#1,116 0 comments 0 reactions 0 assignees View on GitHub
Priority: Normal Type: Bug
Dominant language
Go
Stars
15.6k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
According to the [Cloudflare official documentation](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/configure-tunnels/local-management/as-a-service/windows/), it instructs placing the `config.yml` file at `%USERPROFILE%\cloudflared\config.yml`.

However, when the agent is installed as a Windows service, the path of the `USERPROFILE` variable changes. Upon inspection, it appears to be installed as a service under the `Local System` account.

In this case,

Even if the config.yml is not present in the location demanded by the Cloudflared agent, the agent does not issue a warning.

Even if users have properly configured the config.yml in the local user directory, they still receive error messages like "bad handshake."

Attempting to seek support in the community may be challenging because the error message visible is limited to "bad handshake," making questions and answers restricted in scope.

**To Reproduce**
Steps to reproduce the behavior:
1. Write a `config.yml`
2. Run `cloudflared service install`
3. See error `bad handshake` when `cloudflare access tcp ~`

**Expected behavior**
It should function normally, just like when manually running "cloudflared tunnel run." Alternatively, when attempting "cloudflared service install," there should be a check to ensure the existence of the config.yml, and if it is not present, a warning should be issued.

**Environment and versions**
- OS: Windows 11
- Architecture: AMD64
- Version: cloudflared version 2023.10.0 (built 2023-10-31-1231 UTC)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.