eldelto / temporary

A temporary, encrypted file sharing service written in Elixir.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Temporary

A temporary, encrypted file sharing service.

Introduction

Summary of the core functionality used by Temporary.

File Upload

Temporary uses the following flow to encrypt and upload your files:

  1. Create a random 16 byte UUID and 8 Byte password
  2. Encrypt the filename using AES
  3. Call the backend to create a new chunked file with the given filename
  4. Split the file into chunks (currently 0.25 MB)
  5. For each chunk
    1. Encode each chunk in Base64
    2. Encrypt it using the generated password and AES
    3. Upload the file to the backend
  6. Commit the file on the backend (mark upload as done)

Chunker Implementation

Temporary uses chunker to deal with files in chunks.

The Mnesia based implementation can be found in storable.ex.

File Cleanup

Uploaded files are stored in Mnesia for a limited amount of time (currently 3 days).

For the cleanup a scheduled process (cleanup.ex) runs every 5 minutes to check for old files and deletes them.

Getting Started

git clone https://github.com/eldelto/temporary.git

cd temporary 

// Start development server
mix phx.server

// Build Docker image
./docker_build.sh

To-Do

  • Implement chunked upload
    • Server
    • Client
  • Implement chunked download
    • Server
    • Client
  • Prevent download of uncommitted chunked files
  • Clean up job for chunked files
  • Upload view
    • Progress bar
    • Custom error toasts
    • Counter
    • Copy link
  • Download view
    • Counter
    • Download button
    • Custom error toasts
    • File not found page
  • Version number
  • Use CSS variables
  • Add tests
  • Use custom exceptions in error tuple
  • Add type specs
  • Use web worker for encryption?
  • Review encryption

Screens

Upload View

Download View

About

A temporary, encrypted file sharing service written in Elixir.


Languages

Language:Elixir 60.3%Language:JavaScript 27.6%Language:CSS 7.4%Language:HTML 3.1%Language:Dockerfile 1.4%Language:Shell 0.2%