Contents
- DICloud
- State and details
- How to setup and play with this
- Last steps
- Known issues
- Limitations
- Contributing
-
Disclaimer
DICloud
File manager that allows you to upload and download files to and from Discord and manage them in various file managers via webdav protocol.
Yes, even above 10MB. Currently tested about 750MB for a single file and 9 GB in multifile mode.
Supported functions:
- Manage files (Upload, Download, Delete, Rename, Move, Modify)
- Manage folders (Create, Delete, Rename, Move)
State and details
Not even alpha. Created for fun and ONLY for fun. Dont use it as important storage, since it active development, contains bugs, LOT of bugs and im still making LOT of breaking changes. Use it only for testing and playing around.
Please look at the Known issues section for more information.
Has been tested MAINLY on Windows 10 and on some third party webdav clients: OwlFiles (Android), WinSCP (Windows), dolphin (Linux).
How to setup and play with this
Discord server creation
Create a Guild (server) for the bot to use. Save its id. You can also use existing server.
Bot Creation
Create a bot with admin permissions and invite it to your server. If you already have a bot, you can use it.
- Create a app.
- Once you created app, you should be in the app menu. Go to
BOTtab and create a bot. - Once you created bot and you on bot page, click to
Show Token. Save your bot token. - Once you saved your token, scroll to the bottom to
Privileged Gateway Intents. - Enable
MESSAGE CONTENT INTENT. - Goto
OAuth2/Url-Generatortab and selectbotscope. - Scroll down to
Bot Permissionsand selectAdministrator. - In the bottom you will find url. Your url should look like this:
https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=8&scope=bot. Copy the link and visit it. Follow the instructions to invite the bot to your server.
Setup
-
Install NodeJS (Tested on 16) and Yarn (Tested on 1.22.10).
-
Clone this repo.
-
Navigate to the root of the project and run
yarn install. -
Create a file named
.envin the root of the project. There example fileenv.example, so you can just copy it and rename to.env. You should fill the file with your data (token, server id). Other settings are optional and documented in the file. \ If you dont have opportunity to use .env file, you can set environment variables instead, they should have the same names as in.env.examplefile. -
To run the bot, run
yarn boot. This will compile the project and start the bot.
SSL
Warning! At the moment SSL support is not complete. You can use it, but you have to be aware of potential security issues, since TLS_REJECT_UNAUTHORIZED is set to 0 because of some temponary problems with requests. \ If you want to use SSL, you have to generate a certificate. You can use this service or this one. You can also use your own certificate.
- Generate a certificate.
- Rename your certificate to
cert.pemand your private key toprivKey.pemand if you have chain certificate, rename it tochain.pem. - Put your certificate and private key to
certsfolder. (You have to create manually, its included in.gitignore). - Enable HTTPS in
.envfile. SetENABLE_HTTPStotrue.
Encryption
Files in discord are not encrypted. Because of this, the server supports encryption via AES256-GCM algorithm. To enable encryption:
- Set
ENCRYPTtotruein.envfile. - set
ENCRYPT_PASSto your password. This password will be used to encrypt and decrypt files. \ WARNING. If you lose this password, you WILL NOT be able to decrypt your files.
WANING. Unless its look to work stable, encryption feature still being tested. Im not experienced in cryptography, so i cant guarantee that it will be secure or stable. Use it at your own risk.
Authorization
You can set authorization for the server. To do this, set AUTH to true in .env file.
Then add your username and password to .env file. Set USERS to username:password. You can add multiple users, just separate them with ,. For example: USERS=username1:password1,username2:password2. At the moment, only basic authorization is supported.
Last steps
Once server started, the webdav server will be available on port 3000.
Windows explorer will support webdav out of the box. You can now add windows network drive to http://localhost:3000/dav and use DICloud as a regular drive. Or, just use any client you want.
Limitations
Does not suitable for low memory devices. Uploading and downloading uing in-memory buffer, so it can consume memory.
Known issues
-
Problems with downloading big (~50+ MB) files from windows explorer directly. \ This is limitation of the windows explorer, which limiting downloading files to 50MB. This repo contains a registry file, which can be used to increase this limit (up to 4GB). Script may be found in: scripts/webdav.reg \ If you still having issues with this, i recommend to use WinSCP for downloading big files. \ You can also download big files directly via http. For example, you can use this url:
http://localhost:3000/file.extorhttp://localhost:3000/my/path/to/file.extto download filefile.extfrom root folder or from/my/path/tofolder respectively. -
Uploading and downloading big files (~1GB+) is working unstable, so if you really need it, split big file into smaller chunks (lets say 100MB, with any archiver like 7zip or WinRAR) and upload them one by one. After downloading, you can merge them back. \ Current tested limit for a single file is about 750MB, but i guess it depends on your internet connection. For now no other solution for this, sorry.
-
Half-working SSL support. You can use it, but you have to be aware of potential security issues, since TLS_REJECT_UNAUTHORIZED is set to 0 because of some problems which i dont know how to fix for the moment. But if you dont care much about targeted intercetion of your data, you can use it. \ Will do some work in the future to fix this.
-
Not all webdav clients are working as expected. Will do some work in the future to fix this.
Contributing
Just create a issue or pull request. I will be happy to see any feedback or help.
Disclaimer
I am not responsible for any consequences, data loss, damage, law violations or any other issues that may arise from using this software.
The software (probably) violates Discord's terms of service, so use it at your own risk.
USE IT AT YOUR OWN RISK.