This commit is contained in:
Mateusz Gruszczyński committed 2026-11-28 15:54:56 +01:00
1 parent 9a6c21fa04
commit 5b6d4a7903
41 files changed
+3299 -677

No files matched your search

+3 -2
View File
@@ -46,7 +46,7 @@ Go 1.22+ is required only for the manual build, not for a DEB/RPM installation.
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. On the Docker host run `sudo rustproxy-docker-agent provision-code` (agent 0.37.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.
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. Each agent is a collapsible row (state, name and ID, endpoint, transport security, connection status, Enabled); expanded it holds the provisioning code, diagnostics and the sections **Connection**, **Authentication & TLS**, **Domains & certificates** and **Default publishing**, plus **Test connection** and **Remove**.
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.
@@ -156,7 +156,8 @@ In **Docker vhosts**, select the service and set:
| **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. With **Cache** enabled, **Cache for this vhost** sets a default TTL (empty = global default) and the same cache rules editor as an ordinary vhost (templates, VCL import/preview, compact two-section tester, *Ignore global cache rules*). **Cache & VCL guide** opens the shared modal and inserts examples into this Docker vhost's importer, never the global editor. Tests use unsaved service rules plus saved applicable global rules, unless ignored; a path-only test uses the current service hostname as `Host` when no explicit Host is provided. Unpublished service tests may lack saved vhost settings; see [Cache rules](CACHE.md#cache-rules-vcl-style). Stored as `cache_default_ttl_seconds`, `cache_rules` and `cache_ignore_global_rules` on the assignment.
| **Security and access** | Everything an internet-facing app usually needs, without creating an ordinary vhost: **HTTP Basic Auth** (see below), **HTTP methods** (allow only / block listed, the same method picker as vhosts), **per-client IP rate limit** (requests per window and burst; exceeded requests get `429`), **country access** (block or allow only listed countries via GeoIP; country rules of ACL profiles also apply), **security headers** (HSTS with max-age and includeSubDomains, `X-Content-Type-Options: nosniff`, `X-Frame-Options`, `Referrer-Policy`) and **Use verified Cloudflare client IP** when the app is behind Cloudflare. The summary line of the section shows what is active. Stored as `method_policy`, `rate_limit`, `security_headers` and `cloudflare_client_ip`; unused options are not stored. Docker apps have no login of their own; to require one, publish the app through an ordinary vhost with HTTP Basic Auth, forward auth or OIDC. |
| **Headers** | Diagnostic headers — `Server-Timing`, the selected backend (`X-RustProxy-Backend`) and the backend time (`X-RustProxy-Backend-Time`), for testing; keep them off in production. The collapsed **HTTP policies** editor inside this section holds the assignment's policy rules (see [HTTP policies](POLICY.md)); the section summary shows the enabled headers and the rule count. For Docker publications the backend header uses `<agent-id>/<12-character-service-hash>` (for example `node1/012345abcdef`), rather than the internal `docker-node1-012345abcdef/docker` identifier. Ordinary Vhosts retain their usual backend IDs; the change affects only header presentation, not routing, logs or metrics. Stored as `timing_headers`, `backend_header`, `backend_timing_header`. |
| **Diagnostic headers** | `Server-Timing`, the selected backend (`X-RustProxy-Backend`) and the backend time (`X-RustProxy-Backend-Time`), for testing; keep them off in production. For Docker publications the backend header uses `<agent-id>/<12-character-service-hash>` (for example `node1/012345abcdef`), rather than the internal `docker-node1-012345abcdef/docker` identifier. Ordinary Vhosts retain their usual backend IDs; the change affects only header presentation, not routing, logs or metrics. Stored as `timing_headers`, `backend_header`, `backend_timing_header`. |
| **HTTP policies** | The assignment's ordered policy rules (see [HTTP policies](POLICY.md)); the summary shows the rule count. |
| **Health / ACL / timeouts** | **Access control** shows the agent default ACL profiles pre-selected (*Agent default in use: …*). Unchecking or changing them overrides the default for this service only; leaving them as they are keeps following the agent default. **Public vhost (no agent default ACL)** publishes the service without the agent default profiles (`inherit_acl_profiles: false`) and disables the per-app ACL; global block/allow rules still apply. Up to eight reusable ACL profiles per app; selected profiles appear as removable badges and the summary line shows the effective state. Optional inline ACL remains independently enforced. Explicit denies and country blocks beat merged allows. Test allowed and blocked clients. |
### HTTP Basic Auth for Docker apps