Giter Site home page Giter Site logo

web's Introduction

Disbox Web Client

This is the web client for the Disbox project.

Disbox is a cloud storage service that stores your files on discord. It bypasses the file size limit by splitting files into chunks, and wraps everything in a virtual file system.

Using Discord allows for easy and secure logins, fast uploads and downloads, multiple drives, and easy access management.

Features

Feature Support UI JavaScript API
Login using Webhook URL Setup page new DisboxFileManager(webhookUrl)
Upload files "Upload file" button uploadFile(path, file, onProgress)
Create folders "New folder" button createDirectory(path)
Download files "Download" column downloadFile(path, fileSystemWritable, onProgress)
Share files "Share" column getAttachmentUrls(path)
Delete files/empty folders "Delete" column deleteFile(path, onProgress)
Rename Double-click name column renameFile(path, newName)
Show folder Double-click row (except name column) getChildren(path)
Sort ✅ UI Only Click column header -
Filter ✅ UI Only Click 3 dots on column headers -
Search ✅ UI Only Search bar -
File icons ✅ UI Only On the left of the file name -
Move ⚠️ Coming soon - moveFile(path, newParentPath) (Untested)
Edit files ⚠️ Coming soon - uploadFile(path, file, onProgress) (Untested)
Right-click menu ❌Coming soon (UI Only) - -
Mobile ❌Coming soon (UI Only) - -
Delete non-empty folders - -
Upload folders - -
Download folders - -

...And more!

Suggestions and contributions are welcome!

How it works

In essence, Disbox simply takes your upload files, and splits them to fit in Discord's (25MB) file size limit. It then stores metadata about the file like the file name and path in a separate central database. This allows for a simple way to manage your files and download them back as one chunk.

Technical Details

This section will include techincal details about how Disbox is implemented. It exists to help understand why Disbox does requires certain things and what are it's limitations. It also includes challenges in implementing a project like this, for people who are interested.

Database

Disbox's database only stores file metadata, and the message IDs that contain the attachments for the files. Disbox uses webhook URLs as accounts, which are hashed on the client side. This means that even though disbox has the message ID, it can't access the message itself - so it can't access any of your files.

Discord API

Webhooks

There are 2 main ways to implement this project:

  • Bots: bots have a lot of permissions, and can eliminate the need for a database, storing everything, even metadata, on Discord itself. This is not recommended for 2 reasons:
    • Storing the metadata on Discord itself would make fetching the file system a much slower process.
    • It requires every user to create a bot account, which is a hassle, and makes using Disbox a lot more difficult.
  • Webhooks: While webhooks have very minimal permissions, they are very easy to create. This is the main reason Disbox uses webhooks and not bots.

CORS

As with any secure site, discord doesn't allow other websites to fetch and download data from the API. This is a big issue, because it blocks the ability to download your files from the web client directly.

There are 2 main ways to solve this, and because both are viable and fit for different use cases, Disbox implements both.

  • Proxy: All downloaded are forwarded to an external proxy, which downloads the files and sends them back to the client. Disbox uses the allOrigins proxy for this. This option is less secure as it exposes your data to the proxy. It also decreases download speeds as the proxy's server may be slower than Discord' servers.

  • Browser extension: Instead of forwarding the requests to an external source, Disbox uses an extension to download the files. This is the recommended option, but it requires a browser extension to be installed by every user, which is not always an option.

web's People

Contributors

disboxapp avatar tris203 avatar thenullicorn avatar delibrete avatar sayrix avatar

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.