Bowarc / storage_server

A simple cdn that compresses the data
1 stars 0 forks source link
rocket rust server storage webassembly yew

Simple server that stores data

My goal was to make something like transfer.sh (which is probably down atm) or wetransfer

// Compressed Delivery Network :D

Status

Roadmap

Notes

Idk if any security is needed (ouside something against DDoS or spam but i wont do that here)

About file size, we really should set a limit, even like a rly high one, but a limit is needed. // Fixed at 50MB

Store different infos in the JSON ? // Data size & original file name are currently stored Maybe use RON instead of JSON // No point for now, may be faster ? idk

How to use

First, move in the project directory cd ./storage_server

Build

In each build script (./scripts, you'll find mode=debug # debug, release at the top, replace debug with release to build a more optimized version of the program (build time will be slower)

Start by running sh scripts/init.sh This will create some important folders in the project directory, which the sevrer relies on.

Build everything

sh scripts/build.sh

Build back

sh scripts/build_back.sh

Build front

sh scripts/build_front.sh

Run

To run the server, use sh scripts/build_front.sh
⚠️ Make sure the front it built, else the server wont be able to serve any web user

CURL

Upload

curl --upload_file ./file.ext http://<YOUR_ADDRESS:YOUR_PORT>/

This yields back an uuid that is used by the server to identify that file

Download

curl http://<YOUR_ADDRESS:YOUR_PORT>/<UUID>/file.ext -O

NOTE: On browser you only need the UUID as it auto redirects to the right file name (http://<YOUR_ADDRESS:YOUR_PORT>/<UUID> -> http://<YOUR_ADDRESS:YOUR_PORT>/<UUID>/file.ext).
Take a look at #7 for more informations.