Dishit79 / Discdn

File uploading service like Dropbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DisCloud CDN

Python based cdn for posting your files. As this is a python project there are couple of limitations. Uploading files larger than 1gb are not recommended as the code is not optimized for big files. There also might be some bug in the code which have not been found.

Local Setup

To run DisCloud instance on your local machine.

  1. Install the code with git clone https://github.com/Dishit79/Python-cdn.git
  2. Install all dependencies pip install -r requirements.txt
  3. Create config.json file like the one bellow:
{
  "CLIENT_ID":"736035284957003816", #If do not want to enable discord login, just put in a random string
  "CLIENT_SECRET":"RS-1C_NgpVYa2E79Tui1mj4mfYOS0LFw",
  "REDIRECT_URI":"http://127.0.0.1:5000/user/callback",
  "ADMIN_ACC_CODE":"DISHIT" #The invite code which creates Admin accounts (never share this with anyone and reset after every use)
}
  1. Run the script with python main.py

Deployable Setup

To run DisCloud instance on a server for production use. (Follow same setup as Local Setup)

Systemd Service

[Unit]
Description=Gunicorn instance to serve DisCloud's website
After=network.target

[Service]
User=root
Group=www-data
WorkingDirectory=/var/www/cdn/Python-cdn
Environment="PATH=/var/www/cdn/Python-cdn/env/bin"
ExecStart=/var/www/cdn/Python-cdn/env/bin/gunicorn --workers 3 --bind unix:cdn.sock -m 007 wsgi:app

[Install]
WantedBy=multi-user.target

NGINX

server {
    listen 80;
    server_name domain.xyz;

    location / {
        include proxy_params;
        proxy_pass http://unix:/var/www/cdn/Python-cdn/cdn.sock;
    }
}

Full setup documentation here

About

File uploading service like Dropbox


Languages

Language:HTML 50.1%Language:Python 49.9%