Caddy tutorial needed please

Thanks for sharing the ip_bans file info, I’ve spent about an hour or two on this and to find out it was something so simple.

Thanks

@anon35356645

I finally got caddy (add-on, Bestlibre) working
this is my config:

{
  "homeassistant": "x.duckdns.org",
  "vhosts": [
    {
      "vhost": "y.duckdns.org",
      "port": "9000"
    }
  ],
  "raw_config": [],
  "email": "[email protected]"
}

28

In my router I have port 80 forwarded to 81 and 443 to 444 on my mac mini.
x.duckdns.org points to my HA
y.duckdns.org points to portainer

I also have the duckdns add-on
config:

{
  "lets_encrypt": {
    "accept_terms": false,
    "certfile": "fullchain.pem",
    "keyfile": "privkey.pem"
  },
  "token": "xxxxxxxxxxxxxxxxxxx",
  "domains": [
    "x.duckdns.org",
    "y.duckdns.org"
  ],
  "seconds": 300
}
1 Like

The attached URL links to a tutorial I used to set up Caddy.
https://dew-itwebservices.com.au/setting-home-assistant-up-for-secure-access-over-the-internet/

@paul2nz i cant use my google assistant, i use the port 443 is there any specific configuration?
@DavidFW1960 i have this error , i use your tutorial



image

When you try and link the test app to home assistant, what is the URL it shows in the HA login screen?
What do you type in a browser to access your home assistant from outside your WLAN? Most likely, you have some mismatch in URL at Google - there’s a few places it is entered. Also, make sure your test app is enabled in the simulator on google dev console.

YOU DON’T NEED THE :443…

@DavidFW1960, answering the first question:

2 question:
outside i acess https://my_duckdns.org

3 ok i remove all 443
image
image

yes my test app is enabled in the simulator:

but the error is the same.

why are you still using the API auth instead of the new auth?
It’s not a caddy issue…

if i use the new auth, the error is the same… i dont understand why this happens.

all your posted urls look ok. I assume you’ve built an action?

the fact you’re seeing the HA login screen means caddy isn’t preventing you connecting… it’s a googe thing… I would just work through all the instructions for linking with google and make sure you didn’t miss anything. The google actions might show something in the logs?

when you write Logs, did you mean home-assistant.log? if yes no, i dont have any errors.

no I meant the log in google actions console

@DavidFW1960

I can only suggest you go through the setup of the component from HA docs again to make sure you didn’t miss something.

I’ve done it all again, and it’s still the same. When i used duckdns without this addon everything worked fine.

I think I’ll give up, and use the dnsmasq addon, I just do not know if dnsmasq protects me as much as this.

what does your caddyfile look like?

SECRET.duckdns.org {
    header / {
    Strict-Transport-Security "max-age=31536000; includeSubDomains"
    X-XSS-Protection "1; mode=block"
    X-Content-Type-Options "nosniff"
    X-Frame-Options "SAMEORIGIN"
    Referrer-Policy "same-origin"
    - Server
}
    proxy / localhost:8123 {
        websocket
        transparent
    }
}
nodered.SECRET.duckdns.org {
    proxy / localhost:1880 {
        websocket
        transparent
    }
}
grafana.SECRET.duckdns.org {
    proxy / localhost:1880 {
        websocket
        transparent
    }	
}

what about your http settings in config yaml?

http:
  base_url: https://SECRET.duckdns.org
  api_password: !secret api_password_http
  ip_ban_enabled: True
  login_attempts_threshold: 3

All looks ok to me. Is there a reason you still have the old API-password enabled?