wlatic / hassio.addons

20 stars 16 forks source link

Cloudflare Argo- Adding second tunnel #10

Closed kgalilio closed 3 years ago

kgalilio commented 3 years ago

Hi, Thank you for the great addon. I have been using Cloudflare Argo with my hassio for a while, without any issues. I recently added a new integration into hassio, and am having problems configuring the second tunnel.

2021-04-18T08:23:34Z ERR Couldn't start tunnel error="Error getting origin cert: cannot find a valid certificate at the path null" Error getting origin cert: cannot find a valid certificate at the path null [11:23:35] INFO: Starting CloudFlare Argo Tunnel 2 2021-04-18T08:23:35Z INF Version 2021.4.0 2021-04-18T08:23:35Z INF GOOS: linux, GOVersion: devel +11087322f8 Fri Nov 13 03:04:52 2020 +0100, GoArch: amd64 2021-04-18T08:23:35Z INF Settings: map[config:/etc/cloudflared/2.yml hostname:vault.mydomain.com no-tls-verify:true origincert:null proxy-connect-timeout:2m30s url:http://192.168.1.192:7277] 2021-04-18T08:23:35Z INF Autoupdate frequency is set autoupdateFreq=86400000 2021-04-18T08:23:35Z ERR Cannot find a valid certificate for your origin at the path: null If the path above is wrong, specify the path with the -origincert option. If you don't have a certificate signed by Cloudflare, run the command: /opt/cloudflared login originCertPath=null

When I swop the tunnel (make vault.mydomain.com as the first one, and home.mydomain.com as the second) the error triggers for the second tunnel:

2021-04-18T08:48:30Z ERR Couldn't start tunnel error="Error getting origin cert: cannot find a valid certificate at the path null" Error getting origin cert: cannot find a valid certificate at the path null [11:48:31] INFO: Starting CloudFlare Argo Tunnel 2 2021-04-18T08:48:31Z INF Version 2021.4.0 2021-04-18T08:48:31Z INF GOOS: linux, GOVersion: devel +11087322f8 Fri Nov 13 03:04:52 2020 +0100, GoArch: amd64 2021-04-18T08:48:31Z INF Settings: map[config:/etc/cloudflared/2.yml hostname:home.mydomain.com no-tls-verify:true origincert:null proxy-connect-timeout:2m30s url:http://192.168.1.192:8123] 2021-04-18T08:48:31Z ERR Cannot find a valid certificate for your origin at the path: null If the path above is wrong, specify the path with the -origincert option. If you don't have a certificate signed by Cloudflare, run the command: /opt/cloudflared login originCertPath=null

So I think it is something to do with my configuration, as both tunnels work when they are placed as tunnel 1, but fail when configured as second.

Do I need to specify a separate and unique certificate for each tunnel? Or can I reference the same certificate for the three tunnels? Also If I only use two tunnels, do I have to configure the third tunnel? Or can I just leave it blank?

I appreciate any help I can get on this one.

wlatic commented 3 years ago

The long and short is that it would never have worked, I had certificate2 and certificate3 settings missing.

Added those in ( as well as a CPU usage fix today) and you should be good. You'll need to use the certificate setting for each but it can be the same certificate.

As long as you leave null in for un-used tunnels they wont run / be used.

kgalilio commented 3 years ago

Thanks for the update. I am now getting this in the addon log: "Oops! Something went wrong." In the server log, I get the following: 21-06-05 15:12:09 WARNING (MainThread) [supervisor.addons.options] Option 'url' does not exist in the schema for Cloudflare Argo (367cd613_argocloudflare) 21-06-05 15:12:09 WARNING (MainThread) [supervisor.addons.options] Option 'url2' does not exist in the schema for Cloudflare Argo (367cd613_argocloudflare) 21-06-05 15:12:09 WARNING (MainThread) [supervisor.addons.options] Option 'url3' does not exist in the schema for Cloudflare Argo (367cd613_argocloudflare) 21-06-05 15:12:09 WARNING (MainThread) [supervisor.addons.options] Option 'certificate2' does not exist in the schema for Cloudflare Argo (367cd613_argocloudflare) 21-06-05 15:12:09 WARNING (MainThread) [supervisor.addons.options] Option 'certificate3' does not exist in the schema for Cloudflare Argo (367cd613_argocloudflare)

I have populated the second tunnel parameters, but still no joy. Any suggestions on how to proceed? Is there a template configuration by default to use as an example?

Cheers,

wlatic commented 3 years ago

Hey, Just checking in to make sure you got this updated and its now working.