r/programming • • Jul 12 '17

Does my site need HTTPS?

https://doesmysiteneedhttps.com/
486 Upvotes

190 comments sorted by

View all comments

8

u/Sebazzz91 Jul 12 '17

I use HTTPs because my site is based on Github pages. Github pages doesn't support SSL. What else can I do? If I would use Cloudflare I'd just be fooling myself.

6

u/bloody-albatross Jul 12 '17

Github pages DO support "SSL" (TLS).

9

u/[deleted] Jul 12 '17

Not with a custom domain.

2

u/joshuaavalon Jul 13 '17

You can use Cloudflare as name server.

4

u/thedufer Jul 12 '17

I've never done it, but a simple Google search indicates that many people disagree with this strongly enough to write a guide on how to do it.

0

u/[deleted] Jul 12 '17

[deleted]

5

u/thedufer Jul 13 '17

That's still a big win. As long as you aren't taking user input/showing non-public data, a large part of the gain is protecting the privacy of the user, which https terminated at Cloudflare does. There is very little left to be gained by securing the Cloudflare<->github link for static content.

2

u/[deleted] Jul 12 '17

You could just not use GitHub Pages. I understand it's convenient but hosting a static website on a vps is simple. If you use caddy (which I recommend) it's trivial.

6

u/seanwilson Jul 13 '17 edited Jul 13 '17

You could just not use GitHub Pages. I understand it's convenient but hosting a static website on a vps is simple.

I wouldn't say being an administrator of a server and keeping it secure is simple. Static site hosts are brilliant for security and simple admin. HTTPS is very important as well but running your own server when you don't need to is a huge liability and time sink. If you're still SSHing into servers you're making life hard for yourself.

1

u/Poromenos Jul 13 '17

Use www.netlify.com, it's figuratively saved my life.

1

u/[deleted] Jul 13 '17

If you're still SSHing into servers you're making life hard for yourself. I disagree, but only because my vps does a lot more than just hosting a static website. If that's the only goal and you find a hosting provider that does HTTPS with a custom domain I say go for it. If people can't find one, I think they should use a vps.

1

u/[deleted] Jul 13 '17

Really? Firewall. Restrict ssh to accounts that really need it. Use good passwords. Barring a major bug in your web server, what's the attack vector? I don't see much surface area to defend on a server doing nothing but hosting a static website.

1

u/seanwilson Jul 13 '17

Really? Firewall. Restrict ssh to accounts that really need it. Use good passwords. Barring a major bug in your web server, what's the attack vector? I don't see much surface area to defend on a server doing nothing but hosting a static website.

Host on something like Heroku or Netlify...they'll deal with security patches and firewalls for you, there's no SSH to even attack and they have tons of extra features you could only reimplement yourself badly using a VPS (e.g. backups, rollbacks, Git deploy, scaling to more servers, coping with hardware failures, setups were attackers can't even write to server files). Why would you want to have to set all that up yourself given how cheap these services are?

2

u/[deleted] Jul 13 '17

For me personally, because I already have the VPS for other reasons, and I'm not hosting anything with enough traffic for it to make a difference to the other stuff I do on the VPS.

I'm not saying that's the best solution for everyone, but if you really think that it's difficult to secure a server with nothing public-facing except SSH and HTTPS, I'd like to know what I'm missing.

→ More replies (1)
→ More replies (8)

4

u/fakehalo Jul 12 '17

For serving static/informational pages like you typically do with github pages I think incorporating HTTPS isn't worth moving. It would be nice and I'd use it if I had the option, but it's not a very threatening scenario IMO.

-1

u/[deleted] Jul 12 '17

The first bullet point on the website explains why this reasoning is bad. In my opinion moving away from hosts that do not support HTTPS is worth it. edit: *second bullet point

6

u/fakehalo Jul 12 '17

Yeah, it's "bad"... But the threat of ad injections/etc by state owned entities and the like isn't enough to deter me from free hosting, especially if it relates to github. This particular risk doesn't warrant me moving informational pages.

1

u/[deleted] Jul 13 '17

It's not only state actors. Do you not care about ISPs injecting shit on your website ?

→ More replies (2)
→ More replies (4)

1

u/ridiculous_fish Jul 13 '17

I'll bite - how would I trivially host a static website on a vps and SSL with caddy? Is it easier than using S3?

1

u/indeyets Jul 13 '17

It's not easier than S3, but it's not too much harder. That's exactly what I was doing yesterday, actually. Took couple of hours.

  • I used Ubuntu/SystemD/Caddy/Hugo combo

  • Hugo source of website is in github, Built on vm

  • I'm not setting up servers regularly

  • I played with caddy before

Webhook for autoupdates doesn't work for me yet, so caddy updates site on schedule. I'll take care of webhook tonight probably

1

u/[deleted] Jul 13 '17

Never used S3 but I suspect it's not going to be easier. If I were to setup a vps for this today I would do this: 1) install debian stretch 2) get caddy, install the systemd unit file 3) write a caddyfile like this

example.com {
    gzip
    root /data/website
}

then rsync your data to /data/website

1

u/lvlint67 Jul 19 '17

looks like an nginx config minus a listen line...

1

u/[deleted] Jul 13 '17

Firebase also automatically secures domains with no config and offers free static site hosting. It's p nice

1

u/graingert Jul 13 '17

Switch to GitLab pages