My goal was to make something like transfer.sh (which is probably down atm) or wetransfer
// Compressed Delivery Network :D
-
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
- 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
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
First, move in the project directory cd ./storage_server
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.
sh scripts/build.sh
sh scripts/build_back.sh
sh scripts/build_front.sh
To run the server, use sh scripts/build_front.sh
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
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.