Mesh relay

Operations

Monitor, update, back up, restore and troubleshoot a production Mesh relay container.

Logs and lifecycle

bash
docker logs -f --tail 100 mesh-relay
docker restart mesh-relay
docker inspect mesh-relay

Monitor disk usage for the Docker volume as well as CPU, memory and container restarts. The current image does not define a Docker health check.

Trace message propagation

Check recent events on Azure and on each origin:

bash
docker logs --since 5m --tail 500 mesh-relay 2>&1 | grep '\[relay-envelope\]'

Each event includes its type, messageId (for an envelope), relay addresses from and to, and the hop count. These events do not include full envelopes, signatures or user keys.

  • accepted / stored: client envelope validated / local storage succeeded.
  • sent / received: handed to transport / received by the remote handler.
  • duplicate / send-skipped: envelope already known / outgoing cache suppressed a send.
  • hop-limit: envelope stored or search processed, without further forwarding.
  • rejected, store-failed, send-failed: validation, storage or transport failed.

A UDP sent event does not prove remote receipt: look for the same messageId in the other relay's received and stored events. Client confirmation means local storage, not delivery to the recipient. Searches triggered by an empty poll can be retried after 60 seconds; recovered envelopes become available on a subsequent poll.

Upgrade both Azure and origin relays to enable hop-by-hop forwarding. An old intermediate relay can stop propagation. After upgrading, test new short messages in both directions; existing stored envelopes are not automatically rebroadcast.

Update latest

The latest tag follows the most recent successful image build. Pulling it does not update an already running container; recreate the container while retaining the same /data volume.

With Compose:

bash
docker compose pull relay
docker compose up -d relay
docker image prune

With docker run, pull the image, remove the old container and rerun the complete command from the installation guide with the same volume and arguments:

bash
docker pull ghcr.io/mockingmagician/mesh-relay:latest
docker rm -f mesh-relay

Do not remove mesh-relay-data during an update. Back it up before deploying a new image because storage and protocol formats are still experimental.

Back up the relay

Stop the relay to obtain a consistent snapshot, then archive the named volume into the current directory:

bash
docker stop mesh-relay

docker run --rm \
  -v mesh-relay-data:/data:ro \
  -v "$PWD":/backup \
  alpine \
  tar czf /backup/mesh-relay-backup.tar.gz -C /data .

docker start mesh-relay

Store the archive securely. It contains the relay databases and persistent state.

Restore a backup

Restore only into an empty volume while the relay is stopped:

bash
docker volume create mesh-relay-data

docker run --rm \
  -v mesh-relay-data:/data \
  -v "$PWD":/backup:ro \
  alpine \
  tar xzf /backup/mesh-relay-backup.tar.gz -C /data

Then recreate the relay with the same public host, origins and network.

Firewall

Allow both transports on the chosen external port. For the default port, with UFW:

bash
sudo ufw allow 41234/tcp
sudo ufw allow 41234/udp

Apply equivalent rules in the hosting provider firewall and any upstream router or NAT gateway.

Troubleshooting

The container starts but peers cannot reach it

  • Check that --host is a public IPv4 address or DNS name, without http:// or a path.
  • Confirm that --external-port matches the Docker host port mapped to internal port 41234.
  • Confirm the chosen inbound TCP and UDP port from outside the local network.
  • Check port forwarding if the host is behind NAT.
  • Do not use an IPv6 literal, localhost, 0.0.0.0 or a private LAN address as the advertised host.

The relay does not join the public network

  • Confirm both origins are passed as one comma-separated value.
  • Check outbound connectivity to the origins shown in the startup logs.
  • With automatic discovery, also check HTTPS access to https://mesh-network.org/origins.json. On failure, the relay uses /data/origins-cache.json if valid; otherwise temporarily configure --origins or restore website access. Include this cache in volume backups.

The image does not run

The published image currently targets Linux amd64. An ARM host requires emulation and is not an officially supported deployment.

Disk usage keeps growing

The current runtime does not schedule automatic age-based deletion of message envelopes. Delivered and undelivered encrypted envelopes and their routing metadata may remain in relay.db; monitor the volume and plan capacity accordingly.