From 5e01e54bbb024386d355eede7fa2e83fd9f8f776 Mon Sep 17 00:00:00 2001 From: Finn Herzfeld Date: Wed, 5 Dec 2018 14:54:37 -0800 Subject: [PATCH] Add a patch to remove SQS functionality --- signal-server-patches/remove-sqs.patch | 32 ++++++++++++++++++++++++++ signal-server.Dockerfile | 1 - 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 signal-server-patches/remove-sqs.patch diff --git a/signal-server-patches/remove-sqs.patch b/signal-server-patches/remove-sqs.patch new file mode 100644 index 0000000..a26475a --- /dev/null +++ b/signal-server-patches/remove-sqs.patch @@ -0,0 +1,32 @@ +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 +--- a/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java ++++ b/src/main/java/org/whispersystems/textsecuregcm/sqs/DirectoryQueue.java +@@ -66,26 +66,7 @@ public class DirectoryQueue { + } + + private void sendMessage(String action, String user) { +- final Map messageAttributes = new HashMap<>(); +- messageAttributes.put("id", new MessageAttributeValue().withDataType("String").withStringValue(user)); +- messageAttributes.put("action", new MessageAttributeValue().withDataType("String").withStringValue(action)); +- SendMessageRequest sendMessageRequest = new SendMessageRequest() +- .withQueueUrl(queueUrl) +- .withMessageBody("-") +- .withMessageDeduplicationId(user + action) +- .withMessageGroupId(user) +- .withMessageAttributes(messageAttributes); +- try { +- sqs.sendMessage(sendMessageRequest); +- } catch (AmazonServiceException ex) { +- serviceErrorMeter.mark(); +- logger.warn("sqs service error: ", ex); +- } catch (AmazonClientException ex) { +- clientErrorMeter.mark(); +- logger.warn("sqs client error: ", ex); +- } catch (Throwable t) { +- logger.warn("sqs unexpected error: ", t); +- } ++ logger.info("Pretending to send SQS message: " + user + " " + action); + } + + } diff --git a/signal-server.Dockerfile b/signal-server.Dockerfile index 3c9bf5a..ada478b 100644 --- a/signal-server.Dockerfile +++ b/signal-server.Dockerfile @@ -5,7 +5,6 @@ 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 FROM debian:9 RUN apt-get update && apt-get install -y openjdk-8-jre-headless