#!/bin/sh # Start Warp the way Complement needs it. # # There is no configuration file: every setting Warp has can come from a # WARP_* environment variable, so the whole deployment is the few lines # below. Complement may run this entrypoint more than once against the same # container, so everything here is idempotent. set -eu DATA_DIR="${WARP_DATA_DIR:-/data}" mkdir -p "$DATA_DIR" # Complement names the homeservers hs1, hs2, ... and passes the name in. export WARP_SERVER_NAME="${SERVER_NAME:-hs1}" export WARP_PRIVATE_KEY="$DATA_DIR/signing.key" export WARP_DB_DRIVER=sqlite export WARP_DB_CONNECTION_STRING="file:$DATA_DIR/warp.db?_pragma=journal_mode(WAL)&_pragma=busy_timeout(10000)&_pragma=foreign_keys(1)" export WARP_DB_AUTO_MIGRATE=true export WARP_LISTEN_ADDRESS=":8008" # The suite registers and logs in constantly, all from the one address the # test runner has. Rate limiting would turn that into a wall of # M_LIMIT_EXCEEDED and tell us nothing about the server. Synapse's own # Complement image does the same. export WARP_RATE_LIMIT_ENABLED=false # Open registration: the tests create their own users. export WARP_REGISTRATION_ENABLED=true # Federation stays off unless the profile asks for it. Phase 5 adds the # TLS listener on 8448 that the federation profile needs; until then this # image only serves the Client-Server API. export WARP_FEDERATION_ENABLED="${WARP_FEDERATION_ENABLED:-false}" # Complement captures the container's output, so text at debug level is the # most useful thing to have when a test fails. export WARP_LOG_LEVEL="${WARP_LOG_LEVEL:-debug}" export WARP_LOG_FORMAT="${WARP_LOG_FORMAT:-text}" if [ ! -f "$WARP_PRIVATE_KEY" ]; then warp generate-keys --output "$WARP_PRIVATE_KEY" fi # Migrations also run on boot, but doing them here keeps a schema failure # out of the request path and makes it obvious in the container log. warp migrate exec warp serve