@stacksjs/ts-cloud 0.7.120 → 0.7.122

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.
Files changed (59) hide show
  1. package/dist/bin/cli.js +398 -398
  2. package/dist/bin/dashboard-server.js +86 -86
  3. package/dist/{chunk-0cx84wm2.js → chunk-1mszt89n.js} +1 -1
  4. package/dist/{chunk-zcjc5y9f.js → chunk-w4kb3nwj.js} +3 -0
  5. package/dist/deploy/index.js +2 -2
  6. package/dist/deploy/release-content.d.ts +37 -0
  7. package/dist/deploy/release-content.test.d.ts +1 -0
  8. package/dist/drivers/index.js +1 -1
  9. package/dist/index.js +2 -2
  10. package/dist/ui/account/automation.html +4 -4
  11. package/dist/ui/account/security.html +2 -2
  12. package/dist/ui/applications/compose.html +4 -4
  13. package/dist/ui/applications/new.html +2 -2
  14. package/dist/ui/data/backups.html +4 -4
  15. package/dist/ui/data/services.html +3 -3
  16. package/dist/ui/data/volumes.html +4 -4
  17. package/dist/ui/index.html +3 -3
  18. package/dist/ui/infrastructure/topology.html +4 -4
  19. package/dist/ui/integrations.html +2 -2
  20. package/dist/ui/operations/alerts.html +4 -4
  21. package/dist/ui/operations/configuration.html +4 -4
  22. package/dist/ui/operations/jobs.html +3 -3
  23. package/dist/ui/operations/maintenance.html +4 -4
  24. package/dist/ui/operations/observability.html +4 -4
  25. package/dist/ui/operations/previews.html +3 -3
  26. package/dist/ui/operations/queue.html +4 -4
  27. package/dist/ui/operations/regions.html +4 -4
  28. package/dist/ui/operations/releases.html +4 -4
  29. package/dist/ui/operations/spend.html +4 -4
  30. package/dist/ui/operations/workloads.html +4 -4
  31. package/dist/ui/security.html +2 -2
  32. package/dist/ui/server/actions.html +4 -4
  33. package/dist/ui/server/activity.html +2 -2
  34. package/dist/ui/server/capacity.html +4 -4
  35. package/dist/ui/server/database.html +4 -4
  36. package/dist/ui/server/deployments.html +4 -4
  37. package/dist/ui/server/diagnostics.html +2 -2
  38. package/dist/ui/server/firewall.html +4 -4
  39. package/dist/ui/server/fleet.html +4 -4
  40. package/dist/ui/server/logs.html +3 -3
  41. package/dist/ui/server/metrics.html +4 -4
  42. package/dist/ui/server/security.html +2 -2
  43. package/dist/ui/server/services.html +2 -2
  44. package/dist/ui/server/sites.html +4 -4
  45. package/dist/ui/server/ssh-keys.html +4 -4
  46. package/dist/ui/server/team.html +4 -4
  47. package/dist/ui/server/terminal.html +2 -2
  48. package/dist/ui/serverless/alarms.html +4 -4
  49. package/dist/ui/serverless/assets.html +2 -2
  50. package/dist/ui/serverless/data.html +4 -4
  51. package/dist/ui/serverless/deployments.html +2 -2
  52. package/dist/ui/serverless/firewall.html +2 -2
  53. package/dist/ui/serverless/functions.html +4 -4
  54. package/dist/ui/serverless/logs.html +4 -4
  55. package/dist/ui/serverless/queues.html +4 -4
  56. package/dist/ui/serverless/secrets.html +3 -3
  57. package/dist/ui/serverless/traces.html +4 -4
  58. package/dist/ui/serverless.html +4 -4
  59. package/package.json +3 -3
@@ -50,7 +50,7 @@ import {
50
50
  resolveSiteKind,
51
51
  resolveUiSource,
52
52
  siteInstallBase
53
- } from "./chunk-zcjc5y9f.js";
53
+ } from "./chunk-w4kb3nwj.js";
54
54
  import {
55
55
  SSMClient
56
56
  } from "./chunk-7m60qnc8.js";
