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
@@ -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).