New Add-On: Cloudflared

Very strange, i have created two docker conatiner servers with cloudflare paid domains, one with just web server other one with homeassistant, server with webserver works smooth, but homeassistant server have 75% time have error “ERR Request failed error=“Incoming request ended abruptly: context canceled” connIndex=3”

Can some1 help me and others with this damn error?

Hello everyone.

I have a situation that I’m not sure whether to call a bug. Everything works correctly in my remote connection, however, when I close my browser or the tab where I have logged in remotely, and then try to log in again after a few minutes, I’m asked for all my credentials again, even though I had selected the option to keep the session open. Did I miss any extra configuration to prevent this?

What browser are you using?
Do you delete cookies after closing tab?

Arc browser on windows. I didn’t delete cookies. I’ll check it in setup maybe this browser do it by default

Edit: I’m noticing with another browser that if I close tabs or the browser and then re-enter using autocomplete, I can do so without any issues. However, if I type in the complete address, that’s when HA asks for credentials again. Additionally, when I use autocomplete, the browser says the connection is not secure, but this doesn’t happen when I manually type in the address. Is it normal?

Autocomplete address:
imagen

Typed:
imagen

That isn’t normal. are you sure the addresses are the same? (with https)

Yes, both are https

HI All. I am trying to setup sending data from this tunnel to prometheus as per this link
Monitor Cloudflare Tunnel with Grafana · Cloudflare Zero Trust docs
So I can monitor it via grafana, I checked the add on and it says metrics are included, but I can’t seem to get it working. I can see it says it starts the metrics service

Starting metrics server on [::]:36500/metrics

However the port doesn’t work, and I can’t get to the address. Is there something I need to do to get it working.

Thanks for a great add-on

I suspect this add on will not work with Zero Trust. I believe that Zero Trust rules operate before WAF rules. I could be wrong. I was trying to allow SmartThings webhook, but despite WAF rules, Zero Trust stops access.

I’ve removed all WAF rules and still it does not allow access. I presume it’s Zero Trust.

Hello, I am in desperate need of some help. My knowledge of the Internet/DNS is very limited, I’m an embedded engineer, this stuff is ‘magic’. I am trying to follow Cloudflared tutorials to access my HA externally but I’m running into this roadblock when attempting to add my website to Cloudflared. Any ideas? The website is created and Clourflare owns the DNS (if there’s further configuration in these steps, there’s a good chance I might’ve missed it).

Here is the error that I keep getting when clicking ‘Save’ from Cloudflared configuration tab.

Good morning,
It’s my turn to ask you. I followed a tutorial, but the configuration failed at this point; would you know why?

Leave cloudflared running to download the cert automatically.
2024-07-20T14:27:34Z INF Waiting for login…
2024-07-20T14:28:26Z INF Waiting for login…
2024-07-20T14:29:19Z INF Waiting for login…
2024-07-20T14:30:12Z INF Waiting for login…
2024-07-20T14:31:04Z INF Waiting for login…
2024-07-20T14:31:57Z INF Waiting for login…
2024-07-20T14:32:50Z INF Waiting for login…
2024-07-20T14:33:43Z INF Waiting for login…
2024-07-20T14:34:35Z INF Waiting for login…
2024-07-20T14:35:28Z INF Waiting for login…
Failed to write the certificate due to the following error:
Failed to fetch resource

Your browser will download the certificate instead. You will have to manually
copy it to the following path:

/root/.cloudflared/cert.pem
Failed to fetch resource
s6-rc: warning: unable to start service init-cloudflared-config: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.

Thank you very much for your help !

Hi Good morning, I’m new and discovered HA about 2 weeks ago.

It’s really a new world for me and I struggle to understand also because of the language (I use automatic translator)

I want to connect to the HA remotely.
I followed this step by step guide:

but it gives me this error:

Invalid list for ‘additional_hosts’ option in Cloudflared (9074a9fa_cloudflared).

My intention, however, is the following:
I have my own static IP remote Ubuntu server with a personal domain

I would like to connect
ha.mydomain.xxx to my computer home HA

Could anyone point me to a good guide?
I’ve been looking for it for 2 weeks but can’t find it.

Then I have a question:
How do I tell the server to connect
has.mydomain.xxx
to HA’s local computer via the VPN tunnel I created?
I can’t find this part anywhere, or at least I don’t know how to ask the right question.

Thanks for your help.

Clarification:
I have already created a VPN tunnel that I tested with UBUNTU and Windows and it works.

Hello all,

I’ve got the cloudflare tunnel working great when connecting externally but facing some connection issues with the companion app when on my internal home network.

Looks like occasionally the companion app can’t validate if on my home WiFi so tries the external URL which doesn’t seem to work on my internal home network.

Feels like a NAT hairpin issue but I’m unsure what info I need to configure on my home router to allow access via cloudflare tunnel on my home network

I don’t know how others have set it, but for mobile application I use external url at home, I leave internal url empty. The behaviour of Home assistant is the same, including push notifications or fire event actions.

I got a domain and got this working. It works very well. I am running HA Spawnpoint and would like to expose the HASO Minecraft server as a sub domain (eg: Minecraft.domain.com). I can access the Minecraft server just fine with the IP address and port opened, but I’d like to avoid opening ports and have an address that is easier to remember than an IP address. is there a way to set this up? HA Spawnpoint post

Wonder if someone can assist…

Had Cloudflared all setup and working great.
Today swapped from BT to Sky provider so my public IP has changed.
Now can’t get to HA remotely over domain URL.
Will this sort itself out as DNS updates or do I need to force, change, push something somewhere?

If I use Mx Toolbox the IP doesn’t match what my public IP address is now so guess I just need to wait?

Think I got it working…

Due to change of provider my home network default gateway and DNS had changed.
I run HA on Proxmox so had to update all this, then the settings in HA.
Finally started Cloudflared in HA and it kicked all back in.

Recently I have had a problem connecting from outside my network.
Everything seems OK.
I erased all the private data of the website as well as the tunnel info,

 Use a Cloudflare Tunnel to remotely connect to Home Assistant without opening any ports
-----------------------------------------------------------
 Add-on version: 5.1.19
 You are running the latest version of this add-on.
 System: Home Assistant OS 13.1  (aarch64 / raspberrypi3-64)
 Home Assistant Core: 2024.9.1
 Home Assistant Supervisor: 2024.09.1
-----------------------------------------
[14:21:54] INFO: Checking add-on config...
[14:21:55] INFO: Checking for existing certificate...
[14:21:55] INFO: Existing certificate found
[14:21:55] INFO: Checking for existing tunnel...
[14:21:55] INFO: Existing tunnel with ID xxxxa383 found
[14:21:55] INFO: Checking if existing tunnel matches name given in config
2024-09-16T11:22:03Z WRN Your version 2024.8.3 is outdated. We recommend upgrading it to 2024.9.1
[14:22:03] INFO: Existing Cloudflare Tunnel name matches config, proceeding with existing tunnel file
[14:22:03] INFO: Creating config file...
[14:22:05] INFO: Validating config file...
Validating rules from /tmp/config.json
OK
[14:22:05] INFO: Creating DNS entry xxxx.xyz...
2024-09-16T11:22:07Z INF xxxx.xyz is already configured to route to your tunnel tunnelID=xxxxxxxxxx
[14:22:07] INFO: Finished setting up the Cloudflare Tunnel
[14:22:08] INFO: Connecting Cloudflare Tunnel...

Only indication is as follows:

2024-09-21T07:46:21Z INF Retrying connection in up to 2s connIndex=3 event=0 ip=198.41.192.167
2024-09-21T07:46:22Z WRN Connection terminated error="already connected to this server, trying another address" connIndex=3
2024-09-21T07:46:43Z INF Registered tunnel connection connIndex=3 connection=xxxxx event=0 ip=198.41.192.227 location=tlv02 protocol=quic
2024-09-21T08:11:19Z ERR  error="Incoming request ended abruptly: context canceled" connIndex=2 event=1 ingressRule=0 originService=http://homeassistant:8123
2024-09-21T08:11:19Z ERR Request failed error="Incoming request ended abruptly: context canceled" connIndex=2 dest=https://xxxx.xyz/ event=0 ip=198.41.200.13 type=http

I have the same problem. As much as restarting the add-on, home assistant, host or router, nothing makes it work.

Any idea?

Edit:

At least for me the solution is to change the protocol used to establish the connection, adding a command on “run parameters” section through addon configuration page.

Changing from “quic” to “html2” works.

run_parameters:
  - "--protocol=http2"

Trying to use the Asterisk addon for HomeAssistant, but can’t set it up as ssl certs have to be in default location (/ssl/) which they obviously aren’t when using the Cloudflared addon. Any ideas how to get the necessary certs to put in the ssl directory would be much appreciated!

Hi,

Up until now i had HA and some other services exposed with Nginx Proxy Manager and DuckDNS addons. Had 5 domains in DuckDNS and 5 Proxy Hosts in NPM with Let’s Encrypt certificates. This setup has been running for more then a year without major problems.

But recently my internet provider changed to CGNAT, so now i don’t get a dynamic IPv4 address anymore :frowning:
So obviosly nothing works.

Would this addon work for this case? to be able to access my 5 proxies from anywhere ? I’m not tech savvy so i’d better ask before i start breaking things.

Thank you