@stacksjs/ts-cloud 0.7.20 → 0.7.22

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 (40) hide show
  1. package/dist/bin/cli.js +552 -551
  2. package/dist/{chunk-49nmy775.js → chunk-0tfwdnmf.js} +9 -6
  3. package/dist/{chunk-qgnyzfmx.js → chunk-5mejsd43.js} +1 -1
  4. package/dist/{chunk-296n8hvt.js → chunk-c3yy2xyq.js} +2 -2
  5. package/dist/{chunk-qdhn1s7j.js → chunk-js3vrvvn.js} +158 -5
  6. package/dist/{chunk-xgnxz5dz.js → chunk-kcxxwg3j.js} +89 -12
  7. package/dist/deploy/dashboard-site-settings.d.ts +55 -0
  8. package/dist/deploy/dashboard-site-settings.test.d.ts +1 -0
  9. package/dist/deploy/dashboard-throttle.d.ts +46 -0
  10. package/dist/deploy/dashboard-throttle.test.d.ts +1 -0
  11. package/dist/deploy/index.js +4 -4
  12. package/dist/deploy/management-dashboard.d.ts +45 -15
  13. package/dist/drivers/index.js +2 -2
  14. package/dist/drivers/shared/deploy-script.d.ts +7 -0
  15. package/dist/index.js +8 -4
  16. package/dist/ui/index.html +3 -3
  17. package/dist/ui/server/actions.html +3 -3
  18. package/dist/ui/server/backups.html +3 -3
  19. package/dist/ui/server/database.html +3 -3
  20. package/dist/ui/server/deployments.html +3 -3
  21. package/dist/ui/server/firewall.html +3 -3
  22. package/dist/ui/server/logs.html +3 -3
  23. package/dist/ui/server/services.html +3 -3
  24. package/dist/ui/server/sites.html +3 -3
  25. package/dist/ui/server/ssh-keys.html +3 -3
  26. package/dist/ui/server/team.html +3 -3
  27. package/dist/ui/server/terminal.html +3 -3
  28. package/dist/ui/server/workers.html +3 -3
  29. package/dist/ui/serverless/alarms.html +3 -3
  30. package/dist/ui/serverless/assets.html +3 -3
  31. package/dist/ui/serverless/data.html +3 -3
  32. package/dist/ui/serverless/deployments.html +3 -3
  33. package/dist/ui/serverless/functions.html +3 -3
  34. package/dist/ui/serverless/logs.html +3 -3
  35. package/dist/ui/serverless/queues.html +3 -3
  36. package/dist/ui/serverless/scheduler.html +3 -3
  37. package/dist/ui/serverless/secrets.html +3 -3
  38. package/dist/ui/serverless/traces.html +3 -3
  39. package/dist/ui/serverless.html +3 -3
  40. package/package.json +3 -3
@@ -1,23 +1,34 @@
1
1
  /**
2
- * Auto-deploy of the ts-cloud management dashboard (the `@ts-cloud/ui` stx app)
3
- * on every server provision/deploy.
2
+ * Auto-deploy of the ts-cloud management dashboard on every server
3
+ * provision/deploy, so every box ships with a cockpit.
4
4
  *
5
- * Resolves the UI directory (the repo's local `packages/ui/`, else the prebuilt
6
- * UI that ships inside the installed package at `dist/ui`), derives a `dashboard.<apex>`
7
- * host, and injects it into `config.sites` as a server-static site. It is served
8
- * SECURE BY DEFAULT: the dashboard is served behind htpasswd on every deploy.
9
- * The password is resolved as: `TS_CLOUD_UI_PASSWORD` when set, else a strong
10
- * auto-generated one (persisted to `.ts-cloud/dashboard-credentials.json` so it
11
- * stays stable across deploys and printed once in the deploy log). Serving the
12
- * dashboard publicly is an explicit, deliberate opt-in via `TS_CLOUD_UI_PUBLIC`.
5
+ * **Live (the default).** The dashboard runs as a service on the box
6
+ * (`cloud dashboard:serve --box`) behind the proxy. It serves live data and the
7
+ * control API, and authenticates itself: a login page, sessions, and per-site
8
+ * collaborator grants. The release is tiny the project's cloud config plus a
9
+ * `package.json` and the box installs `@stacksjs/ts-cloud` from npm, which
10
+ * carries both the CLI and the UI it serves.
11
+ *
12
+ * On the first live deploy the box mints an admin and prints the password once
13
+ * into the deploy log. Users and the session key live in the site's shared
14
+ * `.ts-cloud/`, so they survive later deploys.
15
+ *
16
+ * **Static (`TS_CLOUD_UI_STATIC`).** The built UI shipped as files behind
17
+ * htpasswd. One shared password, all data baked in at build time, and therefore
18
+ * no collaborators. Kept for boxes that cannot run the service.
13
19
  *
14
20
  * Env:
21
+ * - `TS_CLOUD_UI_STATIC` set truthy for the old static + htpasswd model
22
+ * - `TS_CLOUD_UI_DOMAIN` explicit dashboard host (else `dashboard.<apex>`)
23
+ * - `TS_CLOUD_UI_PORT` loopback port for the live service (default 7676)
24
+ * - `TS_CLOUD_UI_VERSION` ts-cloud version the box installs (default: this one)
25
+ * - `TS_CLOUD_UI_DISABLE` set truthy to skip auto-deploy
26
+ *
27
+ * Static mode only:
15
28
  * - `TS_CLOUD_UI_PASSWORD` htpasswd password (unset ⇒ auto-generated + saved)
16
29
  * - `TS_CLOUD_UI_PUBLIC` set truthy to serve WITHOUT auth (opt-out, insecure)
17
30
  * - `TS_CLOUD_UI_USERNAME` htpasswd user (default `admin`)
18
- * - `TS_CLOUD_UI_DOMAIN` explicit dashboard host (else `dashboard.<apex>`)
19
31
  * - `TS_CLOUD_UI_REALM` browser auth realm
20
- * - `TS_CLOUD_UI_DISABLE` set truthy to skip auto-deploy
21
32
  */
