cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

💡--pidfile support for "cloudflared access"

Open ambis opened this issue 3 years ago • 3 comments

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

Currently working version:

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:

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.

ambis avatar Aug 13 '22 07:08 ambis

Hi @ambis - Thank you for submitting this feature request with a detailed example. It makes sense and helps us understand what you're aiming to accomplish. We don't develop too many new features for cloudflared access since we've begun investing more and more into our private network model. We do accept a number of community driven pull requests though if you're able to take a stab at implementing this. If not, we'll track this internally and provide updates on this thread if and when we're able to pick it up from the backlog.

abelinkinbio avatar Aug 13 '22 18:08 abelinkinbio

If this is still active, I would love to look at this. Or maybe if there is some other issue which is good as a starting point?

varshneydevansh avatar Sep 05 '23 07:09 varshneydevansh