Skip to content

Fortrx/Fortrx-Client

Repository files navigation

Fortrx Client

Encrypted terminal client for the Fortrx messaging system.

This client is built around:

  • End-to-End Encryption: X3DH / PQXDH-style session bootstrap ensures secure communication.
  • Local-First & Offline: Chat history is stored in an encrypted client database (SQLCipher), allowing you to read synced conversations without an internet connection.
  • Background Daemon: Runs silently in the background for inbox sync, live delivery, and presence updates.

Features

  • Encrypted key initialization and local private-key storage
  • Local chat history and conversation summaries
  • Background daemon for sync and WebSocket listening
  • Contacts and conversation overview
  • Offline chat viewing with --no-sync
  • Self-messaging stored locally as Saved Messages

Requirements

  • Python 3.11+
  • A running Fortrx server
  • Redis enabled on the server for live delivery and presence
  • SQLCipher Python bindings are preferred for encrypted local storage

Server Selection

Production defaults to https://fortrx-server.duckdns.org.

For local development, create .env.local with:

SERVER_URL=http://localhost:8000

You can also point the client at a different stack by setting FORTRX_ENV_FILE to an alternate env file path before running commands.

Install dependencies:

pip install -r requirements.txt

Quick Start

  1. Log in:

    py run.py login <username> --password <account_password> --storage-password <local_storage_password>
  2. Initialize keys once:

    py run.py init --password <local_storage_password>
  3. Start the background daemon:

    py run.py daemon start --password <local_storage_password>
  4. Send a message:

    py run.py send <recipient_id> "hello" --password <local_storage_password>
  5. View conversations:

    py run.py contacts --password <local_storage_password>
    py run.py inbox --password <local_storage_password>
    py run.py chat <contact_id> --password <local_storage_password>

Common Commands

Authentication and setup:

py run.py register <username> <email> --password <account_password>
py run.py login <username> --password <account_password> --storage-password <local_storage_password>
py run.py init --password <local_storage_password>
py run.py verify <user_id> --password <local_storage_password>

Messaging:

py run.py send <recipient_id> "message" --password <local_storage_password>
py run.py inbox --password <local_storage_password>
py run.py contacts --password <local_storage_password>
py run.py chat <contact_id> --password <local_storage_password>
py run.py chat <contact_id> --password <local_storage_password> --before 2026-04-08T10:00:00+00:00

Daemon and sync:

py run.py daemon start --password <local_storage_password>
py run.py daemon run --password <local_storage_password>
py run.py daemon status
py run.py daemon stop

Offline usage:

py run.py contacts --password <local_storage_password> --no-sync
py run.py inbox --password <local_storage_password> --no-sync
py run.py chat <contact_id> --password <local_storage_password> --no-sync

Local Storage Model

The client stores data in .fortrx/fortrx.db by default.

The database contains:

  • encrypted auth token storage
  • private keys
  • ratchet sessions
  • message history
  • conversation summaries
  • presence cache
  • verification data

Already-synced messages can be read offline. New messages still require the server.

Notes

  • Sending to yourself does not go through the server. Those messages are stored locally as Saved Messages.
  • contacts is the fastest overview command for large histories because it uses conversation summaries instead of scanning all messages.
  • inbox marks listed conversations as viewed.
  • chat <contact_id> marks only that conversation as viewed.

Development

Run a quick compile sanity check:

@' 
import compileall
print(compileall.compile_dir("client", quiet=1))
'@ | python -

Run tests:

pytest

Related Files

About

Client face for the quantum encrypted communication engine

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages