insta 0.1.19 → 0.1.20

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.
@@ -68,10 +68,26 @@ export function domainGuidanceLines(r, ctx = {}) {
68
68
  // where the hostname resolves — we cannot confirm routing, and must not call it serving. A Fly
69
69
  // answer carries no `ssl` and has no per-hostname origin concept, so its own verdict stands.
70
70
  const reportsOrigin = (r) => r.ssl !== undefined;
71
+ // A deployment with NO edge custody for custom domains (a pre-Cloudflare plane). It reports
72
+ // `origin: ""` exactly like a region whose operator forgot cf-custom-origin, so the pair alone reads
73
+ // it backwards and names a setting this deployment does not have. The plane's own verdict
74
+ // (`originStatus: 'unmanaged'`) decides when relayed; without it, `ssl: 'external'` is the plane's
75
+ // marker for the same deployment class (it manages no edge certificate here) — the same fallback the
76
+ // console uses. Only an unconfirmed origin is reinterpreted: a reported, confirmed origin stands.
77
+ const edgeUnmanaged = (r) => r.originStatus === 'unmanaged' ||
78
+ (r.originStatus === undefined && r.ssl === 'external' && (r.origin === undefined || r.origin === ''));
71
79
  // Where the hostname actually resolves — the region-specific origin the plane requested vs what
72
80
  // Cloudflare holds. Each shape carries its action; absent fields are reported as absent.
73
81
  export function domainResolveLine(r) {
74
82
  const region = r.region ?? 'this region';
83
+ if (edgeUnmanaged(r)) {
84
+ // Not ready (routing cannot be confirmed from here), but no operator knob to name either:
85
+ // setting cf-custom-origin does nothing on a deployment with no edge custody.
86
+ return {
87
+ line: ` ${pad('resolves to', 12)}UNMANAGED — ${region} does not manage edge certificates for custom domains, so where ${r.hostname} lands cannot be confirmed from here; if it does not serve, contact support`,
88
+ ready: false,
89
+ };
90
+ }
75
91
  if (r.origin === undefined) {
76
92
  if (reportsOrigin(r)) {
77
93
  return {
@@ -194,6 +210,7 @@ export function domainStatusLines(r, ctx = {}) {
194
210
  }
195
211
  }
196
212
  const ssl = r.ssl ?? (r.configured ? 'active' : undefined);
213
+ const reasonOnCert = !!r.errorReason && r.status !== 'error' && ssl !== undefined && ssl !== 'active' && ssl !== 'external';
197
214
  if (ssl === 'active')
198
215
  stage('certificate', 'active', '(edge TLS issued)');
199
216
  else if (ssl === 'external')
@@ -203,7 +220,11 @@ export function domainStatusLines(r, ctx = {}) {
203
220
  blockers.push('certificate');
204
221
  }
205
222
  else {
206
- stage('certificate', 'pending', `(${ssl} — issues once ownership is verified)`);
223
+ // A pending certificate with a reason from the plane: the reason IS why it has not issued (a CAA
224
+ // block, the hostname not pointed at the edge), so it replaces the generic text here and is not
225
+ // repeated below. An `error` row keeps its reason on its own error line.
226
+ const detail = reasonOnCert ? `(${ssl}) ${r.errorReason}` : `(${ssl} — issues once ownership is verified)`;
227
+ stage('certificate', 'pending', detail);
207
228
  blockers.push('certificate');
208
229
  }
209
230
  const resolve = domainResolveLine(r);
@@ -214,9 +235,17 @@ export function domainStatusLines(r, ctx = {}) {
214
235
  stage('error', r.status, r.errorReason || '(the plane reported an error state with no reason)');
215
236
  blockers.push('the plane reports an error state');
216
237
  }
217
- else if (r.errorReason) {
218
- stage('error', r.status, r.errorReason);
219
- blockers.push(r.errorReason);
238
+ else if (r.errorReason && !reasonOnCert) {
239
+ // On an ACTIVE row the plane keeps serving and REPORTS what the edge says has regressed (it
240
+ // never demotes a serving row on an edge read). That is a warning beside a serving hostname,
241
+ // not a blocker: turning it into one would print "not yet" for a domain taking traffic.
242
+ // Every other state with a reason is still being set up, and the reason is what blocks it.
243
+ if (r.status === 'active')
244
+ stage('warning', r.status, r.errorReason);
245
+ else {
246
+ stage('error', r.status, r.errorReason);
247
+ blockers.push(r.errorReason);
248
+ }
220
249
  }
221
250
  // An unconfirmed routing target is one blocker among the others, not a headline that hides them:
222
251
  // a user fixing their DNS needs the whole outstanding list, not whichever item sorted first.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "insta",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "type": "module",
5
5
  "description": "InstaCloud CLI — a thin client of the platform control-plane API.",
6
6
  "keywords": [