Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 1.84 KB

ideas.md

File metadata and controls

50 lines (33 loc) · 1.84 KB

upload (with dedupe)

  1. client sends file name + file size to manager
  2. manager sends OTK to chosen storage node, and approx file size (approx because encryption <3)
  3. manager sends OTK and "random" file name (asdasdl.a.png) to client
  4. client gets hash of original file, then encrypts file with random file name and posts encrypted file with obfuscated file name
  5. after statuscode 200 from storage node to client, client sends manager hash (also stores it for personal verification)
  6. storage node sends "filename" to manager
  7. manager adds "random file name" | filedata to db(/dev/null), UNLESS hash is in the hashes table, if in the hashes table the filedata from the original hash is copied to "random file name" | filedata (this is where original-name) is important, because you need the storagenode filename & the "decryption" filename
  8. if duped, send a delete request to storagenode of "file"
  9. etc etc etc

comments

  • OTK also serves as transaction ID
  • OTK only valid for one file upload

download

  1. client sends file name request to manager
  2. manager checks file name existence, sends server url and sends otk to server and client (client also recieves "actual file name" to decrypt & hash)
  3. if storage node is down cry
  4. storage node streams to client
  5. client decrypts with actual file name, also checks hash

persistence

  • goal, 2 copies of file for each file?

database structure:

snode_id | url, allows_dedup, allows_rebalance, size_left, id file-name | snode_id, original_file_name, file_hash

//todo OTK/transaction temp thing

storage node databse structure:

mnode_id | url, size_left (calculated on startup), file-name | owner_node_id

api definition

``

cool other todos

  • potential multiple manager nodes can sync their files so you can access files uploaded from every manager
  • multiple files requiring one OTK