22
33
  import type { CloudConfig } from '@ts-cloud/core';
23
34
  /**
@@ -51,10 +62,29 @@ export interface EnsureDashboardLogger {
51
62
  info: (msg: string) => void;
52
63
  warn: (msg: string) => void;
53
64
  }
65
+ /** Where the live dashboard's release is staged, inside the project checkout. */
66
+ export declare const LIVE_STAGE_DIR: string;
67
+ /**
68
+ * The ts-cloud version the box should install. Reads this package's own version
69
+ * so a box runs a dashboard matching the CLI that deployed it, rather than
70
+ * drifting to whatever `latest` happens to be mid-deploy.
71
+ */
72
+ export declare function resolveDashboardVersion(): string;
73
+ /**
74
+ * Stage the live dashboard's release: the project's cloud config (so the box
75
+ * can resolve the same sites) plus a `package.json` whose install pulls the CLI
76
+ * and UI from npm.
77
+ *
78
+ * Returns the staged directory relative to `cwd`, or null when the project has
79
+ * no cloud config to ship — without one the dashboard on the box would have
80
+ * nothing to describe.
81
+ */
82
+ export declare function stageLiveDashboardRoot(cwd: string, logger: EnsureDashboardLogger): string | null;
54
83
  /**
55
- * Resolve the UI source to ship. Prefers the repo's local `packages/ui/` (built
56
- * on the deploy machine), then the prebuilt UI bundled in the installed package.
57
- * Returns `{ uiRoot, build }` or null when no UI is available.
84
+ * Resolve the UI source to ship (STATIC mode only — the live dashboard gets its
85
+ * UI from the npm package it installs on the box). Prefers the repo's local
86
+ * `packages/ui/` (built on the deploy machine), then the prebuilt UI bundled in
87
+ * the installed package. Returns `{ uiRoot, build }` or null when unavailable.
58
88
  */
59
89
  export declare function resolveUiSource(cwd: string): {
60
90
  uiRoot: string;
@@ -48,8 +48,8 @@ import {
48
48
  waitForCloudInit,
49
49
  waitForSsh,
50
50
  wrapCloudInitUserData
51
- } from "../chunk-xgnxz5dz.js";
52
- import"../chunk-49nmy775.js";
51
+ } from "../chunk-kcxxwg3j.js";
52
+ import"../chunk-0tfwdnmf.js";
53
53
  import"../chunk-93hjhs78.js";
54
54
  import"../chunk-qpj3edwz.js";
55
55
  import"../chunk-vd87cpvn.js";
@@ -25,6 +25,13 @@ export interface BuildSiteDeployScriptOptions {
25
25
  * `node_modules`.
26
26
  */
27
27
  preStartCommands?: string[];
28
+ /**
29
+ * Extra paths kept in `shared/` and symlinked into each release, so they
30
+ * survive a deploy. `.env` is always shared; anything the app WRITES and must
31
+ * keep (a state directory, a database file) has to be listed here or the next
32
+ * release silently starts from empty.
33
+ */
34
+ sharedPaths?: readonly string[];
28
35
  /**
29
36
  * True zero-downtime cutover for ported sites: the new release runs as its
30
37
  * own systemd instance (`<slug>-<site>@<releaseId>`) that binds the same
package/dist/index.js CHANGED
@@ -55,10 +55,10 @@ import {
55
55
  sanitizeCloudConfig,
56
56
  setMaintenance,
57
57
  startLocalDashboardServer
58
- } from "./chunk-qdhn1s7j.js";
58
+ } from "./chunk-js3vrvvn.js";
59
59
  import {
60
60
  buildAndPushServerlessImage
61
- } from "./chunk-qgnyzfmx.js";
61
+ } from "./chunk-5mejsd43.js";
62
62
  import {
63
63
  CloudWatchLogsClient,
64
64
  EFSClient,
@@ -105,7 +105,7 @@ import {
105
105
  waitForCloudInit,
106
106
  waitForSsh,
107
107
  wrapCloudInitUserData
108
- } from "./chunk-xgnxz5dz.js";
108
+ } from "./chunk-kcxxwg3j.js";
109
109
  import {
110
110
  ABTestManager,
111
111
  AI,
@@ -137,6 +137,8 @@ import {
137
137
  ContainerRegistryManager,
138
138
  CredentialError,
139
139
  CrossRegionReferenceManager,
140
+ DASHBOARD_ENTRY,
141
+ DASHBOARD_STATE_DIR,
140
142
  DEFAULT_SERVICE_LIMITS,
141
143
  DLQMonitoringManager,
142
144
  DNS,
@@ -504,7 +506,7 @@ import {
504
506
  withSecurity,
505
507
  withTimeout,
506
508
  xrayManager
507
- } from "./chunk-49nmy775.js";
509
+ } from "./chunk-0tfwdnmf.js";
508
510
  import {
509
511
  EC2Client,
510
512
  SSMClient
@@ -5118,6 +5120,8 @@ export {
5118
5120
  DNS,
5119
5121
  DLQMonitoringManager,
5120
5122
  DEFAULT_SERVICE_LIMITS,
5123
+ DASHBOARD_STATE_DIR,
5124
+ DASHBOARD_ENTRY,
5121
5125
  DASHBOARD_CREDENTIALS_FILE,
5122
5126
  CrossRegionReferenceManager,
5123
5127
  CredentialError,