mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 07:17:14 +00:00
Merge pull request #564 from MartinHjelmare/update-letsencrypt-blog
Update letsencrypt blog
This commit is contained in:
commit
fd7164e3d2
@ -4,7 +4,7 @@ title: "Set up encryption using Let's Encrypt"
|
|||||||
description: "Tutorial how to encrypt your connection with Home Assistant."
|
description: "Tutorial how to encrypt your connection with Home Assistant."
|
||||||
date: 2015-12-13 10:05:00 -0800
|
date: 2015-12-13 10:05:00 -0800
|
||||||
date_formatted: "December 13, 2015"
|
date_formatted: "December 13, 2015"
|
||||||
author: Paulus Schoutsen
|
author: Paulus Schoutsen & Martin Hjelmare
|
||||||
author_twitter: balloob
|
author_twitter: balloob
|
||||||
comments: true
|
comments: true
|
||||||
categories: How-To
|
categories: How-To
|
||||||
@ -21,12 +21,15 @@ This tutorial will take you through the steps to setup a dynamic DNS for your IP
|
|||||||
|
|
||||||
<!--more-->
|
<!--more-->
|
||||||
|
|
||||||
|
**Updated 2016-06-18**
|
||||||
|
|
||||||
### {% linkable_title Requirements %}
|
### {% linkable_title Requirements %}
|
||||||
|
|
||||||
The DuckDNS part of this tutorial has no requirements but there are a few requirements as of now to run the Let's Encrypt client.
|
The DuckDNS part of this tutorial has no requirements but there are a few requirements as of now to run the Let's Encrypt client.
|
||||||
|
|
||||||
- Direct connection to the internet or admin access to your router to set up port forwarding
|
- Direct connection to the internet or admin access to your router to set up port forwarding.
|
||||||
- A machine running a Unix-ish OS that include Python 2.6 or 2.7 (Docker can be used)
|
- A machine running a Unix-ish OS that include Python 2.6 or 2.7 (Docker can be used).
|
||||||
|
- Root access, to write to default config, log and library directories and bind port 80.
|
||||||
|
|
||||||
<img src='/images/supported_brands/duckdns.png' style='clear: right; border:none; box-shadow: none; float: right; margin-left: 8px; margin-bottom: 8px;' width='60' />
|
<img src='/images/supported_brands/duckdns.png' style='clear: right; border:none; box-shadow: none; float: right; margin-left: 8px; margin-bottom: 8px;' width='60' />
|
||||||
|
|
||||||
@ -46,48 +49,45 @@ First step is to acquire and set up our domain name. For this, go to [DuckDNS],
|
|||||||
|
|
||||||
Let's Encrypt will give you a free 90-day certificate if you pass their domain validation challenge. Domains are validated by having certain data be accessible on your domain for Let's Encrypt ([they describe it better themselves][letsencrypt-technology]).
|
Let's Encrypt will give you a free 90-day certificate if you pass their domain validation challenge. Domains are validated by having certain data be accessible on your domain for Let's Encrypt ([they describe it better themselves][letsencrypt-technology]).
|
||||||
|
|
||||||
Assuming that your home is behind a router, the first thing to do is to set up port forwarding from your router to your computer that will run Let's Encrypt. For the Let's Encrypt set up we need to temporary forward ports `80` (http connections) and `443` (https connections). This can be set up by accessing your router admin interface ([Site with port forwarding instructions per router][port-forward]).
|
Assuming that your home is behind a router, the first thing to do is to set up port forwarding from your router to your computer that will run Let's Encrypt. For the Let's Encrypt set up we need to forward external port `80` to internal port `80` (http connections). This can be set up by accessing your router admin interface ([Site with port forwarding instructions per router][port-forward]). This port forward must be active whenever you want to request a new certificate from Let's Encrypt, typically every three months. If you normally don't use or have an app that listens to port `80`, it should be safe to leave the port open. This will make renewing certificates easier.
|
||||||
|
|
||||||
Now you're ready to run Let's Encrypt:
|
Now you're ready to install and run the client that requests certificates from Let's Encrypt. The following example will use the platform independent script to install and run the [certbot][certbot] client from Let's Encrypt. If there is a certbot package for your OS, it's recommended to install the package instead of the platform independent script. Read the [docs][certbot] for more information. There are also other clients that might offer more customization and options. See the [client options page][letsencrypt-clients] at Let's Encrypt.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ git clone https://github.com/letsencrypt/letsencrypt
|
$ mkdir certbot
|
||||||
[…]
|
$ cd certbot/
|
||||||
$ cd letsencrypt
|
$ wget https://dl.eff.org/certbot-auto
|
||||||
$ ./letsencrypt-auto certonly --email your@email.address -d hass-example.duckdns.org
|
$ chmod a+x certbot-auto
|
||||||
|
$ ./certbot-auto certonly --standalone \
|
||||||
Updating letsencrypt and virtual environment dependencies.......
|
--standalone-supported-challenges http-01 \
|
||||||
Running with virtualenv: sudo /path/letsencrypt/bin/letsencrypt certonly --email your@e-mail.address -d hass-example.duckdns.org
|
--email your@email.address \
|
||||||
|
-d hass-example.duckdns.org
|
||||||
IMPORTANT NOTES:
|
|
||||||
- Congratulations! Your certificate and chain have been saved at
|
|
||||||
/etc/letsencrypt/live/hass-example.duckdns.org/fullchain.pem. Your cert
|
|
||||||
will expire on 2016-03-12. To obtain a new version of the
|
|
||||||
certificate in the future, simply run Let's Encrypt again.
|
|
||||||
- If like Let's Encrypt, please consider supporting our work by:
|
|
||||||
|
|
||||||
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
|
|
||||||
Donating to EFF: https://eff.org/donate-le
|
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're using Docker, run the following command to generate the required keys:
|
If you're using Docker, run the following command to generate the required keys:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo mkdir /etc/letsencrypt /var/lib/letsencrypt
|
sudo mkdir /etc/letsencrypt /var/lib/letsencrypt
|
||||||
sudo docker run -it --rm -p 443:443 -p 80:80 --name letsencrypt \
|
sudo docker run -it --rm -p 80:80 --name certbot \
|
||||||
-v "/etc/letsencrypt:/etc/letsencrypt" \
|
-v "/etc/letsencrypt:/etc/letsencrypt" \
|
||||||
-v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
|
-v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
|
||||||
quay.io/letsencrypt/letsencrypt:latest certonly \
|
quay.io/letsencrypt/letsencrypt:latest certonly \
|
||||||
--email your@e-mail.address -d hass-example.duckdns.org
|
--standalone --standalone-supported-challenges http-01 \
|
||||||
|
--email your@email.address -d hass-example.duckdns.org
|
||||||
```
|
```
|
||||||
|
|
||||||
With either method your certificate will be generated and put in the directory `/etc/letsencrypt/live/hass-example.duckdns.org`. As the lifetime is only 90 days, you will have to repeat this every 90 days.
|
With either method your certificate will be generated and put in the directory `/etc/letsencrypt/live/hass-example.duckdns.org`. As the lifetime is only 90 days, you will have to repeat this every 90 days. There's a special command to simplify renewing certificates:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./certbot-auto renew --quiet --no-self-upgrade --standalone \
|
||||||
|
--standalone-supported-challenges http-01
|
||||||
|
```
|
||||||
|
|
||||||
<img width="60" src="/images/favicon-192x192.png" style='float: right; border:none; box-shadow: none;'>
|
<img width="60" src="/images/favicon-192x192.png" style='float: right; border:none; box-shadow: none;'>
|
||||||
|
|
||||||
### {% linkable_title Home Assistant %}
|
### {% linkable_title Home Assistant %}
|
||||||
|
|
||||||
Before updating the Home Assistant configuration, we have to update the port forwarding at your router config. We can drop the port forwarding for port `80` as we no longer care about unecrypted messages. Update port `443` to forward to port `8123` on the computer that will run Home Assistant.
|
Before updating the Home Assistant configuration, we have to forward port `443` (https connections) to port `8123` on the computer that will run Home Assistant. Do this in your router configuration as previously done for port `80`.
|
||||||
|
|
||||||
The final step is to point Home Assistant at the generated certificates. Before you do this, make sure that the user running Home Assistant has read access to the folder that holds the certificates.
|
The final step is to point Home Assistant at the generated certificates. Before you do this, make sure that the user running Home Assistant has read access to the folder that holds the certificates.
|
||||||
|
|
||||||
@ -105,5 +105,7 @@ _Big thanks to Fabian Affolter for his help and feedback on this article._
|
|||||||
[DuckDNS]: https://duckdns.org
|
[DuckDNS]: https://duckdns.org
|
||||||
[duckdns-install]: https://www.duckdns.org/install.jsp
|
[duckdns-install]: https://www.duckdns.org/install.jsp
|
||||||
[Let's Encrypt]: https://letsencrypt.org
|
[Let's Encrypt]: https://letsencrypt.org
|
||||||
[letsencrypt-technology]: https://letsencrypt.org/howitworks/technology/
|
[letsencrypt-technology]: https://letsencrypt.org/how-it-works/
|
||||||
|
[letsencrypt-clients]: https://letsencrypt.org/docs/client-options/
|
||||||
[port-forward]: http://portforward.com
|
[port-forward]: http://portforward.com
|
||||||
|
[certbot]: https://certbot.eff.org/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user