Even in the main
branch, resources from this repository are unstable in order to facilitate development.
During development, several features will be disabled or insecurely implemented.
Do not run this in production environments.
Flatline Server is a server prototype to which Signal-compatible clients can connect.
It relies on various components forked from their original Signal repositories.
The Flatline server is composed of multiple services organized in separate directories.
- Whisper Service
- Directory: whisper-service
- Upstream: https://github.com/signalapp/Signal-Server
- Storage Service
- Directory: storage-service
- Upstream: https://github.com/signalapp/storage-service
- Registration Service
- Directory: registration-service
- Upstream: https://github.com/signalapp/registration-service
- Contact Discovery Service
- Directory: contact-discovery-service
- Upstream: https://github.com/signalapp/ContactDiscoveryService-Icelake
Additionally, the Flatline server relies on several other infrastructure components.
Testing and building this project relies on Docker.
This project is intended to be built with the Temurin 21 JDK.
For the following commands to succeed, ensure that JAVA_HOME
points to a valid Temurin 21 JDK installation.
Requires a FoundationDB client.
./mvnw -f whisper-service/pom.xml clean verify -e \
-pl '!integration-tests' -Dsurefire.failIfNoSpecifiedTests=false -Dtest=\
\!org.whispersystems.textsecuregcm.controllers.VerificationControllerTest,\
\!org.whispersystems.textsecuregcm.controllers.SubscriptionControllerTest,\
\!org.whispersystems.textsecuregcm.registration.IdentityTokenCallCredentialsTest
Integration tests are excluded as they require an existing environment in which to run.
Tests for features that are disabled for the prototype are be excluded.
./mvnw -f storage-service/pom.xml clean test
./mvnw -f registration-service/pom.xml clean test
To test C dependencies:
make -C contact-discovery-service/c docker_tests
make -C contact-discovery-service/c docker_valgrinds
To run minimal tests without Intel SGX:
./mvnw -f contact-discovery-service/pom.xml verify -Dtest=\
\!org.signal.cdsi.enclave.**,\
\!org.signal.cdsi.IntegrationTest,\
\!org.signal.cdsi.JsonMapperInjectionIntegrationTest,\
\!org.signal.cdsi.limits.redis.RedisLeakyBucketRateLimiterIntegrationTest,\
\!org.signal.cdsi.util.ByteSizeValidatorTest
To run all tests with Intel SGX:
# Set up Intel SGX on Ubuntu 22.04.
sudo ./contact-discovery-service/c/docker/sgx_runtime_libraries.sh
./mvnw -f contact-discovery-service/pom.xml verify
In addition to the JAR artifacts, this stage will build and locally store container images with Jib.
./mvnw -f whisper-service/pom.xml clean deploy \
-Pexclude-spam-filter -Denv=dev -DskipTests \
-Djib.to.image="flatline-whisper-service:dev"
./mvnw -f storage-service/pom.xml clean package \
-Pdocker-deploy -Denv=dev -DskipTests \
-Djib.to.image="flatline-storage-service:dev"
The env
property is used as a prefix to fetch the relevant configuration files from storage-service/config
.
./mvnw -f registration-service/pom.xml clean package \
-Denv=dev -DskipTests \
-Djib.to.image="flatline-registration-service:dev"
As configured for this prototype, the verification code is always the last six digits of the phone number.
./mvnw -f contact-discovery-service/pom.xml package \
-Dpackaging=docker -DskipTests \
-Djib.to.image="flatline-contact-discovery-service:dev"
The dev/compose.yaml
file will use Docker to deploy the container images built from the main
branch.
docker compose -f dev/compose.yaml up
When building the container images locally, edit the compose file to reference those images instead.