I am trying to set up a custom domain and redirect it to Home assistant OS using a subdomain.
Scenario I am trying to setup: I have my own domain name and DNS is managed by Cloudflare. I want the subdomain to be redirected HS and certificates should be valid for 15yrs and auto-renews. I should also be able to use Alexa and google home integration with HS
I find that there is a lot of information available in this community and I am confused
I see the following option. I am posting here so it is also useful for others who are setting up a custom domain in HS for the first time.
Scenario 1 :
- Setup DuckDns
lets_encrypt:
accept_terms: true
certfile: fullchain.pem
keyfile: privkey.pem
token: xxxx1b4-3b3d-xx42c5-b1d1-8d6ecaxx
domains:
- xxxx.duckdns.org
aliases:- domain: home.xxxx.com
alias: xxxx.duckdns.org
seconds: 300
in Cloudflare create a CNAME record pointing to xxxx.duckdns.org
in HS configuration change the external URL to home.xxxx.com:8123
Status: Now if access my subdomain home.xxxx.com it redirects to HS but with this the let’s encrypt certificate is valid for only 3 months then it must be recreated.
Scenario 2 :
- Setup DuckDns
lets_encrypt:
accept_terms: true
certfile: fullchain.pem
keyfile: privkey.pem
token: xxxx1b4-3b3d-xx42c5-b1d1-8d6ecaxx
domains:
- xxxx.duckdns.org
aliases:- domain: home.xxxx.com
alias: xxxx.duckdns.org
seconds: 300
in Cloudflare create a CNAME record pointing to xxxx.duckdns.org.
Generate Cloudflare API key
Letsencrypt add on configuration: add the Cloudflare API key
in HS configuration change the external URL to home.xxxx.com:8123
Restart the addons and HS
Status: I have not yet tested this scenario but read the documentation and it is possible to add the Cloudflare API key in letsencrypt config.
I believe now letsencrypt with use the certificate from Cloudflare?
Scenario 3:
I see there is Cloudflare integration available in HS and we can provide the API key but what to be done is not clear or not documented. If I use this integration does it mean I need not use the duckdns and other configurations?
Can someone add your comments if you have followed any one of these scenarios?