mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 04:36:47 +00:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f13837d2f2 | ||
|
|
3ff2af47cb | ||
|
|
c719da3527 | ||
|
|
0ea52b785e | ||
|
|
1ce1c298d3 | ||
|
|
4d5cc4dc22 | ||
|
|
640274108e | ||
|
|
dd17ddc98c |
No files matched your search
@@ -355,6 +355,12 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
|
||||
new IdleDeviceNotificationSchedulerFactory()));
|
||||
|
||||
bootstrap.addCommand(new RegenerateSecondaryDynamoDbTableDataCommand());
|
||||
|
||||
ServiceLoader.load(SpamFilter.class)
|
||||
.stream()
|
||||
.map(ServiceLoader.Provider::get)
|
||||
.flatMap(spamFilter -> spamFilter.getCommands().stream())
|
||||
.forEach(bootstrap::addCommand);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+32
-12
@@ -86,28 +86,48 @@ public class CallQualitySurveyManager {
|
||||
pubSubMessageBuilder.setDebugLogUrl(submitCallQualitySurveyRequest.getDebugLogUrl());
|
||||
}
|
||||
|
||||
if (submitCallQualitySurveyRequest.hasRttMedianConnection()) {
|
||||
pubSubMessageBuilder.setRttMedianConnection(submitCallQualitySurveyRequest.getRttMedianConnection());
|
||||
if (submitCallQualitySurveyRequest.hasConnectionRttMedian()) {
|
||||
pubSubMessageBuilder.setConnectionRttMedian(submitCallQualitySurveyRequest.getConnectionRttMedian());
|
||||
}
|
||||
|
||||
if (submitCallQualitySurveyRequest.hasRttMedianMedia()) {
|
||||
pubSubMessageBuilder.setRttMedianMedia(submitCallQualitySurveyRequest.getRttMedianMedia());
|
||||
if (submitCallQualitySurveyRequest.hasAudioRttMedian()) {
|
||||
pubSubMessageBuilder.setAudioRttMedian(submitCallQualitySurveyRequest.getAudioRttMedian());
|
||||
}
|
||||
|
||||
if (submitCallQualitySurveyRequest.hasJitterMedianRecv()) {
|
||||
pubSubMessageBuilder.setJitterMedianRecv(submitCallQualitySurveyRequest.getJitterMedianRecv());
|
||||
if (submitCallQualitySurveyRequest.hasVideoRttMedian()) {
|
||||
pubSubMessageBuilder.setVideoRttMedian(submitCallQualitySurveyRequest.getVideoRttMedian());
|
||||
}
|
||||
|
||||
if (submitCallQualitySurveyRequest.hasJitterMedianSend()) {
|
||||
pubSubMessageBuilder.setJitterMedianSend(submitCallQualitySurveyRequest.getJitterMedianSend());
|
||||
if (submitCallQualitySurveyRequest.hasAudioRecvJitterMedian()) {
|
||||
pubSubMessageBuilder.setAudioRecvJitterMedian(submitCallQualitySurveyRequest.getAudioRecvJitterMedian());
|
||||
}
|
||||
|
||||
if (submitCallQualitySurveyRequest.hasPacketLossFractionRecv()) {
|
||||
pubSubMessageBuilder.setPacketLossFractionRecv(submitCallQualitySurveyRequest.getPacketLossFractionRecv());
|
||||
if (submitCallQualitySurveyRequest.hasVideoRecvJitterMedian()) {
|
||||
pubSubMessageBuilder.setVideoRecvJitterMedian(submitCallQualitySurveyRequest.getVideoRecvJitterMedian());
|
||||
}
|
||||
|
||||
if (submitCallQualitySurveyRequest.hasPacketLossFractionSend()) {
|
||||
pubSubMessageBuilder.setPacketLossFractionSend(submitCallQualitySurveyRequest.getPacketLossFractionSend());
|
||||
if (submitCallQualitySurveyRequest.hasAudioSendJitterMedian()) {
|
||||
pubSubMessageBuilder.setAudioSendJitterMedian(submitCallQualitySurveyRequest.getAudioSendJitterMedian());
|
||||
}
|
||||
|
||||
if (submitCallQualitySurveyRequest.hasVideoSendJitterMedian()) {
|
||||
pubSubMessageBuilder.setVideoSendJitterMedian(submitCallQualitySurveyRequest.getVideoSendJitterMedian());
|
||||
}
|
||||
|
||||
if (submitCallQualitySurveyRequest.hasAudioRecvPacketLossFraction()) {
|
||||
pubSubMessageBuilder.setAudioRecvPacketLossFraction(submitCallQualitySurveyRequest.getAudioRecvPacketLossFraction());
|
||||
}
|
||||
|
||||
if (submitCallQualitySurveyRequest.hasVideoRecvPacketLossFraction()) {
|
||||
pubSubMessageBuilder.setVideoRecvPacketLossFraction(submitCallQualitySurveyRequest.getVideoRecvPacketLossFraction());
|
||||
}
|
||||
|
||||
if (submitCallQualitySurveyRequest.hasAudioSendPacketLossFraction()) {
|
||||
pubSubMessageBuilder.setAudioSendPacketLossFraction(submitCallQualitySurveyRequest.getAudioSendPacketLossFraction());
|
||||
}
|
||||
|
||||
if (submitCallQualitySurveyRequest.hasVideoSendPacketLossFraction()) {
|
||||
pubSubMessageBuilder.setVideoSendPacketLossFraction(submitCallQualitySurveyRequest.getVideoSendPacketLossFraction());
|
||||
}
|
||||
|
||||
if (submitCallQualitySurveyRequest.hasCallTelemetry()) {
|
||||
|
||||
@@ -30,6 +30,8 @@ import io.opentelemetry.sdk.resources.ResourceBuilder;
|
||||
import java.time.Duration;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.eclipse.jetty.util.component.LifeCycle;
|
||||
import org.whispersystems.textsecuregcm.WhisperServerConfiguration;
|
||||
import org.whispersystems.textsecuregcm.configuration.dynamic.DynamicConfiguration;
|
||||
import org.whispersystems.textsecuregcm.storage.DynamicConfigurationManager;
|
||||
@@ -120,10 +122,10 @@ public class MetricsUtil {
|
||||
|
||||
OpenTelemetryAppender.install(openTelemetry);
|
||||
|
||||
environment.lifecycle().manage(new Managed() {
|
||||
environment.lifecycle().addEventListener(new LifeCycle.Listener() {
|
||||
@Override
|
||||
public void stop() {
|
||||
openTelemetry.shutdown();
|
||||
public void lifeCycleStopped(final LifeCycle event) {
|
||||
openTelemetry.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+1
@@ -33,6 +33,7 @@ public class OpenTelemetryAppenderFactory extends AbstractAppenderFactory<ILoggi
|
||||
final OpenTelemetryAppender appender = new OpenTelemetryAppender();
|
||||
appender.setCaptureCodeAttributes(true);
|
||||
appender.setCaptureLoggerContext(true);
|
||||
appender.setCaptureMarkerAttribute(true);
|
||||
|
||||
// The installation of an OpenTelemetry configuration happens in
|
||||
// WhisperServerService (or CommandDependencies), in order to let us tie
|
||||
|
||||
@@ -6,10 +6,13 @@
|
||||
package org.whispersystems.textsecuregcm.spam;
|
||||
|
||||
import io.dropwizard.configuration.ConfigurationValidationException;
|
||||
import io.dropwizard.core.cli.ConfiguredCommand;
|
||||
import io.dropwizard.lifecycle.Managed;
|
||||
import jakarta.validation.Validator;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.function.Function;
|
||||
import org.whispersystems.textsecuregcm.WhisperServerConfiguration;
|
||||
import org.whispersystems.textsecuregcm.captcha.CaptchaClient;
|
||||
import org.whispersystems.textsecuregcm.storage.ReportedMessageListener;
|
||||
|
||||
@@ -35,6 +38,14 @@ public interface SpamFilter extends Managed {
|
||||
*/
|
||||
void configure(String environmentName, Validator validator) throws IOException, ConfigurationValidationException;
|
||||
|
||||
/**
|
||||
* Returns a collection of commands provided by this spam filter. Note that this method may be called before
|
||||
* {@link #configure(String, Validator)}.
|
||||
*
|
||||
* @return a collection of commands provided by this spam filter
|
||||
*/
|
||||
Collection<ConfiguredCommand<WhisperServerConfiguration>> getCommands();
|
||||
|
||||
/**
|
||||
* Return a reported message listener controlled by the spam filter. Listeners will be registered with the
|
||||
* {@link org.whispersystems.textsecuregcm.storage.ReportMessageManager}.
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ import software.amazon.awssdk.services.s3.S3AsyncClient;
|
||||
/**
|
||||
* Construct utilities commonly used by worker commands
|
||||
*/
|
||||
record CommandDependencies(
|
||||
public record CommandDependencies(
|
||||
AccountsManager accountsManager,
|
||||
ProfilesManager profilesManager,
|
||||
ReportMessageManager reportMessageManager,
|
||||
|
||||
@@ -73,32 +73,56 @@ message CallQualitySurveyResponsePubSubMessage {
|
||||
|
||||
// The median round-trip time, measured in milliseconds, for STUN/ICE packets
|
||||
// (i.e. connection maintenance and establishment)
|
||||
optional float rtt_median_connection = 16;
|
||||
optional float connection_rtt_median = 16;
|
||||
|
||||
// The median round-trip time, measured in milliseconds, for RTP/RTCP packets
|
||||
// (i.e. call audio/video)
|
||||
optional float rtt_median_media = 17;
|
||||
// for audio streams
|
||||
optional float audio_rtt_median = 17;
|
||||
|
||||
// The median jitter, measured in milliseconds, for the duration of the call
|
||||
// as measured by the client submitting the survey
|
||||
optional float jitter_median_recv = 18;
|
||||
// The median round-trip time, measured in milliseconds, for RTP/RTCP packets
|
||||
// for video streams
|
||||
optional float video_rtt_median = 18;
|
||||
|
||||
// The median jitter, measured in milliseconds, for the duration of the call
|
||||
// as measured by the remote endpoint in the call (either the peer of the
|
||||
// client submitting the survey in a direct call or the SFU in a group call)
|
||||
optional float jitter_median_send = 19;
|
||||
// The median jitter for audio streams, measured in milliseconds, for the
|
||||
// duration of the call as measured by the client submitting the survey
|
||||
optional float audio_recv_jitter_median = 19;
|
||||
|
||||
// The fraction of all packets lost over the duration of the call as measured
|
||||
// by the client submitting the survey
|
||||
optional float packet_loss_fraction_recv = 20;
|
||||
// The median jitter for video streams, measured in milliseconds, for the
|
||||
// duration of the call as measured by the client submitting the survey
|
||||
optional float video_recv_jitter_median = 20;
|
||||
|
||||
// The fraction of all packets lost over the duration of the call as measured
|
||||
// by the remote endpoint in the call (either the peer of the client
|
||||
// The median jitter for audio streams, measured in milliseconds, for the
|
||||
// duration of the call as measured by the remote endpoint in the call (either
|
||||
// the peer of the client submitting the survey in a direct call or the SFU in
|
||||
// a group call)
|
||||
optional float audio_send_jitter_median = 21;
|
||||
|
||||
// The median jitter for video streams, measured in milliseconds, for the
|
||||
// duration of the call as measured by the remote endpoint in the call (either
|
||||
// the peer of the client submitting the survey in a direct call or the SFU in
|
||||
// a group call)
|
||||
optional float video_send_jitter_median = 22;
|
||||
|
||||
// The fraction of audio packets lost over the duration of the call as
|
||||
// measured by the client submitting the survey
|
||||
optional float audio_recv_packet_loss_fraction = 23;
|
||||
|
||||
// The fraction of video packets lost over the duration of the call as
|
||||
// measured by the client submitting the survey
|
||||
optional float video_recv_packet_loss_fraction = 24;
|
||||
|
||||
// The fraction of audio packets lost over the duration of the call as
|
||||
// measured by the remote endpoint in the call (either the peer of the client
|
||||
// submitting the survey in a direct call or the SFU in a group call)
|
||||
optional float packet_loss_fraction_send = 21;
|
||||
optional float audio_send_packet_loss_fraction = 25;
|
||||
|
||||
// The fraction of video packets lost over the duration of the call as
|
||||
// measured by the remote endpoint in the call (either the peer of the client
|
||||
// submitting the survey in a direct call or the SFU in a group call)
|
||||
optional float video_send_packet_loss_fraction = 26;
|
||||
|
||||
// Technical, machine-generated data about the quality and mechanics of a
|
||||
// call; this is a serialized protobuf entity generated (and, critically,
|
||||
// explained to the user!) by the calling library
|
||||
optional bytes call_telemetry = 22;
|
||||
optional bytes call_telemetry = 27;
|
||||
}
|
||||
@@ -59,34 +59,58 @@ message SubmitCallQualitySurveyRequest {
|
||||
|
||||
// The median round-trip time, measured in milliseconds, for STUN/ICE packets
|
||||
// (i.e. connection maintenance and establishment)
|
||||
optional float rtt_median_connection = 10;
|
||||
optional float connection_rtt_median = 10;
|
||||
|
||||
// The median round-trip time, measured in milliseconds, for RTP/RTCP packets
|
||||
// (i.e. call audio/video)
|
||||
optional float rtt_median_media = 11;
|
||||
// for audio streams
|
||||
optional float audio_rtt_median = 11;
|
||||
|
||||
// The median jitter, measured in milliseconds, for the duration of the call
|
||||
// as measured by the client submitting the survey
|
||||
optional float jitter_median_recv = 12;
|
||||
// The median round-trip time, measured in milliseconds, for RTP/RTCP packets
|
||||
// for video streams
|
||||
optional float video_rtt_median = 12;
|
||||
|
||||
// The median jitter, measured in milliseconds, for the duration of the call
|
||||
// as measured by the remote endpoint in the call (either the peer of the
|
||||
// client submitting the survey in a direct call or the SFU in a group call)
|
||||
optional float jitter_median_send = 13;
|
||||
// The median jitter for audio streams, measured in milliseconds, for the
|
||||
// duration of the call as measured by the client submitting the survey
|
||||
optional float audio_recv_jitter_median = 13;
|
||||
|
||||
// The fraction of all packets lost over the duration of the call as measured
|
||||
// by the client submitting the survey
|
||||
optional float packet_loss_fraction_recv = 14;
|
||||
// The median jitter for video streams, measured in milliseconds, for the
|
||||
// duration of the call as measured by the client submitting the survey
|
||||
optional float video_recv_jitter_median = 14;
|
||||
|
||||
// The fraction of all packets lost over the duration of the call as measured
|
||||
// by the remote endpoint in the call (either the peer of the client
|
||||
// The median jitter for audio streams, measured in milliseconds, for the
|
||||
// duration of the call as measured by the remote endpoint in the call (either
|
||||
// the peer of the client submitting the survey in a direct call or the SFU in
|
||||
// a group call)
|
||||
optional float audio_send_jitter_median = 15;
|
||||
|
||||
// The median jitter for video streams, measured in milliseconds, for the
|
||||
// duration of the call as measured by the remote endpoint in the call (either
|
||||
// the peer of the client submitting the survey in a direct call or the SFU in
|
||||
// a group call)
|
||||
optional float video_send_jitter_median = 16;
|
||||
|
||||
// The fraction of audio packets lost over the duration of the call as
|
||||
// measured by the client submitting the survey
|
||||
optional float audio_recv_packet_loss_fraction = 17;
|
||||
|
||||
// The fraction of video packets lost over the duration of the call as
|
||||
// measured by the client submitting the survey
|
||||
optional float video_recv_packet_loss_fraction = 18;
|
||||
|
||||
// The fraction of audio packets lost over the duration of the call as
|
||||
// measured by the remote endpoint in the call (either the peer of the client
|
||||
// submitting the survey in a direct call or the SFU in a group call)
|
||||
optional float packet_loss_fraction_send = 15;
|
||||
optional float audio_send_packet_loss_fraction = 19;
|
||||
|
||||
// The fraction of video packets lost over the duration of the call as
|
||||
// measured by the remote endpoint in the call (either the peer of the client
|
||||
// submitting the survey in a direct call or the SFU in a group call)
|
||||
optional float video_send_packet_loss_fraction = 20;
|
||||
|
||||
// Machine-generated telemetry from the call; this is a serialized protobuf
|
||||
// entity generated (and, critically, explained to the user!) by the calling
|
||||
// library
|
||||
optional bytes call_telemetry = 16;
|
||||
optional bytes call_telemetry = 21;
|
||||
}
|
||||
|
||||
message SubmitCallQualitySurveyResponse {
|
||||
|
||||
+33
-18
@@ -62,12 +62,17 @@ class CallQualitySurveyManagerTest {
|
||||
|
||||
final byte[] telemetryBytes = TestRandomUtil.nextBytes(32);
|
||||
|
||||
final float rttMedianConnection = ThreadLocalRandom.current().nextFloat();
|
||||
final float rttMedianMedia = ThreadLocalRandom.current().nextFloat();
|
||||
final float jitterMedianRecv = ThreadLocalRandom.current().nextFloat();
|
||||
final float jitterMedianSend = ThreadLocalRandom.current().nextFloat();
|
||||
final float packetLossFractionRecv = ThreadLocalRandom.current().nextFloat();
|
||||
final float packetLossFractionSend = ThreadLocalRandom.current().nextFloat();
|
||||
final float connectionRttMedian = ThreadLocalRandom.current().nextFloat();
|
||||
final float audioRttMedian = ThreadLocalRandom.current().nextFloat();
|
||||
final float videoRttMedian = ThreadLocalRandom.current().nextFloat();
|
||||
final float audioRecvJitterMedian = ThreadLocalRandom.current().nextFloat();
|
||||
final float videoRecvJitterMedian = ThreadLocalRandom.current().nextFloat();
|
||||
final float audioSendJitterMedian = ThreadLocalRandom.current().nextFloat();
|
||||
final float videoSendJitterMedian = ThreadLocalRandom.current().nextFloat();
|
||||
final float audioRecvPacketLossFraction = ThreadLocalRandom.current().nextFloat();
|
||||
final float videoRecvPacketLossFraction = ThreadLocalRandom.current().nextFloat();
|
||||
final float audioSendPacketLossFraction = ThreadLocalRandom.current().nextFloat();
|
||||
final float videoSendPacketLossFraction = ThreadLocalRandom.current().nextFloat();
|
||||
|
||||
when(asnInfoProvider.lookup(REMOTE_ADDRESS)).thenReturn(Optional.of(new AsnInfo(asn, asnRegion)));
|
||||
|
||||
@@ -82,12 +87,17 @@ class CallQualitySurveyManagerTest {
|
||||
.setCallType("direct_video")
|
||||
.setSuccess(true)
|
||||
.setCallEndReason("caller_hang_up")
|
||||
.setRttMedianConnection(rttMedianConnection)
|
||||
.setRttMedianMedia(rttMedianMedia)
|
||||
.setJitterMedianRecv(jitterMedianRecv)
|
||||
.setJitterMedianSend(jitterMedianSend)
|
||||
.setPacketLossFractionRecv(packetLossFractionRecv)
|
||||
.setPacketLossFractionSend(packetLossFractionSend)
|
||||
.setConnectionRttMedian(connectionRttMedian)
|
||||
.setAudioRttMedian(audioRttMedian)
|
||||
.setVideoRttMedian(videoRttMedian)
|
||||
.setAudioRecvJitterMedian(audioRecvJitterMedian)
|
||||
.setVideoRecvJitterMedian(videoRecvJitterMedian)
|
||||
.setAudioSendJitterMedian(audioSendJitterMedian)
|
||||
.setVideoSendJitterMedian(videoSendJitterMedian)
|
||||
.setAudioRecvPacketLossFraction(audioRecvPacketLossFraction)
|
||||
.setVideoRecvPacketLossFraction(videoRecvPacketLossFraction)
|
||||
.setAudioSendPacketLossFraction(audioSendPacketLossFraction)
|
||||
.setVideoSendPacketLossFraction(videoSendPacketLossFraction)
|
||||
.setCallTelemetry(ByteString.copyFrom(telemetryBytes))
|
||||
.build();
|
||||
|
||||
@@ -117,12 +127,17 @@ class CallQualitySurveyManagerTest {
|
||||
assertEquals("direct_video", callQualitySurveyResponsePubSubMessage.getCallType());
|
||||
assertTrue(callQualitySurveyResponsePubSubMessage.getSuccess());
|
||||
assertEquals("caller_hang_up", callQualitySurveyResponsePubSubMessage.getCallEndReason());
|
||||
assertEquals(rttMedianConnection, callQualitySurveyResponsePubSubMessage.getRttMedianConnection());
|
||||
assertEquals(rttMedianMedia, callQualitySurveyResponsePubSubMessage.getRttMedianMedia());
|
||||
assertEquals(jitterMedianRecv, callQualitySurveyResponsePubSubMessage.getJitterMedianRecv());
|
||||
assertEquals(jitterMedianSend, callQualitySurveyResponsePubSubMessage.getJitterMedianSend());
|
||||
assertEquals(packetLossFractionRecv, callQualitySurveyResponsePubSubMessage.getPacketLossFractionRecv());
|
||||
assertEquals(packetLossFractionSend, callQualitySurveyResponsePubSubMessage.getPacketLossFractionSend());
|
||||
assertEquals(connectionRttMedian, callQualitySurveyResponsePubSubMessage.getConnectionRttMedian());
|
||||
assertEquals(audioRttMedian, callQualitySurveyResponsePubSubMessage.getAudioRttMedian());
|
||||
assertEquals(videoRttMedian, callQualitySurveyResponsePubSubMessage.getVideoRttMedian());
|
||||
assertEquals(audioRecvJitterMedian, callQualitySurveyResponsePubSubMessage.getAudioRecvJitterMedian());
|
||||
assertEquals(videoRecvJitterMedian, callQualitySurveyResponsePubSubMessage.getVideoRecvJitterMedian());
|
||||
assertEquals(audioSendJitterMedian, callQualitySurveyResponsePubSubMessage.getAudioSendJitterMedian());
|
||||
assertEquals(videoSendJitterMedian, callQualitySurveyResponsePubSubMessage.getVideoSendJitterMedian());
|
||||
assertEquals(audioRecvPacketLossFraction, callQualitySurveyResponsePubSubMessage.getAudioRecvPacketLossFraction());
|
||||
assertEquals(videoRecvPacketLossFraction, callQualitySurveyResponsePubSubMessage.getVideoRecvPacketLossFraction());
|
||||
assertEquals(audioSendPacketLossFraction, callQualitySurveyResponsePubSubMessage.getAudioSendPacketLossFraction());
|
||||
assertEquals(videoSendPacketLossFraction, callQualitySurveyResponsePubSubMessage.getVideoSendPacketLossFraction());
|
||||
assertArrayEquals(telemetryBytes, callQualitySurveyResponsePubSubMessage.getCallTelemetry().toByteArray());
|
||||
}
|
||||
}
|
||||
+1
-1
Submodule spam-filter updated: 41d2a7912d...e5ff57120e.
Reference in new issue
Block a user