Skip to content

jlgingrich/signalman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚨 EXTREMELY WORK IN PROGRESS 🚨

A railway signalman holding a lantern shining a blue light into a fog

Signalman

Goal

Create a Rust interface for the Signal messaging app that can be used for account automation (bots, mailing lists, etc).

Instructions

Prequisites

A device running NixOS or a device running another Linux distro with Nix installed. If your device is Windows, use WSL.

Clone the repo and open it in VS Code

git clone https://github.com/jlgingrich/signalman
code signalman

This will set the default terminal for the workspace as a Nix Shell that contains the neccesary requirements (see shell.nix). All further steps assume you're either running them in the VS Code default terminal, have opened the Nix shell in your other terminal, or otherwise have the requirements installed in your environment.

Link to a Signal account as a secondary device

./scripts/signal-cli-init

This will print a QR code to the terminal output that can be scanned in the Signal app to link Signalman to your account.

Run the signal-cli daemon

./scripts/signal-cli-run-daemon

This runs Signal-CLI, serving requests via JSON-RPC over a Unix domain socket service.

References

Rust Library Documentation

  • anyhow for handling of non-domain errors.
    • Definitely not sure this is idiomatic, but I do like the additional context it can give returned errors.
  • clap for parsing command-line arguments.
  • jsonrpc-types for JSON RPC types to serialize to and from.
    • The other JSON RPC libraries seem to be either application-specific, assume a TCP or HTTP transport, or are designed to create servers, not clients.
  • serde for JSON serialization.
  • tokio for the async runtime and IO.

Signal

Stages

Stage 1 : Rust to Signal CLI

Implement Signalman in Rust as a client app interacting with a Signal CLI daemon using a Unix domain socket.

Stage 2: Total oxidification

Implement Signalman purely in Rust, using the libsignal Rust library directly.

Progress

  • Able to read and deserialize JSONRPC notifications from a socket!
  • Able to write JSONRPC to the socket and receive the response
  • Combine the two into one module, and create a really basic bot that replies to direct messages

About

A Rust interface for the Signal messaging service for client automation

Topics

Resources

Stars

Watchers

Forks

Contributors