Sign inSign up

maximking19/wasicdn-slave

By maximking19

•Updated over 4 years ago

Slave Package šŸš€ Blazing Fast S3 Powered CDN ✨ Powered By Fastify, S3 Buckets & Docker! (W.I.P)

Image
0

1.5K

maximking19/wasicdn-slave repository overview

ā šŸš€ WasiCDN Slave Module

Blazing Fast S3 Powered CDN, Powered By Fastify, S3 Compatible Buckets & Docker!

⁠Running the Slave

⁠docker-compose.yml
version: "3.9"

services:
  cdn:
    image: maximking19/wasicdn-slave
    build: .
    network_mode: host
    environment:
      - name=UK # Location Name
      - PORT=3005 # The Port For The CDN
      - adminPassword="yg6g4byugeuybygbiygyugbyuftuftufvtufvtfytdfcytftufytfc"
      - mongodb="mongodb://" # Your MongoDB Connector For The User & Files Database
      - files="local" # "s3" or "local", Where the CDN files are downloaded from. (Local = Pulls From The Core Server Uploads Folder, S3 = Pulls From The S3 Bucket)
      - coreServerIP="localhost:3010" # Where the core server is located (IP:PORT) (Can Find Port in Docker Compose Core Config Under adminPort. Default: 3010)
      - discordWebhook="https://discord.com/webhook/" # Discord Webhook For Files Uploads and User Audit Logs
      # s3 Bucket Details (If using s3)
      - s3Provider="" # Amazon AWS S3 "aws", Google Cloud Storage "gcs", Microsoft Azure Blob Storage "azure", DigitalOcean Spaces "digitalocean", Wasabi Object Storage "wasabi" (Custom S3 Bucket use = "s3compatible")
    # - endpoint="" # If using "s3compatible", add endpoint here
    # - region="" # If using "aws" or "digitalocean"
      - accessKeyID=""
      - secretAccessKey=""
      - bucketName=""
    volumes:
      - /usr/lib/cdn-slave/uploads:/usr/src/CDN/slave/uploads # Where the uploads are stored (/host/path:/container/path)

Core DockerHub: https://hub.docker.com/r/maximking19/wasicdn-core⁠

Features:
• Fastify Powered Backend
• Built in Load Balancer which directs the connection to the closest server to the user
• Each Slave CDN pulls files from your selected S3 Bucket or local system, each slave location has a copy and distributes them to users.
• Directs users to the closest server by checking the IP Location and sending them to the correct way

⁠CDN Replication

↓    (    Wasabi S3   )     ↓ --> Fetches files from the S3 Bucket
↓            |||            ↓
↓            |||            ↓
↓           /   \           ↓
↓         /       \         ↓
↓       /           \       ↓
↓[ UK Server ][ US Server ] ↓ --> Replicates the files from the S3 Bucket to each server (Replicates at every location) 
↓      \             /      ↓
↓       \           /       ↓
↓        \         /        ↓
   ---------------------  

⁠How it works

↓     (    Request   )      ↓
↓           | b |           ↓
↓           | d |           ↓
↓   ---------------------   ↓
↓   |  Delivery System  |   ↓ --> Checks the request IP, and forwards there request to the closest server (Checks the IP's location to determine cloest server)
↓   ---------------------   ↓
↓            |||            ↓
↓   ---------------------   ↓
↓   |   Load Balancer   |   ↓ --> Redirects the request to the least stressed server in the location (UK1: 50%, UK2:25% - Would forward to UK2 as lowest System load)
↓   ---------------------   ↓ --> Load Balancer Not Realeased (W.I.P) 
↓            |||            ↓
↓   ---------------------   ↓
↓   |        CDN        |   ↓ --> Serves the requested file on the cloest server to them
↓   ---------------------   ↓
↓            |||            ↓
↓           /   \           ↓
↓         /       \         ↓
↓       /           \       ↓
↓ [  Data  ]     [ File ]   ↓ --> Dispatches both the Data and CDN File to the destination 
↓      \             /      ↓
↓       \           /       ↓
↓        \         /        ↓
↓    -------------------    ↓
↓        Destination        ↓ --> File received! :)
↓    -------------------    ↓

Tag summary

Content type

Image

Digest

Size

411.8 MB

Last updated

over 4 years ago

docker pull maximking19/wasicdn-slave