Skip to main content

Signald spectrum2 backend

What is this?

This is a way to connect to the signal instant messaging network using other messaging networks such as XMPP.

It can act as a linked device to your main signal device (your phone), or as a standalone replacement for official signal clients. The latter is my personal use case so this is what is most tested.

Alternatively, you might be interested in the signald python interface in spectrum2_signald/signald.py.

What do I need?

Could you be a little more specific?

Python stuff

python3 -m venv signald-venv
source signald-venv/bin/activate
pip install spectrum2-signald

XMPP Server

Configure a specific component in your XMPP server, for instance with prosody, add something like this to /etc/prosody/prosody.cfg.lua:

modules_enabled = {
  -- [...]
  "privilege";
}

 -- [...]

Component "signal.example.com"
    component_secret = "something-random"
    modules_enabled = {"privilege"}

-- [...]

VirtualHost "example.com"
    privileged_entities = {
        ["signal.example.com"] = {
            roster = "both";
            message = "outgoing";
        }
    }

The privilege thing is not mandatory, but will allow carbons for messages sent from official signal clients to be sent to XMPP clients.

From my experience, reloading configuration and components while prosody is running is not enough to get the privilege thing working, so you might need to systemctl restart prosody at this point.

Signald

Have the /var/lib/signald/attachments directory readable for the user that runs spectrum2 if you want attachments to work.

Spectrum2

Modify the signal.cfg file to match the component secret, path to the right python interpreter and main.py script, and http upload stuff for attachments. Copy it to /etc/spectrum2/transports. You should now be able to use spectrum2_manager signal.example.com start.

XMPP client

  • Discover services on your server.
  • Subscribe to the gateway signal.example.com, using your phone number as a username.
  • If you already used signald with this phone number, your roster should populate with your signal contacts and you should be able to send receive/contacts.
  • If you did not configure signald for this phone number, you should receive a message from a signal@signal.example.com prompting you with instructions to either register your phone number or to link signald to the official signal app.
  • To see which groups are available send a message with "groups" as body to this user to get a link of XMPP URIs to join your groups.

How secure is this?

Not as secure as using the official signal client, especially since this is pre-alpha software. You can read more about it in this gitlab issue. As a rule of thumb, if your main concern is privacy and security, you should use the official signal clients. However, if you are running your own XMPP server, this shouldn't be a lot less "secure" than anything else on your XMPP server.

Multi-user considerations

Right now, it is not safe at all to allow public registrations, because of spectrum and signald. This should be improved some day. Right now, my advice is to only use it on your own server, and disable public registrations as soon as you register your user.

What works?

  • Send/receive private messages.
  • Join and send/receive messages from groups.
  • Attachments if the the script has access to a dir that is publicly available via http.
  • Carbons for self messages sent from official signal clients.

What doesn't work?

  • It crashes quite often, especially this issue seems to be really annoying.
  • Groups need to be manually joined via the XMPP client.
  • Unsubscribing via XMPP does not delete the signald user.

What is the license?

Something free (libre), yet to be determined. I am no expert in this stuff.

Metadata

Release files for spectrum2-signald 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spectrum2-signald 0.1.4
File Size Uploaded
spectrum2-signald-0.1.4.tar.gz 12.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spectrum2-signald 0.1.4
File Interpreter ABI Platform
spectrum2_signald-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 23.6 kB

Release files / spectrum2-signald-0.1.4.tar.gz

Download URL spectrum2-signald-0.1.4.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0538cef9eacfccd4deacd9e231424cf579884d878e96a0e69c4fd11b966794b5
BLAKE2b-256 checksum
How to use checksums
b54228ffb13d707678b8a2a10c9385ad7968fbe959b28bf8e43e565006dd0ffd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.7.3 Linux/4.19.0-13-amd64

Release files / spectrum2_signald-0.1.4-py3-none-any.whl

Download URL spectrum2_signald-0.1.4-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3dd61010563f848719b65b2a4162395e5cc0b1f5b696b4495e7835238d15b675
BLAKE2b-256 checksum
How to use checksums
67e694a4a849c028847f93a61fc733453450c573db08b6864b50ebcbf17d5bcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.7.3 Linux/4.19.0-13-amd64

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page