News for hackers. Stuff that matters.
Re:S3 static site with SSL and automatic deploys using Travis by throwaway2016a on Sunday November 27, 2016 @07:40PM (#13052608)
Why is it using Let's Encrypt when AWS offers it's own certificates that are free, auto-renew, take seconds to setup in CloudFront, and as far as I know are just as widely recognized?
Re:S3 static site with SSL and automatic deploys using Travis by andrelaszlo on Sunday November 27, 2016 @07:42PM (#13052617)
Just for fun actually, it will probably turn out to be a PITA :)
Re:S3 static site with SSL and automatic deploys using Travis by throwaway2016a on Monday November 28, 2016 @11:41AM (#13056524)
I can appreciate that.
Re:S3 static site with SSL and automatic deploys using Travis by bobfunk on Sunday November 27, 2016 @08:31PM (#13052809)
Have a look at Netlify, https://www.netlify.com, (disclaimer I'm a cofounder).

You can get all of this in 30 seconds on our free plan + instant cache invalidation, deploy previews (we'll give you a unique preview url for every pull request), atomic deploys and no issues with deleting files :)

Re:S3 static site with SSL and automatic deploys using Travis by tf2manu994 on Monday November 28, 2016 @03:56PM (#13058323)
Yep, theyre great. One major problem for me is that their build logs are in pure Black, and don't have any colour output. Also, afaik you can't set up a multi stage build step, like Travis.
Re:S3 static site with SSL and automatic deploys using Travis by bobfunk on Tuesday November 29, 2016 @12:09PM (#13064342)
You can setup multi stage builds like:

    npm run build && npm run test
Re:S3 static site with SSL and automatic deploys using Travis by StavrosK on Sunday November 27, 2016 @09:13PM (#13052952)
I second this, I tried it the other day and it really did take 30 seconds, it was great. I'm going to be using them for all my static sites now.
Re:S3 static site with SSL and automatic deploys using Travis by nivertech on Tuesday November 29, 2016 @12:34PM (#13064534)
Does free plan works with multiple custom domains or single domain only?
Re:S3 static site with SSL and automatic deploys using Travis by moodysalem on Sunday November 27, 2016 @09:39PM (#13053027)
Most of the time it's fine to just use Github pages though.

I do something like this for my site https://oauth2cloud.com though.

Re:S3 static site with SSL and automatic deploys using Travis by fancy_pantser on Sunday November 27, 2016 @07:36PM (#13052593)
Note you'll have to manually create and deploy those Let's Encrypt certificates every 90 days because you didn't automate it (which is what they want/prefer).

https://letsencrypt.org/2015/11/09/why-90-days.html

Re:S3 static site with SSL and automatic deploys using Travis by andrelaszlo on Sunday November 27, 2016 @07:41PM (#13052611)
Yes I should add that to the notes (author here). Thanks for pointing it out. I have been thinking about ways to automate it but haven't come up with anything I like yet. Any ideas? Might switch to ACM otherwise.
Re:S3 static site with SSL and automatic deploys using Travis by colinbartlett on Sunday November 27, 2016 @08:25PM (#13052784)
If you happen to use DNSimple for DNS, they recently released a Let's Encrypt integration that verifies via DNS record. They have web hooks and also make the certs and private keys available via API, so I imagine you could set something up with Lambda.

But in my experience, Amazon's certs are so easy to setup and use there is no reason not to.

Re:S3 static site with SSL and automatic deploys using Travis by simonw on Sunday November 27, 2016 @07:52PM (#13052660)
It may be possible to automate using a scheduled AWS lambda function - though you would need to host a dynamic path under your cloudfront-hosted domain which triggers a lambda function as part of the renewal process.
Re:S3 static site with SSL and automatic deploys using Travis by martiuk on Monday November 28, 2016 @12:05PM (#13056717)
Now just to set up the redirect so your visitors can only view in https.
Re:S3 static site with SSL and automatic deploys using Travis by willglynn on Monday November 28, 2016 @01:56PM (#13057533)
CloudFront makes adding redirects easy -- set "Viewer Protocol Policy: Redirect HTTP to HTTPS" and it'll return 301s as appropriate. Done.

http://docs.aws.amazon.com/AmazonCloudFront/latest/Developer...

Now let's say you want to use HSTS so that browsers automatically rewrite HTTP to HTTPS. HSTS can protect users from agents that manipulate HTTP traffic, and it is therefore complementary to any redirection strategy.

S3 lets you specify headers with your objects, like Cache-Control and Content-Type and such, but it doesn't support Strict-Transport-Security. (You can get S3 to use custom headers, but they must start with x-amz-meta-, which doesn't help here.) If the S3 origin can't return Strict-Transport-Security, that leaves CloudFront -- but CloudFront has no specific mechanism for HSTS nor any general mechanism for adding a response header.

So... it's trivial to set a policy to redirect HTTP to HTTPS, but it's impossible to get S3->CloudFront to articulate that policy with Strict-Transport-Security headers. Sigh.