Skip to content

mollyim/flatline-server

Repository files navigation

🚧 Work in Progress 🚧

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

Flatline Server is a server prototype to which Signal-compatible clients can connect.

It relies on various components forked from their original Signal repositories.

Components

The Flatline server is composed of multiple services organized in separate directories.

Additionally, the Flatline server relies on several other infrastructure components.

Development

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.

Testing

Whisper Service

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.

Storage Service

./mvnw -f storage-service/pom.xml clean test

Registration Service

./mvnw -f registration-service/pom.xml clean test

Contact Discovery Service

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

Building

In addition to the JAR artifacts, this stage will build and locally store container images with Jib.

Whisper Service

./mvnw -f whisper-service/pom.xml clean deploy \
  -Pexclude-spam-filter -Denv=dev -DskipTests \
  -Djib.to.image="flatline-whisper-service:dev"

Storage Service

./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.

Registration Service

./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.

Contact Discovery Service

./mvnw -f contact-discovery-service/pom.xml package \
  -Dpackaging=docker -DskipTests \
  -Djib.to.image="flatline-contact-discovery-service:dev"

Running

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.

About

Server prototype for hosting a private Signal network.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages