This commit is contained in:
Mateusz Gruszczyński committed 2026-11-14 21:52:48 +01:00
1 parent f48843e934
commit e2c8099d9c
64 files changed
+5354 -673

No files matched your search

+2
View File
@@ -28,6 +28,8 @@ Ordinary Vhosts can reject selected MIME types under **Vhosts → Security → R
## HTTP methods and rate limits
HTTP methods (global policy, Vhost → Security and custom locations) are chosen from a list of known methods with a short description each — GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, CONNECT, TRACE, TRACK, PURGE, BAN and the WebDAV/CalDAV methods; type another method name and press Enter to add a custom one. The stored format is unchanged (`method_policy.methods`).
Method policies allow, block or leave methods unrestricted. A denied method returns `405`, while typical ACL/country denials return `403`. Per-client rate limits can configure request count, window and burst with optional country overrides; exceeding the limit returns `429` with `Retry-After`. Limits are application controls, not a replacement for upstream DDoS protection.
## Identity providers and authentication integration methods
+1 -1
View File
@@ -21,7 +21,7 @@ The current bundled `src/admin/openapi.json` declares these operations (among ot
| `GET /api/config/history` · `POST /api/config/history/restore` | Review/restore retained configuration snapshots. |
| `GET /api/status` · `GET /api/backends` | Operational status and backend observations. |
| `GET /api/cache` · `POST /api/cache/purge` · `POST /api/cache/invalidate` | Cache observations and authenticated invalidation. `GET` supports the lightweight `view=live` polling view. |
| `GET /api/cache/rules/stats` · `POST /api/cache/rules/test` · `POST /api/cache/rules/import-vcl` | Cache rule match counters, simulation of saved or draft rules for a test request/response, and conversion of a VCL subset into rules (nothing is saved). See [Cache rules](CACHE.md#cache-rules-vcl-style). |
| `GET /api/cache/rules/stats` · `GET /api/cache/rules/targets` · `POST /api/cache/rules/test` · `POST /api/cache/rules/import-vcl` | Cache rule match counters, the vhosts a rule can target (ordinary and generated Docker vhosts), simulation of saved or draft rules for a test request/response (also for Docker vhosts), and conversion of a VCL subset into rules (nothing is saved). See [Cache rules](CACHE.md#cache-rules-vcl-style). |
| `GET /api/transform` | Transform observations and resource usage. Supports the lightweight `view=live` polling view. |
| `GET /api/logs` · `GET /api/live-logs` | Recent and streaming request logs. |
| `GET /api/file-logs` · `GET /api/file-logs/query` | Stored-log exploration. |
+3 -1
View File
@@ -61,7 +61,7 @@ In **Vhosts → Cache**, overrides for static extensions, bypass path prefixes a
|---|---|---|---|
| Request | `vcl_recv`, `vcl_hash` | host, URL, path, extension, method, query parameter, request header, cookie, client IP | bypass cache (`pass`), remove cookies (all or all except listed), remove query parameters (list with `*`, or keep only listed), add a header or cookie value to the cache key |
| Backend response | `vcl_backend_response` | the request conditions plus status (`200`, `4xx`, `500-599`), Content-Type, response header | set TTL, set grace, do not store, ignore backend `Cache-Control`/`Expires`, remove `Set-Cookie` |
| Deliver | `vcl_deliver` | the request and response conditions | set or remove a response header |
| Deliver | `vcl_deliver` | the request and response conditions | set a response header, set it only if the response lacks it, or remove it |
- Rules run top to bottom (drag to reorder). Each rule matches when all (or any) of its conditions match; a rule without conditions matches every request. *Stop evaluating later rules* ends the stage, like `return` in VCL.
- Vhost rules run before global rules. A global rule can be limited to selected vhosts. For TTL, grace, bypass and *do not store*, the first matching rule wins: the vhost editor and the global list show which rules override others, and the tester lists every overridden action. *Ignore global cache rules* switches global rules off for that vhost.
@@ -70,6 +70,8 @@ In **Vhosts → Cache**, overrides for static extensions, bypass path prefixes a
- **Test a request** checks the rules on screen (including unsaved edits) against a sample URL, headers, client IP and backend response, and shows the decision, cache key, TTL/grace, matched and overridden rules. **Import VCL** converts supported statements from `vcl_recv`, `vcl_hash`, `vcl_backend_response`/`vcl_fetch` and `vcl_deliver` (`if`/`elsif`/`else`, `~`, `!~`, `==`, `!=`, status comparisons, `return (pass)`, `unset req.http.Cookie`, query-parameter `regsuball` on `req.url`, `hash_data(req.http.X)`, `beresp.ttl`, `beresp.grace`, `beresp.uncacheable`, `unset beresp.http.Set-Cookie`, `set/unset resp.http.X`); everything else is listed as a warning. **Copy as VCL** shows the equivalent VCL (read-only).
- Limits: 128 rules per list, 16 conditions and 16 actions per rule, regular expressions with linear-time matching. Match counters live in memory (reset on restart) and are exported as `rust_proxy_cache_rule_matches_total{origin,vhost,rule}` when the *Domains and effectiveness* metric group is enabled.
- Rules apply to Reverse Proxy vhosts (including Docker vhosts) while the cache is active for the route; built-in web server sources are not affected.
- **Deliver rules apply to the whole application.** Since 0.37.2 they run for every response of the vhost — also when caching is switched off for it, for bypassed requests and for misses — so they can override headers such as `Cache-Control` for browsers, or add security headers, for an entire application. *Set header if missing* (`default_header`) keeps a header the backend already sent. Templates: *Browser cache for static files (30 days)*, *No browser cache for HTML and /admin*, *Default security headers*. Request and backend-response rules still run only while the cache is active for the route.
- Docker vhosts have their own rules too: in **Docker vhosts**, enable *Cache* for the service and open **Cache for this vhost** (default TTL and rules). The global rule vhost picker and the tester list Docker vhosts (marked *Docker*) next to ordinary vhosts; `GET /api/cache/rules/targets` returns the same list.
## Stored object rules
+1
View File
@@ -41,6 +41,7 @@ After **Unlock layout**, every block shows a compact toolbar: the **⠿** handle
- **Drag:** grab the ⠿ handle (mouse, pen or touch). The block lifts and follows the pointer, and a dashed frame of the same width shows exactly where it will land; neighbouring blocks glide aside instead of jumping. Release to drop, or press **Esc** to return the block to its previous place. Dragging near the top or bottom edge of the window scrolls the page.
- **Keyboard:** focus the ⠿ handle and use the arrow keys to move the block one position.
- **Arrange manually:** blocks get fixed grid positions. Drag a block anywhere — a dashed frame shows the cell it will snap to — and the other blocks stay where they are (a block already in that place moves down). Making a block narrower or shorter leaves the space empty instead of pulling the next block in; making it bigger pushes overlapping blocks down. *Fit to screen* and *Fill gaps* are off in this mode. The positions are saved with **Save and lock** (`dashboard_widget_positions` in the administrator preferences) and the mode is switched on again automatically the next time you unlock a manually arranged layout; untick it to return to the ordered layout.
- **Fill gaps:** a saved custom layout keeps blocks in exactly the order you arranged them, so a wide block that does not fit at the end of a row leaves a visible gap instead of other blocks silently moving into it. Use **Fill gaps** to pack blocks into empty space once; nothing is stored until **Save and lock**.
**Dashboard Presets** supports up to **16 named layouts per administrator**. Save, load, rename, overwrite and delete presets; a factory layout can be restored. Presets preserve the dashboard arrangement, not the live traffic values. Interface theme, scale and other display settings are also account-scoped and do not alter proxy routing or rewrite shared configuration.
+10 -2
View File
@@ -48,17 +48,23 @@ Go 1.22+ is required only for the manual build, not for a DEB/RPM installation.
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>`. The ★ button on a domain in the picker makes it the master domain. **Aliases** may be short labels (expanded below the master domain, or below another agent domain chosen next to the alias input, which lists the master domain only once) 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.
The same domain may be assigned to **several agents** (for example two Docker hosts serving `apps.example.com`); the picker then lists every agent that uses it. Only the final names must stay unique: two services on different agents cannot publish the same hostname or alias.
### 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.
In the certificate list every name is labelled with what it covers — *main domain*, *www*, *wildcard* or *subdomain* — for example `example.com (main domain), *.example.com (wildcard)`. Wildcard certificates suggested as agent domains show the certificate ID and *(wildcard)*.
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** or entered as **Custom address…**. The list is grouped into *Recommended* (primary route, public address or `RUSTPROXY_DOCKER_ADVERTISE_IP` override, the primary one marked ★), *Other host interfaces* and, from agent 0.37.1, *Container bridges* (`docker0`, `br-*`, `podman*`, `cni-*`, `virbr*`), which are reachable only when RustProxy runs on the same host. *Automatic* keeps the per-service choice (bind address, primary IP, detected addresses). The list fills after the first successful poll.
Agent 0.37.2 lists every active host interface again on systemd installations: the unit now allows `AF_NETLINK`, which the interface enumeration needs, and when netlink is still blocked (older unit, hardened container) the agent falls back to `/proc/net/if_inet6`, `/proc/net/fib_trie` and `/proc/net/route`. After upgrading, reinstall the unit (`install -m 0644 rustproxy-docker-agent.service /etc/systemd/system/`, `systemctl daemon-reload`, restart) so all addresses — not only the routed and public ones — appear. The agent default IP option is no longer listed a second time under the detected addresses, because *Auto / agent default* already shows it.
### Host diagnostics
Agents 0.37.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`.
@@ -124,6 +130,8 @@ Agent inventory polling is separate from the panel's live status refresh. A new
## Publish a discovered application
Endpoints that belong together are **grouped**: every published port of one Docker Compose / Podman Compose project (all its services and replicas), or of one plain container with several ports, appears under a collapsible group header showing the project or container name, the number of endpoints, how many are published and their hostnames. Single endpoints stay ungrouped. Sorting and search work inside groups; the collapsed state is remembered in the browser. Grouping is display only — each port is still published and configured on its own.
In **Docker vhosts**, select the service and set:
| Option | Guidance |
@@ -134,8 +142,8 @@ In **Docker vhosts**, select the service and set:
| **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. |
| **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, tester, *Ignore global cache rules*); 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. |
| **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. |
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.
+6
View File
@@ -18,6 +18,12 @@ Vhost and Docker Vhost live request-rate charts use a **recent-traffic adaptive
Overview allows account-specific card layout and history controls; see [Dashboard](DASHBOARD.md). GeoIP/country analytics depend on the installed/update database and whether country capture is enabled.
### Alerts
The application status (the health indicator in the sidebar, *Application status*) has an **Alerts** entry next to API, listeners, backends, Docker and logging. It lists, with a link to the right page: certificates that have expired or expire within 14 days (error below 3 days), failed ACME renewals, an ACME environment that is not ready while ACME certificates exist, file descriptors at 80% of the limit or more, country rules without a loaded GeoIP database, a Prometheus exporter listening beyond localhost without a token or address restriction, and an available update (information only). New warnings and errors also appear as a notification. Alerts are computed from the current state at most every 30 seconds — no history is kept — and are available as `alerts` in `/api/status` and from `GET /api/alerts` (which also repeats the Docker alerts).
**Settings → Alerts** configures them: a main switch, notifications for new alerts, and each kind on its own — certificate expiry with the warning and error thresholds in days (default 14 and 3), failed ACME renewals, ACME environment, file descriptors with warning and error percentages (default 80 and 95), GeoIP, Prometheus and updates. Stored as `alerts` in the configuration (omitted while everything is at the defaults); saving applies immediately. Docker alerts keep their own settings under **Settings → Docker agents**. API tokens with read access can read `GET /api/alerts`.
### System information
**Settings → System information** is a read-only diagnostic page built from `GET /api/system-info`:
+8
View File
@@ -57,6 +57,14 @@ WebSockets normally use HTTP/1.1 Upgrade. HTTP/2/HTTP/3 client requests can stil
Public HTTPS requires a correct certificate with hostname coverage. Administration TLS is separate. Backend `https://` encrypts traffic, but **upstream certificate verification is opt-in by default** in the current backend model; enable it and specify CA/name where needed. Private/loopback addresses and routing to a local RustProxy listener require explicit risk overrides.
### Cipher configurator
**Settings → TLS policy** shows the cipher suites as a table grouped by TLS 1.3 and TLS 1.2, with the certificate type each suite needs (RSA, ECDSA or either), the encryption, key size and a rating. Presets set versions and suites in one click: **Modern** (TLS 1.3 only), **Recommended** (TLS 1.2 and 1.3 with every suite rustls offers — the widest compatibility RustProxy can give) and **256-bit only**; any other combination shows *Custom*. Ticking every suite stores an empty list (rustls defaults).
Next to the table an **SSL Labs–style estimate** grades protocols, key exchange and cipher strength (A, or A+ when HSTS is on in the global security headers) and lists the checks — forward secrecy, AEAD-only ciphers, TLS 1.3, post-quantum key exchange and HSTS. **Client compatibility** simulates common clients for the selection: current browsers, Safari 9–12, Android 4.4–9, Java 8/11, OpenSSL 1.0.2/1.1.1 and IE 11 (Windows 7/8.1 only with an ECDSA certificate). It is a simplified simulation, not a handshake test.
For "older systems" there is a hard limit: rustls implements only AEAD suites with forward secrecy, so TLS 1.0/1.1, CBC, RC4, 3DES and static RSA key exchange cannot be enabled. Windows XP, IE 6–10, Android 4.3 and older and Java 6/7 cannot connect to RustProxy whatever the selection; the list marks them accordingly. The server applies its own suite order. Stored as before: `tls.policy.tls12`, `tls13`, `cipher_suites`.
## Post-quantum TLS key exchange (optional)
**Settings → TLS policy → Post-quantum key exchange** enables the hybrid TLS 1.3 group **X25519MLKEM768** (X25519 combined with ML-KEM-768) for incoming TLS. It is a key-exchange group, not a cipher suite: certificates and AES-GCM/ChaCha20-Poly1305 ciphers stay unchanged, and classic groups remain available as a fallback. The setting is off by default and requires TLS 1.3.