Raft Demo / Documentation

Development

  1. Development
    1. Tech Stack
    2. Git Repository & Issue Tracker
    3. Running Tests
    4. Environment Variables
      1. Debugging
      2. Override Configuration
      3. Essential Secrets
    5. Browser Tips

Tech Stack

Raft uses:

The Postgres multitool: Typically, a web application might use RabbitMQ for messages, Reddis for session storage & push notifications & caching, and Elastic Search for full text queries. To simplify hosting, Raft uses Postgres for all that. Postgres has fairly robust features that allow it to be used in this way, although for a large installation it is better to reduce load on the database as much as possible.

Traditional web app, with a twist: Raft is a traditional “server-rendered” web app with little rendering of HTML handled by javascript presentation code. However, like many Rails apps these days, it relies heavily Turbo Drive & Turbo Streams, which has the effect of the application really being a single page javascript app that simulates a traditional web app by fetching element updates pre-rendered from the server. The goal with Turbo is to provide the interactivity of a single page javascript app with the easy of development of a traditional web app. Your mileage may vary, but it more or less works as advertised in most cases.

Javascript required: Raft requires that javascript is enabled in the browser, since the webauthn authentication protocol does not work without it.

Modern browser required: Only the most recent browsers correctly support webauthn. For example, Safari did not support it until late 2025.

Git Repository & Issue Tracker

The upstream code for Raft can be found at https://tangled.org/rewire.host/raft

Running Tests

Start test database & services:

docker compose -f container/development/compose.yml up -d

Run all the tests (app, gems, engines):

rake test

Run tests just for the app:

rails test

Run tests for an engine or gem that does not have its own test/dummy:

rails test engines/raft_files/test

Run tests for a gem or engine that includes its own test/dummy rails app:

cd engines/raft_encryption
RAILS_ENV=test rake db:test:prepare test

Dependency Audit

To check if any of the dependencies have a known security vulnerability:

rake bundle:audit:update
rake bundle:audit

Environment Variables

Debugging

  • LOG_LEVEL: one of “error”, “warning”, “info”, “debug”
  • LOG_STDOUT: if set, logs to stdout
  • LOG_JOBS: if set, logs job args and app backtrace with level “error”.

Override Configuration

Every configuration value defined in config/config.yml or config/defaults.yml can be overridden by an environment variable with the same name (in all caps).

Essential Secrets

Raft requires some essential secrets to run should be defined as environment variables. You can generate new values for these by running:

rake raft:secrets

Browser Tips

In order to test drag and drop in firefox against localhost, you must enable dom.events.dataTransfer.insecure.enabled in about:config.