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.
To run DisCloud instance on your local machine.
- Install the code with
git clone https://github.com/Dishit79/Python-cdn.git
- Install all dependencies
pip install -r requirements.txt
- 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)
}
- Run the script with
python main.py
To run DisCloud instance on a server for production use. (Follow same setup as Local Setup)
[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
server {
listen 80;
server_name domain.xyz;
location / {
include proxy_params;
proxy_pass http://unix:/var/www/cdn/Python-cdn/cdn.sock;
}
}