Giter VIP home page Giter VIP logo

signal-cli's Introduction

signal-cli

signal-cli is a commandline interface for the Signal messenger. It supports registering, verifying, sending and receiving messages. signal-cli uses a patched libsignal-service-java, extracted from the Signal-Android source code. For registering you need a phone number where you can receive SMS or incoming calls.

signal-cli is primarily intended to be used on servers to notify admins of important events. For this use-case, it has a daemon mode with JSON-RPC interface (man page) and D-BUS interface (man page) . For the JSON-RPC interface there's also a simple example client, written in Rust.

Installation

You can build signal-cli yourself or use the provided binary files, which should work on Linux, macOS and Windows. There's also a docker image and some Linux packages provided by the community.

System requirements:

  • at least Java Runtime Environment (JRE) 21

  • native library: libsignal-client

    The native libs are bundled for x86_64 Linux (with recent enough glibc), Windows and MacOS. For other systems/architectures see: Provide native lib for libsignal

Install system-wide on Linux

See latest version.

export VERSION=<latest version, format "x.y.z">
wget https://github.com/AsamK/signal-cli/releases/download/v"${VERSION}"/signal-cli-"${VERSION}".tar.gz
sudo tar xf signal-cli-"${VERSION}".tar.gz -C /opt
sudo ln -sf /opt/signal-cli-"${VERSION}"/bin/signal-cli /usr/local/bin/

You can find further instructions on the Wiki:

Usage

For a complete usage overview please read the man page and the wiki.

Important: The ACCOUNT is your phone number in international format and must include the country calling code. Hence it should start with a "+" sign. (See Wikipedia for a list of all country codes.)

  • Register a number (with SMS verification)

    signal-cli -a ACCOUNT register
    

    You can register Signal using a landline number. In this case you can skip SMS verification process and jump directly to the voice call verification by adding the --voice switch at the end of above register command.

    Registering may require solving a CAPTCHA challenge: Registration with captcha

  • Verify the number using the code received via SMS or voice, optionally add --pin PIN_CODE if you've added a pin code to your account

    signal-cli -a ACCOUNT verify CODE
    
  • Send a message

    signal-cli -a ACCOUNT send -m "This is a message" RECIPIENT
  • Pipe the message content from another process.

    uname -a | signal-cli -a ACCOUNT send --message-from-stdin RECIPIENT
    
  • Receive messages

    signal-cli -a ACCOUNT receive
    

Hint: The Signal protocol expects that incoming messages are regularly received (using daemon or receive command). This is required for the encryption to work efficiently and for getting updates to groups, expiration timer and other features.

Storage

The password and cryptographic keys are created when registering and stored in the current users home directory:

$XDG_DATA_HOME/signal-cli/data/
$HOME/.local/share/signal-cli/data/

Building

This project uses Gradle for building and maintaining dependencies. If you have a recent gradle version installed, you can replace ./gradlew with gradle in the following steps.

  1. Checkout the source somewhere on your filesystem with

    git clone https://github.com/AsamK/signal-cli.git
    
  2. Execute Gradle:

    ./gradlew build
    

    2a. Create shell wrapper in build/install/signal-cli/bin:

    ./gradlew installDist
    

    2b. Create tar file in build/distributions:

    ./gradlew distTar
    

    2c. Create a fat tar file in build/libs/signal-cli-fat:

    ./gradlew fatJar
    

    2d. Compile and run signal-cli:

    ./gradlew run --args="--help"

Building a native binary with GraalVM (EXPERIMENTAL)

It is possible to build a native binary with GraalVM. This is still experimental and will not work in all situations.

  1. Install GraalVM and setup the environment

  2. Execute Gradle:

    ./gradlew nativeCompile
    

    The binary is available at build/native/nativeCompile/signal-cli

FAQ and Troubleshooting

For frequently asked questions and issues have a look at the wiki.

License

This project uses libsignal-service-java from Open Whisper Systems:

https://github.com/WhisperSystems/libsignal-service-java

Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html

signal-cli's People

Contributors

0mp avatar adaptivegarage avatar andrewwang43 avatar asamk avatar atomic-bean avatar bentolor avatar bratkartoffel avatar brenns10 avatar bublath avatar ced-b avatar chr1shaefn3r avatar cuu508 avatar dependabot[bot] avatar exquo avatar i-infra avatar johnfreed avatar kpcyrd avatar lkwg82 avatar lunar-debian avatar matuskosut avatar michaelkebe avatar morph027 avatar orazioedoardo avatar pimotte avatar signal-stickers avatar sunnysidevibes avatar taigrr avatar technillogue avatar thisisparker avatar trolldemorted avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

