Skip to content

peterkeen/diycdn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jun 24, 2020
77c4245 · Jun 24, 2020
Jun 24, 2020
Mar 18, 2019
Apr 13, 2019
Sep 22, 2019
Oct 21, 2018
Aug 19, 2018
Aug 19, 2018
Aug 19, 2018
Aug 19, 2018
Aug 19, 2018
Aug 19, 2018
Aug 21, 2018
Aug 19, 2018
Sep 8, 2018
Sep 13, 2018
Sep 13, 2018
Aug 21, 2018
Apr 13, 2019
Aug 19, 2018
Aug 19, 2018
Aug 19, 2018

Repository files navigation

DIY CDN

This is a Rails app that will eventually power my tiny DIY content distribution network. Follow along if you'd like.

setting up a new cache node

  • create proxy in cdn app
  • create dns entry
  • create vps
  • curl -H 'Authorization: Bearer <proxy api key>' https://cdn.hostname/setup | sudo bash

scripts

  • setup install nginx, create update cron
  • update one-minute cron, update certificates and config with last-updated-at. if there are updates, extract new certificates file, restart nginx

Changelog

2018-09-02

  • Add log shipping to papertrail
  • Add S3 sync sites

2018-08-30

  • Made the cache last forever
  • added rudiumentary "push" zones but not using it yet because the deploy story isn't ready
  • can now deactiate proxies and have them automatically taken out of the pool

2018-08-26 (evening)

Switched to production LE and set up corastreetpress.com. Everything seems to be working as expected.

2018-08-26

App can now set up latency-based A and AAAA records for sites

Next steps:

  • Use the last_seen_at Proxy attribute to pull proxies out of rotation that don't check in
  • Switch to production LE & set up a real site

2018-08-25

These things are now working:

  • creating or updating a site's domain list will generate a LetsEncrypt certificate
  • nginx config generation
  • setup script (install nginx, create update curl | bash shim, set up cron)
  • update script (download certificates and nginx config, restart nginx)
  • update script is a server-controlled noop unless a site or proxy has updated since the certificates zipfile was last downloaded

Next steps:

  • Switch to production LetsEncrypt
  • Teach app how to set up proxies as geo-latency A and AAAA records for labels in domain_list for each site
  • Set up a real site

TODO

  • log rotate + remote_syslog2
  • coordinate proxy admin with capistrano
  • investigate SSH certificate authority

About

Hosting my own CDN for fun and profit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published