cloudflare / cloudflare/cloudflared

💡--pidfile support for "cloudflared access"

Open
#723 3 comments 0 reactions 0 assignees View on GitHub
Area: Access Good first issue Help-Wanted Priority: Deferred Type: Feature Request
Dominant language
Go
Stars
15.6k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

**Describe the feature you'd like**
Hello! Here to suggest adding --pidfile to `cloudflared access`.

Currently working version:
```yaml
version: '3'
tasks:
env:
cmds:
- cloudflared access tcp --hostname https://api.example.com --url 127.0.0.1:12345 &
- defer: kill -15 $(pgrep -fl cloudflared | grep '127.0.0.1:12345' | cut -d' ' -f1)
- HTTPS_PROXY=socks5://127.0.0.1:12345 "${SHELL}" # kubectl now works with the API
```

Oh boy if this would be possible:
```yaml
version: '3'
tasks:
env:
cmds:
- cloudflared access tcp --pidfile .cloudflared.pid --hostname https://api.example.com --url 127.0.0.1:12345 &
- defer: pkill -F .cloudflared.pid
- HTTPS_PROXY=socks5://127.0.0.1:12345 "${SHELL}" # kubectl now works with the API
```

I have found myself using the socks tunnels for quite many things now (Hashicorp Vault access for CI, kube API etc). This would make supporting scripts so much cleaner.

Thanks.

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.