I have the caddy proxy addon running fine with homeassistant. Using the vhost list to add an additional local server to proxy works fine. However when I try to proxy a local https unifi server, caddy proxy doesn’t work because the cert on the unifi server is invalid.
I tried adding the additional proxy using raw_config with “insecure_skip_verify” to tell caddy to ignore the certificate problem, but can’t work out the format. I tried the following value for raw_config:
The error message indicates that the vhost section is missing the “remote” setting, which is the backend server ip or server address. “port” is the backend server port and vhost is the external name of the service being proxied.
You shouldn’t have “homeassistant.mydomain.com” both the “homeassistant” setting and the “vhosts” ->“vhost” section.The “homeassistant” setting will autogenerate a vhosts entry for the local home assistant instance, so it is intended to use the “homeassistant” setting for HA and vhosts for other services that you wish to proxy.
Disclaimer: I don’t understand the templating tools used to generate the caddy file, so this is a best guess based on a quick scan of the code in git.
Thanks for the reply @wackydoo. I’ll definitely change my options, as I will also be looking to vhost my Unifi controller as well. The only difference between our setup is that I don’t have a cert for Unifi.
Will wait until @bestlibre releases his next candidate to test any changes.
@bestlibre FYI, I just plugged in another SD card with an older version of Hass.io (v54) and am receiving the same error message, when I try to save my basic two line config: Missing option vhosts in root for dictionary value @ data[‘options’]
Letting you know, hoping it may help you track down any changes
To be clear, I also don’t have a valid cert for the backend unifi controller. For most people the cert will be some default cert which the browser will not recognize, unless they manually upload a valid cert. The problem is that caddy will also not connect to unifi as it also rejects the cert just like the browser does. From caddy logs (with “port”:“8443” and “remote”:“https://ip.address.of.unifi_controller”) I get:
[ERROR 502 /cgi-bin/luci] x509: certificate has expired or is not yet valid
I was just trying to add “insecure_skip_verify” using raw_config to override caddy’s cert check on the unifi controller. I figure this is safe since the caddy to backend connection is only an internal network and I am not expecting a MITM attack from the internal network.
Hi @bestlibre, just to confirm, the options are now saving for Caddy-proxy, without prompting for additional information. Thankyou for the addons + the fix(es).
The only addons I have installed are Caddy and the HA supported ssh addon.
Also, as per my earlier question, if any has a working raw_config example (e.g. to define a custom proxy host), it would be great if they could share it, because I couldn’t get anything working.
This a base image for my debian based addons, not really an addon. I don’t want it to appear in the list of addons. The warning will probably stay (it’s armless) until I find a better solution.
@wackydoo : I didn’t have any time to look at the raw config. I will check ASAP.
Hi, I have installed influxDB from Bestlibre Addons repository version 0.1.4 however I cannot get http API working. I have tried calling curl for creation DB (curl -i -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE home_assistant" connection refused) .
Update: I was able to create database using Chronograf.
Update2: I was running curl on hassio ssh, however it did not work with localhost. When I changed it to proper IP it works fine.
Hi @bestlibre - quick question re your caddy addon. Does it pass through ip of client? If there is a login failure will hass show the clients ip or the ip of caddy?
I currently have caddy set up in docker (different docker than hassio) and when I have a hass login failure for wrong password it shows as the caddy ip not the original client ip - meaning I cannot use the hass ban policy.
Seems to me that passing through client ip will be something that should be configurable.