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)
- Same requirement as old version
- GCP is currenlty disabled
- Clone signal server
git clone https://github.com/signalapp/signal-server-2.92/
-
Create your config using new
config.yml
-
Update
zkgroup
dependency inservice/pom.xml
from0.6.0
to0.7.0
...
<dependency>
<groupId>org.signal</groupId>
<artifactId>zkgroup-java</artifactId>
<version>0.7.0</version>
</dependency>
...
- (Optional, only if you see error regarding this line) Add this
import
statement and fix thefinal PrivateKey key
variable inservice/src/main/java/org/whispersystems/textsecuregcm/gcp/CanonicalRequestSigner.java
...
import java.security.KeyPair;
...
final PrivateKey key = ((KeyPair) pemReader.readObject()).getPrivate();
...
- (Optional, for attachment bucket) Change
objectName
inservice/src/main/java/org/whispersystems/textsecuregcm/controllers/AttachmentControllerV2.java
and change the variable.
...
String objectName = "attachments/" + String.valueOf(attachmentId);
...
- (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());
...
- Compile the server code
mvn clean install -DskipTests
- 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.
- 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
-
Setup Nginx & coTurn, it has the same steps as the old code.
-
Run PostgreSQL & Redis, using the
docker-compose
is recommended. -
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
- Run the server
java -jar service/target/TextSecureServer-3.21.jar server service/config/config.yml
- Clone signal android
git clone https://github.com/signalapp/Signal-Android/
-
Import your SSL certificate to
app/src/main/res/raw/whisper.store
. The password is "whisper" without quotation mark. -
Remove
distributionSha256Sum
line fromgradle/wrapper/gradle-wrapper.properties
-
Modify the server url in
app/build.gradle
underdefaultConfig
...
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\""
...
-
Select
Sync Project
when prompted after saving the build.gradle change. Note: Please ignore when prompted to update the dependency. -
(Optional, for attachment bucket) Change
ATTACHMENT_UPLOAD_PATH
inlibsignal/service/src/main/java/org/whispersystems/signalservice/internal/push/PushServiceSocket.java
...
private static final String ATTACHMENT_UPLOAD_PATH = "";
...
-
Setup Firebase, it has the same steps as the old code.
-
Build the project.
- User can't create PIN in this server version, so skip it after registration.
- User profile (name & display picture) not found because the API return 404.
- 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.