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

+1
View File
@@ -29,6 +29,7 @@ The current bundled `src/admin/openapi.json` declares these operations (among ot
| `GET /api/logs` · `GET /api/live-logs` | Recent and streaming request logs. |
| `GET /api/file-logs` · `GET /api/file-logs/query` | Stored-log exploration. Source metadata includes `domains` (current configured hostnames/aliases, empty when not applicable); source and group IDs remain stable. |
| `GET /api/traffic` · `GET /api/system-info` | Traffic and system observations. Traffic supports the lightweight `view=live` polling view. |
| `GET /api/pages/preview?kind=&status=&host=` | Panel session only. Renders a local page (`welcome`, `builtin`, `cloudflare`, `cloudflare_welcome`, `cloudflare_placeholder`, `empty`, or `html`, which shows saved custom HTML: `host=<404 host ID>`, or `slot=direct_ip|unknown_host|response|fallback|error-<code>` with optional `vhost=<ID>` for per-vhost pages) with a `sandbox` Content-Security-Policy: no scripts, opaque origin, framing only by the panel. |
| `GET /api/metrics/json` · `GET /api/metrics/summary` | Full JSON snapshot (includes all Prometheus samples and `summary`) or compact computed `summary` only, both pull-only. [Monitoring](MONITORING.md). |
| `GET /api/docker` · `POST /api/docker/refresh` | Docker-agent observation and refresh. |
| `GET /api/certificates` · `POST /api/certificates/upload` | Certificate inventory/import. |
+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
+1 -1
View File
@@ -17,7 +17,7 @@ below. VCL remains the owner of its existing cache-rule precedence and terminal
- In the panel, open **Settings → Rules & headers → HTTP policies** globally,
**Vhost → Headers → HTTP policies**, the location's **HTTP policies** section,
or **Docker Vhosts → service → Headers → HTTP policies** for a Docker assignment. The shared editor offers a rule
or **Docker Vhosts → service → HTTP policies** for a Docker assignment. The shared editor offers a rule
builder, scenario presets, a JSON view, import preview and a draft tester.
Global settings use the same editor at `settings?tab=policies`. Reordering uses
the visible rule order; switching views preserves the same policy object.
+1 -1
View File
@@ -12,7 +12,7 @@ The **Streams** workspace forwards non-HTTP TCP or UDP traffic through dedicated
The source model supports a legacy single-upstream configuration or a backend list (up to the validated per-host limit), with pool-based load balancing and health observations. Do not assume HTTP health-check response codes can be applied to a UDP-only application: use the probe options actually supported by the Stream type.
The backend editor groups connection/capacity settings separately from active health-check options. When **Health checks** is Off, probe tuning fields are hidden; selecting TCP connect/UDP probe reveals them without erasing their values. Hidden fields are excluded from browser validation.
The stream editor has the tabs **Details**, **Listener & upstream**, **Backends**, **Health** and **Limits**. Backends are rows of a table (state, name, weight, address, live health and sessions, chips for drain, session limit, health check and detail metrics); an expanded row holds the connection and capacity fields and can be copied or removed. The **Health** tab holds the health check of every backend. The stream card shows the state (running, pending restart, disabled), protocol, health summary, limits and per-backend health. The backend editor groups connection/capacity settings separately from active health-check options. When **Health checks** is Off, probe tuning fields are hidden; selecting TCP connect/UDP probe reveals them without erasing their values. Hidden fields are excluded from browser validation.
## Behavior and boundaries
+1 -1
View File
@@ -92,7 +92,7 @@ Backend pools support scheduling/weighting, standby members, draining and option
- `backup` members act as fallbacks; `drain` prevents new normal selection while letting existing work complete within normal lifetimes. Explicitly pinned backends need careful policy review.
- Concurrency and queue limits protect overloaded origins. Retries are restricted; do not assume non-idempotent requests are automatically replayed.
The **Redirects** and **404 hosts** editors distinguish host identity/domains from frontend listeners and certificate selection. The configuration options have not changed.
The **Redirects** and **404 hosts** editors have three tabs: **Details** (name, ID, enabled, hostnames), **Frontend** (listeners, certificate, HTTP/2 and HTTP/3) and **Rules** or **Response**. Redirect rules are rows of a rule table: the collapsed row shows match, path, status and target; an expanded rule is split into **When** (ID, incoming scheme, match, source path) and **Where** (target type as URL / host / path on the same host, scheme, path and query handling, status, cache max-age). **Add rule** offers starting points (whole host → new domain, HTTP → HTTPS, one path → URL, directory → another host, empty rule). The URL tester under the rules evaluates the unsaved rules with the same longest-prefix order and `Location` construction as the proxy. The 404 host **Response** tab chooses the page with cards, offers the Cloudflare variant and status, and shows a sandboxed preview (also **Open in a new tab**); custom HTML is previewed from the saved version. Cards in both lists can be enabled or disabled directly. The configuration options have not changed.
## Hostnames, redirects and errors
+5 -1
View File
@@ -83,7 +83,11 @@ For common Apache 2.2 migrations, `Order deny,allow`, `Order allow,deny`, `Order
## Admin editor layout
In **Web Server → Edit → Delivery**, static file delivery, dynamic compression and precompressed assets have separate sections. In **PHP-FPM**, profile/endpoint, request options, resource limits and FastCGI/php.ini overrides are grouped. Disabled local controls indicate that PHP is off or a shared profile owns those settings; selection and saved values behave as before.
The service list uses the same cards as Vhosts: usage and backend labels, ID and document root, **Edit / Copy / Delete**, a detail strip (FastCGI backend, index/try_files, .htaccess, delivery, Cache-Control, hardening, used by) and live metrics. **Copy** opens a new service with the same settings and an ID generated from the new name.
The editor tabs are General, Routing, FastCGI / PHP, .htaccess, Cache & headers, Delivery, MIME and Security. **General** starts with the service type (static files, SPA, PHP application with a framework preset, downloads, custom); choosing a type applies the matching preset to ordinary fields, which stay editable — the document root, ID/name and FastCGI endpoint are not replaced. **FastCGI / PHP** first asks where the settings come from: a **shared FastCGI profile** (a read-only summary with *Edit profile* and *Manage FastCGI profiles*) or **settings of this service** (endpoint, handler, request options, limits and php.ini overrides). In **Delivery**, static file delivery, dynamic compression and precompressed assets have separate sections.
**FastCGI profiles** list each profile with handler, number of services and endpoint; an expanded profile groups Profile and connection, Timeouts and capacity, Custom FastCGI parameters and PHP-FPM options (php.ini, PHP-FPM only). **Copy** creates a new profile with the same settings. A profile used by a Web Service cannot be deleted.
## FastCGI and error responses