proxy

package module
v0.0.0-...-36c2ded Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package proxy is Keel's Caddy plugin, compiled into the keel-proxy image next to caddy-l4 (Dockerfile). Convex owns the configuration and pushes all of it through the admin API (packages/backend/convex/proxy.ts); this package adds what stock Caddy lacks for that:

  • networks `host-tcp` and `host-udp`: listeners in the host's network namespace (hostns.go)
  • GET /keel/host-addrs: the host addresses to bind, so Convex can write the listen lists
  • GET /keel/certs?name=…: what the proxy knows about each hostname's certificate
  • event handler `keel`: reports cert_obtained / cert_failed to Convex as they happen

See docs/networking.md.

Index

Constants

View Source
const HostNetNS = "/run/hostns/net"

The proxy runs in a container on the Swarm overlay, so it reaches `svc-<id>:<port>` by overlay DNS, but its public listeners live in the host's network namespace: a Docker port mapping is fixed when the container is created, while a socket opened in the host namespace is not, so Convex adds a TCP or UDP port through the admin API without restarting anything. Needs CAP_SYS_ADMIN (setns) and the host's namespace file mounted at HostNetNS (deploy/compose.yml).

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct{}

Admin serves Keel's routes on the admin endpoint (a unix socket only Convex can reach).

func (Admin) CaddyModule

func (Admin) CaddyModule() caddy.ModuleInfo

func (Admin) Routes

func (Admin) Routes() []caddy.AdminRoute

type Cert

type Cert struct {
	State    string    `json:"state"` // ok | failed | pending
	Error    string    `json:"error,omitempty"`
	NotAfter time.Time `json:"notAfter,omitzero"`
}

Cert is one hostname's certificate as far as this process knows. `pending`: neither a cert nor a failure yet (ACME is working on it, or the name is not managed).

type Reporter

type Reporter struct {
	URL   string `json:"url,omitempty"`
	Token string `json:"token,omitempty"`
	// contains filtered or unexported fields
}

Reporter is the `keel` event handler: Convex subscribes it to cert_obtained and cert_failed so a certificate's outcome reaches the canvas without polling (POST /proxy/events, worker token).

func (Reporter) CaddyModule

func (Reporter) CaddyModule() caddy.ModuleInfo

func (*Reporter) Handle

func (r *Reporter) Handle(_ context.Context, e caddy.Event) error

func (*Reporter) Provision

func (r *Reporter) Provision(ctx caddy.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL