diff --git a/signal-server-patches/apply-patches.sh b/signal-server-patches/apply-patches.sh new file mode 100755 index 0000000..ab4e9e9 --- /dev/null +++ b/signal-server-patches/apply-patches.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -euo pipefail +for patch in /tmp/signal-server-patches/*.patch; do + echo "patch -p1 < \$patch" + patch -p1 < $patch +done diff --git a/signal-server-patches/remove-twilio.patch b/signal-server-patches/remove-twilio.patch new file mode 100644 index 0000000..ab494d0 --- /dev/null +++ b/signal-server-patches/remove-twilio.patch @@ -0,0 +1,56 @@ +diff --git a/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java b/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java +index 8b62e0f..0e68bb0 100644 +--- a/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java ++++ b/src/main/java/org/whispersystems/textsecuregcm/sms/SmsSender.java +@@ -16,15 +16,12 @@ + */ + 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 clientType, String verificationCode) +@@ -48,20 +42,12 @@ public class SmsSender { + destination = "+521" + destination.substring(3); + } + +- try { +- twilioSender.deliverSmsVerification(destination, clientType, verificationCode); +- } catch (TwilioRestException e) { +- logger.info("Twilio SMS Failed: " + e.getErrorMessage()); +- } ++ logger.info("Sending SMS verification code to " + destination + ": " + destination); + } + + public void deliverVoxVerification(String destination, String verificationCode) + throws IOException + { +- try { +- twilioSender.deliverVoxVerification(destination, verificationCode); +- } catch (TwilioRestException e) { +- logger.info("Twilio Vox Failed: " + e.getErrorMessage()); +- } ++ logger.info("Sending voice verification code to " + destination + ": " + verificationCode); + } + } diff --git a/signal-server.Dockerfile b/signal-server.Dockerfile index 0210698..3c9bf5a 100644 --- a/signal-server.Dockerfile +++ b/signal-server.Dockerfile @@ -2,6 +2,8 @@ FROM debian:9 as build RUN apt-get update && apt-get install -y openjdk-8-jdk-headless maven git RUN git -C /usr/local/src clone https://github.com/signalapp/Signal-Server WORKDIR /usr/local/src/Signal-Server +COPY signal-server-patches /tmp/signal-server-patches +RUN /tmp/signal-server-patches/apply-patches.sh RUN mvn install -DskipTests RUN ls -lha target