@@ -5720,6 +5720,9 @@ function buildSiteDeployScript(options) {
5720
5720
  ...buildActivateRelease(paths),
5721
5721
  `systemctl enable ${instance} 2>/dev/null || true`,
5722
5722
  `for TS_CLOUD_U in \${TS_CLOUD_OLD_UNITS}; do systemctl stop "$TS_CLOUD_U" 2>/dev/null || true; systemctl disable "$TS_CLOUD_U" 2>/dev/null || true; done`,
5723
+ `TS_CLOUD_LISTENING=0; for TS_CLOUD_I in $(seq 1 ${Math.max(1, healthGateSeconds)}); do if ss -ltnH "sport = :${port}" 2>/dev/null | grep -q .; then TS_CLOUD_LISTENING=1; break; fi; sleep 1; done`,
5724
+ `if [ "$TS_CLOUD_LISTENING" -ne 1 ]; then echo "[ts-cloud] nothing is listening on ${port} after retiring the previous release — restarting ${instance} on the now-free port" >&2; systemctl restart ${instance}; for TS_CLOUD_I in $(seq 1 ${Math.max(1, healthGateSeconds)}); do if ss -ltnH "sport = :${port}" 2>/dev/null | grep -q .; then TS_CLOUD_LISTENING=1; break; fi; sleep 1; done; fi`,
5725
+ `if [ "$TS_CLOUD_LISTENING" -ne 1 ]; then echo "[ts-cloud] ${instance} is active but never bound ${port}" >&2; journalctl -u ${instance} -n 50 --no-pager >&2 || true; exit 1; fi`,
5723
5726
  `systemctl list-unit-files --plain --no-legend "${unitBase}@*.service" 2>/dev/null | awk '{print $1}' | { grep -v -e "^${instance}$" -e "^${unitBase}@\\.service$" || true; } | while read -r TS_CLOUD_U; do systemctl disable "$TS_CLOUD_U" 2>/dev/null || true; done`,
5724
5727
  `if [ -f /etc/systemd/system/${serviceName} ]; then systemctl disable ${serviceName} 2>/dev/null || true; rm -f /etc/systemd/system/${serviceName}; systemctl daemon-reload; fi`,
5725
5728
  ...buildPruneReleases(paths, keepReleases)
@@ -36,7 +36,7 @@ import {
36
36
  synchronizeDashboardUsers,
37
37
  trackDashboardOperation,
38
38
  verifyStaticApiOrigin
39
- } from "../chunk-0cx84wm2.js";
39
+ } from "../chunk-1mszt89n.js";
40
40
  import {
41
41
  deleteStaticSite,
42
42
  deployStaticSite,
@@ -83,7 +83,7 @@ import {
83
83
  siteInstallBase,
84
84
  validateDeploymentConfig,
85
85
  verifyAddressRecord
86
- } from "../chunk-zcjc5y9f.js";
86
+ } from "../chunk-w4kb3nwj.js";
87
87
  import"../chunk-7m60qnc8.js";
88
88
  import"../chunk-4cjrg98a.js";
89
89
  import"../chunk-rds0sy87.js";
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Pre-flight check on what a site is about to ship.
3
+ *
4
+ * `existsSync(site.root)` was the only gate before this, and a directory
5
+ * existing says nothing about whether it holds a servable site. The failure it
6
+ * missed is specific and expensive: a static-site generator that renders into a
7
+ * SUBDIRECTORY of its output directory (BunPress writes `<outdir>/.bunpress`,
8
+ * and it is far from alone) leaves the configured `root` existing but holding
9
+ * only that one child. The tarball then ships `current/.bunpress/index.html`,
10
+ * the gateway serves `current/`, and every URL 404s while the deploy prints
11
+ * success and exits 0.
12
+ *
13
+ * So the check looks at the content, and when the content says the root is one
14
+ * level too high it says so by name instead of leaving it to be found in
15
+ * production.
16
+ */
17
+ export interface ReleaseContentIssue {
18
+ level: 'error' | 'warning';
19
+ message: string;
20
+ }
21
+ export interface CheckReleaseContentOptions {
22
+ /** The site's resolved `root`, as configured. */
23
+ root: string;
24
+ /** Site key, for messages. */
25
+ siteName: string;
26
+ /**
27
+ * Static sites are served by path from the release root, so a missing
28
+ * top-level `index.html` means the domain root 404s. An app site ships a
29
+ * source tree and has no such expectation.
30
+ */
31
+ expectIndex: boolean;
32
+ }
33
+ /**
34
+ * Inspect what a site is about to package. Returns every issue found; the
35
+ * caller fails the deploy when any of them is an `error`.
36
+ */
37
+ export declare function checkReleaseContent(options: CheckReleaseContentOptions): ReleaseContentIssue[];
@@ -0,0 +1 @@
1
+ export {};
@@ -68,7 +68,7 @@ import {
68
68
  waitForSsh,
69
69
  wrapCloudInitUserData,
70
70
  writeResizeCheckpoint
71
- } from "../chunk-zcjc5y9f.js";
71
+ } from "../chunk-w4kb3nwj.js";
72
72
  import"../chunk-7m60qnc8.js";
73
73
  import"../chunk-4cjrg98a.js";
74
74
  import"../chunk-rds0sy87.js";
package/dist/index.js CHANGED
@@ -208,7 +208,7 @@ import {
208
208
  verifyUpdateSignature,
209
209
  webhookEndpoint,
210
210
  zeroCapacity
211
- } from "./chunk-0cx84wm2.js";
211
+ } from "./chunk-1mszt89n.js";
212
212
  import {
213
213
  deleteStaticSite,
214
214
  deployStaticSite,
@@ -341,7 +341,7 @@ import {
341
341
  waitForCloudInit,
342
342
  waitForSsh,
343
343
  wrapCloudInitUserData
344
- } from "./chunk-zcjc5y9f.js";
344
+ } from "./chunk-w4kb3nwj.js";
345
345
  import {
346
346
  EC2Client,
347
347
  SSMClient