signal-cli's Issues

Build fails

[pim@laptop-pim signal-cli]$ ./gradlew build installDist
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not find com.github.turasa:signal-service-java:2.4.7_unofficial_3.
  Searched in the following locations:
      https://raw.github.com/AsamK/maven/master/releases/com/github/turasa/signal-service-java/2.4.7_unofficial_3/signal-service-java-2.4.7_unofficial_3.pom
      https://raw.github.com/AsamK/maven/master/releases/com/github/turasa/signal-service-java/2.4.7_unofficial_3/signal-service-java-2.4.7_unofficial_3.jar
      https://repo1.maven.org/maven2/com/github/turasa/signal-service-java/2.4.7_unofficial_3/signal-service-java-2.4.7_unofficial_3.pom
      https://repo1.maven.org/maven2/com/github/turasa/signal-service-java/2.4.7_unofficial_3/signal-service-java-2.4.7_unofficial_3.jar
  Required by:
      project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.641 secs

Did you make a temporary release and then take it down? Is there a way I build while not running into #56 ?

support for sending files/locations

It would be great if signal-cli was able to send files and locations like the android client!

Maybe you could put this on your long-time todo-list ;)

Cannot addDevice

got this error when i tried to add my Signal-Desktop client to signal-cli:

signal-cli -u "[REDACTED]" addDevice --uri "tsdevice:/?uuid=[REDACTED]&pub_key=[REDACTED]"
org.whispersystems.signalservice.api.push.exceptions.NotFoundException: Not found
	at org.whispersystems.signalservice.internal.push.PushServiceSocket.makeRequest(PushServiceSocket.java:512)
	at org.whispersystems.signalservice.internal.push.PushServiceSocket.sendProvisioningMessage(PushServiceSocket.java:167)
	at org.whispersystems.signalservice.api.SignalServiceAccountManager.addDevice(SignalServiceAccountManager.java:411)
	at org.asamk.signal.Manager.addDevice(Manager.java:438)
	at org.asamk.signal.Manager.addDeviceLink(Manager.java:431)
	at org.asamk.signal.Main.handleCommands(Main.java:202)
	at org.asamk.signal.Main.main(Main.java:68)

groups are async if own number is omitted

if you omit your own number, signal-cli still creates a group (including yourself).

