Skip to content

Added SSL guide to cookbook #2269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 31, 2017
Merged

Added SSL guide to cookbook #2269

merged 3 commits into from
Mar 31, 2017

Conversation

point-4ward
Copy link
Contributor

Added SSL guide to cookbook. Contains an image, which I have put in the images folder.

Hope this is ok?

Marc Forth added 2 commits March 16, 2017 10:29
2 files - SSL guide and a screenshot

The SSL guide is a comprehensive guide for the novice to get an external connection with SSL certificate and auto-renews where possible, with various notes for other eventualities.
Copy link
Contributor

@bdurrer bdurrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the effort to write this guide. Please don't be offended by my comments. These are just suggestions of a interested reader and fellow coder 😄

http://12.12.12.12:8123
```

Can you see your HA instance? Awesome! If not, your router may not support ' loopback' - try the next step anyway and if that works, and this one still doesn't, just remember that you cannot use loopback, so will have to use internal addresses when you're on your home network. More on this later on if it's relevant to you.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that you put loopback in quotes suggests that it has a meaning which a lot of users don't understand.
I guess it should either be explained or left out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, I was kinda hoping in the context that it would just 'make sense', any suggestions for an explanatory sentence?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errm no, I don't have a better explanation. I guess that problem won't happen often anyway.


Can you see your HA instance? Awesome! If not, your router may not support ' loopback' - try the next step anyway and if that works, and this one still doesn't, just remember that you cannot use loopback, so will have to use internal addresses when you're on your home network. More on this later on if it's relevant to you.

Just to verify this isn't some kind of witchcraft that is actualy using your internal network, pick up your phone, disconnect it from your wifi so that you are on your mobile data and not connected to the home network, put the same url in the browser on your phone.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually, two L 😄
Maybe transform to a checklist instead of one big sentence

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, I didn't use spell check for the entire guide, so if you only found one spelling mistake I'm well happy!

I'll correct when I get a sec.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling corrected.


* You can access your HA instance across your local network, and access the device that it is on via SSH from your local network.
* You know the internal IP address of your router and can access your router's configuration pages.
* You have already set up a password for your HA instance, following the advice on this page: [http](https://home-assistant.io/docs/configuration/basic/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that a password should be set up BEFORE opening the router's firewall cannot be stressed enough.
I think there should be a fat warning note on the beginning of the page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I'll add a warning when I get a sec.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning added.

Remember to save the new rule.

<p class='note'>
In cases where your ISP blocks port 80 you will need to change the port forward options to forward port 443 from outside to port 443 on your HA device. Please note that this will limit your options for automatically renewing the certificate, but this is a limitation because of your ISP setup and there is not a lot we can do about it!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know what we are talking about here, but I still had a hard time reading that note (but then, I don't have an suggestion to change it besides writing shorter sentences in general 😏 ) .

Also I do wonder how a "noob" could detect or know that port 80 is blocked? But I guess when it gets longer it would require an extra troubleshooting section

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is kinda what I meant in the opening section about not covering every eventuality, and why I said 'novice' rather than noob. If you can think of a better way to word this bit I'm all ears :-)



<p class='note'>
If you're running the 'standard' setup on a raspberry pi the chances are you just logged in as the 'pi' user. If not, you may have logged in as the HA user. There are commands below that require the HA user to be on the sudoers list. If you are not using the 'standard' pi setup it is presumed you will know how to get your HA user on the sudoers list before continuing. If you are running the 'standard' pi setup, from your 'pi' user issue the following command (where <hass> is the HA user):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical Question: Why does the user need to be on the sudoers list? I think it's not a good idea to give homeassistant that priviledge, since it's running the web services.
EDIT: Ah certbot needs root in --standalone mode. Bummer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that could be avoided by adding an extra user and create wrapper scripts which do su to that extra user... well yeah, thats probably too complicated, the guide is already very extensive 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there are ways around this, but as a catch-all for a guide it seems like the easiest and isn't that insecure in the grand scheme of things.

Protocol - Both
```

If during step 4 you had to use port 443 instead of port 80 to generate your certificate, you should delete that rule now.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rewrite or reorder to line 301 to make clear which rule you mean with "delete that rule"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, I'll reorder when I get a sec.

base_url: examplehome.duckdns.org
```

You may wish to set up other options for the http component at this point, these extra options are beyond the scope of this guide but can be found on the http component page here: [http](https://home-assistant.io/components/http/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style hint: More full stops would improve the text 😉


...and accepting the browsers warning that you are connecting to an insecure site. This warning occurs because your certificate expects your incoming connection to come via your DuckDNS URL. It does not mean that your device has suddenly become insecure.

Some cases such as this are where your router does not allow 'loopback' or where there is a problem with incoming connections due to technical failure. In these cases you can still use your internal connection and ignore the warnings.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's way too technical, without explaining the technical terms. I suggest to just remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which bit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's again about the loopback. Which I don't know how to explain in two or less sentences 😄

ha_ssl and ha_letsencrypt
```

If you have any more for HA you should delete them now. If you only have ha_ssl this is probably because during step 4 you had to use port 443 instead of port 80, so we deleted the rule during step 5.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"any more" of what?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rules, is it really that unclear? I think when it is 'presented' and formatted it will look right, but if it doesn't I'll reword it. Not sure what to though?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it might be the formatting. Speaking of, I suggest you put the rule names as code.
PS: Line 366 has a typo: "You chould now"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo corrected - will have to see how clear it is when it is rendered and if there are any issues with clarity I will fix with a further PR.


Please remember whether you are a ONE-RULE person or a BOTH-RULE person for step 8!

LetsEncrypt certificates only last for 90 days. When they have less than 30 days left they can be renewed. Renewal is a simple process.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That might be helpful further up to explain what the guide wants to tell us with "renewal"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't get this one, can you clarify please?

Thanks for all the feedback so far :-D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 229 the talk is about automatic renewal, but I guess some readers wonder why that is necessary.
But I don't know where a better place is than down here :)

Additions and corrections.
@point-4ward
Copy link
Contributor Author

Added a few bits and corrected a few bits, should be good to go...

Copy link
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will merge it, move it to the Docs section, and fix the remaining issues.

New examples/documentation can go to current if there is no dependency to the main repo.

@fabaff fabaff merged commit 8da09ab into home-assistant:next Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants