Storage88 is a Node.js application that provides secure file storage and retrieval using Discord as a backend. It encrypts files before sending them to Discord and decrypts them upon retrieval.
- End-to-end file encryption
- Discord-based file storage
- Secure file retrieval and decryption
- Handling of Discord file size limits
- Rate limiting for Discord API compliance
- RESTful API for file upload and download
- Node.js (v14 or higher)
- MongoDB
- A Discord bot with necessary permissions
-
Clone the repository:
git clone https://github.com/atom1488/Storage88.git cd storage88
-
Install dependencies:
npm install
-
Create a
.env
file in the project root with the following content:DISCORD_BOT_TOKEN=your_discord_bot_token CHANNEL_ID=discord_channel_id MAX_FILE_SIZE_GB=10 MONGODB_URI=mongodb://localhost:27017/storage88 ENCRYPTION_KEY=your_secure_encryption_key
Note: The
ENCRYPTION_KEY
should be a secure, randomly generated string. It's crucial for the encryption and decryption of your files. -
Start the application:
npm start
POST /upload
Content-Type: multipart/form-data
file: [your file]
Response: Unique ID of the uploaded file
GET /download/{id}
Response: The downloaded file
src/api/discordApi.ts
: Discord API configurationsrc/encryption/encryption.ts
: Encryption and decryption functionssrc/routes/upload.ts
: Upload route handlingsrc/routes/download.ts
: Download route handlingsrc/types/types.ts
: TypeScript type definitionssrc/types/uploadRecordModel.ts
: Mongoose model for upload recordssrc/utils/utils.ts
: Utility functionssrc/server.ts
: Server configuration and launch
- Files are encrypted using AES-256-CBC before being sent to Discord
- File names are also encrypted
- A static IV is used for buffer encryption
- The encryption key is stored as an environment variable for added security
- Maximum file size is limited by Discord configuration and the
MAX_FILE_SIZE_GB
parameter - Performance may be affected by Discord API rate limits
DISCORD_BOT_TOKEN
: Your Discord bot tokenCHANNEL_ID
: The ID of the Discord channel used for storageMAX_FILE_SIZE_GB
: Maximum allowed file size in GBMONGODB_URI
: MongoDB connection stringENCRYPTION_KEY
: Secret key used for file encryption and decryption
Contributions are welcome! Please feel free to submit a Pull Request.