Skip to content
kemeterPublic

Repository files navigation

Sōzune

Sōzune (pronounce Sozuné) is a modern reverse proxy built on Sōzu. It discovers your services across Docker, Podman, Swarm, Kubernetes, Nomad, Consul, Ring, an HTTP endpoint, or a YAML file, manages Let's Encrypt certificates automatically, and applies your changes without restarting.

Sōzune dashboard

Features

  • Multi-platform service discovery — Docker, Podman, Swarm, Kubernetes (Ingress + Gateway API), Nomad, Consul, Ring, an HTTP endpoint, or a YAML file.
  • Automatic HTTPS — ACME (Let's Encrypt) provisioning and renewal, no intervention. HTTP-01, TLS-ALPN-01 and DNS-01 (Cloudflare, OVH, Gandi, Scaleway, deSEC, DigitalOcean, Hetzner, Infomaniak, Porkbun, RFC 2136), including wildcard certificates.
  • HTTP/2 — negotiated through ALPN on every TLS listener.
  • Hot reload — REST API applies changes on the fly, no downtime.
  • Wildcard & regex hostnames — *.example.com, /cdn[0-9]+/.example.com.
  • Multi-protocol — HTTP, HTTPS, WebSocket, raw TCP (with SNI-based TLS passthrough) and UDP.

Quick start

# compose.yaml
services:
  sozune:
    image: ghcr.io/kemeter/sozune:latest
    ports:
      - "80:80"
      - "443:443"
    group_add:
      - "${DOCKER_GID:?export DOCKER_GID=$(stat -c %g /var/run/docker.sock)}"
    environment:
      CONFIG_PATH: /etc/sozune/config.yaml
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./config.yaml:/etc/sozune/config.yaml

  whoami:
    image: traefik/whoami
    labels:
      - "sozune.enable=true"
      - "sozune.http.whoami.host=whoami.localhost"
# config.yaml
providers:
  docker:
    enabled: true

api: {}

proxy:
  http:
    listen_address: 80
  https:
    listen_address: 443
export DOCKER_GID=$(stat -c %g /var/run/docker.sock)
docker compose up -d
curl -H "Host: whoami.localhost" http://localhost

The image runs as a non-root user: group_add lets it open the Docker socket, and CONFIG_PATH points it at the mounted file. See Installation.

Documentation

Architecture

┌─────────────────┐       ┌─────────────────┐
│   Docker API    │ ────▶ │     Sōzune      │
│   (events)      │       │  (discovery)    │
└─────────────────┘       └─────────────────┘
                           ▲       │
┌─────────────────┐        │       │
│   Config file   │ ───────┘       │
│  (entrypoints)  │                │
└─────────────────┘                ▼
                           ┌─────────────────┐       ┌─────────────────┐
                           │     Storage     │ ────▶ │      Proxy      │
                           │  (entrypoints)  │       │     (Sōzu)      │
                           └─────────────────┘       └─────────────────┘
                                    │
                                    ▼
                           ┌─────────────────┐
                           │    REST API     │
                           │  (monitoring)   │
                           └─────────────────┘

Default ports

Port Service
80 HTTP proxy
443 HTTPS proxy
3035 REST API (loopback)
3036 ACME HTTP-01 challenge (loopback)
3037 Internal middleware proxy (loopback)
3038 Dashboard (loopback)
3039 Dedicated /metrics listener (loopback)
3040 ACME TLS-ALPN-01 responder (loopback)

Contributing

Pull requests welcome. The test suites:

  • cargo test --bin sozune: unit tests.
  • bash tests/e2e/run-all.sh: end-to-end tests against Docker containers (E2E_HTTP_PORT, E2E_HTTPS_PORT and E2E_API_PORT move its ports).
  • cd dashboard && bun run test:e2e: the dashboard's functional tests with Playwright, against a Sōzune it builds and starts (bunx playwright install chromium first).

License

MIT — see LICENSE.md.

Releases

Packages

Used by

Contributors

Languages