News for hackers. Stuff that matters.
Re:Building a static serverless website using S3 and CloudFront by m82labs on Monday February 17, 2020 @06:14PM (#22351838)
I found s3 + cloudflare to be a better combo. Cloudflare offers free ssl certs and has overall been a great experience. I also use AWS SES for my domain mail. It gets delivered to S3, then a local python script grabs it and dumps it in a mailbox file for dovecot to serve via imap. I pay $0.05/month for my hosting of my site and email.

https://markw.dev

Re:Building a static serverless website using S3 and CloudFront by divbzero on Monday February 17, 2020 @06:22PM (#22351889)
Or GitHub Pages + CloudFlare.

And as another comment mentions, GitHub Pages now offers HTTPS certificates [1] for custom domains, so GitHub Pages alone is sufficient for most static websites.

[1]: https://github.blog/2018-05-01-github-pages-custom-domains-h...

Re:Building a static serverless website using S3 and CloudFront by m82labs on Monday February 17, 2020 @06:27PM (#22351922)
I started there but didn’t like having my drafts and unfinished ideas visible in the repo. I now maintain my site in a private repo and publish to S3. Not sure if that’s possible now in Github or not.
Re:Building a static serverless website using S3 and CloudFront by divbzero on Monday February 17, 2020 @06:32PM (#22351981)
That’s a fair point. GitHub Pages from private repos are enabled only if you have a Pro or Team subscription. [1]

[1]: https://github.com/pricing#feature-comparison

Re:Building a static serverless website using S3 and CloudFront by BeeOnRope on Monday February 17, 2020 @08:09PM (#22352540)
Actually I'm not sure if it makes sense. If you had gh pages from a private repo, they would be public (in the sense that they are published on the open web) - so that won't solve the OP's problem.

IMO the simplest solution for the OP is to have a private repository where he does any draft work, and then pushes the master branch (or whatever) to the public repo in order to "publish".

This option is available with or without a paid account, and I don't see any significantly better option available to paid accounts. The only thing you could do there is publish your pages from a private repo, and maintain your drafts in branches in the same repo. That is virtually identical to the original suggestion except that "master branch in public repo" is replaced by "master branch in private (same) repo" which probably makes little practical difference in the workflow.

Re:Building a static serverless website using S3 and CloudFront by bachmeier on Monday February 17, 2020 @07:47PM (#22352429)
Well, the html files of your website are of course public information once you publish them, and you can copy the html files to a public repo as part of the build process. When I tried Hugo a couple years ago, I had it set up to do just that (output to a different repo). There was no difference on my end. No matter how you build your site, you can always add the copying at the end of your Makefile or whatever method you use.
Re:Building a static serverless website using S3 and CloudFront by cortesoft on Monday February 17, 2020 @07:28PM (#22352329)
You could always keep the main repo private, and just pushed the published versions to the public repo
Re:Building a static serverless website using S3 and CloudFront by jorge-d on Monday February 17, 2020 @06:32PM (#22351978)
You can have a private repo hosting github pages, I'm using it for my personal website
Re:Building a static serverless website using S3 and CloudFront by StavrosK on Monday February 17, 2020 @07:33PM (#22352355)
Are you paying for it? It sounds like a great solution if it's available on the free tier.
Re:Building a static serverless website using S3 and CloudFront by chipsa on Monday February 17, 2020 @07:36PM (#22352374)
GitHub provided private repos to everyone after Microsoft bought them. And I don't know why it'd require the repo to be public to do the pages...
Re:Building a static serverless website using S3 and CloudFront by travisjungroth on Monday February 17, 2020 @08:33PM (#22352665)
Pages from a private repo is a paid feature.
Re:Building a static serverless website using S3 and CloudFront by lucasverra on Tuesday February 18, 2020 @03:19AM (#22354350)
private repo + netlify when ready then
Re:Building a static serverless website using S3 and CloudFront by scarface74 on Monday February 17, 2020 @06:30PM (#22351957)
AWS also offers free SSL certs via the Amazon Certificate Manager. The certs only work with CloudFront, Load balancers and API Gateway though.

One advantage is that they are auto renewing and you don’t have to manage them.

Re:Building a static serverless website using S3 and CloudFront by juddlyon on Monday February 17, 2020 @07:40PM (#22352398)
The free SSL certificates via ACM are only available in the US East (Northern Virginia) Region. That has tripped me up before.
Re:Building a static serverless website using S3 and CloudFront by phinnaeus on Monday February 17, 2020 @07:46PM (#22352424)
That's not quite right. You must provision your CloudFront certificate in us-east-1 because that's where CloudFront is. You can provision ACM certs in any region.
Re:Building a static serverless website using S3 and CloudFront by kryptk on Monday February 17, 2020 @08:04PM (#22352520)
I have ACM certs issued and working in ap-northeast-1 and us-west-2, attached to an ALB.
Re:Building a static serverless website using S3 and CloudFront by stonewhite on Tuesday February 18, 2020 @08:17AM (#22355771)
That is the case for Cloudfront certificates globally. For Loadbalancer or other uses, you should just provision your certs in your own region.
Re:Building a static serverless website using S3 and CloudFront by dontdoitpls on Monday February 17, 2020 @11:09PM (#22353373)
AWS ses has convinced me Amazon and Google have too much power. 1% "spam" = frozen account

Could be bounces, but mostly just users who literally signed up clearly for my email list with 0 deception marking spam.

It's actually cut my content production down because I'm afraid to email. From 50 articles per year to 12 to 4 to 2.

Re:Building a static serverless website using S3 and CloudFront by scrollaway on Tuesday February 18, 2020 @06:14AM (#22355106)
Knowing AWS SES rules and seeing the lack of context from your post, I'm going to guess that either you're embellishing the story, or your content quality is low enough that users see it as spam. 50 a year that is one a week; I need to be super motivated to stay subscribed to a 1-a-week email from a single content provider.

Bounces also have their own system and should be handled by your email system as well.

Re:Building a static serverless website using S3 and CloudFront by dontdoitpls on Tuesday February 18, 2020 @10:01AM (#22356498)
Not embellishing.

And even at 4 a year I have this issue.

If 70 of the 7000 emails I send bounce or get marked as Spam, I get frozen until I ask for forgiveness.

Re:Building a static serverless website using S3 and CloudFront by divbzero on Monday February 17, 2020 @06:29PM (#22351944)
I find your email setup intriguing. Any chance you could share those scripts in a GitHub repo or gist?
Re:Building a static serverless website using S3 and CloudFront by m82labs on Monday February 17, 2020 @06:36PM (#22352012)
I plan to write a post about it. I’ll put it up here when I’m done.
Re:Building a static serverless website using S3 and CloudFront by mxie-ca on Monday February 17, 2020 @06:42PM (#22352051)
I have this set up couple years ago via this lambda function: https://github.com/arithmetric/aws-lambda-ses-forwarder

It may look outdated, but it still functions well for me

Re:Building a static serverless website using S3 and CloudFront by m82labs on Monday February 17, 2020 @07:30PM (#22352342)
The big difference is my setup doesn’t require another email service. Just 10 lines in a config to spin up an imap server. I was trying avoid the big mail providers when I set this up.