Skip to content

leventdev/dropspace

Repository files navigation

DropSpace

Files uploaded
(^ that's how many files were ever uploaded to DropSpaces)

Simple file sharing made in Laravel

About DropSpace

DropSpace is an easy way to self-host a file drop. Simply upload your file, and share the link. That's all!
DropSpace is built using Laravel.

DropSpace Demo

A demo instance is available here!

Features

Feature Status
File upload (chunked using Resumable.js
Server side settings. (Max file size, default expiry, ...)
User system for uploads (With multiple users)
Rich embeds. (Video player or image display)
File checksum verification
File sharing in email
File protection
Set expiry based on download limit
Set expiry based on date
Auto delete based on date expiry
Auto delete based on download count
File download via curl (click-to-copy command)
File storage in S3 buckets
File upload from clipboard (Just press command/controll + V)

DropSpace Chunker

DropSpace now uses it's own chunker for concurrent file uploading. This allows for faster uploads, and more reliable uploads.

The chunker is a replacement for Resumable.js, which was used in previous versions of DropSpace (Broken).

How does it work?

DropSpace Chunker works by splitting the file into chunks.
Let's take a 100MB file for example. The chunker would split that, to 100 chunks of 1MB each. This is to avoid hitting a payload limit. Then instead of uploading all the chunks in its own thread, all at once (Which would probably trigger a rate limit), the chunker splits the chunks into four groups.
The groups would look like the following

Group 1 Group 2 Group 3 Group 4
Chunk 1 Chunk 2 Chunk 3 Chunk 4
Chunk 5 Chunk 6 Chunk 7 Chunk 8
Chunk 9 Chunk 10 Chunk 11 Chunk 12
Chunk 13 Chunk 14 Chunk 15 Chunk 16
Chunk 17 Chunk 18 Chunk 19 Chunk 20
Chunk ... Chunk ... Chunk ... Chunk ...

After we grouped all the chunks, we start uploading the chunks, by creating each group it's own thread.
This allows for faster, and more reliable uploads, without hitting a rate, or payload limit.
Below is a comparison of a chunker uploading each file after each other (sequential), and DropSpace Chunker uploading them concurrently.


Deployment

Clone the repository

git clone https://github.com/leventdev/dropspace.git

Go into the cloned repository

cd dropspace

Install php8.1

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Install composer

sudo apt install composer

Install dependencies

sudo apt install php8.1-xml php8.1-gd php8.1-curl php8.1-mysql

Install up-to-date NPM

sudo apt install nodejs
curl -L https://npmjs.org/install.sh | sudo sh

Install composer dependancies

composer install

Install npm dependancies

npm install

Make an environment configuration based on the example and set it up

cp .env.example .env
nano .env

Set the app key

php artisan key:generate

Set up the tables

php artisan migrate

Set up permissions for the app

sudo chown -R www-data:www-data /root/to/dropspace

Set up the web server of your choice

And finish off by building the app

npm run prod

Add command to crontab
Replace /var/www/dropspace to DropSpace's location

*/5 * * * * cd /var/www/dropspace && php artisan schedule:run

Security Vulnerabilities

If you discover a security vulnerability within DropSpace, please make a pull request and use the security vulnerability tag.

License

The DropSpace project is open-sourced software licensed under the MIT license.