Skip to content
/ hako Public

Simple file sharing with client-side encryption, powered by Rust and WebAssembly

License

Notifications You must be signed in to change notification settings

skystar-p/hako

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hako

Simple file sharing with client-side encryption, powered by Rust and WebAssembly

preview

Not feature-packed, but basic functionalities are just working. Feature requests and PR are very welcome.

Features

  • No external database setup and file-serving proxy needed. (Hako uses SQLite and bundles all frontend assets in its binary)
  • Handy file sharing
  • Handy text-snippet sharing
  • Client-side encryption using XChacha20Poly1305
  • Fast and safe implementations thanks to Rust
  • Neat Web UI built with WebAssembly
  • Asynchronous upload, encryption, download, and decryption on your browser.

Why?

Sharing file safely between two devices is quite annoying. Hardware mediums(like USB flash memory) can be useful, but sharing file between mobile devices or different operating systems are frustrating. You can go with third-party file hosting server or E-mail, but those are not safe and not good for your privacy.
Hako is web application, which gives you great compatibility among various devices and operating systems. Also, Hako uses client-side encryption, so no one can see your original file, even the Hako server.

Build

For simplicity, Hako bundles frontend dist files into server binary statically. So you MUST build frontend web application first, and then build server application.

Frontend

You need two additional tools: trunk and tailwindcss.

# To install trunk, use:
cargo install --locked trunk

# To install tailwindcss, use:
yarn global add tailwindcss

And build your WASM application.

cd ./webapp
rm -rf dist
trunk build --release

Server

You need cargo to build server. If you don't have it, follow the instructions in here.

cd ./server
cargo build --release

Hako uses simple SQLite database to store your encrypted files and metadata. So no external database setting is required, but you may give database file path by argument or environment variable. See here.

Run

Serving Hako application is dead simple. No additional file-serving proxy and external database setup is needed. Just run your Hako server binary behind of HTTP proxy to take advantage of TLS.
You can check configuration info by running:

./hako --help

Running Hako application is just simple as:

./hako

# ... and open http://localhost:12321/ on your browser.

If you want to serve Hako in public, serving behind of reverse-proxy with TLS is strongly recommended.

You can use Caddy for easy TLS configuration. Example Caddy configuration:

your-domain.com {
    handle * {
        reverse_proxy localhost:12321
    }
}

To-dos

  • Authentication
    • WebAuthn
    • or just plain username-password pair
  • CLI tool
    • WASM can provide compatibility among various environment, and CLI downloader will provide good performance