Skip to content

ISENLabs/ocl-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OCL-RS

Optimized CDN for Lazy in Rust

Logs

FAIL: Failed to do something, someone tried to do some weird stuff
INFO: Something happened, you should be made aware of it
LOAD: Starting to process something, might take some time
GOOD: Achieved targeted task, everything is good

Usage

To send a file :
-> curl -X POST -F "myfile=@/path/to/file" http://127.0.0.1:7878/upload

To send a file and compress it :
-> curl -X POST -F "image=@/path/to/file" -F "res[]=0.25" -F "res[]=0.5" http://127.0.0.1:7878/upload_compress

To fetch a file :
-> curl -X GET http://127.0.0.1:7878/images/{id}

To delete a file :
-> curl -X DELETE -H "Delete-Token: 123xyz" http://127.0.0.1:7878/images/{id}

Files Security :
123xyz.jpg (image id)
123xyz.lock (image lock file, contains the delete secret key)

Build / Dev

Packages

On NixOS
Run nix-shell --pure

On Linux / WSL
Packages are likely to already be installed, but in case :
Install libssl-dev
Install pkg-config
Also install Rustup and/or Cargo (not through your package manager)

Build

To build in debug (fast compile, slow perf),
Run cargo build then ./target/debug/ocl-rs

To build in release (slow compile, fast perf),
Run cargo build --release then ./target/release/ocl-rs

Todo

  • Requests handling
  • Files handling
  • Link requests and files
  • Secure file management
  • Outsourced constants
  • Logs
  • Better documentation
  • Image compression

Links

MIT License

About

Optimized CDN for Lazy

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors