This commit is contained in:
Mateusz Gruszczyński committed 2026-11-22 15:35:11 +01:00
1 parent 748fe1d146
commit 27b640a0df
22 files changed
+532 -30

No files matched your search

+20
View File
@@ -52,6 +52,26 @@ Provider tokens and TSIG secrets are security credentials: use least privilege,
Managed certificates have configurable automatic renewal. RustProxy runs the scheduler while the service is active; this is **not** a separate cron service. Certificate status and next checks are visible in Certificates. The scheduler uses spaced checks and retry/backoff on failure, without automatically forcing a CA reissue on every check.
### Checking now or forcing a renewal
Each managed certificate in **Certificates → Automatic renewal** has three actions:
- **Check now** — runs `certbot renew` for that profile; Certbot decides whether the certificate is due (result `acme.not_due` otherwise).
- **Force renewal now** (since 0.40.1) — runs `certbot renew --force-renewal`, so a new certificate is requested from the CA even if the current one is far from expiry. Use it after a key compromise, a CA revocation, or when the names or chain must change immediately. The action asks for confirmation because every forced certificate counts against the CA rate limits (Let's Encrypt: 5 certificates for the same names per week). The current certificate stays active until the new pair is validated and deployed; the audit log records `acme.renew_forced`.
- **Validate renewal (dry run)** — tests the challenge against the staging CA and deploys nothing.
The same is available through the API and the local CLI:
```bash
# API (session or API token with certificate permissions)
curl -X POST https://admin.example.com/api/acme/renew -H 'content-type: application/json' \
-d '{"certificate_id":"site","force":true}'
# local CLI on the server (uses the administration listener)
sudo rust-proxy --data-dir /var/lib/rustproxy tls renew --id site --force
```
`force` cannot be combined with `dry_run`. The renewal runs in the background; the job and the result are shown in the panel. Headless mode has its own command, see [Headless: forcing a new certificate](HEADLESS.md#forcing-a-new-certificate-tls-renew---force).
After successful renewal, RustProxy validates the new pair and publishes it to new TLS handshakes without interrupting existing connections. Invalid/rejected material should leave the previous active pair in place. Keep room for archived ACME generations and monitor expiry; this is not an independent external expiry-alert service. **Do not run an overlapping system Certbot timer** against the RustProxy-managed ACME profiles.
## Externally managed Certbot / PEM files
+2 -2
View File
@@ -42,7 +42,7 @@ RustProxy is a single service that combines a reverse proxy, a static/PHP web se
## Certificates
- Self-signed certificates, PEM import and externally managed certificate paths (for example Certbot).
- Managed ACME with HTTP-01 and DNS-01 (Cloudflare, OVH, RFC 2136), automatic renewal and job history.
- Managed ACME with HTTP-01 and DNS-01 (Cloudflare, OVH, RFC 2136), automatic renewal, on-demand check, forced renewal (panel, API, `tls renew --force`) and job history.
- Certificate inventory with expiry, coverage check and bulk assignment to Vhosts.
- Restricted certificate API keys for deploy/reload from external systems such as OPNsense.
- Prometheus metrics for the expiry date and remaining days of every installed certificate, ready for alerting.
@@ -97,7 +97,7 @@ RustProxy is a single service that combines a reverse proxy, a static/PHP web se
- Configuration stored in SQLite or in a JSON file, with validation before activation and hot reload.
- Headless mode without the panel: configuration from a read-only JSON file, catch-all `*` host, reload by `SIGHUP`/`systemctl reload` and a `/healthz` endpoint ([Headless mode](HEADLESS.md)).
- Headless HTTPS and Traefik-style operation: certificate files or directories (Certbot/acme.sh layouts) and automatic DV certificates with renewal (HTTP-01 or DNS-01 with Cloudflare, OVH, RFC 2136, wildcards), `acme.auto` for every vhost host, configured in a `"headless"` JSON section or on the command line; `--route HOST=URL` without a configuration file, `--force-https`, automatic reload on file changes (`watch`) and a `/certificates` status endpoint ([Headless mode](HEADLESS.md#https-certificate-files-and-automatic-certificates)).
- Headless HTTPS and Traefik-style operation: certificate files or directories (Certbot/acme.sh layouts) and automatic DV certificates with renewal (HTTP-01 or DNS-01 with Cloudflare, OVH, RFC 2136, wildcards), `acme.auto` for every vhost host, configured in a `"headless"` JSON section or on the command line; `--route HOST=URL` without a configuration file, `--force-https`, automatic reload on file changes (`watch`), forced re-issue of ACME certificates on demand (`rust-proxy --headless tls renew --force`) and a `/certificates` status endpoint ([Headless mode](HEADLESS.md#https-certificate-files-and-automatic-certificates)).
- Revision history with diff and one-click restore.
- Encrypted full backups and validated offline restore; encrypted Secret Store for credentials.
- Docker and Podman discovery through a separate agent: publish containers as Vhosts with one switch, one-time agent provisioning codes, publishing from container labels, multiple domains and certificate lists per agent, per-app HTTP Basic Auth, method policy, rate limit, country access, security and diagnostic headers, a searchable list of published apps, host and container diagnostics with history, authenticated agent process diagnostics and bounded inventory polling, Docker alerts, Prometheus host metrics and optional Docker Overview cards; the Grafana dashboard covers several RustProxy servers.
+20
View File
@@ -19,6 +19,7 @@ Available since 0.38.0.
| Certificate files | import in the panel | `headless.tls` / `--tls-cert-file`, `--tls-cert-dir` (since 0.40.0) |
| Configuration file | optional | required, unless `--route` is used (since 0.40.0) |
| Automatic reload on file change | — | `"watch": true` / `--watch` (since 0.40.0) |
| Forced certificate renewal | **Force renewal now** in Automatic renewal, `POST /api/acme/renew` with `force`, `rust-proxy tls renew --id ID --force` | `rust-proxy --headless tls renew [--force] [--id NAME]` (since 0.40.1) |
| Software update check | on | off |
| Health endpoint | optional `--health-listen` | optional `--health-listen` |
@@ -303,6 +304,25 @@ How it works:
- A failed request is logged with the path of the Certbot log and retried after 10 minutes, 30 minutes, 1, 3, 6 and then every 12 hours; Let's Encrypt limits failed validations, so test new setups with `staging` first. If the configuration file is invalid at that moment, the certificate is kept and applied by the next successful reload.
- Removing a name from `domains` changes the certificate id; the old entry in `headless-acme.json` is simply no longer used.
### Forcing a new certificate (`tls renew --force`)
Since 0.40.1 the running service can be asked to request a certificate **now**, even if it is not due yet — for example after a key compromise, after switching from `staging` to production, or after a CA revocation:
```bash
# re-issue every headless ACME certificate (explicit and acme.auto)
sudo rust-proxy --headless --data-dir /var/lib/rustproxy tls renew --force
# only the certificate containing this name (or with this hl-acme-… id); --id may be repeated or comma-separated
sudo rust-proxy --headless --data-dir /var/lib/rustproxy tls renew --force --id api.example.com
# without --force: check now and renew only what is due, also skipping the failure back-off
sudo rust-proxy --headless --data-dir /var/lib/rustproxy tls renew
```
- The command writes a short request to `<data-dir>/headless-acme-renew.json` (mode `0600`, owned by the owner of the data directory) and sends `SIGUSR1` to the process in `<data-dir>/rustproxy.pid`. The ACME task picks it up as soon as the request in progress (if any) finishes; it is processed once and deleted. Requests older than 10 minutes are discarded, so a request left behind while the service was stopped never forces a renewal after a restart.
- A forced request skips the expiry check and the failure back-off; the new certificate is installed exactly like a renewal (internal reload, connections and cache kept, the previous generation deleted). If it fails, the old certificate stays active and normal retries follow.
- Targets that match no ACME certificate are logged as warnings. Progress and results are in the service log and in [`/certificates`](#certificate-status-certificates).
- Every forced certificate counts against the CA rate limits (Let's Encrypt: 5 certificates for the same set of names per week); use `staging` to test.
- `--dry-run` is panel-only; in headless mode test with `staging`. A service older than 0.40.1 does not handle `SIGUSR1`, so on Linux the command checks this first and refuses instead of stopping it.
### Automatic certificates for every vhost (`acme.auto`)
Like a Traefik certificate resolver attached to every router: with `"auto": true` (or `--acme-auto`) RustProxy collects the hosts of all enabled vhosts and redirects, leaves out those already covered by another certificate (from `tls.certificates`, certificate files/directories or `acme.domains`, wildcards included), and requests **one certificate per vhost** for the rest (up to 16 names each, at most 64 automatic certificates). Skipped automatically: `*`, IP addresses, single-label names and, with HTTP-01, wildcard hosts (they are requested with a DNS-01 provider).
+1 -1
View File
@@ -31,7 +31,7 @@ Guides for operating RustProxy: installation, publishing services, security, cer
## Security and access
- [Access and authentication](ACCESS.md) — ACLs, countries, rate limits, Basic Auth, Forward Auth and OIDC.
- [Certificates](CERTIFICATES.md) — PEM import, ACME HTTP-01/DNS-01, external Certbot files and automatic renewal.
- [Certificates](CERTIFICATES.md) — PEM import, ACME HTTP-01/DNS-01, external Certbot files, automatic and forced renewal.
- [Security model](SECURITY.md) — trust boundaries and deployment recommendations.
## Performance and delivery