bestlibre / hassio-addons

173 stars 110 forks source link

Caddy Proxy - Can't set basic auth #74

Closed tml89 closed 6 years ago

tml89 commented 6 years ago

If i save the user and pwd to the config to enable basic auth, my configuration will be overwritten and my entered values are gone.

Here is my working cnfiguration withouth basic auth:

{
  "homeassistant": "xxx.duckdns.org",
  "vhosts": [],
  "raw_config": [],
  "email": "xxx@gmail.com"
}

And this is the configuration which i tried:

{
  "homeassistant": "xxx.duckdns.org",
  "vhosts": [],
  "raw_config": [],
  "user" : "test",
  "pwd" : "password"
  "email": "xxx@gmail.com"
}

Can anybody please help me?

Thank you in advance!

Best regards Tim

bcheck commented 6 years ago

It's not clear from the formatting, but user/pwd goes within the vhosts list. You'll also need to include vhost and port (instead of the "homeassistant" setting shortcut afaik). See the config.json: https://github.com/bestlibre/hassio-addons/blob/master/caddy_proxy/config.json

So a minimal config would look like:

{
  "homeassistant": "",
  "vhosts": [
    {
      "vhost": "your.host.name",
      "port": "8123",
      "user": "someusername",
      "pwd": "somepassword"
    }
  ],
  "raw_config": [],
  "email": "emailaddressforletsencrypt"
}
tml89 commented 6 years ago

Hello bcheck,

thank you for your reply! Your suggested configuration did work!

Thank you!