Giter VIP home page Giter VIP logo

discord-fs's Introduction

discord-fs

discord-fs is a Discord bot that allows creating an encrypted virtual file system accesible via FTP, backed by text-messages for journaling and attachments for storage. The maximum file size limit is 8mb. For bigger files i've implemented multi-part up & download. There is no limit in the amount of files in theory.

Features

  • Theoretically unlimited file size thanks to splitting the file in 8mb chunks (discord is quite unreliable when it comes to uploading 20 files in a row without any issues)
  • FTP frontend
  • HTTP frontend (up & downloading) I've disabled it for now because of building complications on windows. You may wanna tinker with it, to enable, uncomment the lines in GuildStorageHandler.ts
  • (Incomplete) fuse frontend
  • optional AES-256-CBC encryption (with per file iv, unreadable journal)

Installation & Preparation

If you haven't already created a discord bot, follow the following steps:

Create a Discord bot identity

  1. Create a new application on https://discord.com/developers/applications
  2. Select your new app, navigate to "Bot" in the sidebar, "Add Bot", copy its Token
  3. Navigate to "OAuth2" in the sidebar, write down your "Client ID"
  4. Fill in http://localhost as Redirect above "Add Redirect" and save the form

Invite the Discord bot to your guild

  1. Complete the following url with your client id: https://discord.com/oauth2/authorize?response_type=code&client_id=YOUR_CLIENT_ID_HERE&scope=bot
  2. Navigate to the url and let the bot join your preferred guild

You can obtain your guild and channel snowflake (its id) by enabling developer mode on your Discord client (User Settings > Advanced > Developer Mode) and rightclicking both the guilds name or the specifc channel and choose "Copy ID" from the context menu.

Quick Start

You can clone or fork this repo and start from there (recommended if you want to make changes).

git clone https://github.com/fr34kyn01535/discord-fs.git
cd discord-fs
npm install

and then run the code from git repository

#EXAMPLE for your ba/z/shell of choice
export GUILD=536667092276215811 #The guild snowflake
export CHANNEL=536667818452582411 #The channel snowflake
export TOKEN=_6qrZcUqja7812RVdnEKjpzOL4CvHB123qrZcUqja7812RVdnEKjpzOL4CvHBFG #Your discord bot api token
export AES_KEY=BAM~NOBODY~GUESSES_this_:D #If you don't want encrpytion, keep this empty, otherwise roll a new secret

export LISTEN_IP=127.0.0.1 #IP the FTP server will listen on
export EXTERNAL_IP=127.0.0.1 #IP reported to passive FTP connections (Set it to your external ip)
export FTP_PORT=33333 #Port the FTP server will listen on
export HTTP_PORT=1338 #Port the web frontend will listen on

npm start

or directly download and launch the bot as-is from GitHub using npx.

#EXAMPLE for PowerShell
$ENV:GUILD="536667092276215811" #The guild snowflake
$ENV:CHANNEL="536667818452582411" #The channel snowflake
$ENV:TOKEN="_6qrZcUqja7812RVdnEKjpzOL4CvHB123qrZcUqja7812RVdnEKjpzOL4CvHBFG" #Your discord bot api token
$ENV:AES_KEY="BAM~NOBODY~GUESSES_this_:D" #If you don't want encrpytion, keep this empty, otherwise roll a new secret

$ENV:LISTEN_IP="127.0.0.1" #IP the FTP server will listen on
$ENV:EXTERNAL_IP="127.0.0.1" #IP reported to passive FTP connections (Set it to your external ip)
$ENV:FTP_PORT="33333" #Port the FTP server will listen on
$ENV:HTTP_PORT="1338" #Port the web frontend will listen on

npx git+https://github.com/fr34kyn01535/discord-fs

Contributing

At this point discord-fs is pretty mutch just a POC. Pull requests are welcome.

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.