also looking at this
fix(tls): wait for DNS before ACME issuance
#166
4 files
+42
-4
| @@ -547,7 +547,10 @@ describe('renewRpxCertificates', () => { | ||
| 547 | 547 | expect(ok).toBe(true) |
| 548 | 548 | const call = (driver.runRemoteDeploy as ReturnType<typeof mock>).mock.calls[0][0] |
| 549 | 549 | expect(call.targets[0].id).toBe('i-abc123') |
| 550 | expect(call.commands).toEqual(['systemctl start rpx-cert-renew-my-app.service']) | |
| 550 | expect(call.commands).toEqual([ | |
| 551 | 'systemctl start rpx-cert-renew-my-app.service', | |
| 552 | "test -s '/etc/rpx/certs/my-app.example.com.crt'", | |
| 553 | ]) | |
| 551 | 554 | expect(call.tags.Role).toBe('app') |
| 552 | 555 | }) |
| 553 | 556 | |
| @@ -768,6 +768,10 @@ describe('managed TLS (acmeChallengeWebroot + cert renewal)', () => { | ||
| 768 | 768 | expect(joined).toContain('acme:renew') |
| 769 | 769 | expect(joined).toContain('--webroot') |
| 770 | 770 | expect(joined).toContain(DEFAULT_ACME_WEBROOT) |
| 771 | expect(joined).toContain('while ! getent ahosts "$d"') | |
| 772 | expect(joined).toContain("DNS_ATTEMPTS='24'") | |
| 773 | expect(joined).toContain("DNS_DELAY_SECONDS='5'") | |
| 774 | expect(joined.indexOf('wait_for_dns "$d"')).toBeLessThan(joined.indexOf('$TLSX acme:issue')) | |
| 771 | 775 | expect(joined).toContain(`[ -s "$CERTS/$d.crt" ] && systemctl restart ${RPX_SERVICE_NAME}`) |
| 772 | 776 | expect(joined.indexOf(`systemctl restart ${RPX_SERVICE_NAME}`)).toBeLessThan(joined.indexOf('acme:renew')) |
| 773 | 777 | // Per-app renewal units (slug defaults to 'app'). |