0.37.0
This commit is contained in:
1 parent
ad0ff60632
commit
6b59434ffa
60 files changed
+7418
-732
No files matched your search
@@ -4,7 +4,7 @@ RustProxy discovers published Docker services through a **separate read-only Doc
|
||||
|
||||
## Set up a Docker host
|
||||
|
||||
Install the **optional Docker agent on each Linux Docker host**, not on the RustProxy server. It is distributed as a separate `rustproxy-docker-agent` DEB/RPM package and is **not built as FreeBSD `pkg`**. Docker Engine, systemd and access to `/var/run/docker.sock` are required at runtime.
|
||||
Install the **optional Docker agent on each Linux Docker host**, not on the RustProxy server. It is distributed as a separate `rustproxy-docker-agent` DEB/RPM package and is **not built as FreeBSD `pkg`**. Docker Engine **or Podman**, systemd and access to the container API socket (`/var/run/docker.sock`, `/run/podman/podman.sock` or a rootless `$XDG_RUNTIME_DIR/podman/podman.sock`) are required at runtime. The agent detects the socket automatically (`RUSTPROXY_DOCKER_SOCKET=auto`); see [docker-agent/README.md](../docker-agent/README.md#podman) for Podman socket permissions.
|
||||
|
||||
### Option A: prebuilt DEB/RPM (recommended)
|
||||
|
||||
@@ -39,8 +39,66 @@ Go 1.22+ is required only for the manual build, not for a DEB/RPM installation.
|
||||
### Connect to RustProxy
|
||||
|
||||
1. Allow port `9876` **only from the RustProxy server** in the Docker-host firewall. The default example listens on `0.0.0.0:9876`.
|
||||
2. In **Settings → Docker agents**, create an agent with an endpoint such as `https://10.10.0.21:9876`, its Bearer token and certificate SHA-256 fingerprint, base domain, selected listener IDs, and optional certificate/ACL/default backend IP.
|
||||
3. Use **Docker vhosts → Refresh agents** and check that discovery succeeds before publishing.
|
||||
2. On the Docker host run `sudo rustproxy-docker-agent provision-code` (agent 1.1.0+). It prints one `RPDA1-…` code with the HTTPS endpoint, the Bearer token and the certificate SHA-256 fingerprint. The code **contains the secret token**; paste it only into the panel. Use `--endpoint-host` to put a different host/IP in the code.
|
||||
3. In **Settings → Docker agents** press **Paste provisioning code** (or open **Provisioning code** in an existing agent to update a rotated token) and paste it. The panel fills in the name, the agent ID (generated from the name like Vhost IDs, editable until saved), endpoint, token and fingerprint. Older agents: enter endpoint, token and fingerprint manually.
|
||||
4. Assign **Domains** (at least one; the first, marked ★, is the master domain for new Docker vhosts — click ★ on another domain to make it the master), choose **Certificates** (*Automatic* or a list of certificates), the listener IDs and optional ACL profiles and **Default backend IP**, then save.
|
||||
5. Use **Docker vhosts → Refresh agents** and check that discovery succeeds before publishing.
|
||||
|
||||
### Domains
|
||||
|
||||
An agent has a list of DNS suffixes (`domains`, up to 16), picked in the same searchable multi-select as ACL profiles; type a new domain in the search box and press Enter to add it. Suggestions come from other agents and from wildcard certificates. Every published Docker vhost selects its **master domain** from this list (default: the first domain), so a newly published service is reachable immediately as `<container-name>.<master domain>`. **Aliases** may be short labels (expanded below the master domain, or below another agent domain chosen next to the alias input) or full names, which the panel only accepts inside one of the agent domains. Configurations from before 0.37.0 with a single `base_domain` are migrated to `domains: [base_domain]` on the next save; nothing else changes.
|
||||
|
||||
### Certificates
|
||||
|
||||
- **Automatic** (no certificate selected, the default): generated vhosts behave like a Vhost left on *Global SNI / default certificate* — every requested name gets the stored certificate whose SNI/SAN names cover it.
|
||||
- **Selected certificates**: each generated vhost uses the selected certificate covering **all** its names (exact names beat wildcards, then the narrowest certificate). If none covers them, it falls back to the generic SNI/default certificate, so each name can still be served by the matching stored certificate. The per-service editor shows which certificate will be used. *Accept certificate/domain mismatch* forces the first selected certificate when none covers the names.
|
||||
|
||||
A previously selected single `certificate_id` is migrated to `certificate_ids: [certificate_id]`.
|
||||
|
||||
### Default backend IP
|
||||
|
||||
The agent default backend IP is chosen from the **addresses the agent detected** (interface, scope and source are shown) or entered as **Custom address…**. *Automatic* keeps the per-service choice (bind address, primary IP, detected addresses). The list fills after the first successful poll.
|
||||
|
||||
### Host diagnostics
|
||||
|
||||
Agents 1.1.0+ report host data when RustProxy 0.37.0+ asks for it: OS and kernel, architecture, Docker/Podman runtime and version, uptime, load average, CPU usage, memory, swap, disk usage of the container data directory, host network totals and current rates (container/virtual interfaces excluded) and running/total container and image counts. They are shown in **Docker vhosts → Agent details → Host system** and in a compact strip in **Settings → Docker agents**. Values an agent does not send are not shown; older agents show none. Disable reporting on the agent with `RUSTPROXY_DOCKER_SYSTEM_INFO=false`.
|
||||
|
||||
### Alerts
|
||||
|
||||
RustProxy turns agent and host problems into ordinary alerts, using only the latest agent poll (nothing is kept over time): an **agent that could not be reached at the last check** (severity error), **disk** or **memory** use at or above the threshold (default 90% / 95%), **load per CPU** (the host's own 5-minute load average divided by logical CPUs) at or above the threshold (default 2.0), a **published service that disappeared from the inventory**, a published **container that is unhealthy, restarting, exited or dead**, and **container labels** that could not be published. Alerts appear as a **Docker** entry in the application status in the sidebar (amber for warnings, red for errors), as a notification when a new alert appears, as a list at the top of **Docker vhosts**, as `Docker alert raised` / `Docker alert cleared` log lines and as Prometheus `rust_proxy_docker_alert{agent,kind,severity,service}`. Configure them under **Settings → Docker agents → Alerts**; switching alerts off removes them everywhere. For alerts over longer periods use Prometheus/Grafana with the `rust_proxy_docker_*` metrics.
|
||||
|
||||
### Publishing from container labels
|
||||
|
||||
Enable **Publish from container labels** on an agent to publish containers that carry `rustproxy.enable=true` without opening the panel:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
shop:
|
||||
image: nginx
|
||||
ports: ["18080:80"]
|
||||
labels:
|
||||
rustproxy.enable: "true"
|
||||
rustproxy.host: shop # label or full name inside the agent domains
|
||||
rustproxy.domain: example.org # master domain, one of the agent domains
|
||||
rustproxy.aliases: www,shop.lab.example.com
|
||||
rustproxy.scheme: http # or https
|
||||
rustproxy.port: "80" # container port to publish when several are exposed
|
||||
rustproxy.force_ssl: "true"
|
||||
```
|
||||
|
||||
Also supported: `rustproxy.websockets`, `rustproxy.cache`, `rustproxy.compression` and `rustproxy.preserve_host` (`true`/`false`). Labels never leave the agent domains, never take a name already used by a vhost, redirect, 404 host or another Docker service and never override a manual setting for the same service. Invalid labels produce a **LABEL ERROR** badge and an alert instead of a vhost. Label publications use the agent defaults (listeners, certificates, ACL profiles, default backend IP). To customise one, open it and press **Apply changes** (it becomes a manual setting); switching **Publish** off stores a disabled manual override. Labels are read only from agents 1.1.0+. The option is off by default because anyone who can start containers on that host can then publish names inside the agent domains.
|
||||
|
||||
### Container state and history
|
||||
|
||||
Agents 1.1.0+ report per published container its state and health check, CPU usage, memory (without page cache) with its limit and restart count; the service row shows them and Prometheus exports `rust_proxy_docker_container_*`. Containers whose image defines no `HEALTHCHECK` are shown as *no health check* (`health: "none"`) and are judged only by their state (running is fine; restarting, exited or dead raise an alert). The small CPU, memory, load and network charts in **Agent details** are sampled in the browser from the agent polls while the page is open, like the other panel charts; RustProxy does not store history.
|
||||
|
||||
### Test connection and one-time codes
|
||||
|
||||
**Test connection** in each agent runs one inventory request with the values in the form, before saving. `sudo rustproxy-docker-agent provision-code` prints a **one-time code** by default: it holds the endpoint, the certificate pin and a single-use enrollment secret valid for 15 minutes (`--ttl 1h` to change), not the token. When you paste it, RustProxy connects to the agent over the pinned HTTPS connection, redeems the secret and fills in the permanent token; the code cannot be used again. The agent service must be running. `provision-code --static` prints the previous reusable code that contains the token (also needed for plain-HTTP agents).
|
||||
|
||||
### Overview cards
|
||||
|
||||
Six optional Overview cards (hidden by default; enable them in the Overview layout editor or **Settings → Appearance → Dashboard layout**): **Docker agents** (connected/enabled), **Docker apps** (published vhosts with a healthy backend, down, checking, missing and discovered services), **Docker app requests** (request rate across all Docker vhosts with a chart), **Docker hosts network** (combined host RX/TX rate with a chart), **Docker hosts load** (CPU/memory bars and load per host) and **Containers** (running/total, images, Docker/Podman host count). They read the compact `docker` object in `/api/status` and the live view. Every card exists four times (*Docker hosts load*, *Docker hosts load #2* … *#4*, likewise for the others), so you can place the same card once per agent next to each other. With two or more agents each card has an agent selector — **All agents** or a single agent — so you can monitor agents separately or together. The selector is shown in the card and next to the card in the hidden-cards list of the layout editors, so the agent can be chosen when the card is added. The choice is stored per administrator (`docker_widget_agents` in `/api/preferences`); a card whose agent was removed falls back to all agents.
|
||||
|
||||
The self-signed certificate is persistent. RustProxy pins its exact fingerprint; if replaced, update the pin. A trusted CA-issued certificate can use normal CA and hostname verification instead. Plain HTTP is available only by explicit opt-out and exposes the token in transit.
|
||||
|
||||
@@ -70,16 +128,16 @@ In **Docker vhosts**, select the service and set:
|
||||
|
||||
| Option | Guidance |
|
||||
|---|---|
|
||||
| **Hostname / aliases** | By default, the sanitized Docker container name expands under the agent base domain, without an image or port suffix. A custom short name or full FQDN overrides it, and aliases remain configurable. Containers exposing multiple published TCP ports require distinct manually assigned hostnames to publish both ports. Configure public DNS separately. |
|
||||
| **Hostname / master domain / aliases** | By default, the sanitized Docker container name expands under the selected master domain (one of the agent domains), without an image or port suffix. A custom short name or a full name inside the agent domains overrides it; aliases may use any agent domain. Containers exposing multiple published TCP ports require distinct manually assigned hostnames to publish both ports. Configure public DNS separately. |
|
||||
| **Backend IP/port** | Pick a detected, reachable Docker-host address or the configured automatic option. Docker host/firewall binding must permit RustProxy to connect. |
|
||||
| **HTTP / HTTPS upstream** | Match the container's actual service protocol; review origin TLS verification and Host behavior. |
|
||||
| **Frontend listeners / certificate** | Selected through the agent defaults and RustProxy configuration; ensure certificate covers the generated name. |
|
||||
| **Frontend listeners / certificate** | Selected through the agent defaults: automatic SNI or the agent's certificate list (see [Certificates](#certificates)); the editor shows the certificate that will be used. |
|
||||
| **Frontend protocols** | HTTP/1.1 is always available. Enable/disable HTTP/2 and HTTP/3 independently per Docker vhost (both enabled by default). H2/H3 require corresponding frontend listener support; switching them does not change the selected HTTP/HTTPS backend scheme. H3 disabled also removes its advertisement. |
|
||||
| **Force HTTPS / WebSockets** | Enable only when needed and when the right frontend listeners exist. |
|
||||
| **Cache / compression / transforms** | Optional; obey the global limits and privacy policy of the application. |
|
||||
| **Health / ACL / timeouts** | Select up to eight reusable ACL profiles per app or inherit the agent's defaults. A searchable multi-select previews the profile ID, default action, IP rules and country filters; selected profiles appear as removable badges. Optional inline ACL remains independently enforced. Explicit denies and country blocks beat merged allows. Test allowed and blocked clients. |
|
||||
|
||||
To deliberately assign a domain not covered by the agent's **named frontend certificate**, enable **Accept certificate/domain mismatch** immediately below **Backend host IP** in the per-service editor and confirm the risk. This records `allow_certificate_mismatch: true` on that publication only. Without consent, the server rejects the incompatible mapping. The client browser may still reject the TLS handshake; a matching SAN certificate is strongly preferred. The agent's own outbound TLS fingerprint validation is unaffected.
|
||||
To deliberately assign a domain not covered by any of the agent's **selected certificates**, enable **Accept certificate/domain mismatch** immediately below **Backend host IP** in the per-service editor and confirm the risk. This records `allow_certificate_mismatch: true` on that publication only. Without consent, the server rejects the incompatible mapping. The client browser may still reject the TLS handshake; a matching SAN certificate is strongly preferred. The agent's own outbound TLS fingerprint validation is unaffected.
|
||||
|
||||
Use the per-service **Publish** on/off switch to expose or remove the generated Vhost; toggling it saves immediately. Test the resulting hostname with **Open app**. Edits to an already published service use its own **Apply changes** action; switching Publish off removes the proxy publication but does not stop the Docker container. Hidden rows in the page are only a browser view preference, not a security policy.
|
||||
|
||||
@@ -102,7 +160,9 @@ The Docker request-rate chart uses the **same adaptive Y range as ordinary Vhost
|
||||
- **WAITING:** first poll not yet observed; refresh and inspect the agent endpoint.
|
||||
- **Agent error:** verify firewall, TLS fingerprint/CA, bearer token, service state, advertised host and TCP route.
|
||||
- **503 generated Vhost:** verify running container, published TCP port, selected IP/bind address, backend protocol and health check.
|
||||
- **Wrong application hostname:** check base-domain expansion, aliases, DNS and conflicting ordinary Vhosts.
|
||||
- **Wrong application hostname:** check the master domain, alias expansion, DNS and conflicting ordinary Vhosts.
|
||||
- **Invalid provisioning code:** copy the whole `RPDA1-…` line; codes from agents older than 1.1.0 do not exist — enter the values manually.
|
||||
- **No host diagnostics:** the agent is older than 1.1.0, `RUSTPROXY_DOCKER_SYSTEM_INFO=false` is set, or the value cannot be read on that host.
|
||||
- **Docker service not listed:** agent reports only eligible running containers with published non-loopback TCP bindings.
|
||||
|
||||
For agent operations and its security model see `docker-agent/README.md`. For normal routing, health and cache controls see [Vhosts](VHOSTS.md) and [Cache](CACHE.md).
|
||||
Reference in new issue
Block a user