diff --git a/scripts/relay/.env.example b/scripts/relay/.env.example index 313446b516..7bfbd89615 100644 --- a/scripts/relay/.env.example +++ b/scripts/relay/.env.example @@ -10,6 +10,9 @@ POSTGRES_PASSWORD=change-me # Ref to build: tag, branch or commit. CHAT_REF=88df79d1e26921c7d1835fc8484fade596356fb6 +# SMP server for the relay address, used when the address is created. +#RELAY_ADDRESS_SERVER=smp://@smp.example.com + # GHC runtime options, without the +RTS/-RTS markers. #RELAY_RTS_OPTS="-N -F1.2 -A16m -I0.01 -Iw15" diff --git a/scripts/relay/docker-compose.yaml b/scripts/relay/docker-compose.yaml index 22648b7726..569d403966 100644 --- a/scripts/relay/docker-compose.yaml +++ b/scripts/relay/docker-compose.yaml @@ -14,6 +14,7 @@ services: environment: RELAY_NAME: ${RELAY_NAME} RELAY_WEB_DOMAIN: ${RELAY_WEB_DOMAIN} + RELAY_ADDRESS_SERVER: ${RELAY_ADDRESS_SERVER:-} # Empty values fall back to the entrypoint defaults. RELAY_RTS_OPTS: ${RELAY_RTS_OPTS:-} RELAY_POOL_SIZE: ${RELAY_POOL_SIZE:-} diff --git a/scripts/relay/entrypoint.py b/scripts/relay/entrypoint.py index f8d715ba36..522e87eb22 100755 --- a/scripts/relay/entrypoint.py +++ b/scripts/relay/entrypoint.py @@ -78,6 +78,11 @@ def main(): common = [BIN, "--relay", "--headless", "--user-display-name", name] + # Only applied when the address is created, which the one-shot below does. + address_server = os.environ.get("RELAY_ADDRESS_SERVER") + if address_server: + common += ["--relay-address-server", address_server] + # The image is applied only when the profile is created. if not os.path.exists(ADDR_FILE): oneshot = common + (["--user-image-file", image_file] if image_file else []) + ["-d", conn]