Update for Signal Server 2.55

This commit is contained in:
Finn 2019-10-16 21:28:31 -07:00
parent e2f5b430fb
commit bd89a8b1fb
6 changed files with 44 additions and 60 deletions

View file

@ -13,12 +13,28 @@ services:
POSTGRES_USER: signal POSTGRES_USER: signal
expose: expose:
- 5432 - 5432
volumes:
- "./postgres-data:/var/lib/postgresql/data"
adminer:
image: adminer
restart: always
ports:
- "127.0.0.1:8083:8080"
testhelper:
image: registry.git.callpipe.com/finn/signald-test-infrastructure/testhelper:master
restart: always
build:
context: .
dockerfile: testhelper.Dockerfile
environment:
DB: "host=db user=signal dbname=signal password=password sslmode=disable"
ports:
- "127.0.0.1:8082:8082"
signal: signal:
image: registry.git.callpipe.com/finn/signald-test-infrastructure/signal-server:2.02 image: registry.git.callpipe.com/finn/signald-test-infrastructure/signal-server:2.02
build: build:
context: . context: .
dockerfile: signal-server.Dockerfile dockerfile: signal-server.Dockerfile
command: server /etc/signal-server.yaml
volumes: volumes:
- "./signal-server.yaml:/etc/signal-server.yaml" - "./signal-server.yaml:/etc/signal-server.yaml"
ports: ports:

6
migrate-and-start-server.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
set -exu
java -jar /usr/share/TextSecureServer.jar abusedb migrate /etc/signal-server.yaml
java -jar /usr/share/TextSecureServer.jar accountdb migrate /etc/signal-server.yaml
java -jar /usr/share/TextSecureServer.jar messagedb migrate /etc/signal-server.yaml
java -jar /usr/share/TextSecureServer.jar server /etc/signal-server.yaml

View file

@ -1,7 +1,7 @@
diff --git a/src/main/resources/accountsdb.xml b/src/main/resources/accountsdb.xml diff --git a/src/main/resources/accountsdb.xml b/src/main/resources/accountsdb.xml
index f2a9c31..7090051 100644 index f2a9c31..7090051 100644
--- a/src/main/resources/accountsdb.xml --- a/service/src/main/resources/accountsdb.xml
+++ b/src/main/resources/accountsdb.xml +++ b/service/src/main/resources/accountsdb.xml
@@ -119,29 +119,6 @@ @@ -119,29 +119,6 @@
</column> </column>
</createTable> </createTable>

View file

@ -1,7 +1,7 @@
diff --git a/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java b/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java diff --git a/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java b/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java
index bd05995..0d12f57 100644 index bd05995..0d12f57 100644
--- a/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java --- a/service/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java
+++ b/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java
@@ -66,26 +66,7 @@ public class DirectoryQueue { @@ -66,26 +66,7 @@ public class DirectoryQueue {
} }

View file

@ -1,56 +1,17 @@
diff --git a/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java b/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java b/service/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java
index 8b62e0f..0e68bb0 100644 index 55773a3..c3c705b 100644
--- a/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java --- a/service/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java
+++ b/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java
@@ -16,15 +16,12 @@ @@ -42,10 +42,10 @@ public class SmsSender {
*/
package org.whispersystems.textsecuregcm.sms;
-
-import com.twilio.sdk.TwilioRestException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Optional;
-@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
public class SmsSender {
static final String SMS_IOS_VERIFICATION_TEXT = "Your Signal verification code: %s\n\nOr tap: sgnl://verify/%s";
@@ -33,11 +30,8 @@ public class SmsSender {
private final Logger logger = LoggerFactory.getLogger(SmsSender.class);
- private final TwilioSmsSender twilioSender;
+ public SmsSender(TwilioSmsSender twilioSender) {
- public SmsSender(TwilioSmsSender twilioSender)
- {
- this.twilioSender = twilioSender;
}
public void deliverSmsVerification(String destination, Optional<String> clientType, String verificationCode)
@@ -48,20 +42,12 @@ public class SmsSender {
destination = "+521" + destination.substring(3); destination = "+521" + destination.substring(3);
} }
- try {
- twilioSender.deliverSmsVerification(destination, clientType, verificationCode); - twilioSender.deliverSmsVerification(destination, clientType, verificationCode);
- } catch (TwilioRestException e) { + // twilioSender.deliverSmsVerification(destination, clientType, verificationCode);
- logger.info("Twilio SMS Failed: " + e.getErrorMessage());
- }
+ logger.info("Sending SMS verification code to " + destination + ": " + verificationCode);
} }
public void deliverVoxVerification(String destination, String verificationCode) public void deliverVoxVerification(String destination, String verificationCode, Optional<String> locale) {
throws IOException - twilioSender.deliverVoxVerification(destination, verificationCode, locale);
{ + // twilioSender.deliverVoxVerification(destination, verificationCode, locale);
- try {
- twilioSender.deliverVoxVerification(destination, verificationCode);
- } catch (TwilioRestException e) {
- logger.info("Twilio Vox Failed: " + e.getErrorMessage());
- }
+ logger.info("Sending voice verification code to " + destination + ": " + verificationCode);
} }
} }

View file

@ -1,15 +1,16 @@
FROM debian:9 as build FROM debian:buster as build
RUN apt-get update && apt-get install -y openjdk-8-jdk-headless maven git RUN apt-get update && apt-get install -y openjdk-11-jdk-headless maven git
RUN git -C /usr/local/src clone https://github.com/signalapp/Signal-Server RUN git -C /usr/local/src clone https://github.com/signalapp/Signal-Server
WORKDIR /usr/local/src/Signal-Server WORKDIR /usr/local/src/Signal-Server
COPY signal-server-patches /tmp/signal-server-patches COPY signal-server-patches /tmp/signal-server-patches
RUN /tmp/signal-server-patches/apply-patches.sh RUN /tmp/signal-server-patches/apply-patches.sh
RUN mvn install -DskipTests RUN mvn install -DskipTests
FROM debian:9 FROM debian:buster
RUN apt-get update && apt-get install -y openjdk-8-jre-headless RUN apt-get update && apt-get install -y openjdk-11-jre-headless
COPY --from=build /usr/local/src/Signal-Server/target/TextSecureServer-2.02.jar /usr/share/TextSecureServer.jar COPY --from=build /usr/local/src/Signal-Server/service/target/TextSecureServer-2.55.jar /usr/share/TextSecureServer.jar
COPY migrate-and-start-server.sh /usr/bin/migrate-and-start-server
RUN useradd signal RUN useradd signal
RUN chown -R signal /usr/share/TextSecureServer.jar RUN chown -R signal /usr/share/TextSecureServer.jar
USER signal USER signal
ENTRYPOINT ["java", "-jar", "/usr/share/TextSecureServer.jar"] CMD ["/usr/bin/migrate-and-start-server"]