Skip to content

Latest commit

 

History

History
83 lines (57 loc) · 2.54 KB

readme.md

File metadata and controls

83 lines (57 loc) · 2.54 KB

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

  • Backend It works well. I think cleanup is needed in the cache management code. Routes are ugly but eh, it works I think logs are bad, and it needs better failure management

  • Front-end It's really basic Some of the CSS is still done inline A good design is still needed But it works

Roadmap

  • The actual server
    • Web server that we can upload files to
    • Web server that we can download files from
    • JSON API
  • Compression
  • WASM front end
    • Simple load and upload
    • Simple download
  • Integration with curl #6
  • Simple download link #7

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.