Turn Discord into a datastore that can manage and store your files.
This fork prevents files from becoming unavailable after 24 hours due to Discord's sharing restrictions. 😎
What's changing? Just add a user token to the .env ;)
DDrive A lightweight cloud storage system using discord as storage device written in nodejs. Supports an unlimited file size and unlimited storage, Implemented using node js streams with multi-part up & download.
ddrive_demo.mp4
- Theoretically unlimited file size, thanks to splitting the file in 24mb chunks using nodejs streams API.
- Simple yet robust HTTP front end
- Rest API with OpenAPI 3.1 specifications.
- Tested with storing 4000 GB of data on single discord channel (With max file size of 16GB).
- Supports basic auth with read only public access to panel.
- Easily deployable on heroku/replit and use as private cloud storage.
- NodeJS v16.x or Docker
- Postgres Database, Discord Webhook URLs
- Avg technical knowledge
- Clone this project
- Create few webhook urls. For better performance and to avoid rate limit at least create 5 with 1 webhook / text channel. (How to create webhook url)
- Setup postgres using docker, if you already don't have it running
cd .devcontainer
docker-compose up -d
- Copy
config/.env_sample
toconfig/.env
and make necessary changes - Optional - If you have lots of webhookURLs you can put those in
webhook.txt
with\n
seperated. - Run -
npm install
- Run -
npm run migration:up
- Run -
node bin/ddrive
- Navigate to
http://localhost:3000
in your browser.
- Install pm2 with
npm install -g pm2
- Run -
pm2 start bin/ddrive
- Run -
pm2 list
to check status of ddrive - Run -
pm2 logs
to check ddrive logs
# config/.env
# Required params
DATABASE_URL= # Database URL of postgres with valid postgres uri
WEBHOOKS={url1},{url2} # Webhook urls seperated by ","
# Optional params
PORT=3000 # HTTP Port where ddrive panel will start running
REQUEST_TIMEOUT=60000 # Time in ms after which ddrive will abort request to discord api server. Set it high if you have very slow internet
CHUNK_SIZE=25165824 # ChunkSize in bytes. You should probably never touch this and if you do don't set it to more than 25MB, with discord webhooks you can't upload file bigger than 25MB
SECRET=someverysecuresecret # If you set this every files on discord will be stored using strong encryption, but it will cause significantly high cpu usage, so don't use it unless you're storing important stuff
AUTH=admin:admin # Username password seperated by ":". If you set this panel will ask for username password before access
PUBLIC_ACCESS=READ_ONLY_FILE # If you want to give read only access to panel or file use this option. Check below for valid options.
# READ_ONLY_FILE - User will be only access download links of file and not panel
# READ_ONLY_PANEL - User will be able to browse the panel for files/directories but won't be able to upload/delete/rename any file/folder.
UPLOAD_CONCURRENCY=3 # ddrive will upload this many chunks in parallel to discord. If you have fast internet increasing it will significantly increase performance at cost of cpu/disk usage
USER_TOKEN= # Put real Discord User account Token (see below for steps)
- Open Discord on your Browser.
- Open the Dev Tools ( Inspect Element )
- Go to the Console Tab and paste in the following command
console.log((webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken());
- Copy the output and set it in the
.env
file. (e.gUSER_TOKEN=PASTE_TOKEN_HERE
), the account does not have to be on your ddrive server
docker run -rm -it -p 8080:8080 \
-e PORT=8080 \
-e WEBHOOKS={url1},{url2} \
-e DATABASE_URL={database url} \
-e USER_TOKEN=PASTE_TOKEN_HERE \
--name ddrive forscht/ddrive
...see the original repo for the full readme Credit : Copyright 2024 ShufflePerson