Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Latest commit

 

History

History

signal-server-3.21

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Signal New Code

This guide is written by using Signal Server v3.21 & Signal Android v4.66.1

(For Signal v2.92 please refer to signal-server guide)

Related Guide

Requirement

  • Same requirement as old version
  • GCP is currenlty disabled

Steps for Signal Server

  1. Clone signal server
git clone https://github.com/signalapp/signal-server-2.92/
  1. Create your config using new config.yml

  2. Update zkgroup dependency in service/pom.xml from 0.6.0 to 0.7.0

...

<dependency>
    <groupId>org.signal</groupId>
    <artifactId>zkgroup-java</artifactId>
    <version>0.7.0</version>
</dependency>

...
  1. (Optional, only if you see error regarding this line) Add this import statement and fix the final PrivateKey key variable in service/src/main/java/org/whispersystems/textsecuregcm/gcp/CanonicalRequestSigner.java
...

import java.security.KeyPair;

...

final PrivateKey key = ((KeyPair) pemReader.readObject()).getPrivate();

...
  1. (Optional, for attachment bucket) Change objectName in service/src/main/java/org/whispersystems/textsecuregcm/controllers/AttachmentControllerV2.java and change the variable.
...

String   objectName   =    "attachments/" + String.valueOf(attachmentId);

...
  1. (Optional, if you follow the previous step) Update the test file in service/src/test/java/org/whispersystems/textsecuregcm/tests/controllers/AttachmentControllerTest.java
...

assertThat(descriptor.getKey()).isEqualTo("attachments/" + descriptor.getAttachmentIdString());

...
  1. Compile the server code
mvn clean install -DskipTests
  1. Generate zkparams value for the config.
java -jar service/target/TextSecureServer-3.21.jar zkparams

Note: The public key generated in this step may not suffice the length needed in the android, in that case, please add '=' to the end of the public key.

  1. Generate UnidentifiedDelivery value for the config.
java -jar service/target/TextSecureServer-3.21.jar certificate -ca

Use the private key from previous command here. You can use any ID for the key_ID.

java -jar service/target/TextSecureServer-3.21.jar certificate --key priv_key_from_step_above --id key_ID
  1. Setup Nginx & coTurn, it has the same steps as the old code.

  2. Run PostgreSQL & Redis, using the docker-compose is recommended.

  3. Run database migration

java -jar service/target/TextSecureServer-3.21.jar abusedb migrate service/config/config.yml

java -jar service/target/TextSecureServer-3.21.jar accountdb migrate service/config/config.yml

java -jar service/target/TextSecureServer-3.21.jar messagedb migrate service/config/config.yml
  1. Run the server
java -jar service/target/TextSecureServer-3.21.jar server service/config/config.yml

Steps for Signal Android

  1. Clone signal android
git clone https://github.com/signalapp/Signal-Android/
  1. Import your SSL certificate to app/src/main/res/raw/whisper.store. The password is "whisper" without quotation mark.

  2. Remove distributionSha256Sum line from gradle/wrapper/gradle-wrapper.properties

  3. Modify the server url in app/build.gradle under defaultConfig

...

buildConfigField "String", "SIGNAL_URL", "\"https://domain.com\""
buildConfigField "String", "STORAGE_URL", "\"https://domain.com\""
buildConfigField "String", "SIGNAL_CDN_URL", "\"https://xxx.cloudfront.net\""
buildConfigField "String", "SIGNAL_CDN2_URL", "\"https://xxx.cloudfront.net\""
buildConfigField "String", "SIGNAL_CONTACT_DISCOVERY_URL", "\"https://domain.com\""
buildConfigField "String", "SIGNAL_SERVICE_STATUS_URL", "\"https://domain.com\""
buildConfigField "String", "SIGNAL_KEY_BACKUP_URL", "\"https://domain.com\""

...

buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"change-to-unidentified-delivery-public-key\""
buildConfigField "String", "ZKGROUP_SERVER_PUBLIC_PARAMS", "\"change-to-zkparams-public-key\""
        
...
  1. Select Sync Project when prompted after saving the build.gradle change. Note: Please ignore when prompted to update the dependency.

  2. (Optional, for attachment bucket) Change ATTACHMENT_UPLOAD_PATH in libsignal/service/src/main/java/org/whispersystems/signalservice/internal/push/PushServiceSocket.java

...

private static final String ATTACHMENT_UPLOAD_PATH   =   "";

...
  1. Setup Firebase, it has the same steps as the old code.

  2. Build the project.

Known Issue

  1. User can't create PIN in this server version, so skip it after registration.
  2. User profile (name & display picture) not found because the API return 404.
  3. Due to this server version being too old, the android client version that compatible to this server is too old too, so it give "Version Expired" error, for this please refer to the Signal Android Guide.