however, your number is not added to the groupstore, so every subsequent group update sent by signal-cli does not contain your own number.
since you must not "remove" members from groups with a group update (https://github.com/WhisperSystems/Signal-Desktop/blob/814328b12c9ec8aefa528c9761c2652da62d00f2/libtextsecure/storage/groups.js#L143), signal-desktop throws an exception and does not compute the group update.

receiving a group update from a phone or manually adding your number to the groupstore solves this issue.

Exception while sending message

When sending a message with ./bin/textsecure-cli -u +85XXXXXX send -m "this is a test" +4YYYYYYYYYY I get an InvalidKeyException error. The error kind of makes sense, because the cipher key in getCipher():

  private Cipher getCipher(int mode, SecretKeySpec key, IvParameterSpec iv) {
    try {
      Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
      cipher.init(mode, key, iv);
      return cipher;
...

is 256-bits (32 bytes), but AES expects 128-bits.

The exception:

Exception in thread "main" java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:454)
    at org.whispersystems.libaxolotl.SessionCipher.getCiphertext(SessionCipher.java:399)
    at org.whispersystems.libaxolotl.SessionCipher.encrypt(SessionCipher.java:111)
    at org.whispersystems.textsecure.api.crypto.TextSecureCipher.encrypt(TextSecureCipher.java:68)
    at org.whispersystems.textsecure.api.TextSecureMessageSender.getEncryptedMessage(TextSecureMessageSender.java:342)
    at org.whispersystems.textsecure.api.TextSecureMessageSender.getEncryptedMessages(TextSecureMessageSender.java:304)
    at org.whispersystems.textsecure.api.TextSecureMessageSender.sendMessage(TextSecureMessageSender.java:244)
    at org.whispersystems.textsecure.api.TextSecureMessageSender.sendMessage(TextSecureMessageSender.java:121)
    at cli.Main.main(Main.java:127)
Caused by: java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
    at javax.crypto.Cipher.implInit(Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
    at javax.crypto.Cipher.init(Cipher.java:1396)
    at javax.crypto.Cipher.init(Cipher.java:1327)
    at org.whispersystems.libaxolotl.SessionCipher.getCipher(SessionCipher.java:449)
    ... 8 more

I don't know if this is a bug with textsecure-cli, libtextsecure-java or some recent change that is not reflected in these. Where does this key come from?

I checked libtextsecure-java and it didn't change much lately. It seems that also upstream TextSecure uses AES, not AES-256.

updateGroup messes up groups with Signal-Desktop

Situation:

a group was created with signal-cli and the initial members were synchronized fine.
after adding another member (which was currently offline with all devices, 1x singal-cli, 1x signal desktop), the groups ran async:

  • the new member can see the group, write messages to all participants
  • my signal desktop (which was online and was restarted several times by now) receives text messages from the new member, but does not consider him a member of the group. furthermore, it appears to ignore any group update from the signal-cli account, even group name changes are not visible for it
  • my signal-cli instance handled the group updates (both member and name) correctly
  • the signal-cli of the account that created the group lists both me and the new member as members, but not itself (my own signal-cli instance always lists myself as a member. which is the correct behaviour?)

this is not the first time im having trouble with signal-cli, signal-desktop and group updates.
sadly, i do not know whether its a problem with signal-cli, signal-desktop or both, but you might want to look into it.

support for disappearing messages

currently when you enable disappearing messages signal-cli simply disables this feature. While this is much better than breaking outright (thanks a bunch for that, much appreciated), it would be nice if you could support using that the other end selects, or even allow setting of the disappear length.

group updates are not sent to slave devices

Steps to reproduce/prove:

  • have 2 cli instances linked to 1 phone number
  • create a new group on the master: signal-cli -u +49XXXXXX072 updateGroup -n "test3"
  • receive on the other one signal-cli -u +49XXXXXX072 receive

Even though the group is properly saved into the master's groupstore, the creation/update is not sent to the slave, and neither are subsequent group updates.

[Edit: I guess i found the culprit - this method is also called for common group updates, so you should not always remove yourself]

adding signal-android devices

is it possible to add signal for android as a non-master device?

i know that the android devices cannot display a tsdevice link, but since it is nothing but an encoded public key (?) i guess i can construct it manually with a self-compiled signal android.

did you try it yet and do you know any imminent problems?

contacts store and sync

Hello,

i have noticed commit 32beb8a but could not figure out how to use it.

could you update the readme to cover contact handling?

javax.net.ssl.SSLException: java.security.ProviderException: Could not derive key

i'm seeing the following exception fire when trying to register an account using:

textsecure-cli -u nnnnnnnnnn register -v

error comes from this location in textsecure-cli's source:

./src/main/java/cli/Main.java:71:  System.err.println("Request verify error: " + e.getMessage());

the full line printed to the terminal including text of the error message (from deeper in the libraries somewhere) is:

Request verify error: javax.net.ssl.SSLException: java.security.ProviderException: Could not derive key

i googled around (quite a lot, actually) and cannot find anything relevant other than greps deep inside the sun library code surrounding generation of a new secret; this does not tell me what's happening at invocaiton of textsecure-cli.

i followed the note in textsecure-cli's README.md about using unlimited strength crypto (under Troubleshooting) but this didn't help. (i actually never saw the specific error mentioned there regarding key size/strength.)

i am on Debian 8. (8.2 to be precise, if my update memory serves.)

i can provide logs, etc.; just tell me what to pull.

initially i tried openjdk-7-jdk, but could not get "./gradlew build" to work for textsecure-cli because the compileJava step complained about wanting version 1.8, so i went to the Oracle distro of Java8. then the build command was happy.

P.S.: I did my git clone this evening so i believe i have the latest version of textsecure-cli.

P.P.S.: I can turn on whatever Java debug stuff may be useful (getting a stack trace might be useful?) but i haven't done Java in a long time so i'm not sure what options i could submit to textsecure-cli to enable this sort of thing, nor what environment variables (or other stimuli) i could provide to get more info out than a simple exception message when it throws.

adding users to groups

Hello again,

it would be nice to be able to add users to groups - if that is not already on your todolist.

Cannot Resolve Session Bus Address

I installed signal-cli as system-bus, which means I installed signal-cli and added a systemd service. The signal.service seams to run fine:

$ systemctl status signal.service
● signal.service - Send secure messages to Signal clients
   Loaded: loaded (/etc/systemd/system/signal.service; enabled)
   Active: active (running) since So 2017-01-22 17:18:51 CET; 24h ago
 Main PID: 24989 (java)
   CGroup: /system.slice/signal.service
           └─24989 java -Xms2m -classpath /opt/signal-cli-0.5.2/lib/signal-cli-0.5.2.jar:/opt/signal-cli-0.5.2/lib/signal-service-java-2.4.2_unofficial_1.jar:/opt/signal-cli-0.5.2/lib/bcprov-jdk15on-1.55.jar:/...

Jan 22 17:18:47  systemd[1]: Starting Send secure messages to Signal clients...
Jan 22 17:18:51  systemd[1]: Started Send secure messages to Signal clients.

I removed the "--config" option from "/etc/systemd/system/signal.service" ExecStart, so that signal-cli would look the config up in "$HOME/.config/signal/data/". Otherwise the installation was done as described in the README.
To test it I tried to send a message via dbus like this:

signal-cli --dbus send -m "Ping" <MySignalRegisteredNumber>

But this returns with an error:

org.freedesktop.dbus.exceptions.DBusException: Cannot Resolve Session Bus Address
	at org.freedesktop.dbus.DBusConnection.getConnection(DBusConnection.java:244)
	at org.asamk.signal.Main.handleCommands(Main.java:88)
	at org.asamk.signal.Main.main(Main.java:69)

The failing send doesn't change anything observable with signal.service, the status output is still exactly the same.

Unfortunately I'm very unfamiliar with dbus, so I can't investigate the issue further. If you need any more information don't hesitate to ask.

Cheers,
Christoph

How to safely capture output?

The format that signal-cli gives output makes it very hard for a script to safely capture message content.

E.g. by sending a message like:
"Hey! Nothing suspicious about this message.
Attachments:

  • image/jpeg (Pointer)
    Id: XXXXXXXXXXXXXXX Key length: 64 Relay:
    Size: nnnnnn bytes
    Stored plaintext in: /path/to/secret/key"
    "

A malicious user can trick a script that is grepping for the given format to perhaps act on a file guessed by the malicious user.
I suggest optional formatting command line parameters:

1 --json, output is guaranteed to be valid json

2 -0 -Z or --null (see man grep and man xargs). use zero bytes as delimeters, e.g. to delineate when message text ends.

Config file lock acquired

Hi,

I´m using signal-cli to messages from my monitoring to my client, but in test I get message from program
-> Config file is in use by another instance, waitingâ¦
-> Config file lock acquired.
When the program is execute in parallel.

Time to wait to execute is in range 2 to 15 seconds, is correctly ?

OS: CentOS Linux release 7.2.1511 (Core)
3.10.0-327.el7.x86_64

Use code as library

In this project you provide a lot of stuff that everybody needs that wants to send messages from a desktop client. My idea to was to extract the functionality and offer it up as a java library.

My idea was to use this so that my system monitoring tool can send me messages.

I ran into a problem however. I constantly get:

Error loading state file "/Users/.config/signal/data/": javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

The strange thing is that if I use a freshly compiled version of signal-cli, this does not happen. They use the same security library and setup in general.

Have you run into this problem as well? Any hit of a solution?

accepting new identities

signal-cli does not decrypt messages from clients with a new identity (which is reasonable) and prints a UntrustedIndentityException.

can i remove the contact from the identityKeyStore and signal-cli will sort it out and accept the new identity?

nevertheless, it would be great if the readme would cover this, as others will run into the same problem sooner or later,

unregistered users are added to groups

if you add a phonenumber that is not registered with signal, signal-cli will output correctly:

Failed to send (some) messages:
Unregistered user "+4913371337": org.whispersystems.signalservice.api.push.exceptions.NotFoundException: Not found

but nevertheless they are added to the groupstore.

cannot link to existing android device

the manpage says this:

link

Link to an existing device, instead of registering a new number. This shows a
"tsdevice:/…" URI. If you want to connect to another signal-cli instance, you can
just use this URI. If you want to link to an Android/iOS device, create a QR code
with the URI (e.g. with qrencode) and scan that in the Signal app.

-n NAME, --name NAME: Optionally specify a name to describe this new device.
By default "cli" will be used.

I was assuming that I could link against an existing device out of the box, but instead I get a null pointer exception.

To reproduce, I have more or less followed the instructions in the README:

export VERSION=<latest version, format "x.y.z">
wget https://github.com/AsamK/signal-cli/releases/download/v"${VERSION}"/signal-cli-"${VERSION}".tar.gz
sudo tar xf signal-cli-"${VERSION}".tar.gz -C /opt
sudo ln -sf /opt/signal-cli-"${VERSION}"/bin/signal-cli /usr/local/bin/

Then ran the link command:

$ signal-cli link         
Exception in thread "main" java.lang.NullPointerException
	at org.whispersystems.signalservice.internal.websocket.WebSocketConnection.connect(WebSocketConnection.java:81)
	at org.whispersystems.signalservice.internal.push.ProvisioningSocket.getProvisioningUuid(ProvisioningSocket.java:29)
	at org.whispersystems.signalservice.api.SignalServiceAccountManager.getNewDeviceUuid(SignalServiceAccountManager.java:348)
	at org.asamk.signal.Manager.getDeviceLinkUri(Manager.java:363)
	at org.asamk.signal.Main.handleCommands(Main.java:175)
	at org.asamk.signal.Main.main(Main.java:68)

Did I do something wrong?

Rename repository to signal-cli?

Since the name TextSecure has pretty much been dropped in favor of Signal, shouldn't this repository follow the same pattern?

signal-cli fails to delete temp files

Everytime i send a voice message from my droid, signal-cli receives a sync sent message with the audio attachment and complains that it failed to delete the temp file:

Failed to delete temp file: C:\Users\XXXXX\AppData\Local\Temp\ts_attach_90949199056035476364255783916527914059.tmp
Envelope from: ?Ich? +49XXXXXX462 (device: 7)
Timestamp: 1480025899101
Received a sync message
Received sync sent message
To:  , Message timestamp: 1480025899101
Message timestamp: 1480025899101
Body:
Group info:
  Id: txFIeGmfMS/OPlERkBK1sw==
  Name: #ARGS
  Type: DELIVER
Attachments:
- audio/aac (Pointer)
  Id: 9094919905603547636 Key length: 64 Relay:
  Size: 49340 bytes
  Stored plaintext in: C:\Users\Benni\.config\signal\attachments\9094919905603547636

Add better error for when doesn't have dbus dependencies

I didn't read the docs fully and got the following error message

Authorization failed, was the number registered elsewhere?
Exception in thread "main" java.lang.UnsatisfiedLinkError: no unix-java in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at cx.ath.matthew.unix.UnixSocket.<clinit>(UnixSocket.java:40)
	at org.freedesktop.dbus.Transport.connect(Transport.java:772)
	at org.freedesktop.dbus.Transport.<init>(Transport.java:737)
	at org.freedesktop.dbus.DBusConnection.<init>(DBusConnection.java:299)
	at org.freedesktop.dbus.DBusConnection.getConnection(DBusConnection.java:282)
	at org.asamk.signal.Main.handleCommands(Main.java:546)
	at org.asamk.signal.Main.main(Main.java:69)

when trying to run signal-cli -u UN daemon. I forgot to install the libunixsocket-java dependency, which I eventually realized, but the error message sure threw me off. Perhaps add a little dependency check that fails with a better error message?

Signal config should not be world readable

signal-cli currently creates the .config/signal directory and subdirectories with mode drwxr-xr-x and files with mode -rw-r--r--. This is not good since this is where phone numbers and private keys are stored. It should create them with modes drwx------ and -rw------- respectively. Moreover, it should warn the user (or perhaps even hard fail unless a --allow-bad-permissions flag is given) if their config files don't have these modes.

Registration not visible for other users.

I've registered and verified new textsecure user and I can send Messages to other TextSecure users. But when they try to send me a message they fail. Also if I register 2 different users with CLI and try to send a message from one to another - I recieve UserNotFound Exception for the recipient.

Cannot Resolve Session Bus Address

Hi

I´ll instaled libmatthew-java-0.8 but I try to use signal-cli with daemon and return yet org.freedesktop.dbus.exceptions.DBusException: Cannot Resolve Session Bus Address

java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

variables
CLASSPATH="/usr/local/share/java:/usr/local/lib/jni:/opt/jdk1.8.0_121:/usr/local/share/java:/usr/local/lib/jni:/opt/jdk1.8.0_121"
JAVA_HOME="/opt/jdk1.8.0_121"
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/jdk1.8.0_121/bin"

signal-daemon.txt

OS: CentOS Linux release 7.2.1511 (Core)
3.10.0-327.el7.x86_64

A connection to https://textsecure-service.whispersystems.org/ was leaked

First, thanks for signal-cli, I am finding it really useful.

I have signal-cli e083a20 + Turasa/libsignal-service-java@bdd19a6 running on two Ubuntu 16.04.1 machines with openjdk-8-jre-headless, started by

/usr/bin/signal-cli -u $PHONE_NUMBER --config /var/lib/signal-cli daemon --system

in a systemd unit, and on one of the machines, I sometimes see this every few seconds:

-- Logs begin at Mon 2017-02-13 12:57:51 UTC, end at Mon 2017-02-13 14:12:00 UTC. --
Feb 13 12:58:07 plato systemd[1]: Starting signal-cli daemon...
Feb 13 12:58:35 plato systemd[1]: Started signal-cli daemon.
Feb 13 13:03:35 plato signal-cli[1565]: Feb 13, 2017 1:03:35 PM okhttp3.internal.platform.Platform log
Feb 13 13:03:35 plato signal-cli[1565]: WARNING: A connection to https://textsecure-service.whispersystems.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger 
level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
Feb 13 13:03:37 plato signal-cli[1565]: Feb 13, 2017 1:03:37 PM okhttp3.internal.platform.Platform log
Feb 13 13:03:37 plato signal-cli[1565]: WARNING: A connection to https://textsecure-service.whispersystems.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger 
level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
Feb 13 13:03:38 plato signal-cli[1565]: Feb 13, 2017 1:03:38 PM okhttp3.internal.platform.Platform log
Feb 13 13:03:38 plato signal-cli[1565]: WARNING: A connection to https://textsecure-service.whispersystems.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger 
level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
Feb 13 13:03:39 plato signal-cli[1565]: Feb 13, 2017 1:03:39 PM okhttp3.internal.platform.Platform log
Feb 13 13:03:39 plato signal-cli[1565]: WARNING: A connection to https://textsecure-service.whispersystems.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger 
level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
Feb 13 13:03:41 plato signal-cli[1565]: Feb 13, 2017 1:03:41 PM okhttp3.internal.platform.Platform log
Feb 13 13:03:41 plato signal-cli[1565]: WARNING: A connection to https://textsecure-service.whispersystems.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger 
level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
Feb 13 13:03:43 plato signal-cli[1565]: Feb 13, 2017 1:03:43 PM okhttp3.internal.platform.Platform log
Feb 13 13:03:43 plato signal-cli[1565]: WARNING: A connection to https://textsecure-service.whispersystems.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger 
level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
Feb 13 13:03:45 plato signal-cli[1565]: Feb 13, 2017 1:03:45 PM okhttp3.internal.platform.Platform log
Feb 13 13:03:45 plato signal-cli[1565]: WARNING: A connection to https://textsecure-service.whispersystems.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger 
level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
Feb 13 13:03:47 plato signal-cli[1565]: Feb 13, 2017 1:03:47 PM okhttp3.internal.platform.Platform log
Feb 13 13:03:47 plato signal-cli[1565]: WARNING: A connection to https://textsecure-service.whispersystems.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger 
level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
Feb 13 13:03:50 plato signal-cli[1565]: Feb 13, 2017 1:03:50 PM okhttp3.internal.platform.Platform log
Feb 13 13:03:50 plato signal-cli[1565]: WARNING: A connection to https://textsecure-service.whispersystems.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger 
level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);

This happens at idle; I was not sending messages. Sending messages works, though. My Internet connection was not going up and down, either.

This doesn't happen on the other machine (yet?). The only relevant difference is that the machine with leaking connections is a slave device, but that might be irrelevant.

unregister support

i have registered a test phone number for this... it would be nice if i could abandon it properly as well... as things stand, there's actually no way to do that, that i can think of at least...

signal-cli returns EXIT_SUCCESS even when message failed to send

I've been using my https://github.com/kb100/signal-authenticator as a send-only device. Today it just stopped working for no apparent reason. I checked my authenticator code and it shows that signal-cli is returning success when sending a message, but I never receive the message. Just for the heck of it, I tried signal-cli -u USERNAME receive and used grep to count that I had exactly 99 pending messages ("Got receipt.", all from the same number).

The fact that it was 99 seems too suspicious to be coincidence. I don't know exactly how signal works, but I wonder if this could have anything to do with the fact that there are 100 preKey records in my config.

After doing the signal-clii -u USERNAME receive my authenticator started working again.

I would hope that if signal-cli can tell that a message failed, then it would not return EXIT_SUCCESS so at the very least my authenticator can account for it.

Cannot link to device

I tried to link signal-cli to my iOS client using the pre-built version 0.5.0 release as well as the latest commit on Github which I built using the gradle instructions. signal-cli generates a tsdevice:/... link, but when I scan the qr-encoded barcode on the iOS device, signal-cli crashes with the following output (uuid removed):

$ signal-cli link -n "laptop"
tsdevice:/?uuid=[REDACTED]
Exception in thread "main" java.lang.AssertionError: java.security.InvalidKeyException: Illegal key size
        at org.whispersystems.signalservice.internal.crypto.ProvisioningCipher.decrypt(ProvisioningCipher.java:118)
        at org.whispersystems.signalservice.internal.crypto.ProvisioningCipher.decrypt(ProvisioningCipher.java:102)
        at org.whispersystems.signalservice.internal.push.ProvisioningSocket.getProvisioningMessage(ProvisioningSocket.java:45)
        at org.whispersystems.signalservice.api.SignalServiceAccountManager.finishNewDeviceRegistration(SignalServiceAccountManager.java:376)
        at org.asamk.signal.Manager.finishDeviceLink(Manager.java:373)
        at org.asamk.signal.Main.handleCommands(Main.java:172)
        at org.asamk.signal.Main.main(Main.java:67)
Caused by: java.security.InvalidKeyException: Illegal key size
        at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
        at javax.crypto.Cipher.implInit(Cipher.java:805)
        at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
        at javax.crypto.Cipher.init(Cipher.java:1396)
        at javax.crypto.Cipher.init(Cipher.java:1327)
        at org.whispersystems.signalservice.internal.crypto.ProvisioningCipher.decrypt(ProvisioningCipher.java:115)
        ... 6 more

Please let me know if you need any additional information.

XMPP-Transport-Interface [feature-request]

Hi everyone,

is there any chance that you could implement the spectrum2 transport gateway api, like transwhat does, or even the official XMPP Component Protocol API, so signal-cli could be user via Jabber...? transwhat is a whatsapp-transport for jabber, so it also uses an e164-number as the identifier and should be fairly similar to signal...

Or, is there any way to use the d-bus api from a jabber-transport?

group info requests for unknown groups crash signal-cli

There is a groupinfo-request my signal-cli's message queue for a group which is unknown to that signal-cli instance.

signal-cli now crashes every time i want to receive:

signal-cli -u +49XXXXXX072 receive
Exception in thread "main" org.asamk.signal.GroupNotFoundException: Group not found: Mm2pLHHApwBVxoBzoez/2Q==
        at org.asamk.signal.Manager.getGroupForSending(Manager.java:560)
        at org.asamk.signal.Manager.sendUpdateGroupMessage(Manager.java:687)
        at org.asamk.signal.Manager.handleSignalServiceDataMessage(Manager.java:942)
        at org.asamk.signal.Manager.handleMessage(Manager.java:1093)
        at org.asamk.signal.Manager.retryFailedReceivedMessages(Manager.java:1014)
        at org.asamk.signal.Manager.receiveMessages(Manager.java:1024)
        at org.asamk.signal.Main.handleCommands(Main.java:378)
        at org.asamk.signal.Main.main(Main.java:67)

Since the message is apparently not removed from the queue, it is the first to be retrieved the next time, and thus signal-cli crashes again.

Failed to send message: Rate limit exceeded: 413

I am testing whether i can kill Signal-Android instances by sending them enough attachments so that they run out of file descriptors. Unfortunately, when sending too many attachments with one command, signal-cli responds:

Failed to send message: Rate limit exceeded: 413

Aren't multiple attachments wrapped into a single message, and should not cause rate limit hits?

java.lang.UnsupportedClassVersionError error on macOS

Hi, I'm getting the following error when executing ./signal-cli:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/asamk/signal/Main : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

I'm on macOS El Capitan 10.11.5, Java version: Java 8 update 101

attachment-free message body clipped at 2000 bytes

perhaps this is not a limitation in textsecure-cli, but one in the underlying libtextsecure-java ?

i tried sending a message in varying sizes up to 2048 bytes by piping to textsecure-cli. the result is clipped after the 2000th byte.

since things like pictures and videos can be sent, clearly the underlying architecture supports larger messages. just wonder if textsecure-cli is being conservative?

also, it is useful to know this limit (2000 bytes) which does not seem to be declared in the sources. i also search in the sources available on github for libtextsecure-java and do not seem to find any clearly defined limits.

perhaps this is just a documentation issue.

remove documentation from README

as discussed in #57, the README is now out of date. we should probably move all of that documentation to the manpage instead.

furthermore, it seems to me it would be better if the manpage was rendered directly on github - for this i believe it would be sufficient to rename it to .asciidoc, see the asciidoc readme for an example.

receive doesn't work with linked device

i can't seem to receive messages with a phone number that i linked (see #28 for my previous experience with this) with signal-cli. i can receive messages with a phone number that was registered with signal cli. an example would maybe help clarify this:

  • phone number A was registered on an android phone and linked with the signal-cli program
  • phone number B was registered directly with signal-cli (register -v + verify)

this works:

signal-cli -u A send B -mtest
signal-cli -u B receive -t -1

this doesn't work:

signal-cli -u B send A -mtest
signal-cli -u A receive -t -1

in the above, the Android device that registered A would see the message, but not signal-cli receive

i also tried with a friend's phone number (say C). in that case, C would see messages sent with signal-cli, but only the Android device would receive the answers.

any advice on how to debug this? is this normal behavior?

[Request] --ignore-attachments and --ignore-messages options

Since many applications of using signal-cli are automated, it may not be desirable to allow message attachments or even to allow any kind of replies at all (beyond automated message receipts). It would be nice (but I'm not sure if it would be possible) if messages/attachments are not even downloaded (except for message receipts), as opposed to downloading and piping them to /dev/null.

E.g. in my signal-authenticator project, signal-cli is used to send one-time codes that are then inputted via ssh. I absolutely never want to download a message or attachment that a user sends to the authenticator, though for the sake of not clogging up Open Whisper Systems's servers, I wouldn't mind acknowledging the messages.

race condition safety

can i use multiple instances of signal-cli in parallel without corrupting (or partially reverting) the local storage?

at the moment i am forking signal-cli via cron, and i wonder what happens if two instances want to write e.g. a new known key to disk at the same time.

Getting FingerPrint from android device to trust identity

I'm not sure to understand, I have a user using signal-cli, communicating to another user using an android device.
I wanted to trust this user but I can't find it's fingerprint on the android device, the only thing I can get is the "safety numbers", but they dont match the fingerprint so I assume this is not the same thing.

Is there a way to get the user fingerprint from an android or a desktop application ?

signal.service fails to start User is not registered

I'm trying to run signal-cli as system dbus service. My problem is that the signal.service keeps on failing to start and complaining about User is not registered:

$ systemctl start signal.service
Job for signal.service failed. See 'systemctl status signal.service' and 'journalctl -xn' for details.
$ systemctl status signal.service
● signal.service - Send secure messages to Signal clients
   Loaded: loaded (/etc/systemd/system/signal.service; enabled)
   Active: failed (Result: exit-code) since Sa 2017-01-21 16:55:09 CET; 1s ago
  Process: 12014 ExecStart=/usr/local/bin/signal-cli -u +4915151219921 --config /var/lib/signal-cli daemon --system (code=exited, status=1/FAILURE)
 Main PID: 12014 (code=exited, status=1/FAILURE)

Jan 21 16:55:08 hugo.christophhaefner.de systemd[1]: Starting Send secure messages to Signal clients...
Jan 21 16:55:09 hugo.christophhaefner.de signal-cli[12014]: User is not registered.
Jan 21 16:55:09 hugo.christophhaefner.de systemd[1]: signal.service: main process exited, code=exited, status=1/FAILURE
Jan 21 16:55:09 hugo.christophhaefner.de systemd[1]: Failed to start Send secure messages to Signal clients.
Jan 21 16:55:09 hugo.christophhaefner.de systemd[1]: Unit signal.service entered failed state.

I tried registering with the "signal-cli" user, so that "/home/signal-cli/.config/signal/data/" is populated, but that didn't help.
I also tried registering as root, so that "/root/.config/signal/data/" is populated, but that didn't help either.

Could someone tell me where he looks for the registration information?

Cheers,
Christoph

Multiple instances of signal-cli

I'm writing a hubot adapter to communicate via signal, and I'm using signal-cli.

Is there a way to launch multiple signal-cli instances ? Right now I have one signal-cli receiving messages, but I need another instance to send back messages from the hubot.

I havent been able to use the daemon with oracle jvm and unix-java on debian (and I'm willing to put the hubot in a docker container) so I was wondering if you had an idea.

Please make new release

I would like to update my signal-authenticator to use your new --ignore-attachments flag, so I would like to be able to warn them that they must use MIN_VERSION=0.5.3 for signal-cli in order for signal-authenticator to work. Please release :) and thank you for your continued work on signal-cli.

Error: Could not find or load main class org.asamk.signal.Main

I set up a fresh install of Ubuntu 14.04, installed default-jre-headless on the machine and then installed the signal-cli per the instructions. however i get this error when running signal-cli

Error: Could not find or load main class org.asamk.signal.Main

let me know how I can resolve this....I am guessing I am using the wrong jre for linux, but then again, i wish this cli didnt have to have java as a dependency and instead used something more common to servers like python or bash

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.