Sebclem / hassio-nextcloud-backup

Hass.io Add-on: Backup your snapshots to Nextcloud
GNU General Public License v3.0
127 stars 20 forks source link

IPv6 only Host not working #241

Open FirstS0ul opened 4 months ago

FirstS0ul commented 4 months ago

Describe the bug My Nextcloud Instance is IPv6 only. HA can connect, but ne NC Backup Tool not.

To Reproduce Set IPv6 address in HA and configure an ipv6 only NC instance.

Expected behavior Error: Can't connect to Nextcloud (Error: connect ENETUNREACH - Local (:::0))

System information

Morgendorfferr commented 3 months ago

I had the same issue. The following workaround (local DNS-rebinding) solved that for me. I would still prefer a solution in the add-on itself as there are some preconditions for the workaround:

  1. The ipv6-only nextcloud instance needs to be in the same network as the home-assistant instance (or better: be in principle accessible under a local ipv4 address for home assistant).
  2. You need to be able to define a local DNS-record. In may case I have a local Pi-Hole.

Under these preconditions you can:

  1. Define a local DNS-record that resolves your nextcloud address to its local ipv4 address. In Pi-Hole UI this can be done under „Local DNS -> DNS records“. Alternatively this should also be possible in some routers.
  2. Let your home-assistant use these local DNS-record. This can be done in the home-assistant UI under „Settings -> System -> Network -> Interface -> ipv4/ipv6“. Define a static DNS-resolver with the local address of your Pi-Hole.
  3. In some routers you need to allow local DNS-rebinding to your local nextcloud.
  4. Restart home-assistant to let the add-on use Pi-Hole as well.
  5. This should work as the add-on now gets a DNS A record wich points to your local nextcloud. Obviously the add-on uses only the ipv4 A record and ignores the ipv6 AAAA record.

If you use Pi-Hole you should avoid blocking domains your home-assistant tries to access. Either by whitelisting all blocked domains or (better) by group management (assigning no adlist to the home-assistant group).