42

My Own Private CDN

 5 years ago
source link: https://www.tuicool.com/articles/hit/j2uAFjn
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Hosting my own CDN has long been a completely irrational goal of mine. Wouldn't it be neat, I'd think, if I could tweak every knob instead of relying on CloudFront to do the right thing? Recently I read this article by Janos Pasztor about how he built a tiny CDN for his website. This just proves to me that at least it's not an uncommon irrational thought.

Yesterday I decided to actually start building something. Even if it doesn't make it into production, I'll at least have learned something.

Technical Goals

curl | sudo bash
nginx

Additionally, I really want to learn how LetsEncrypt works. certbot is great but it is very much a black box to me. Command-line arguments in, certificates out. If I write my own management system I can actually learn how the guts work.

Current Status

  • basic Rails app that knows about sites and proxies
  • creating or updating a site (re)generates a LetsEncrypt certificate for all of the domains that point at that site
  • wildcard domains are fully supported
  • authenticated endpoint that generates a zip file of all of the certificates and private keys

Next Steps

  • Automatic certificate refresh using something like Sidekiq Cron
  • Deploy onto the server in my basement on my ZeroTier network
  • Move all of my existing LetsEncrypt certbot crons into this system
  • Provision a POP by hand and then automate the steps to provision another one

If you'd like to follow along I put the project up on GitHub . I'll also be posting updates here as I go.

Want more stuff like this? Sign up for my mailing list . I post everything there a week before I post it here.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK