Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

open-taffeta Build Status

Raspberry Pi-hosted website controlling access to a building

The mobile App interfacing to this backend is hosted here.

Rust installation

Install Rust

curl -sSf | sh

Select the custom setup and choose the nightly compiler (Rocket does not yet run on stable, see Caveats).

If you have already Rust installed (stable or beta), simply install the additional toolchain:

$ rustup toolchain install nightly
$ rustup override set nightly

Install sources (in case you want to use linting tools like racer or RLS):

rustup component add rust-src

Additional libraries

Install libssl-dev to compile OpenSSL, libmysqlclient-dev to install diesel-cli.

Additional tooling for this project

Install cargo-edit (to get cargo add superpowers) and cargo-deb.

Install the ORM (Diesel) cli:

cargo install diesel_cli --no-default-features --features sqlite

Performs DB setup and migrations

$ sh <ROCKET_ENV> (dev, staging, production)
$ diesel setup
$ diesel migration generate create_users

Write the SQL to create migrations (up.sql and down.sql)

Run both migrations to check if they are ok:

diesel migration run

Running tests

Integration tests need the server running, so first launch cargo run in a shell and cargo test --all in another one. Run one single test with ex. cargo test test_list_users or to run an entire directory of tests with ex. cargo test --test test_users.

To run test sequencially instead of parallelized (by default), use:

RUST_TEST_THREADS=1 cargo test


cargo test -- --test-threads=1

Running the server

cargo run

with different logging enabled:

Logging levels:

Application and every (!) library (don't do this): RUST_LOG=debug cargo run

Whole Open-Taffeta application: RUST_LOG=open_taffeta_lib=debug cargo run

Whole Open-Taffeta and Rocket INFO: RUST_LOG=rocket::rocket=INFO,open_taffeta_lib=debug cargo run

DB module only: RUST_LOG=open_taffeta_lib::db=debug cargo run

Deployment instructions

Install Rust nightly

$ curl -sSf | sh
$ rustup toolchain install nightly
$ rustup override set nightly
$ cargo install diesel_cli

Get latest release package

  • dpkg -i open-taffeta_x.y.z_amd64.deb
  • Configure .env_dev with buzzer endpoint
  • $ diesel setup
  • sudo systemctl start open-taffeta

Testing the endpoint

curl "http://localhost:8000" -H "Content-Type: application/json"

The response should look like this JSON:

    "email": "",
    "id": 1,
    "password": "123456",
    "username": "apiraino"
}, {
    "email": "",
    "id": 2,
    "password": "654321",
    "username": "kkom"

As a Docker container

  • Dockerfile: recipe to build the image

  • script to rebuild the image (~1.7gb currently, working on making it thinner)

  • script to tun locally the container for test

  • docker-compose -f docker-compose.yml up: raise the container using docker compose (adviced)


See Wiki


Keeping track of past and current issues, not related to the codebase but to external Rust tooling.

See Wiki.


Raspberry Pi-hosted website controlling access to a building







No packages published