this post was submitted on 15 Apr 2021
26 points (100.0% liked)

Open Source

32814 readers
687 users here now

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

founded 5 years ago
MODERATORS
 

I am not really sure if its even possible, but is there some kind of Open-Source Self-Hosted CDN software? I'm new to this so please don't bully me on the comments.

top 13 comments
sorted by: hot top controversial new old
[–] [email protected] 10 points 3 years ago (1 children)

Hello! A CDN is just a webserver, with some extra configuration at the network level.

If you're unfamiliar with how BGP routing works between Internet operators, all you have to know is that each operator (AS - Autonomous System) has links to others, and can decide:

  • where through to route its own traffic to other AS (eg. your AT&T ISP may have a direct route to OVH (where lemmy.ml is hosted), or may go through a 3rd party transit provider like Level3 (for a much higher cost)
  • in which Points of Presence (PoPs) to advertise which routes to its own network ; you can advertise address 1.2.3.4 only from your Paris PoP and let other AS find the best route to you, and at the same time advertise address 1.3.1.2 from Paris, Moscow, Beijing, etc..

A CDN is more or less an IP address announced from many places, pointing to different servers depending on where you access it from, but with a single TLS certificate for HTTPS. So if you try to reach it from AT&T, you'll get traffic directed to a datacenter in USA, etc..

So, on a system level, it's REALLY easy to deploy a CDN. It's just a webserver. On a network level, it's more complicated because you need your own IP block that's announced on your own network. In fact, that's not entirely true as you can find (very costly) network operators that'll do that for you.

Did i answer your question? :)

[–] [email protected] 1 points 3 years ago

This did explain to me what a CDN is/how it works yes! Thank you! I just have now to learn or try to understand exactly how could this possibly be set up.

[–] [email protected] 7 points 3 years ago (1 children)

https://ipfs.io/ kinda works like a CDN, but it is probably not what you are looking for.

I think there was some open source javascript based CDN software, but I forgot the name. Sorry.

[–] [email protected] 1 points 3 years ago

I'll check it later, thank you!

[–] [email protected] 6 points 3 years ago (2 children)

Yes, you can run for example Nginx or Varnish or Caddy web server software to serve static content like images and java script files. Here an example.

https://www.nginx.com/blog/learn-to-stop-worrying-build-cdn/

[–] [email protected] 2 points 3 years ago

I'll have a look when i have some free time, thx!

[–] [email protected] 1 points 3 years ago

Apache HTTP Server with load_balancing modules can work like it too.

There is also HAProxy.

[–] [email protected] 4 points 3 years ago (2 children)

What's your goal with the CDN? Distributed file storage?

[–] [email protected] 3 points 3 years ago

Or mount a community network to support FLOSS services between each one.

[–] [email protected] 2 points 3 years ago

For now I'm just trying to understand how it works, and how is it possible to make one. But something like website hosting (which I do believe is in the file storage category)

[–] [email protected] 4 points 3 years ago (2 children)

You don't self-host a CDN. The CDN is hosting around the world so users connect to closer servers.

[–] [email protected] 4 points 3 years ago

A sefhosted network of cdn servers would be cool though. Basically a more generalized webtorrent.

[–] [email protected] 2 points 3 years ago

In this case of self-hosting I mean my self managing the CDN network, even if its like let's say Linode hosting it for example, instead of beying like cloudflare CDN.