feat(client): check broker health before issuance - #91
Conversation
First-time certificate setup now confirms the registration broker responds with HTTP 204 on /v1/health before starting ACME issuance. While the broker keeps failing the check, the client logs one ERROR and re-checks after max(1h, min(Retry-After, 24h)) instead of running doomed ACME flows that certmagic would retry with backoff for weeks. Issuance starts automatically once the broker recovers. Nodes with a certificate already in storage are unaffected. The probe is exported as client.CheckBrokerHealth together with the client.HealthCheckPath constant.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #91 +/- ##
==========================================
+ Coverage 68.70% 69.17% +0.46%
==========================================
Files 21 22 +1
Lines 1713 1765 +52
==========================================
+ Hits 1177 1221 +44
- Misses 416 425 +9
+ Partials 120 119 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Suggested tag:
Cutting a Release (and modifying code files)This PR is modifying both Automatically created GitHub ReleaseA draft GitHub Release has been created. |
* feat(autotls): skip issuance when broker is down Bump github.com/ipshipyard/p2p-forge to the head of ipshipyard/p2p-forge#91: before first-time ACME issuance the client now confirms the broker responds with HTTP 204 on /v1/health, after the registration delay and once the node is publicly reachable. While the broker keeps failing the check, certificate setup is postponed with one ERROR and an hourly re-check (respecting Retry-After, capped at 24h) instead of doomed ACME retries for weeks. Ephemeral nodes (CI runners) still produce no broker traffic at all, and nodes with a certificate in storage are unaffected. * chore: update p2p-forge to v0.10.0
Problem
A node without a certificate starts ACME issuance even when the registration broker is unreachable (offline network, firewall, outage). Every attempt is doomed: certmagic retries the full flow with backoff for up to 30 days, filling logs with ERRORs that no amount of retrying can resolve.
Fix
startCertManagementwaits until the broker answersGET /v1/healthwith HTTP 204 (15s probe timeout)max(1h, min(Retry-After, 24h)); issuance starts automatically once the broker recoversclient.CheckBrokerHealthwith theclient.HealthCheckPathconstantOne cheap GET per interval replaces full ACME attempts while the broker is down. Nodes with a certificate in storage are unaffected; renewal behavior is out of scope.
Merging cuts release v0.10.0 (
version.jsonand changelog are included). Downstream wiring is validated in ipfs/kubo#11397, whose CI is green against this PR's feature commit.