relay-agent-entity 0.1.0

Enitity definitions for the Relay Mail Agent
Documentation
  • Coverage
  • 71.43%
    55 out of 77 items documented0 out of 6 items with examples
  • Size
  • Source code size: 73.06 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 5s Average build duration of successful builds.
  • all releases: 1m 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • relay-mail/rust/agent
    0 0 5
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • LeviLovie

Agent

A sample Relay Mail Agent.

Install

Write a Docker Compose file which pulls registry.gitlab.com/relay-mail/rust/agent/relay-agent:latest and run it.

Forward all traffic to localhost:2526 with a reverse proxy like NGINX. Make sure to use HTTPS, all connections require it.

Example compose.yml

services:
  db:
    image: postgres:16
    container_name: relay-postgres
    restart: unless-stopped
    environment:
      POSTGRES_USER: relay
      POSTGRES_PASSWORD: relay
      POSTGRES_DB: relay
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U relay -d relay"]
      interval: 5s
      timeout: 5s
      retries: 5

  agent:
    image: registry.gitlab.com/relay-mail/rust/agent/relay-agent:latest
    container_name: relay-agent
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
    environment:
      AGENT_DOMAIN: example.org
      DATABASE_URL: postgres://relay:relay@db/relay
      AGENT_ADDRESS: 0.0.0.0
      AGENT_PORT: 2525
      RUST_LOG: info
    ports:
      - "2525:2525"

volumes:
  pgdata:

Example NGINX server

server {
    listen 2525 ssl;
    listen [::]:2525 ssl;

    server_name _;

    ssl_certificate     /etc/letsencrypt/live/DOMAIN/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/DOMAIN/privkey.pem;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers off;

    location / {
        proxy_pass http://127.0.0.1:2526;
        proxy_http_version 1.1;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
    }
}