Live data from Hacker News

Show HN: Scar – Static websites with HTTPS, a global CDN, and custom domains

github.com

71–80 of 171 posts

Re: Show HN: Scar – Static websites with HTTPS, a global CDN, and custom domains

#71

Earlier quoted context omitted.

What I like about static sites is that you can serve the site in its entirety from a CDN. So you can literally just CNAME www.yoursite.com to yoursite.gitlab.io (or w/e static site host you use). This dramatically cuts down on latency worldwide. It also removes your web server as a single point of failure for short-term outages.

> you can literally just CNAME www.yoursite.com to yoursite.gitlab.io After so many years I still can't really understand how easily people hand over almost complete control over their site to someone else, just because everyone else does. It's like handing over your e-mail account passwords when LinkedIn started. Yes, CloudFlare, Google and others are helping you, but there is a price to pay that might not be immedi…

How would you do it without trusting a third party?

Re: Show HN: Scar – Static websites with HTTPS, a global CDN, and custom domains

#72

How much does this cost? I put in some more effort to setup my HAProxy and nginx containers on a Vultr node, but I get LetsEncrypt for free, so I'm just paying for a Vultr node (or DO droplet) and the price of the domain name: https://github.com/sumdog/bee2

It costs at least $0.50/month but probably not much more than that for most small to medium sites.

The $0.50 is the monthly cost of the Route 53 hosted zone; the CloudFront and S3 costs typically amount to pennies, but of course it depends on traffic.

Re: Show HN: Scar – Static websites with HTTPS, a global CDN, and custom domains

#73

I have a two-line Makefile that with one target that sync's my website with an S3 bucket. Deploys are instant. The rest is handled by Cloudflare an AWS. The sheer number of moving parts in this system is outrageous for a static website. A fun project for sure, though.

I think the complexity for this setup is about the same. Once the different AWS services are provisioned during the initial setup, subsequent deploys are quite straightforward. For example, I have a three-line Makefile target for Jekyll sites that looks something like this (using Docker with a local `aws-cli` image wrapping the CLI):

    docker run --rm -e "JEKYLL_ENV=production" -v $(PWD)/src:/srv/jekyll -it jekyll/jekyll:3.8.5 jekyll build
    docker run --rm -itv $(HOME)/.aws:/root/.aws aws-cli aws s3 sync src/_site s3://www.
    docker run --rm -itv $(HOME)/.aws:/root/.aws aws-cli aws cloudfront create-invalidation --distribution-id  --paths "/*"

Re: Show HN: Scar – Static websites with HTTPS, a global CDN, and custom domains

#74
post #23

Bundling service config and launch makes the whole process easier, for sure. There's also more than one way to configure this depending on what your needs are, so it'd be cool to have a few different versions of SCAR. I started with a setup similar to your diagram and tweaked it when I realized S3 didn't serve index.html when the URL was just the parent "directory", i.e. example.com/foo/ doesn't resolve to s3://examp…

That should indeed be the default behavior out of the box with the way the S3 buckets are configured. I have a couple Jekyll sites deployed this way, and a request to the parent directory does get served by the contents in `index.html`. Are you not seeing that behavior?

I'd definitely like to add more variants of the default stack. At the minimum, I'm sure there are folks that prefer `www` redirects to the apex domain, or removing the `www` subdomain altogether.

Re: Show HN: Scar – Static websites with HTTPS, a global CDN, and custom domains

#75
post #47

Am I the only one who still hosts my own static sites on a plain old virtual machine? It's pretty simple to configure nginx for static sites, and by doing it yourself you reduce vendor lockin to just about nil. Even if S3 is massively cheaper, $5/month for a tiny VM seems like a small price to pay for being vendor-abstract. I suppose S3 is way less likely to suffer a meaningful outage than my little VM, but how many…

Maintenance is my primary concern. I deal with software for a living. I want my blog to just work without me having to worry about maintaining the VM. Netlify makes this dead simple.

I used to host Wordpress sites for myself and family members. I've now moved nearly all of those sites to Netlify (for hosting) and Forestry (for editing/CMS). I no longer have to worry about malicious hacking attempts, Wordpress updates, or anything else outside of the site content.

Here is my post on this transition for those interested: https://dev.clintonblackburn.com/2019/03/31/wordpress-to-jek....

Re: Show HN: Scar – Static websites with HTTPS, a global CDN, and custom domains

#76
post #30

Off topic, but what did you use to draw the flow diagram?

The AWS CloudFormation console has a "Designer" tool that allows drag-and-drop creation of template files, and also visualizes existing JSON or YAML template files with these diagrams.

Re: Show HN: Scar – Static websites with HTTPS, a global CDN, and custom domains

#77
post #76
post #30

Off topic, but what did you use to draw the flow diagram?

The AWS CloudFormation console has a "Designer" tool that allows drag-and-drop creation of template files, and also visualizes existing JSON or YAML template files with these diagrams.

Thanks!

Re: Show HN: Scar – Static websites with HTTPS, a global CDN, and custom domains

#78
post #47

Am I the only one who still hosts my own static sites on a plain old virtual machine? It's pretty simple to configure nginx for static sites, and by doing it yourself you reduce vendor lockin to just about nil. Even if S3 is massively cheaper, $5/month for a tiny VM seems like a small price to pay for being vendor-abstract. I suppose S3 is way less likely to suffer a meaningful outage than my little VM, but how many…

How is there vendor lock-in for static websites, though? Can't you just take your files and go somewhere else?

Re: Show HN: Scar – Static websites with HTTPS, a global CDN, and custom domains

#79

Earlier quoted context omitted.

Legitimate doubt: Fronted or frontended?

frontended doesn't make sense as a word. Fronted has many somewhat applicable definitions including * provide (something) with a front or facing of a particular type or material. * act as a front or cover for someone or something acting illegally or wishing to conceal something. "he fronted for them in illegal property deals" * stand face to face with; confront.

Thank you for the clarification.

Re: Show HN: Scar – Static websites with HTTPS, a global CDN, and custom domains

#80
post #47

Am I the only one who still hosts my own static sites on a plain old virtual machine? It's pretty simple to configure nginx for static sites, and by doing it yourself you reduce vendor lockin to just about nil. Even if S3 is massively cheaper, $5/month for a tiny VM seems like a small price to pay for being vendor-abstract. I suppose S3 is way less likely to suffer a meaningful outage than my little VM, but how many…

I served a static website off nginx from a docker container for a while. At some point there was a breaking change and it would have taken 3 minutes to fix, but I didn't bother. Static hosting is a solved problem and there's not really a reason to do it yourself unless you just want to learn.
Post reply on HN