@faable/faable 4.13.0 → 4.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { requireApi } from '../../../api/context.js';
2
2
  import { print_json, json_option } from '../../../lib/listing.js';
3
3
  import { log } from '../../../log.js';
4
4
  import { resolve_app_id } from '../resolve_app_id.js';
5
- import { find_by_fqdn, acme_record, cname_target, dns_badge } from './format.js';
5
+ import { find_by_fqdn, acme_record, cname_target, dns_badge, tls_line } from './format.js';
6
6
 
7
7
  const domains_check = {
8
8
  command: 'check <fqdn>',
@@ -54,6 +54,7 @@ const domains_check = {
54
54
  ? '✅ in place: the certificate is issued without waiting for the CNAME'
55
55
  : '(optional; for a domain live elsewhere, so the move has no TLS gap)'}`);
56
56
  }
57
+ log.info(` Certificate: ${tls_line(domain)}`);
57
58
  if (status?.dns_checked_at) {
58
59
  log.info(` Last checked: ${status.dns_checked_at}`);
59
60
  }
@@ -28,6 +28,18 @@ const acme_record = (domain) => ({
28
28
  target: domain.status?.acme_expected?.[0] ?? `${domain.id}.acme.faable.com`,
29
29
  ready: domain.status?.acme_state === 'ok'
30
30
  });
31
+ // The certificate line of `domains check`: what the edge serves today.
32
+ const tls_line = (domain) => {
33
+ if (!domain.tls)
34
+ return 'off (tls: false)';
35
+ if (domain.status?.tls_state === 'ok') {
36
+ const until = domain.status.tls_expires_at?.slice(0, 10);
37
+ return `✅ served${until ? `, valid until ${until}` : ''}`;
38
+ }
39
+ return domain.status?.acme_state === 'ok' || domain.status?.dns_state === 'ok'
40
+ ? '⏳ being issued — usually a couple of minutes'
41
+ : '⏳ issued once the CNAME (or the pre-validation record) is in place';
42
+ };
31
43
  const find_by_fqdn = (domains, fqdn) => domains.find(d => d.fqdn.toLowerCase() === fqdn.toLowerCase());
32
44
 
33
- export { acme_record, cname_target, dns_badge, find_by_fqdn };
45
+ export { acme_record, cname_target, dns_badge, find_by_fqdn, tls_line };
package/dist/mcp/tools.js CHANGED
@@ -352,7 +352,7 @@ const TOOLS = [
352
352
  {
353
353
  name: 'check_domain',
354
354
  title: 'Check a domain',
355
- description: 'DNS diagnostic of one custom domain: the CNAME it expects, what DNS answers today, and why it is not verified yet. `prevalidation_cname.ready` says whether the optional `_acme-challenge` record is in place, so the certificate is issued without waiting for the CNAME.',
355
+ description: 'DNS diagnostic of one custom domain: the CNAME it expects, what DNS answers today, and why it is not verified yet. `prevalidation_cname.ready` says whether the optional `_acme-challenge` record is in place, so the certificate is issued without waiting for the CNAME; `status.tls_state` is `ok` once the edge serves a valid certificate for the domain (`status.tls_expires_at`).',
356
356
  input: {
357
357
  app,
358
358
  project,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/faable",
3
- "version": "4.13.0",
3
+ "version": "4.14.0",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Marc Pomar <marc@faable.com>",