@marinoscar/platform-cli 0.1.0-next.3 → 0.1.0-next.31
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.
- package/CHANGELOG.md +365 -0
- package/README.md +163 -31
- package/dist/android/build.d.ts +30 -0
- package/dist/android/build.d.ts.map +1 -0
- package/dist/android/build.js +126 -0
- package/dist/android/build.js.map +1 -0
- package/dist/android/command.d.ts +21 -0
- package/dist/android/command.d.ts.map +1 -0
- package/dist/android/command.js +355 -0
- package/dist/android/command.js.map +1 -0
- package/dist/android/deploy-step.d.ts +85 -0
- package/dist/android/deploy-step.d.ts.map +1 -0
- package/dist/android/deploy-step.js +268 -0
- package/dist/android/deploy-step.js.map +1 -0
- package/dist/android/doctor.d.ts +47 -0
- package/dist/android/doctor.d.ts.map +1 -0
- package/dist/android/doctor.js +219 -0
- package/dist/android/doctor.js.map +1 -0
- package/dist/android/exec.d.ts +42 -0
- package/dist/android/exec.d.ts.map +1 -0
- package/dist/android/exec.js +103 -0
- package/dist/android/exec.js.map +1 -0
- package/dist/android/fix-plan.d.ts +44 -0
- package/dist/android/fix-plan.d.ts.map +1 -0
- package/dist/android/fix-plan.js +86 -0
- package/dist/android/fix-plan.js.map +1 -0
- package/dist/android/git-freshness.d.ts +34 -0
- package/dist/android/git-freshness.d.ts.map +1 -0
- package/dist/android/git-freshness.js +120 -0
- package/dist/android/git-freshness.js.map +1 -0
- package/dist/android/gradle.d.ts +32 -0
- package/dist/android/gradle.d.ts.map +1 -0
- package/dist/android/gradle.js +55 -0
- package/dist/android/gradle.js.map +1 -0
- package/dist/android/identity.d.ts +27 -0
- package/dist/android/identity.d.ts.map +1 -0
- package/dist/android/identity.js +60 -0
- package/dist/android/identity.js.map +1 -0
- package/dist/android/index.d.ts +7 -0
- package/dist/android/index.d.ts.map +1 -0
- package/dist/android/index.js +8 -0
- package/dist/android/index.js.map +1 -0
- package/dist/android/installer.d.ts +28 -0
- package/dist/android/installer.d.ts.map +1 -0
- package/dist/android/installer.js +96 -0
- package/dist/android/installer.js.map +1 -0
- package/dist/android/java.d.ts +26 -0
- package/dist/android/java.d.ts.map +1 -0
- package/dist/android/java.js +65 -0
- package/dist/android/java.js.map +1 -0
- package/dist/android/keystore.d.ts +54 -0
- package/dist/android/keystore.d.ts.map +1 -0
- package/dist/android/keystore.js +159 -0
- package/dist/android/keystore.js.map +1 -0
- package/dist/android/metadata.d.ts +39 -0
- package/dist/android/metadata.d.ts.map +1 -0
- package/dist/android/metadata.js +61 -0
- package/dist/android/metadata.js.map +1 -0
- package/dist/android/operations.d.ts +42 -0
- package/dist/android/operations.d.ts.map +1 -0
- package/dist/android/operations.js +59 -0
- package/dist/android/operations.js.map +1 -0
- package/dist/android/paths.d.ts +29 -0
- package/dist/android/paths.d.ts.map +1 -0
- package/dist/android/paths.js +97 -0
- package/dist/android/paths.js.map +1 -0
- package/dist/android/publish.d.ts +37 -0
- package/dist/android/publish.d.ts.map +1 -0
- package/dist/android/publish.js +119 -0
- package/dist/android/publish.js.map +1 -0
- package/dist/android/registrations.d.ts +92 -0
- package/dist/android/registrations.d.ts.map +1 -0
- package/dist/android/registrations.js +112 -0
- package/dist/android/registrations.js.map +1 -0
- package/dist/android/release-status.d.ts +73 -0
- package/dist/android/release-status.d.ts.map +1 -0
- package/dist/android/release-status.js +161 -0
- package/dist/android/release-status.js.map +1 -0
- package/dist/android/release.d.ts +33 -0
- package/dist/android/release.d.ts.map +1 -0
- package/dist/android/release.js +59 -0
- package/dist/android/release.js.map +1 -0
- package/dist/android/screen-layout.d.ts +26 -0
- package/dist/android/screen-layout.d.ts.map +1 -0
- package/dist/android/screen-layout.js +24 -0
- package/dist/android/screen-layout.js.map +1 -0
- package/dist/android/screen-model.d.ts +56 -0
- package/dist/android/screen-model.d.ts.map +1 -0
- package/dist/android/screen-model.js +207 -0
- package/dist/android/screen-model.js.map +1 -0
- package/dist/android/screen.d.ts +8 -0
- package/dist/android/screen.d.ts.map +1 -0
- package/dist/android/screen.js +395 -0
- package/dist/android/screen.js.map +1 -0
- package/dist/android/sdk.d.ts +48 -0
- package/dist/android/sdk.d.ts.map +1 -0
- package/dist/android/sdk.js +82 -0
- package/dist/android/sdk.js.map +1 -0
- package/dist/android/server-url.d.ts +19 -0
- package/dist/android/server-url.d.ts.map +1 -0
- package/dist/android/server-url.js +36 -0
- package/dist/android/server-url.js.map +1 -0
- package/dist/android/upload-progress.d.ts +3 -0
- package/dist/android/upload-progress.d.ts.map +1 -0
- package/dist/android/upload-progress.js +47 -0
- package/dist/android/upload-progress.js.map +1 -0
- package/dist/android/version.d.ts +47 -0
- package/dist/android/version.d.ts.map +1 -0
- package/dist/android/version.js +136 -0
- package/dist/android/version.js.map +1 -0
- package/dist/api-client/index.d.ts +3 -0
- package/dist/api-client/index.d.ts.map +1 -0
- package/dist/api-client/index.js +5 -0
- package/dist/api-client/index.js.map +1 -0
- package/dist/commands/index.d.ts +52 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +63 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/core/cli-registry.d.ts +41 -0
- package/dist/core/cli-registry.d.ts.map +1 -0
- package/dist/core/cli-registry.js +49 -0
- package/dist/core/cli-registry.js.map +1 -0
- package/dist/core/command-registry.d.ts +10 -0
- package/dist/core/command-registry.d.ts.map +1 -1
- package/dist/core/command-registry.js +17 -0
- package/dist/core/command-registry.js.map +1 -1
- package/dist/core/env-annotation-registry.d.ts +58 -0
- package/dist/core/env-annotation-registry.d.ts.map +1 -0
- package/dist/core/env-annotation-registry.js +80 -0
- package/dist/core/env-annotation-registry.js.map +1 -0
- package/dist/core/env-generator-registry.d.ts +59 -0
- package/dist/core/env-generator-registry.d.ts.map +1 -0
- package/dist/core/env-generator-registry.js +102 -0
- package/dist/core/env-generator-registry.js.map +1 -0
- package/dist/core/env-group-registry.d.ts +65 -0
- package/dist/core/env-group-registry.d.ts.map +1 -0
- package/dist/core/env-group-registry.js +77 -0
- package/dist/core/env-group-registry.js.map +1 -0
- package/dist/core/env-spec-registry.d.ts +16 -2
- package/dist/core/env-spec-registry.d.ts.map +1 -1
- package/dist/core/env-spec-registry.js +15 -0
- package/dist/core/env-spec-registry.js.map +1 -1
- package/dist/core/env-values.d.ts +3 -2
- package/dist/core/env-values.d.ts.map +1 -1
- package/dist/core/env-values.js +5 -3
- package/dist/core/env-values.js.map +1 -1
- package/dist/core/index.d.ts +10 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +6 -2
- package/dist/core/index.js.map +1 -1
- package/dist/deploy/index.d.ts +3 -0
- package/dist/deploy/index.d.ts.map +1 -0
- package/dist/deploy/index.js +5 -0
- package/dist/deploy/index.js.map +1 -0
- package/dist/engine/api-client.d.ts +211 -0
- package/dist/engine/api-client.d.ts.map +1 -0
- package/dist/engine/api-client.js +350 -0
- package/dist/engine/api-client.js.map +1 -0
- package/dist/engine/browser.d.ts +18 -0
- package/dist/engine/browser.d.ts.map +1 -0
- package/dist/engine/browser.js +115 -0
- package/dist/engine/browser.js.map +1 -0
- package/dist/engine/builtin-registrations.d.ts +20 -0
- package/dist/engine/builtin-registrations.d.ts.map +1 -0
- package/dist/engine/builtin-registrations.js +86 -0
- package/dist/engine/builtin-registrations.js.map +1 -0
- package/dist/engine/commands/api.d.ts +88 -0
- package/dist/engine/commands/api.d.ts.map +1 -0
- package/dist/engine/commands/api.js +398 -0
- package/dist/engine/commands/api.js.map +1 -0
- package/dist/engine/commands/config.d.ts +5 -0
- package/dist/engine/commands/config.d.ts.map +1 -0
- package/dist/engine/commands/config.js +83 -0
- package/dist/engine/commands/config.js.map +1 -0
- package/dist/engine/commands/deploy.d.ts +250 -0
- package/dist/engine/commands/deploy.d.ts.map +1 -0
- package/dist/engine/commands/deploy.js +1186 -0
- package/dist/engine/commands/deploy.js.map +1 -0
- package/dist/engine/commands/init.d.ts +18 -0
- package/dist/engine/commands/init.d.ts.map +1 -0
- package/dist/engine/commands/init.js +50 -0
- package/dist/engine/commands/init.js.map +1 -0
- package/dist/engine/commands/login.d.ts +4 -0
- package/dist/engine/commands/login.d.ts.map +1 -0
- package/dist/engine/commands/login.js +205 -0
- package/dist/engine/commands/login.js.map +1 -0
- package/dist/engine/commands/node.d.ts +21 -0
- package/dist/engine/commands/node.d.ts.map +1 -0
- package/dist/engine/commands/node.js +503 -0
- package/dist/engine/commands/node.js.map +1 -0
- package/dist/engine/config.d.ts +284 -0
- package/dist/engine/config.d.ts.map +1 -0
- package/dist/engine/config.js +469 -0
- package/dist/engine/config.js.map +1 -0
- package/dist/engine/conformance.d.ts +193 -0
- package/dist/engine/conformance.d.ts.map +1 -0
- package/dist/engine/conformance.js +243 -0
- package/dist/engine/conformance.js.map +1 -0
- package/dist/engine/create-cli.d.ts +181 -0
- package/dist/engine/create-cli.d.ts.map +1 -0
- package/dist/engine/create-cli.js +91 -0
- package/dist/engine/create-cli.js.map +1 -0
- package/dist/engine/deploy/about.d.ts +12 -0
- package/dist/engine/deploy/about.d.ts.map +1 -0
- package/dist/engine/deploy/about.js +110 -0
- package/dist/engine/deploy/about.js.map +1 -0
- package/dist/engine/deploy/adopt.d.ts +21 -0
- package/dist/engine/deploy/adopt.d.ts.map +1 -0
- package/dist/engine/deploy/adopt.js +78 -0
- package/dist/engine/deploy/adopt.js.map +1 -0
- package/dist/engine/deploy/answers-file.d.ts +7 -0
- package/dist/engine/deploy/answers-file.d.ts.map +1 -0
- package/dist/engine/deploy/answers-file.js +49 -0
- package/dist/engine/deploy/answers-file.js.map +1 -0
- package/dist/engine/deploy/app-role.d.ts +278 -0
- package/dist/engine/deploy/app-role.d.ts.map +1 -0
- package/dist/engine/deploy/app-role.js +826 -0
- package/dist/engine/deploy/app-role.js.map +1 -0
- package/dist/engine/deploy/app-version.d.ts +103 -0
- package/dist/engine/deploy/app-version.d.ts.map +1 -0
- package/dist/engine/deploy/app-version.js +344 -0
- package/dist/engine/deploy/app-version.js.map +1 -0
- package/dist/engine/deploy/checks/compose.d.ts +16 -0
- package/dist/engine/deploy/checks/compose.d.ts.map +1 -0
- package/dist/engine/deploy/checks/compose.js +149 -0
- package/dist/engine/deploy/checks/compose.js.map +1 -0
- package/dist/engine/deploy/checks/database.d.ts +83 -0
- package/dist/engine/deploy/checks/database.d.ts.map +1 -0
- package/dist/engine/deploy/checks/database.js +455 -0
- package/dist/engine/deploy/checks/database.js.map +1 -0
- package/dist/engine/deploy/checks/dns.d.ts +3 -0
- package/dist/engine/deploy/checks/dns.d.ts.map +1 -0
- package/dist/engine/deploy/checks/dns.js +85 -0
- package/dist/engine/deploy/checks/dns.js.map +1 -0
- package/dist/engine/deploy/checks/host.d.ts +19 -0
- package/dist/engine/deploy/checks/host.d.ts.map +1 -0
- package/dist/engine/deploy/checks/host.js +543 -0
- package/dist/engine/deploy/checks/host.js.map +1 -0
- package/dist/engine/deploy/checks/index.d.ts +35 -0
- package/dist/engine/deploy/checks/index.d.ts.map +1 -0
- package/dist/engine/deploy/checks/index.js +75 -0
- package/dist/engine/deploy/checks/index.js.map +1 -0
- package/dist/engine/deploy/checks/registry.d.ts +110 -0
- package/dist/engine/deploy/checks/registry.d.ts.map +1 -0
- package/dist/engine/deploy/checks/registry.js +104 -0
- package/dist/engine/deploy/checks/registry.js.map +1 -0
- package/dist/engine/deploy/checks/source.d.ts +45 -0
- package/dist/engine/deploy/checks/source.d.ts.map +1 -0
- package/dist/engine/deploy/checks/source.js +175 -0
- package/dist/engine/deploy/checks/source.js.map +1 -0
- package/dist/engine/deploy/checks/stack-ports.d.ts +4 -0
- package/dist/engine/deploy/checks/stack-ports.d.ts.map +1 -0
- package/dist/engine/deploy/checks/stack-ports.js +261 -0
- package/dist/engine/deploy/checks/stack-ports.js.map +1 -0
- package/dist/engine/deploy/checks/tls.d.ts +87 -0
- package/dist/engine/deploy/checks/tls.d.ts.map +1 -0
- package/dist/engine/deploy/checks/tls.js +552 -0
- package/dist/engine/deploy/checks/tls.js.map +1 -0
- package/dist/engine/deploy/checks/types.d.ts +202 -0
- package/dist/engine/deploy/checks/types.d.ts.map +1 -0
- package/dist/engine/deploy/checks/types.js +199 -0
- package/dist/engine/deploy/checks/types.js.map +1 -0
- package/dist/engine/deploy/compose-command.d.ts +16 -0
- package/dist/engine/deploy/compose-command.d.ts.map +1 -0
- package/dist/engine/deploy/compose-command.js +40 -0
- package/dist/engine/deploy/compose-command.js.map +1 -0
- package/dist/engine/deploy/compose-containers.d.ts +101 -0
- package/dist/engine/deploy/compose-containers.d.ts.map +1 -0
- package/dist/engine/deploy/compose-containers.js +191 -0
- package/dist/engine/deploy/compose-containers.js.map +1 -0
- package/dist/engine/deploy/compose-files.d.ts +29 -0
- package/dist/engine/deploy/compose-files.d.ts.map +1 -0
- package/dist/engine/deploy/compose-files.js +118 -0
- package/dist/engine/deploy/compose-files.js.map +1 -0
- package/dist/engine/deploy/compose-hints.d.ts +11 -0
- package/dist/engine/deploy/compose-hints.d.ts.map +1 -0
- package/dist/engine/deploy/compose-hints.js +70 -0
- package/dist/engine/deploy/compose-hints.js.map +1 -0
- package/dist/engine/deploy/compose-port-variables.d.ts +58 -0
- package/dist/engine/deploy/compose-port-variables.d.ts.map +1 -0
- package/dist/engine/deploy/compose-port-variables.js +184 -0
- package/dist/engine/deploy/compose-port-variables.js.map +1 -0
- package/dist/engine/deploy/compose-ports.d.ts +98 -0
- package/dist/engine/deploy/compose-ports.d.ts.map +1 -0
- package/dist/engine/deploy/compose-ports.js +204 -0
- package/dist/engine/deploy/compose-ports.js.map +1 -0
- package/dist/engine/deploy/compose-project.d.ts +113 -0
- package/dist/engine/deploy/compose-project.d.ts.map +1 -0
- package/dist/engine/deploy/compose-project.js +177 -0
- package/dist/engine/deploy/compose-project.js.map +1 -0
- package/dist/engine/deploy/consent.d.ts +29 -0
- package/dist/engine/deploy/consent.d.ts.map +1 -0
- package/dist/engine/deploy/consent.js +35 -0
- package/dist/engine/deploy/consent.js.map +1 -0
- package/dist/engine/deploy/database-drop.d.ts +22 -0
- package/dist/engine/deploy/database-drop.d.ts.map +1 -0
- package/dist/engine/deploy/database-drop.js +135 -0
- package/dist/engine/deploy/database-drop.js.map +1 -0
- package/dist/engine/deploy/database.d.ts +116 -0
- package/dist/engine/deploy/database.d.ts.map +1 -0
- package/dist/engine/deploy/database.js +252 -0
- package/dist/engine/deploy/database.js.map +1 -0
- package/dist/engine/deploy/deploy-info.d.ts +48 -0
- package/dist/engine/deploy/deploy-info.d.ts.map +1 -0
- package/dist/engine/deploy/deploy-info.js +163 -0
- package/dist/engine/deploy/deploy-info.js.map +1 -0
- package/dist/engine/deploy/deployment-evidence.d.ts +38 -0
- package/dist/engine/deploy/deployment-evidence.d.ts.map +1 -0
- package/dist/engine/deploy/deployment-evidence.js +92 -0
- package/dist/engine/deploy/deployment-evidence.js.map +1 -0
- package/dist/engine/deploy/edge-config.d.ts +103 -0
- package/dist/engine/deploy/edge-config.d.ts.map +1 -0
- package/dist/engine/deploy/edge-config.js +170 -0
- package/dist/engine/deploy/edge-config.js.map +1 -0
- package/dist/engine/deploy/env-absence.d.ts +61 -0
- package/dist/engine/deploy/env-absence.d.ts.map +1 -0
- package/dist/engine/deploy/env-absence.js +33 -0
- package/dist/engine/deploy/env-absence.js.map +1 -0
- package/dist/engine/deploy/env-file.d.ts +14 -0
- package/dist/engine/deploy/env-file.d.ts.map +1 -0
- package/dist/engine/deploy/env-file.js +58 -0
- package/dist/engine/deploy/env-file.js.map +1 -0
- package/dist/engine/deploy/env-fragments.d.ts +29 -0
- package/dist/engine/deploy/env-fragments.d.ts.map +1 -0
- package/dist/engine/deploy/env-fragments.js +73 -0
- package/dist/engine/deploy/env-fragments.js.map +1 -0
- package/dist/engine/deploy/env-metadata.d.ts +73 -0
- package/dist/engine/deploy/env-metadata.d.ts.map +1 -0
- package/dist/engine/deploy/env-metadata.js +227 -0
- package/dist/engine/deploy/env-metadata.js.map +1 -0
- package/dist/engine/deploy/env-spec.d.ts +75 -0
- package/dist/engine/deploy/env-spec.d.ts.map +1 -0
- package/dist/engine/deploy/env-spec.js +239 -0
- package/dist/engine/deploy/env-spec.js.map +1 -0
- package/dist/engine/deploy/env-wizard.d.ts +56 -0
- package/dist/engine/deploy/env-wizard.d.ts.map +1 -0
- package/dist/engine/deploy/env-wizard.js +235 -0
- package/dist/engine/deploy/env-wizard.js.map +1 -0
- package/dist/engine/deploy/executor.d.ts +81 -0
- package/dist/engine/deploy/executor.d.ts.map +1 -0
- package/dist/engine/deploy/executor.js +247 -0
- package/dist/engine/deploy/executor.js.map +1 -0
- package/dist/engine/deploy/free-ports.d.ts +145 -0
- package/dist/engine/deploy/free-ports.d.ts.map +1 -0
- package/dist/engine/deploy/free-ports.js +235 -0
- package/dist/engine/deploy/free-ports.js.map +1 -0
- package/dist/engine/deploy/health.d.ts +153 -0
- package/dist/engine/deploy/health.d.ts.map +1 -0
- package/dist/engine/deploy/health.js +335 -0
- package/dist/engine/deploy/health.js.map +1 -0
- package/dist/engine/deploy/hooks.d.ts +66 -0
- package/dist/engine/deploy/hooks.d.ts.map +1 -0
- package/dist/engine/deploy/hooks.js +19 -0
- package/dist/engine/deploy/hooks.js.map +1 -0
- package/dist/engine/deploy/host-facts.d.ts +23 -0
- package/dist/engine/deploy/host-facts.d.ts.map +1 -0
- package/dist/engine/deploy/host-facts.js +67 -0
- package/dist/engine/deploy/host-facts.js.map +1 -0
- package/dist/engine/deploy/install.d.ts +239 -0
- package/dist/engine/deploy/install.d.ts.map +1 -0
- package/dist/engine/deploy/install.js +1474 -0
- package/dist/engine/deploy/install.js.map +1 -0
- package/dist/engine/deploy/inventory.d.ts +30 -0
- package/dist/engine/deploy/inventory.d.ts.map +1 -0
- package/dist/engine/deploy/inventory.js +122 -0
- package/dist/engine/deploy/inventory.js.map +1 -0
- package/dist/engine/deploy/journal.d.ts +77 -0
- package/dist/engine/deploy/journal.d.ts.map +1 -0
- package/dist/engine/deploy/journal.js +221 -0
- package/dist/engine/deploy/journal.js.map +1 -0
- package/dist/engine/deploy/layout.d.ts +77 -0
- package/dist/engine/deploy/layout.d.ts.map +1 -0
- package/dist/engine/deploy/layout.js +191 -0
- package/dist/engine/deploy/layout.js.map +1 -0
- package/dist/engine/deploy/oauth-check.d.ts +58 -0
- package/dist/engine/deploy/oauth-check.d.ts.map +1 -0
- package/dist/engine/deploy/oauth-check.js +213 -0
- package/dist/engine/deploy/oauth-check.js.map +1 -0
- package/dist/engine/deploy/proxy-bootstrap.d.ts +149 -0
- package/dist/engine/deploy/proxy-bootstrap.d.ts.map +1 -0
- package/dist/engine/deploy/proxy-bootstrap.js +416 -0
- package/dist/engine/deploy/proxy-bootstrap.js.map +1 -0
- package/dist/engine/deploy/proxy-streams.d.ts +110 -0
- package/dist/engine/deploy/proxy-streams.d.ts.map +1 -0
- package/dist/engine/deploy/proxy-streams.js +208 -0
- package/dist/engine/deploy/proxy-streams.js.map +1 -0
- package/dist/engine/deploy/proxy.d.ts +375 -0
- package/dist/engine/deploy/proxy.d.ts.map +1 -0
- package/dist/engine/deploy/proxy.js +758 -0
- package/dist/engine/deploy/proxy.js.map +1 -0
- package/dist/engine/deploy/renewal.d.ts +54 -0
- package/dist/engine/deploy/renewal.d.ts.map +1 -0
- package/dist/engine/deploy/renewal.js +169 -0
- package/dist/engine/deploy/renewal.js.map +1 -0
- package/dist/engine/deploy/repo.d.ts +119 -0
- package/dist/engine/deploy/repo.d.ts.map +1 -0
- package/dist/engine/deploy/repo.js +282 -0
- package/dist/engine/deploy/repo.js.map +1 -0
- package/dist/engine/deploy/run-record.d.ts +28 -0
- package/dist/engine/deploy/run-record.d.ts.map +1 -0
- package/dist/engine/deploy/run-record.js +44 -0
- package/dist/engine/deploy/run-record.js.map +1 -0
- package/dist/engine/deploy/stack-ports-gate.d.ts +19 -0
- package/dist/engine/deploy/stack-ports-gate.d.ts.map +1 -0
- package/dist/engine/deploy/stack-ports-gate.js +54 -0
- package/dist/engine/deploy/stack-ports-gate.js.map +1 -0
- package/dist/engine/deploy/state.d.ts +289 -0
- package/dist/engine/deploy/state.d.ts.map +1 -0
- package/dist/engine/deploy/state.js +163 -0
- package/dist/engine/deploy/state.js.map +1 -0
- package/dist/engine/deploy/steps/app-step-context.d.ts +24 -0
- package/dist/engine/deploy/steps/app-step-context.d.ts.map +1 -0
- package/dist/engine/deploy/steps/app-step-context.js +45 -0
- package/dist/engine/deploy/steps/app-step-context.js.map +1 -0
- package/dist/engine/deploy/steps/pipeline.d.ts +46 -0
- package/dist/engine/deploy/steps/pipeline.d.ts.map +1 -0
- package/dist/engine/deploy/steps/pipeline.js +73 -0
- package/dist/engine/deploy/steps/pipeline.js.map +1 -0
- package/dist/engine/deploy/steps/plan.d.ts +28 -0
- package/dist/engine/deploy/steps/plan.d.ts.map +1 -0
- package/dist/engine/deploy/steps/plan.js +32 -0
- package/dist/engine/deploy/steps/plan.js.map +1 -0
- package/dist/engine/deploy/steps/registry.d.ts +182 -0
- package/dist/engine/deploy/steps/registry.d.ts.map +1 -0
- package/dist/engine/deploy/steps/registry.js +214 -0
- package/dist/engine/deploy/steps/registry.js.map +1 -0
- package/dist/engine/deploy/steps/step-values.d.ts +28 -0
- package/dist/engine/deploy/steps/step-values.d.ts.map +1 -0
- package/dist/engine/deploy/steps/step-values.js +33 -0
- package/dist/engine/deploy/steps/step-values.js.map +1 -0
- package/dist/engine/deploy/testing/fake-containers.d.ts +29 -0
- package/dist/engine/deploy/testing/fake-containers.d.ts.map +1 -0
- package/dist/engine/deploy/testing/fake-containers.js +32 -0
- package/dist/engine/deploy/testing/fake-containers.js.map +1 -0
- package/dist/engine/deploy/testing/fake-postgres.d.ts +88 -0
- package/dist/engine/deploy/testing/fake-postgres.d.ts.map +1 -0
- package/dist/engine/deploy/testing/fake-postgres.js +236 -0
- package/dist/engine/deploy/testing/fake-postgres.js.map +1 -0
- package/dist/engine/deploy/testing/fake-vps.d.ts +147 -0
- package/dist/engine/deploy/testing/fake-vps.d.ts.map +1 -0
- package/dist/engine/deploy/testing/fake-vps.js +371 -0
- package/dist/engine/deploy/testing/fake-vps.js.map +1 -0
- package/dist/engine/deploy/uninstall.d.ts +87 -0
- package/dist/engine/deploy/uninstall.d.ts.map +1 -0
- package/dist/engine/deploy/uninstall.js +321 -0
- package/dist/engine/deploy/uninstall.js.map +1 -0
- package/dist/engine/deploy/update.d.ts +114 -0
- package/dist/engine/deploy/update.d.ts.map +1 -0
- package/dist/engine/deploy/update.js +1385 -0
- package/dist/engine/deploy/update.js.map +1 -0
- package/dist/engine/deploy/version-step.d.ts +74 -0
- package/dist/engine/deploy/version-step.d.ts.map +1 -0
- package/dist/engine/deploy/version-step.js +177 -0
- package/dist/engine/deploy/version-step.js.map +1 -0
- package/dist/engine/device-auth.d.ts +240 -0
- package/dist/engine/device-auth.d.ts.map +1 -0
- package/dist/engine/device-auth.js +442 -0
- package/dist/engine/device-auth.js.map +1 -0
- package/dist/engine/device-login.d.ts +126 -0
- package/dist/engine/device-login.d.ts.map +1 -0
- package/dist/engine/device-login.js +164 -0
- package/dist/engine/device-login.js.map +1 -0
- package/dist/engine/errors.d.ts +314 -0
- package/dist/engine/errors.d.ts.map +1 -0
- package/dist/engine/errors.js +561 -0
- package/dist/engine/errors.js.map +1 -0
- package/dist/engine/github-raw-manifest.d.ts +59 -0
- package/dist/engine/github-raw-manifest.d.ts.map +1 -0
- package/dist/engine/github-raw-manifest.js +197 -0
- package/dist/engine/github-raw-manifest.js.map +1 -0
- package/dist/engine/identity.d.ts +169 -0
- package/dist/engine/identity.d.ts.map +1 -0
- package/dist/engine/identity.js +227 -0
- package/dist/engine/identity.js.map +1 -0
- package/dist/engine/index.d.ts +141 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +147 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/init/local-profile.d.ts +93 -0
- package/dist/engine/init/local-profile.d.ts.map +1 -0
- package/dist/engine/init/local-profile.js +295 -0
- package/dist/engine/init/local-profile.js.map +1 -0
- package/dist/engine/init/run-init.d.ts +41 -0
- package/dist/engine/init/run-init.d.ts.map +1 -0
- package/dist/engine/init/run-init.js +297 -0
- package/dist/engine/init/run-init.js.map +1 -0
- package/dist/engine/node/capabilities.d.ts +433 -0
- package/dist/engine/node/capabilities.d.ts.map +1 -0
- package/dist/engine/node/capabilities.js +597 -0
- package/dist/engine/node/capabilities.js.map +1 -0
- package/dist/engine/node/daemon-channels.d.ts +66 -0
- package/dist/engine/node/daemon-channels.d.ts.map +1 -0
- package/dist/engine/node/daemon-channels.js +65 -0
- package/dist/engine/node/daemon-channels.js.map +1 -0
- package/dist/engine/node/daemon.d.ts +63 -0
- package/dist/engine/node/daemon.d.ts.map +1 -0
- package/dist/engine/node/daemon.js +279 -0
- package/dist/engine/node/daemon.js.map +1 -0
- package/dist/engine/node/doctor.d.ts +60 -0
- package/dist/engine/node/doctor.d.ts.map +1 -0
- package/dist/engine/node/doctor.js +447 -0
- package/dist/engine/node/doctor.js.map +1 -0
- package/dist/engine/node/enrollment.d.ts +98 -0
- package/dist/engine/node/enrollment.d.ts.map +1 -0
- package/dist/engine/node/enrollment.js +189 -0
- package/dist/engine/node/enrollment.js.map +1 -0
- package/dist/engine/node/env-flags.d.ts +5 -0
- package/dist/engine/node/env-flags.d.ts.map +1 -0
- package/dist/engine/node/env-flags.js +22 -0
- package/dist/engine/node/env-flags.js.map +1 -0
- package/dist/engine/node/executors/credential-hygiene.d.ts +63 -0
- package/dist/engine/node/executors/credential-hygiene.d.ts.map +1 -0
- package/dist/engine/node/executors/credential-hygiene.js +210 -0
- package/dist/engine/node/executors/credential-hygiene.js.map +1 -0
- package/dist/engine/node/executors/db-backup-run.d.ts +73 -0
- package/dist/engine/node/executors/db-backup-run.d.ts.map +1 -0
- package/dist/engine/node/executors/db-backup-run.js +362 -0
- package/dist/engine/node/executors/db-backup-run.js.map +1 -0
- package/dist/engine/node/executors/example-checksum.d.ts +30 -0
- package/dist/engine/node/executors/example-checksum.d.ts.map +1 -0
- package/dist/engine/node/executors/example-checksum.js +56 -0
- package/dist/engine/node/executors/example-checksum.js.map +1 -0
- package/dist/engine/node/executors/index.d.ts +213 -0
- package/dist/engine/node/executors/index.d.ts.map +1 -0
- package/dist/engine/node/executors/index.js +58 -0
- package/dist/engine/node/executors/index.js.map +1 -0
- package/dist/engine/node/executors/registry.d.ts +38 -0
- package/dist/engine/node/executors/registry.d.ts.map +1 -0
- package/dist/engine/node/executors/registry.js +103 -0
- package/dist/engine/node/executors/registry.js.map +1 -0
- package/dist/engine/node/heap-snapshot.d.ts +37 -0
- package/dist/engine/node/heap-snapshot.d.ts.map +1 -0
- package/dist/engine/node/heap-snapshot.js +160 -0
- package/dist/engine/node/heap-snapshot.js.map +1 -0
- package/dist/engine/node/host-telemetry.d.ts +38 -0
- package/dist/engine/node/host-telemetry.d.ts.map +1 -0
- package/dist/engine/node/host-telemetry.js +39 -0
- package/dist/engine/node/host-telemetry.js.map +1 -0
- package/dist/engine/node/host-vitals.d.ts +51 -0
- package/dist/engine/node/host-vitals.d.ts.map +1 -0
- package/dist/engine/node/host-vitals.js +117 -0
- package/dist/engine/node/host-vitals.js.map +1 -0
- package/dist/engine/node/install-deps.d.ts +231 -0
- package/dist/engine/node/install-deps.d.ts.map +1 -0
- package/dist/engine/node/install-deps.js +392 -0
- package/dist/engine/node/install-deps.js.map +1 -0
- package/dist/engine/node/ipc-protocol.d.ts +114 -0
- package/dist/engine/node/ipc-protocol.d.ts.map +1 -0
- package/dist/engine/node/ipc-protocol.js +122 -0
- package/dist/engine/node/ipc-protocol.js.map +1 -0
- package/dist/engine/node/lifecycle.d.ts +103 -0
- package/dist/engine/node/lifecycle.d.ts.map +1 -0
- package/dist/engine/node/lifecycle.js +260 -0
- package/dist/engine/node/lifecycle.js.map +1 -0
- package/dist/engine/node/logger.d.ts +95 -0
- package/dist/engine/node/logger.d.ts.map +1 -0
- package/dist/engine/node/logger.js +241 -0
- package/dist/engine/node/logger.js.map +1 -0
- package/dist/engine/node/memory-watchdog.d.ts +89 -0
- package/dist/engine/node/memory-watchdog.d.ts.map +1 -0
- package/dist/engine/node/memory-watchdog.js +248 -0
- package/dist/engine/node/memory-watchdog.js.map +1 -0
- package/dist/engine/node/models.d.ts +195 -0
- package/dist/engine/node/models.d.ts.map +1 -0
- package/dist/engine/node/models.js +379 -0
- package/dist/engine/node/models.js.map +1 -0
- package/dist/engine/node/node-api.d.ts +439 -0
- package/dist/engine/node/node-api.d.ts.map +1 -0
- package/dist/engine/node/node-api.js +125 -0
- package/dist/engine/node/node-api.js.map +1 -0
- package/dist/engine/node/node-config.d.ts +128 -0
- package/dist/engine/node/node-config.d.ts.map +1 -0
- package/dist/engine/node/node-config.js +237 -0
- package/dist/engine/node/node-config.js.map +1 -0
- package/dist/engine/node/node-dashboard-source.d.ts +83 -0
- package/dist/engine/node/node-dashboard-source.d.ts.map +1 -0
- package/dist/engine/node/node-dashboard-source.js +181 -0
- package/dist/engine/node/node-dashboard-source.js.map +1 -0
- package/dist/engine/node/node-engine.d.ts +282 -0
- package/dist/engine/node/node-engine.d.ts.map +1 -0
- package/dist/engine/node/node-engine.js +925 -0
- package/dist/engine/node/node-engine.js.map +1 -0
- package/dist/engine/node/node-errors.d.ts +54 -0
- package/dist/engine/node/node-errors.d.ts.map +1 -0
- package/dist/engine/node/node-errors.js +71 -0
- package/dist/engine/node/node-errors.js.map +1 -0
- package/dist/engine/node/node-events-queue.d.ts +27 -0
- package/dist/engine/node/node-events-queue.d.ts.map +1 -0
- package/dist/engine/node/node-events-queue.js +46 -0
- package/dist/engine/node/node-events-queue.js.map +1 -0
- package/dist/engine/node/node-events.d.ts +132 -0
- package/dist/engine/node/node-events.d.ts.map +1 -0
- package/dist/engine/node/node-events.js +2 -0
- package/dist/engine/node/node-events.js.map +1 -0
- package/dist/engine/node/node-vitals.d.ts +123 -0
- package/dist/engine/node/node-vitals.d.ts.map +1 -0
- package/dist/engine/node/node-vitals.js +266 -0
- package/dist/engine/node/node-vitals.js.map +1 -0
- package/dist/engine/node/paths.d.ts +39 -0
- package/dist/engine/node/paths.d.ts.map +1 -0
- package/dist/engine/node/paths.js +60 -0
- package/dist/engine/node/paths.js.map +1 -0
- package/dist/engine/node/pg-dump.d.ts +126 -0
- package/dist/engine/node/pg-dump.d.ts.map +1 -0
- package/dist/engine/node/pg-dump.js +223 -0
- package/dist/engine/node/pg-dump.js.map +1 -0
- package/dist/engine/node/pidfile.d.ts +38 -0
- package/dist/engine/node/pidfile.d.ts.map +1 -0
- package/dist/engine/node/pidfile.js +156 -0
- package/dist/engine/node/pidfile.js.map +1 -0
- package/dist/engine/node/power-probe.d.ts +59 -0
- package/dist/engine/node/power-probe.d.ts.map +1 -0
- package/dist/engine/node/power-probe.js +240 -0
- package/dist/engine/node/power-probe.js.map +1 -0
- package/dist/engine/node/power-watcher.d.ts +30 -0
- package/dist/engine/node/power-watcher.d.ts.map +1 -0
- package/dist/engine/node/power-watcher.js +116 -0
- package/dist/engine/node/power-watcher.js.map +1 -0
- package/dist/engine/node/runtime-state.d.ts +24 -0
- package/dist/engine/node/runtime-state.d.ts.map +1 -0
- package/dist/engine/node/runtime-state.js +19 -0
- package/dist/engine/node/runtime-state.js.map +1 -0
- package/dist/engine/node/runtime-tuning.d.ts +174 -0
- package/dist/engine/node/runtime-tuning.d.ts.map +1 -0
- package/dist/engine/node/runtime-tuning.js +327 -0
- package/dist/engine/node/runtime-tuning.js.map +1 -0
- package/dist/engine/node/service.d.ts +39 -0
- package/dist/engine/node/service.d.ts.map +1 -0
- package/dist/engine/node/service.js +215 -0
- package/dist/engine/node/service.js.map +1 -0
- package/dist/engine/node/start.d.ts +69 -0
- package/dist/engine/node/start.d.ts.map +1 -0
- package/dist/engine/node/start.js +325 -0
- package/dist/engine/node/start.js.map +1 -0
- package/dist/engine/node/worker-env-aliases.d.ts +39 -0
- package/dist/engine/node/worker-env-aliases.d.ts.map +1 -0
- package/dist/engine/node/worker-env-aliases.js +126 -0
- package/dist/engine/node/worker-env-aliases.js.map +1 -0
- package/dist/engine/node/worker-env-table.d.ts +15 -0
- package/dist/engine/node/worker-env-table.d.ts.map +1 -0
- package/dist/engine/node/worker-env-table.js +100 -0
- package/dist/engine/node/worker-env-table.js.map +1 -0
- package/dist/engine/node/worker-env.d.ts +67 -0
- package/dist/engine/node/worker-env.d.ts.map +1 -0
- package/dist/engine/node/worker-env.js +114 -0
- package/dist/engine/node/worker-env.js.map +1 -0
- package/dist/engine/output.d.ts +97 -0
- package/dist/engine/output.d.ts.map +1 -0
- package/dist/engine/output.js +274 -0
- package/dist/engine/output.js.map +1 -0
- package/dist/engine/package-info.d.ts +7 -0
- package/dist/engine/package-info.d.ts.map +1 -0
- package/dist/engine/package-info.js +38 -0
- package/dist/engine/package-info.js.map +1 -0
- package/dist/engine/program.d.ts +53 -0
- package/dist/engine/program.d.ts.map +1 -0
- package/dist/engine/program.js +213 -0
- package/dist/engine/program.js.map +1 -0
- package/dist/engine/prompt.d.ts +69 -0
- package/dist/engine/prompt.d.ts.map +1 -0
- package/dist/engine/prompt.js +205 -0
- package/dist/engine/prompt.js.map +1 -0
- package/dist/engine/registries.d.ts +5 -0
- package/dist/engine/registries.d.ts.map +1 -0
- package/dist/engine/registries.js +68 -0
- package/dist/engine/registries.js.map +1 -0
- package/dist/engine/request-body.d.ts +31 -0
- package/dist/engine/request-body.d.ts.map +1 -0
- package/dist/engine/request-body.js +156 -0
- package/dist/engine/request-body.js.map +1 -0
- package/dist/engine/semver.d.ts +31 -0
- package/dist/engine/semver.d.ts.map +1 -0
- package/dist/engine/semver.js +100 -0
- package/dist/engine/semver.js.map +1 -0
- package/dist/engine/test-support.d.ts +50 -0
- package/dist/engine/test-support.d.ts.map +1 -0
- package/dist/engine/test-support.js +86 -0
- package/dist/engine/test-support.js.map +1 -0
- package/dist/engine/tui/app-registry.d.ts +103 -0
- package/dist/engine/tui/app-registry.d.ts.map +1 -0
- package/dist/engine/tui/app-registry.js +103 -0
- package/dist/engine/tui/app-registry.js.map +1 -0
- package/dist/engine/tui/app.d.ts +11 -0
- package/dist/engine/tui/app.d.ts.map +1 -0
- package/dist/engine/tui/app.js +134 -0
- package/dist/engine/tui/app.js.map +1 -0
- package/dist/engine/tui/builtin-screens.d.ts +11 -0
- package/dist/engine/tui/builtin-screens.d.ts.map +1 -0
- package/dist/engine/tui/builtin-screens.js +69 -0
- package/dist/engine/tui/builtin-screens.js.map +1 -0
- package/dist/engine/tui/conformance.d.ts +149 -0
- package/dist/engine/tui/conformance.d.ts.map +1 -0
- package/dist/engine/tui/conformance.js +428 -0
- package/dist/engine/tui/conformance.js.map +1 -0
- package/dist/engine/tui/context.d.ts +220 -0
- package/dist/engine/tui/context.d.ts.map +1 -0
- package/dist/engine/tui/context.js +258 -0
- package/dist/engine/tui/context.js.map +1 -0
- package/dist/engine/tui/dashboard/index.d.ts +8 -0
- package/dist/engine/tui/dashboard/index.d.ts.map +1 -0
- package/dist/engine/tui/dashboard/index.js +5 -0
- package/dist/engine/tui/dashboard/index.js.map +1 -0
- package/dist/engine/tui/dashboard/jobs-insights.d.ts +145 -0
- package/dist/engine/tui/dashboard/jobs-insights.d.ts.map +1 -0
- package/dist/engine/tui/dashboard/jobs-insights.js +63 -0
- package/dist/engine/tui/dashboard/jobs-insights.js.map +1 -0
- package/dist/engine/tui/dashboard/node-embedded.d.ts +33 -0
- package/dist/engine/tui/dashboard/node-embedded.d.ts.map +1 -0
- package/dist/engine/tui/dashboard/node-embedded.js +81 -0
- package/dist/engine/tui/dashboard/node-embedded.js.map +1 -0
- package/dist/engine/tui/dashboard/source.d.ts +294 -0
- package/dist/engine/tui/dashboard/source.d.ts.map +1 -0
- package/dist/engine/tui/dashboard/source.js +397 -0
- package/dist/engine/tui/dashboard/source.js.map +1 -0
- package/dist/engine/tui/dashboard/use-dashboard.d.ts +23 -0
- package/dist/engine/tui/dashboard/use-dashboard.d.ts.map +1 -0
- package/dist/engine/tui/dashboard/use-dashboard.js +32 -0
- package/dist/engine/tui/dashboard/use-dashboard.js.map +1 -0
- package/dist/engine/tui/index.d.ts +25 -0
- package/dist/engine/tui/index.d.ts.map +1 -0
- package/dist/engine/tui/index.js +89 -0
- package/dist/engine/tui/index.js.map +1 -0
- package/dist/engine/tui/layout.d.ts +152 -0
- package/dist/engine/tui/layout.d.ts.map +1 -0
- package/dist/engine/tui/layout.js +214 -0
- package/dist/engine/tui/layout.js.map +1 -0
- package/dist/engine/tui/menu-registry.d.ts +201 -0
- package/dist/engine/tui/menu-registry.d.ts.map +1 -0
- package/dist/engine/tui/menu-registry.js +205 -0
- package/dist/engine/tui/menu-registry.js.map +1 -0
- package/dist/engine/tui/menu-tree.d.ts +198 -0
- package/dist/engine/tui/menu-tree.d.ts.map +1 -0
- package/dist/engine/tui/menu-tree.js +276 -0
- package/dist/engine/tui/menu-tree.js.map +1 -0
- package/dist/engine/tui/raw-mode.d.ts +54 -0
- package/dist/engine/tui/raw-mode.d.ts.map +1 -0
- package/dist/engine/tui/raw-mode.js +106 -0
- package/dist/engine/tui/raw-mode.js.map +1 -0
- package/dist/engine/tui/routes.d.ts +5 -0
- package/dist/engine/tui/routes.d.ts.map +1 -0
- package/dist/engine/tui/routes.js +16 -0
- package/dist/engine/tui/routes.js.map +1 -0
- package/dist/engine/tui/screen-registry.d.ts +170 -0
- package/dist/engine/tui/screen-registry.d.ts.map +1 -0
- package/dist/engine/tui/screen-registry.js +180 -0
- package/dist/engine/tui/screen-registry.js.map +1 -0
- package/dist/engine/tui/screen-sections.d.ts +9 -0
- package/dist/engine/tui/screen-sections.d.ts.map +1 -0
- package/dist/engine/tui/screen-sections.js +45 -0
- package/dist/engine/tui/screen-sections.js.map +1 -0
- package/dist/engine/tui/screens/deploy/advanced-model.d.ts +69 -0
- package/dist/engine/tui/screens/deploy/advanced-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/advanced-model.js +228 -0
- package/dist/engine/tui/screens/deploy/advanced-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/doctor-model.d.ts +37 -0
- package/dist/engine/tui/screens/deploy/doctor-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/doctor-model.js +89 -0
- package/dist/engine/tui/screens/deploy/doctor-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/doctor.d.ts +8 -0
- package/dist/engine/tui/screens/deploy/doctor.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/doctor.js +163 -0
- package/dist/engine/tui/screens/deploy/doctor.js.map +1 -0
- package/dist/engine/tui/screens/deploy/fields.d.ts +123 -0
- package/dist/engine/tui/screens/deploy/fields.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/fields.js +202 -0
- package/dist/engine/tui/screens/deploy/fields.js.map +1 -0
- package/dist/engine/tui/screens/deploy/flags-model.d.ts +67 -0
- package/dist/engine/tui/screens/deploy/flags-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/flags-model.js +302 -0
- package/dist/engine/tui/screens/deploy/flags-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/index.d.ts +6 -0
- package/dist/engine/tui/screens/deploy/index.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/index.js +83 -0
- package/dist/engine/tui/screens/deploy/index.js.map +1 -0
- package/dist/engine/tui/screens/deploy/install-model.d.ts +159 -0
- package/dist/engine/tui/screens/deploy/install-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/install-model.js +319 -0
- package/dist/engine/tui/screens/deploy/install-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/install.d.ts +8 -0
- package/dist/engine/tui/screens/deploy/install.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/install.js +365 -0
- package/dist/engine/tui/screens/deploy/install.js.map +1 -0
- package/dist/engine/tui/screens/deploy/model.d.ts +49 -0
- package/dist/engine/tui/screens/deploy/model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/model.js +59 -0
- package/dist/engine/tui/screens/deploy/model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/run-model.d.ts +58 -0
- package/dist/engine/tui/screens/deploy/run-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/run-model.js +117 -0
- package/dist/engine/tui/screens/deploy/run-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/run.d.ts +75 -0
- package/dist/engine/tui/screens/deploy/run.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/run.js +201 -0
- package/dist/engine/tui/screens/deploy/run.js.map +1 -0
- package/dist/engine/tui/screens/deploy/status.d.ts +17 -0
- package/dist/engine/tui/screens/deploy/status.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/status.js +107 -0
- package/dist/engine/tui/screens/deploy/status.js.map +1 -0
- package/dist/engine/tui/screens/deploy/update.d.ts +41 -0
- package/dist/engine/tui/screens/deploy/update.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/update.js +175 -0
- package/dist/engine/tui/screens/deploy/update.js.map +1 -0
- package/dist/engine/tui/screens/deploy.d.ts +12 -0
- package/dist/engine/tui/screens/deploy.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy.js +23 -0
- package/dist/engine/tui/screens/deploy.js.map +1 -0
- package/dist/engine/tui/screens/invoke.d.ts +6 -0
- package/dist/engine/tui/screens/invoke.d.ts.map +1 -0
- package/dist/engine/tui/screens/invoke.js +196 -0
- package/dist/engine/tui/screens/invoke.js.map +1 -0
- package/dist/engine/tui/screens/jobs.d.ts +12 -0
- package/dist/engine/tui/screens/jobs.d.ts.map +1 -0
- package/dist/engine/tui/screens/jobs.js +72 -0
- package/dist/engine/tui/screens/jobs.js.map +1 -0
- package/dist/engine/tui/screens/login.d.ts +6 -0
- package/dist/engine/tui/screens/login.d.ts.map +1 -0
- package/dist/engine/tui/screens/login.js +263 -0
- package/dist/engine/tui/screens/login.js.map +1 -0
- package/dist/engine/tui/screens/logout.d.ts +6 -0
- package/dist/engine/tui/screens/logout.d.ts.map +1 -0
- package/dist/engine/tui/screens/logout.js +149 -0
- package/dist/engine/tui/screens/logout.js.map +1 -0
- package/dist/engine/tui/screens/menu.d.ts +25 -0
- package/dist/engine/tui/screens/menu.d.ts.map +1 -0
- package/dist/engine/tui/screens/menu.js +124 -0
- package/dist/engine/tui/screens/menu.js.map +1 -0
- package/dist/engine/tui/screens/node.d.ts +6 -0
- package/dist/engine/tui/screens/node.d.ts.map +1 -0
- package/dist/engine/tui/screens/node.js +277 -0
- package/dist/engine/tui/screens/node.js.map +1 -0
- package/dist/engine/tui/screens/not-logged-in.d.ts +12 -0
- package/dist/engine/tui/screens/not-logged-in.d.ts.map +1 -0
- package/dist/engine/tui/screens/not-logged-in.js +14 -0
- package/dist/engine/tui/screens/not-logged-in.js.map +1 -0
- package/dist/engine/tui/screens/status.d.ts +6 -0
- package/dist/engine/tui/screens/status.d.ts.map +1 -0
- package/dist/engine/tui/screens/status.js +138 -0
- package/dist/engine/tui/screens/status.js.map +1 -0
- package/dist/engine/tui/scroll-box.d.ts +42 -0
- package/dist/engine/tui/scroll-box.d.ts.map +1 -0
- package/dist/engine/tui/scroll-box.js +62 -0
- package/dist/engine/tui/scroll-box.js.map +1 -0
- package/dist/engine/tui/section-registry.d.ts +65 -0
- package/dist/engine/tui/section-registry.d.ts.map +1 -0
- package/dist/engine/tui/section-registry.js +90 -0
- package/dist/engine/tui/section-registry.js.map +1 -0
- package/dist/engine/tui/terminal.d.ts +31 -0
- package/dist/engine/tui/terminal.d.ts.map +1 -0
- package/dist/engine/tui/terminal.js +142 -0
- package/dist/engine/tui/terminal.js.map +1 -0
- package/dist/engine/tui/testing/feeds.d.ts +58 -0
- package/dist/engine/tui/testing/feeds.d.ts.map +1 -0
- package/dist/engine/tui/testing/feeds.js +67 -0
- package/dist/engine/tui/testing/feeds.js.map +1 -0
- package/dist/engine/tui/testing/harness.d.ts +243 -0
- package/dist/engine/tui/testing/harness.d.ts.map +1 -0
- package/dist/engine/tui/testing/harness.js +332 -0
- package/dist/engine/tui/testing/harness.js.map +1 -0
- package/dist/engine/tui/theme.d.ts +179 -0
- package/dist/engine/tui/theme.d.ts.map +1 -0
- package/dist/engine/tui/theme.js +111 -0
- package/dist/engine/tui/theme.js.map +1 -0
- package/dist/engine/tui/tty.d.ts +56 -0
- package/dist/engine/tui/tty.d.ts.map +1 -0
- package/dist/engine/tui/tty.js +146 -0
- package/dist/engine/tui/tty.js.map +1 -0
- package/dist/engine/tui/ui/active-items.d.ts +40 -0
- package/dist/engine/tui/ui/active-items.d.ts.map +1 -0
- package/dist/engine/tui/ui/active-items.js +38 -0
- package/dist/engine/tui/ui/active-items.js.map +1 -0
- package/dist/engine/tui/ui/event-log.d.ts +58 -0
- package/dist/engine/tui/ui/event-log.d.ts.map +1 -0
- package/dist/engine/tui/ui/event-log.js +32 -0
- package/dist/engine/tui/ui/event-log.js.map +1 -0
- package/dist/engine/tui/ui/index.d.ts +20 -0
- package/dist/engine/tui/ui/index.d.ts.map +1 -0
- package/dist/engine/tui/ui/index.js +14 -0
- package/dist/engine/tui/ui/index.js.map +1 -0
- package/dist/engine/tui/ui/meter-legend.d.ts +26 -0
- package/dist/engine/tui/ui/meter-legend.d.ts.map +1 -0
- package/dist/engine/tui/ui/meter-legend.js +25 -0
- package/dist/engine/tui/ui/meter-legend.js.map +1 -0
- package/dist/engine/tui/ui/run-summary.d.ts +58 -0
- package/dist/engine/tui/ui/run-summary.d.ts.map +1 -0
- package/dist/engine/tui/ui/run-summary.js +29 -0
- package/dist/engine/tui/ui/run-summary.js.map +1 -0
- package/dist/engine/tui/ui/segment-meter.d.ts +72 -0
- package/dist/engine/tui/ui/segment-meter.d.ts.map +1 -0
- package/dist/engine/tui/ui/segment-meter.js +128 -0
- package/dist/engine/tui/ui/segment-meter.js.map +1 -0
- package/dist/engine/tui/ui/status-line.d.ts +42 -0
- package/dist/engine/tui/ui/status-line.d.ts.map +1 -0
- package/dist/engine/tui/ui/status-line.js +35 -0
- package/dist/engine/tui/ui/status-line.js.map +1 -0
- package/dist/engine/tui/ui/tone.d.ts +46 -0
- package/dist/engine/tui/ui/tone.d.ts.map +1 -0
- package/dist/engine/tui/ui/tone.js +48 -0
- package/dist/engine/tui/ui/tone.js.map +1 -0
- package/dist/engine/update-notice-options.d.ts +70 -0
- package/dist/engine/update-notice-options.d.ts.map +1 -0
- package/dist/engine/update-notice-options.js +79 -0
- package/dist/engine/update-notice-options.js.map +1 -0
- package/dist/engine/update-notice.d.ts +69 -0
- package/dist/engine/update-notice.d.ts.map +1 -0
- package/dist/engine/update-notice.js +204 -0
- package/dist/engine/update-notice.js.map +1 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +5 -0
- package/dist/node/index.js.map +1 -0
- package/dist/telemetry/index.d.ts +2 -1
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +1 -0
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/node-span-relay.d.ts +1 -1
- package/dist/telemetry/node-span-relay.d.ts.map +1 -1
- package/dist/telemetry/node-span-relay.js +39 -6
- package/dist/telemetry/node-span-relay.js.map +1 -1
- package/dist/telemetry/node-span.d.ts +39 -7
- package/dist/telemetry/node-span.d.ts.map +1 -1
- package/dist/telemetry/node-span.js +19 -1
- package/dist/telemetry/node-span.js.map +1 -1
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +4 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/tui/index.d.ts +3 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +7 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/testing/index.d.ts +5 -0
- package/dist/tui/testing/index.d.ts.map +1 -0
- package/dist/tui/testing/index.js +12 -0
- package/dist/tui/testing/index.js.map +1 -0
- package/dist/tui/ui/index.d.ts +2 -0
- package/dist/tui/ui/index.d.ts.map +1 -0
- package/dist/tui/ui/index.js +10 -0
- package/dist/tui/ui/index.js.map +1 -0
- package/package.json +56 -5
|
@@ -0,0 +1,1186 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { basename, join, resolve } from 'node:path';
|
|
3
|
+
import { cliName, envVar } from '../identity.js';
|
|
4
|
+
import { extractRoleAnswers, superuserAllowedFor } from '../deploy/app-role.js';
|
|
5
|
+
import { allChecks, checksPassed, gitCredentialStateFor, runChecks, summarise, } from '../deploy/checks/index.js';
|
|
6
|
+
import { parseEnvFile } from '../deploy/env-spec.js';
|
|
7
|
+
import { collectHealth, isHealthy, } from '../deploy/health.js';
|
|
8
|
+
import { resolveRepoUrl } from '../deploy/repo.js';
|
|
9
|
+
import { readState } from '../deploy/state.js';
|
|
10
|
+
import { readAbout, renderAbout } from '../deploy/about.js';
|
|
11
|
+
import { readAnswersFile } from '../deploy/answers-file.js';
|
|
12
|
+
import { isDeployment, resolveEnvPath } from '../deploy/deployment-evidence.js';
|
|
13
|
+
import { readEnvFile } from '../deploy/env-file.js';
|
|
14
|
+
import { collectInventory, renderInventory } from '../deploy/inventory.js';
|
|
15
|
+
import { planUninstall, runUninstall, } from '../deploy/uninstall.js';
|
|
16
|
+
import { assertValidContainerName, certificateExpiry, certificateServedMatchesDisk, describeReloadCommand, parseProxyMode, renewCertificate, resolveRecordedProxyRuntime, RENEW_WITHIN_DAYS, } from '../deploy/proxy.js';
|
|
17
|
+
import { DEFAULT_APPS_ROOT, locateApp, } from '../deploy/layout.js';
|
|
18
|
+
import { composeProjectFor, oauthSmokeTarget, runInstall, } from '../deploy/install.js';
|
|
19
|
+
import { runUpdate } from '../deploy/update.js';
|
|
20
|
+
import { runCommand } from '../deploy/executor.js';
|
|
21
|
+
import { reconcileComposeProject } from '../deploy/compose-project.js';
|
|
22
|
+
import { CliError, EXIT, PreconditionError, UsageError } from '../errors.js';
|
|
23
|
+
import { shouldUseColour } from '../output.js';
|
|
24
|
+
// =============================================================================
|
|
25
|
+
// `appctl deploy` (issue #178, epic #168)
|
|
26
|
+
// =============================================================================
|
|
27
|
+
//
|
|
28
|
+
// The first user-facing surface of the deployment work, and the place the
|
|
29
|
+
// command GROUP is established - so the shape chosen here is the one every
|
|
30
|
+
// later subcommand follows.
|
|
31
|
+
//
|
|
32
|
+
// Two rules inherited from program.ts, neither negotiable here:
|
|
33
|
+
//
|
|
34
|
+
// - HUMAN OUTPUT GOES TO STDERR. stdout carries `--json` and nothing else,
|
|
35
|
+
// so `appctl deploy doctor --json | jq` is clean.
|
|
36
|
+
// - FAILURE IS NON-ZERO. A doctor that prints failures and exits 0 makes
|
|
37
|
+
// `doctor || provision-the-box` silently useless.
|
|
38
|
+
// =============================================================================
|
|
39
|
+
export const DEFAULT_DEPLOY_ROOT = '/opt/infra/apps';
|
|
40
|
+
export { DEFAULT_APPS_ROOT };
|
|
41
|
+
export const DEFAULT_PROXY_ROOT = '/opt/infra/proxy';
|
|
42
|
+
export const DEFAULT_BIND_PORT = 3535;
|
|
43
|
+
const PROXY_CONTAINER_HELP = 'Name of the shared proxy container (default: as recorded, else proxy-nginx)';
|
|
44
|
+
const PROXY_MODE_HELP = 'How the shared proxy runs: container or host (default: as recorded, else detected)';
|
|
45
|
+
/**
|
|
46
|
+
* Validates the proxy-runtime flags BEFORE anything runs.
|
|
47
|
+
*
|
|
48
|
+
* Refused as a usage error rather than passed through: a mistyped mode must not
|
|
49
|
+
* quietly become detection, and a container name reaches a docker argv.
|
|
50
|
+
*/
|
|
51
|
+
function proxyFlags(options) {
|
|
52
|
+
const mode = options.proxyMode === undefined ? undefined : parseProxyMode(options.proxyMode);
|
|
53
|
+
if (options.proxyContainer !== undefined)
|
|
54
|
+
assertValidContainerName(options.proxyContainer);
|
|
55
|
+
return {
|
|
56
|
+
...(mode === undefined ? {} : { mode }),
|
|
57
|
+
...(options.proxyContainer === undefined ? {} : { container: options.proxyContainer }),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const ESC = String.fromCharCode(27);
|
|
61
|
+
const RESET = ESC + '[0m';
|
|
62
|
+
export function registerDeployCommand(program, ctx) {
|
|
63
|
+
const deploy = program
|
|
64
|
+
.command('deploy')
|
|
65
|
+
.description('Check, install and update this application on a server');
|
|
66
|
+
deploy
|
|
67
|
+
.command('doctor')
|
|
68
|
+
.description('Check that this server meets the prerequisites')
|
|
69
|
+
.option('--root <path>', 'Deployment directory (rank 1: an explicit path)')
|
|
70
|
+
.option('--apps-root <path>', 'Directory holding the deployments (rank 3 walks up inside it)', DEFAULT_APPS_ROOT)
|
|
71
|
+
.option('--name <app>', 'Which deployment to act on, by name')
|
|
72
|
+
.option('--proxy-root <path>', 'Shared reverse proxy directory', DEFAULT_PROXY_ROOT)
|
|
73
|
+
.option('--port <port>', 'Loopback port the proxy forwards to', String(DEFAULT_BIND_PORT))
|
|
74
|
+
.option('--domain <domain>', 'Public domain; enables the DNS and TLS checks')
|
|
75
|
+
.option('--proxy-container <name>', PROXY_CONTAINER_HELP)
|
|
76
|
+
.option('--proxy-mode <mode>', PROXY_MODE_HELP)
|
|
77
|
+
.option('--repo <url>', 'Repository whose access to check (default: the recorded one, then this checkout\'s origin)')
|
|
78
|
+
.option('--json', 'Print a machine-readable report on stdout')
|
|
79
|
+
.option('--no-color', 'Disable colour even on a terminal')
|
|
80
|
+
.addHelpText('after', [
|
|
81
|
+
'',
|
|
82
|
+
'Examples:',
|
|
83
|
+
` ${cliName()} deploy doctor`,
|
|
84
|
+
` ${cliName()} deploy doctor --domain app.example.com`,
|
|
85
|
+
` ${cliName()} deploy doctor --json | jq '.checks[] | select(.status=="fail")'`,
|
|
86
|
+
'',
|
|
87
|
+
'Exit codes:',
|
|
88
|
+
' 0 every required check passed (warnings do not fail the run)',
|
|
89
|
+
' 6 a required check failed; nothing was changed',
|
|
90
|
+
'',
|
|
91
|
+
'Nothing is installed, written or started. It is safe to run at any time.',
|
|
92
|
+
].join('\n'))
|
|
93
|
+
.action(async (options) => {
|
|
94
|
+
await runDoctorCommand(options, ctx);
|
|
95
|
+
});
|
|
96
|
+
deploy
|
|
97
|
+
.command('install')
|
|
98
|
+
.description('Install this application on this server')
|
|
99
|
+
.option('--root <path>', 'Deployment directory (rank 1: an explicit path)')
|
|
100
|
+
.option('--apps-root <path>', 'Directory holding the deployments (rank 3 walks up inside it)', DEFAULT_APPS_ROOT)
|
|
101
|
+
.option('--name <app>', 'Which deployment to act on, by name')
|
|
102
|
+
.option('--domain <domain>', 'Public domain to publish under')
|
|
103
|
+
.option('--proxy-root <path>', 'Shared reverse proxy directory', DEFAULT_PROXY_ROOT)
|
|
104
|
+
.option('--proxy-container <name>', PROXY_CONTAINER_HELP)
|
|
105
|
+
.option('--proxy-mode <mode>', PROXY_MODE_HELP)
|
|
106
|
+
.option('--port <port>', 'Loopback port the proxy forwards to', String(DEFAULT_BIND_PORT))
|
|
107
|
+
.option('--repo <url>', 'Repository to deploy (default: this checkout\'s origin)')
|
|
108
|
+
.option('--ref <ref>', 'Branch, tag or commit (default: the remote default branch)')
|
|
109
|
+
.option('--email <email>', 'Certificate registration address')
|
|
110
|
+
.option('--group <name>', 'Optional feature group; repeat for more', collectGroup, [])
|
|
111
|
+
.option('--all', 'Review every environment variable, not only the essential ones')
|
|
112
|
+
.option('--non-interactive', 'Never prompt; fail listing anything unresolved')
|
|
113
|
+
.option('--answer <key=value>', 'Supply one environment answer; repeat for more', collectAnswer, new Map())
|
|
114
|
+
.option('--answers-file <path>', 'Read answers from a KEY=value file (like .env)')
|
|
115
|
+
.option('--reinstall', 'Install over an existing deployment')
|
|
116
|
+
.option('--resume', 'Continue from the step that failed')
|
|
117
|
+
.option('--skip-doctor', 'Skip the prerequisite checks')
|
|
118
|
+
.option('--skip-proxy', 'Do not touch the reverse proxy or request a certificate')
|
|
119
|
+
.option('--skip-seed', 'Do not run the database seed')
|
|
120
|
+
.option('--bootstrap-proxy', 'Create the shared proxy if this server has none (no prompt)')
|
|
121
|
+
.option('--create-database', 'Create the database if it does not exist (no prompt)')
|
|
122
|
+
.option('--app-db-user <name>', 'Name of the dedicated application database role (default: <app>_app)')
|
|
123
|
+
.option('--admin-user <name>', 'Administrative database login that provisions the role (password: $' + envVar('DB_ADMIN_PASSWORD') + ' or DB_ADMIN_PASSWORD in the answers file; never a flag)')
|
|
124
|
+
.option('--skip-role-provisioning', 'Create no role; POSTGRES_USER must already be an ordinary role')
|
|
125
|
+
.option('--allow-superuser', 'Run the API as a superuser/BYPASSRLS login anyway (tenant isolation OFF)')
|
|
126
|
+
.option('--rotate-app-password', 'Generate a new password for the application role')
|
|
127
|
+
.option('--provision-app-role', 'Consent: create the role when the database login is a superuser (no prompt)')
|
|
128
|
+
.option('--transfer-ownership', 'Consent: change the owner of an existing database\'s objects to the role (no prompt)')
|
|
129
|
+
.option('--allow-reduced-role', 'Consent: accept a role the server would not give CREATEROLE/createrole_self_grant')
|
|
130
|
+
.option('--show-credentials', 'Print the generated application login once at the end (never journaled)')
|
|
131
|
+
.option('--skip-renewal', 'Do not schedule certificate renewal')
|
|
132
|
+
.option('--skip-oauth-check', 'Do not verify the Google OAuth credentials with Google')
|
|
133
|
+
.option('--no-cache', 'Rebuild images without the layer cache')
|
|
134
|
+
.option('--force', 'Discard uncommitted changes in the checkout')
|
|
135
|
+
.option('--staging', "Use Let's Encrypt staging while working out the setup")
|
|
136
|
+
.option('--app-version <version>', 'Release version to deploy (default: a patch bump of the current one)')
|
|
137
|
+
.option('--no-version-bump', 'Deploy the current version: no write, no commit, no push')
|
|
138
|
+
.option('--json', 'Print a machine-readable result on stdout')
|
|
139
|
+
.addHelpText('after', [
|
|
140
|
+
'',
|
|
141
|
+
'Examples:',
|
|
142
|
+
` ${cliName()} deploy install --domain app.example.com`,
|
|
143
|
+
` ${cliName()} deploy install --domain app.example.com --staging`,
|
|
144
|
+
` ${cliName()} deploy install --non-interactive --domain app.example.com`,
|
|
145
|
+
'',
|
|
146
|
+
'What it does, in order: checks prerequisites, clones the repository,',
|
|
147
|
+
'collects the environment, provisions a dedicated, ordinary database role',
|
|
148
|
+
'when the login you enter is a superuser (row-level security does not',
|
|
149
|
+
'apply to one), validates the database and the Google OAuth',
|
|
150
|
+
'credentials, creates the database if it is missing (asked, or',
|
|
151
|
+
'--create-database), builds the images, migrates, seeds, starts the',
|
|
152
|
+
'stack, waits for health, creates the shared proxy if the server has',
|
|
153
|
+
'none (asked, or --bootstrap-proxy), issues the certificate and',
|
|
154
|
+
'publishes the vhost, schedules renewal unless something already owns',
|
|
155
|
+
'it, then verifies the result -- including that sign-in redirects to',
|
|
156
|
+
'Google with the configured client.',
|
|
157
|
+
'',
|
|
158
|
+
'The repository and branch come from THIS checkout\'s git remote unless',
|
|
159
|
+
'you pass --repo/--ref, so a fork deploys itself with no configuration.',
|
|
160
|
+
].join('\n'))
|
|
161
|
+
.action(async (options, command) => {
|
|
162
|
+
// `--port` has a default, so only the value source tells whether the
|
|
163
|
+
// operator passed it (#1027).
|
|
164
|
+
await runInstallCommand({ ...options, portIsDefault: command.getOptionValueSource('port') === 'default' }, ctx);
|
|
165
|
+
});
|
|
166
|
+
deploy
|
|
167
|
+
.command('update')
|
|
168
|
+
.description('Bring this server up to the latest revision')
|
|
169
|
+
.option('--root <path>', 'Deployment directory (rank 1: an explicit path)')
|
|
170
|
+
.option('--apps-root <path>', 'Directory holding the deployments (rank 3 walks up inside it)', DEFAULT_APPS_ROOT)
|
|
171
|
+
.option('--name <app>', 'Which deployment to act on, by name')
|
|
172
|
+
.option('--ref <ref>', 'Branch, tag or commit to move to')
|
|
173
|
+
.option('--force', 'Rebuild even when the revision has not changed')
|
|
174
|
+
.option('--no-cache', 'Rebuild images without the layer cache')
|
|
175
|
+
.option('--non-interactive', 'Never prompt; fail listing anything unresolved')
|
|
176
|
+
.option('--answer <key=value>', 'Supply one environment answer; repeat for more', collectAnswer, new Map())
|
|
177
|
+
.option('--answers-file <path>', 'Read answers from a KEY=value file (like .env)')
|
|
178
|
+
.option('--skip-seed', 'Do not re-run the database seed')
|
|
179
|
+
.option('--skip-proxy', 'Do not touch the reverse proxy')
|
|
180
|
+
.option('--create-database', 'Create the database if it does not exist (no prompt)')
|
|
181
|
+
.option('--app-db-user <name>', 'Name of the dedicated application database role (default: <app>_app)')
|
|
182
|
+
.option('--admin-user <name>', 'Administrative database login that provisions the role (password: $' + envVar('DB_ADMIN_PASSWORD') + ' or DB_ADMIN_PASSWORD in the answers file; never a flag)')
|
|
183
|
+
.option('--skip-role-provisioning', 'Create no role; POSTGRES_USER must already be an ordinary role')
|
|
184
|
+
.option('--allow-superuser', 'Run the API as a superuser/BYPASSRLS login anyway (tenant isolation OFF)')
|
|
185
|
+
.option('--rotate-app-password', 'Generate a new password for the application role')
|
|
186
|
+
.option('--provision-app-role', 'Consent: create the role when the database login is a superuser (no prompt)')
|
|
187
|
+
.option('--transfer-ownership', 'Consent: change the owner of an existing database\'s objects to the role (no prompt)')
|
|
188
|
+
.option('--allow-reduced-role', 'Consent: accept a role the server would not give CREATEROLE/createrole_self_grant')
|
|
189
|
+
.option('--show-credentials', 'Print the generated application login once at the end (never journaled)')
|
|
190
|
+
.option('--skip-renewal', 'Do not schedule certificate renewal')
|
|
191
|
+
.option('--skip-oauth-check', 'Do not run the post-deploy OAuth sign-in smoke')
|
|
192
|
+
.option('--proxy-container <name>', PROXY_CONTAINER_HELP)
|
|
193
|
+
.option('--proxy-mode <mode>', PROXY_MODE_HELP)
|
|
194
|
+
.option('--app-version <version>', 'Release version to deploy (default: a patch bump of the current one)')
|
|
195
|
+
.option('--no-version-bump', 'Deploy the current version: no write, no commit, no push')
|
|
196
|
+
.option('--maintenance', 'Serve a 503 from before the build until just after restart, instead of whatever the stop/migrate/restart window looks like underneath')
|
|
197
|
+
.option('--json', 'Print a machine-readable result on stdout')
|
|
198
|
+
.addHelpText('after', [
|
|
199
|
+
'',
|
|
200
|
+
'Examples:',
|
|
201
|
+
` ${cliName()} deploy update`,
|
|
202
|
+
` ${cliName()} deploy update --ref v1.4.0`,
|
|
203
|
+
` ${cliName()} deploy update --maintenance`,
|
|
204
|
+
'',
|
|
205
|
+
'Exits 0 without doing anything when the revision has not moved, so it',
|
|
206
|
+
'is safe to run from cron.',
|
|
207
|
+
'',
|
|
208
|
+
'The seed RE-RUNS by default. It is idempotent, and it is the only way',
|
|
209
|
+
'permissions added by a new release reach an existing deployment —',
|
|
210
|
+
'without it the feature ships and the permission does not exist, which',
|
|
211
|
+
'surfaces as a confusing 403. Pass --skip-seed to opt out.',
|
|
212
|
+
'',
|
|
213
|
+
'There is no automatic roll-back: a partly-applied migration cannot be',
|
|
214
|
+
'undone by checking out the old code. On failure the previous revision',
|
|
215
|
+
'and the command to redeploy it are printed.',
|
|
216
|
+
'',
|
|
217
|
+
'--maintenance forces MAINTENANCE_MODE on in the deployment\'s .env from',
|
|
218
|
+
'just before the build until just after the restart, recreating the api',
|
|
219
|
+
'container each time so it takes effect — the environment break-glass is',
|
|
220
|
+
'the only layer this CLI can use without an admin session. A failure',
|
|
221
|
+
'before the window closes leaves the deployment in maintenance mode; the',
|
|
222
|
+
'next update (with or without this flag) clears a leftover window on its',
|
|
223
|
+
'own.',
|
|
224
|
+
].join('\n'))
|
|
225
|
+
.action(async (options) => {
|
|
226
|
+
await runUpdateCommand(options, ctx);
|
|
227
|
+
});
|
|
228
|
+
deploy
|
|
229
|
+
.command('status')
|
|
230
|
+
.description('Report whether the deployment on this server is healthy')
|
|
231
|
+
.option('--root <path>', 'Deployment directory (rank 1: an explicit path)')
|
|
232
|
+
.option('--apps-root <path>', 'Directory holding the deployments (rank 3 walks up inside it)', DEFAULT_APPS_ROOT)
|
|
233
|
+
.option('--name <app>', 'Which deployment to act on, by name')
|
|
234
|
+
.option('--port <port>', 'Loopback port the proxy forwards to', String(DEFAULT_BIND_PORT))
|
|
235
|
+
.option('--domain <domain>', 'Public domain; adds an external HTTPS check')
|
|
236
|
+
.option('--json', 'Print a machine-readable report on stdout')
|
|
237
|
+
.option('--no-color', 'Disable colour even on a terminal')
|
|
238
|
+
.addHelpText('after', [
|
|
239
|
+
'',
|
|
240
|
+
'Examples:',
|
|
241
|
+
` ${cliName()} deploy status`,
|
|
242
|
+
` ${cliName()} deploy status --domain app.example.com`,
|
|
243
|
+
` ${cliName()} deploy status --json || alert 'deployment unhealthy'`,
|
|
244
|
+
'',
|
|
245
|
+
'Exit codes:',
|
|
246
|
+
' 0 serving, and the schema is current',
|
|
247
|
+
' 1 installed but unhealthy',
|
|
248
|
+
' 2 nothing is installed at --root',
|
|
249
|
+
'',
|
|
250
|
+
'Note that /api/health/ready only proves SELECT 1 succeeded, so it',
|
|
251
|
+
'passes against an empty database. Migration state is reported',
|
|
252
|
+
'separately, and a green probe alone is not treated as proof.',
|
|
253
|
+
].join('\n'))
|
|
254
|
+
.action(async (options) => {
|
|
255
|
+
await runStatusCommand(options, ctx);
|
|
256
|
+
});
|
|
257
|
+
deploy
|
|
258
|
+
.command('list')
|
|
259
|
+
.description('List every deployment on this server')
|
|
260
|
+
.option('--apps-root <path>', 'Directory holding the deployments', DEFAULT_APPS_ROOT)
|
|
261
|
+
.option('--json', 'Print a machine-readable inventory on stdout')
|
|
262
|
+
.addHelpText('after', [
|
|
263
|
+
'',
|
|
264
|
+
'Reads only the filesystem: no git, no Docker, no network. A deployment',
|
|
265
|
+
'with no record reports a null commit rather than having one looked up,',
|
|
266
|
+
'so listing a host with several applications costs no subprocesses and',
|
|
267
|
+
'cannot fail differently per application.',
|
|
268
|
+
'',
|
|
269
|
+
'The SOURCE column says where each row came from:',
|
|
270
|
+
' record a deployment record was read',
|
|
271
|
+
' inferred reconstructed from the environment file; `update` adopts it',
|
|
272
|
+
' unreadable a record is present and this build cannot interpret it',
|
|
273
|
+
].join('\n'))
|
|
274
|
+
.action((options) => {
|
|
275
|
+
runListCommand(options, ctx);
|
|
276
|
+
});
|
|
277
|
+
deploy
|
|
278
|
+
.command('about')
|
|
279
|
+
.description('Show what this server says it is running')
|
|
280
|
+
.option('--root <path>', 'Deployment directory (rank 1: an explicit path)')
|
|
281
|
+
.option('--apps-root <path>', 'Directory holding the deployments (rank 3 walks up inside it)', DEFAULT_APPS_ROOT)
|
|
282
|
+
.option('--name <app>', 'Which deployment to act on, by name')
|
|
283
|
+
.option('--json', 'Print the record itself on stdout')
|
|
284
|
+
.addHelpText('after', [
|
|
285
|
+
'',
|
|
286
|
+
'Reads `deploy-info/info.json` off this disk — it does NOT ask the',
|
|
287
|
+
'application. The moment you most want to know what was deployed here',
|
|
288
|
+
'is the moment it is not answering, and that endpoint needs a login.',
|
|
289
|
+
'',
|
|
290
|
+
'Exits 0 when there is no record. A deployment installed before this',
|
|
291
|
+
'CLI wrote one, or whose run stopped before the API answered, simply',
|
|
292
|
+
'has none — which is not the same as nothing being deployed.',
|
|
293
|
+
].join('\n'))
|
|
294
|
+
.action((options) => {
|
|
295
|
+
runAboutCommand(options, ctx);
|
|
296
|
+
});
|
|
297
|
+
deploy
|
|
298
|
+
.command('certs')
|
|
299
|
+
.description('Inspect or renew this deployment\'s TLS certificate')
|
|
300
|
+
.option('--root <path>', 'Deployment directory (rank 1: an explicit path)')
|
|
301
|
+
.option('--apps-root <path>', 'Directory holding the deployments (rank 3 walks up inside it)', DEFAULT_APPS_ROOT)
|
|
302
|
+
.option('--name <app>', 'Which deployment to act on, by name')
|
|
303
|
+
.option('--proxy-root <path>', 'Shared reverse proxy directory', DEFAULT_PROXY_ROOT)
|
|
304
|
+
.option('--domain <domain>', 'Domain to act on (default: the recorded one)')
|
|
305
|
+
.option('--proxy-container <name>', PROXY_CONTAINER_HELP)
|
|
306
|
+
.option('--proxy-mode <mode>', PROXY_MODE_HELP)
|
|
307
|
+
.option('--renew', 'Renew when the certificate is inside the renewal window')
|
|
308
|
+
.option('--force', 'Renew even when it is not due. Spends rate-limit budget.')
|
|
309
|
+
.option('--email <email>', 'Registration address (default: INITIAL_ADMIN_EMAIL)')
|
|
310
|
+
.option('--staging', "Use Let's Encrypt staging, which is not trusted by browsers")
|
|
311
|
+
.option('--json', 'Print a machine-readable report on stdout')
|
|
312
|
+
.addHelpText('after', [
|
|
313
|
+
'',
|
|
314
|
+
'Without --renew this reports and changes nothing.',
|
|
315
|
+
'',
|
|
316
|
+
`With --renew it renews only when the certificate expires within ${String(RENEW_WITHIN_DAYS)} days.`,
|
|
317
|
+
"Let's Encrypt allows 5 DUPLICATE certificates per week, and a command that",
|
|
318
|
+
're-issued on every invocation would exhaust that during one debugging',
|
|
319
|
+
'session -- leaving the deployment unable to get a certificate at the moment',
|
|
320
|
+
'it most needs one. --force overrides that and is deliberately not implied.',
|
|
321
|
+
'',
|
|
322
|
+
'An unreadable expiry is reported, never treated as "not due": silently',
|
|
323
|
+
'assuming a certificate is healthy is how one quietly expires.',
|
|
324
|
+
'',
|
|
325
|
+
'A renewal validates and RELOADS the proxy afterwards: a renewed certificate',
|
|
326
|
+
'on disk is not served until nginx reloads. A renewal whose reload failed',
|
|
327
|
+
'exits 1, because the old certificate is still what browsers see.',
|
|
328
|
+
'',
|
|
329
|
+
'Exit codes:',
|
|
330
|
+
' 0 reported, or renewed and reloaded successfully',
|
|
331
|
+
' 1 the certificate is due and --renew was not passed, or the reload failed',
|
|
332
|
+
' 2 nothing is installed at --root',
|
|
333
|
+
].join('\n'))
|
|
334
|
+
.action(async (options) => {
|
|
335
|
+
await runCertsCommand(options, ctx);
|
|
336
|
+
});
|
|
337
|
+
deploy
|
|
338
|
+
.command('uninstall')
|
|
339
|
+
.description('Remove a deployment from this server')
|
|
340
|
+
.option('--root <path>', 'Deployment directory (rank 1: an explicit path)')
|
|
341
|
+
.option('--apps-root <path>', 'Directory holding the deployments (rank 3 walks up inside it)', DEFAULT_APPS_ROOT)
|
|
342
|
+
.option('--name <app>', 'Which deployment to act on, by name')
|
|
343
|
+
.option('--proxy-root <path>', 'Shared reverse proxy directory', DEFAULT_PROXY_ROOT)
|
|
344
|
+
.option('--proxy-container <name>', PROXY_CONTAINER_HELP)
|
|
345
|
+
.option('--proxy-mode <mode>', PROXY_MODE_HELP)
|
|
346
|
+
.option('--dry-run', 'Report what would be removed and change nothing')
|
|
347
|
+
.option('--drop-database', 'Also DROP the PostgreSQL database named by POSTGRES_DB, after the stack stops (needs --confirm-database)')
|
|
348
|
+
.option('--confirm-database <name>', "The database's own name, typed back")
|
|
349
|
+
.option('--purge-storage', 'Also delete every object in storage (needs --confirm-bucket)')
|
|
350
|
+
.option('--confirm-bucket <name>', "The bucket's own name, typed back")
|
|
351
|
+
.option('--json', 'Print a machine-readable plan on stdout')
|
|
352
|
+
.addHelpText('after', [
|
|
353
|
+
'',
|
|
354
|
+
'Removes the containers and their volumes, the clone, the vhost, the',
|
|
355
|
+
'logs, the environment file and the deployment record.',
|
|
356
|
+
'',
|
|
357
|
+
'ALWAYS REFUSES to remove four things, because they are shared with every',
|
|
358
|
+
'other application on this host:',
|
|
359
|
+
' - the shared Docker network',
|
|
360
|
+
' - the shared proxy container',
|
|
361
|
+
" - the TLS certificate (Let's Encrypt allows 5 duplicates per week;",
|
|
362
|
+
' keeping it is what makes a reinstall possible)',
|
|
363
|
+
" - the renewal cron entry (per-host; it renews the neighbours' certs too)",
|
|
364
|
+
'',
|
|
365
|
+
'The two destructive extras each need their own flag AND that resource\'s',
|
|
366
|
+
'own real name typed back -- not the word DELETE. A word typed for one',
|
|
367
|
+
'must never authorise the other.',
|
|
368
|
+
'',
|
|
369
|
+
'--drop-database runs DROP DATABASE after the stack stops and before the',
|
|
370
|
+
'files go. If it fails, the checkout and the environment file are kept',
|
|
371
|
+
'(they hold the credentials) so the same command can be re-run.',
|
|
372
|
+
'',
|
|
373
|
+
'Run --dry-run first. It reports exactly what would go and what would stay.',
|
|
374
|
+
].join('\n'))
|
|
375
|
+
.action(async (options) => {
|
|
376
|
+
await runUninstallCommand(options, ctx);
|
|
377
|
+
});
|
|
378
|
+
return deploy;
|
|
379
|
+
}
|
|
380
|
+
export async function runUninstallCommand(options, ctx) {
|
|
381
|
+
// ⚠ Resolved through the five ranks, not read off `--root`. See
|
|
382
|
+
// `resolveApp`: with a defaulted `--root` every rank below the first
|
|
383
|
+
// was dead code, including the cwd walk the resolver exists for.
|
|
384
|
+
const app = resolveApp(options);
|
|
385
|
+
const proxy = proxyFlags(options);
|
|
386
|
+
const stdout = ctx?.stdout ?? process.stdout;
|
|
387
|
+
const stderr = ctx?.stderr ?? process.stderr;
|
|
388
|
+
const plan = planUninstall({
|
|
389
|
+
deployRoot: app.deployRoot,
|
|
390
|
+
proxyRoot: options.proxyRoot,
|
|
391
|
+
...(options.dropDatabase === undefined ? {} : { dropDatabase: options.dropDatabase }),
|
|
392
|
+
...(options.purgeStorage === undefined ? {} : { purgeStorage: options.purgeStorage }),
|
|
393
|
+
});
|
|
394
|
+
// ⚠ THE INVENTORY COMES FIRST, ALWAYS. Nobody can consent to a number they
|
|
395
|
+
// were not shown, so the plan is rendered before any confirmation is judged.
|
|
396
|
+
if (options.json === true) {
|
|
397
|
+
stdout.write(`${JSON.stringify(plan, null, 2)}\n`);
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
stderr.write(`${renderUninstallPlan(plan)}\n`);
|
|
401
|
+
}
|
|
402
|
+
if (options.dryRun === true)
|
|
403
|
+
return;
|
|
404
|
+
const result = await runUninstall({
|
|
405
|
+
deployRoot: app.deployRoot,
|
|
406
|
+
proxyRoot: options.proxyRoot,
|
|
407
|
+
...(proxy.mode === undefined ? {} : { proxyMode: proxy.mode }),
|
|
408
|
+
...(proxy.container === undefined ? {} : { proxyContainer: proxy.container }),
|
|
409
|
+
...(options.dropDatabase === undefined ? {} : { dropDatabase: options.dropDatabase }),
|
|
410
|
+
...(options.confirmDatabase === undefined ? {} : { confirmDatabase: options.confirmDatabase }),
|
|
411
|
+
...(options.purgeStorage === undefined ? {} : { purgeStorage: options.purgeStorage }),
|
|
412
|
+
...(options.confirmBucket === undefined ? {} : { confirmBucket: options.confirmBucket }),
|
|
413
|
+
...(ctx?.runCommand === undefined ? {} : { runCommand: ctx.runCommand }),
|
|
414
|
+
});
|
|
415
|
+
for (const warning of result.warnings)
|
|
416
|
+
stderr.write(`warning: ${warning}\n`);
|
|
417
|
+
if (result.database !== undefined) {
|
|
418
|
+
// The count is always printed, even when zero: an operator not told a
|
|
419
|
+
// session was killed cannot know to go and ask whose it was.
|
|
420
|
+
stderr.write(`Dropped database ${result.database.name} ` +
|
|
421
|
+
`(terminated ${String(result.database.terminated)} session(s)).\n`);
|
|
422
|
+
}
|
|
423
|
+
stderr.write(`Removed ${app.deployRoot}. Log: ${result.journalPath}\n`);
|
|
424
|
+
}
|
|
425
|
+
export function renderUninstallPlan(plan) {
|
|
426
|
+
const lines = [`Uninstalling ${plan.deployRoot}`, '', 'This will REMOVE:'];
|
|
427
|
+
for (const entry of plan.removes)
|
|
428
|
+
lines.push(` - ${entry}`);
|
|
429
|
+
lines.push('', 'This will KEEP:');
|
|
430
|
+
for (const keep of plan.keeps)
|
|
431
|
+
lines.push(` - ${keep.what} (${keep.because})`);
|
|
432
|
+
return lines.join('\n');
|
|
433
|
+
}
|
|
434
|
+
export async function runCertsCommand(options, ctx) {
|
|
435
|
+
// ⚠ Resolved through the five ranks, not read off `--root`. See
|
|
436
|
+
// `resolveApp`: with a defaulted `--root` every rank below the first
|
|
437
|
+
// was dead code, including the cwd walk the resolver exists for.
|
|
438
|
+
const app = resolveApp(options);
|
|
439
|
+
const proxy = proxyFlags(options);
|
|
440
|
+
const stdout = ctx?.stdout ?? process.stdout;
|
|
441
|
+
const stderr = ctx?.stderr ?? process.stderr;
|
|
442
|
+
const run = ctx?.runCommand ?? runCommand;
|
|
443
|
+
const state = readState(app.deployRoot);
|
|
444
|
+
const domain = options.domain ?? state?.domain;
|
|
445
|
+
if (domain === undefined) {
|
|
446
|
+
throw new UsageError(`No domain is recorded for the deployment at ${app.deployRoot}, and none was given. Pass --domain.`);
|
|
447
|
+
}
|
|
448
|
+
const target = {
|
|
449
|
+
domain,
|
|
450
|
+
bindPort: state?.bindPort ?? DEFAULT_BIND_PORT,
|
|
451
|
+
proxyRoot: state?.proxyRoot ?? options.proxyRoot,
|
|
452
|
+
};
|
|
453
|
+
// Always resolved now (issue #642): the served-vs-disk check below needs it
|
|
454
|
+
// to name the exact remedy command whether or not --renew was asked for.
|
|
455
|
+
const runtime = await resolveRecordedProxyRuntime({
|
|
456
|
+
proxyRoot: target.proxyRoot,
|
|
457
|
+
flags: proxy,
|
|
458
|
+
recorded: state,
|
|
459
|
+
runCommand: run,
|
|
460
|
+
});
|
|
461
|
+
const report = options.renew === true
|
|
462
|
+
? await renewCertificate(target, {
|
|
463
|
+
runCommand: run,
|
|
464
|
+
// Which certbot runs, and where the post-renewal reload happens.
|
|
465
|
+
runtime,
|
|
466
|
+
email: options.email ?? emailFor(app.deployRoot),
|
|
467
|
+
...(options.force === undefined ? {} : { force: options.force }),
|
|
468
|
+
...(options.staging === undefined ? {} : { staging: options.staging }),
|
|
469
|
+
}).then((result) => ({
|
|
470
|
+
...result.expiry,
|
|
471
|
+
renewed: result.renewed,
|
|
472
|
+
reloaded: result.reloaded,
|
|
473
|
+
reason: result.reason,
|
|
474
|
+
}))
|
|
475
|
+
: await certificateExpiry(target, { runCommand: run }).then((expiry) => ({
|
|
476
|
+
...expiry,
|
|
477
|
+
renewed: false,
|
|
478
|
+
reloaded: false,
|
|
479
|
+
reason: 'reported only; pass --renew to act',
|
|
480
|
+
}));
|
|
481
|
+
// Whether what the proxy actually SERVES matches what's on disk (#642):
|
|
482
|
+
// the one check neither the health probes (never go through TLS) nor the
|
|
483
|
+
// expiry/renewal report above (only ever reads the file) can catch. Run
|
|
484
|
+
// whenever there is a certificate to compare against, report-only calls
|
|
485
|
+
// included -- that is the ordinary way an operator asks "is this actually
|
|
486
|
+
// working", with no --renew involved at all.
|
|
487
|
+
const served = report.exists
|
|
488
|
+
? await certificateServedMatchesDisk(target, { runCommand: run })
|
|
489
|
+
: { checked: false };
|
|
490
|
+
if (options.json === true) {
|
|
491
|
+
stdout.write(`${JSON.stringify({ domain, ...report, notAfter: report.notAfter?.toISOString() ?? null, served }, null, 2)}\n`);
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
stderr.write(`${renderCerts(domain, report, served, runtime)}\n`);
|
|
495
|
+
}
|
|
496
|
+
// A certificate that is due and was not renewed is a non-zero exit, so a cron
|
|
497
|
+
// wrapper notices. Reporting it at exit 0 is how it goes unnoticed until the
|
|
498
|
+
// browser says so.
|
|
499
|
+
if (report.exists && report.dueForRenewal && report.renewed !== true) {
|
|
500
|
+
throw new DeploymentUnhealthyError(`The certificate for ${domain} is due for renewal. Re-run with --renew.`);
|
|
501
|
+
}
|
|
502
|
+
// Renewed but not reloaded: the new certificate is on disk and the OLD one is
|
|
503
|
+
// still what browsers get. Exit non-zero so a cron wrapper notices, exactly
|
|
504
|
+
// as for a certificate that was never renewed.
|
|
505
|
+
if (report.renewed && !report.reloaded) {
|
|
506
|
+
throw new DeploymentUnhealthyError(`The certificate for ${domain} was renewed, but the proxy was not reloaded, so the old certificate is still being served. ${report.reason}`);
|
|
507
|
+
}
|
|
508
|
+
// The proxy is serving something other than what's on disk -- most often a
|
|
509
|
+
// certificate that WAS replaced correctly, but that the proxy was never
|
|
510
|
+
// told to reload (#640, #642). Exit non-zero so this is never silently
|
|
511
|
+
// "fine" just because the file on disk looks right.
|
|
512
|
+
if (served.checked && served.matches === false) {
|
|
513
|
+
throw new DeploymentUnhealthyError(`The certificate for ${domain} on disk does not match what the proxy is serving ` +
|
|
514
|
+
`(served issuer: ${served.servedIssuer ?? 'unknown'}; disk issuer: ${served.diskIssuer ?? 'unknown'}). ` +
|
|
515
|
+
`The proxy needs to reload to pick up the certificate that is already on disk: ${describeReloadCommand(runtime)}`);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
/** The registration address a renewal should use, from the deployment's own env. */
|
|
519
|
+
function emailFor(deployRoot) {
|
|
520
|
+
const path = join(deployRoot, 'repo', 'infra', 'compose', '.env');
|
|
521
|
+
try {
|
|
522
|
+
const email = parseEnvFile(readFileSync(path, 'utf8')).get('INITIAL_ADMIN_EMAIL');
|
|
523
|
+
if (email !== undefined && email !== '')
|
|
524
|
+
return email;
|
|
525
|
+
}
|
|
526
|
+
catch {
|
|
527
|
+
// No readable .env. The explicit --email below is the answer.
|
|
528
|
+
}
|
|
529
|
+
throw new UsageError('No registration address: pass --email, or set INITIAL_ADMIN_EMAIL in the deployment environment.');
|
|
530
|
+
}
|
|
531
|
+
export function renderCerts(domain, report, served, runtime) {
|
|
532
|
+
const lines = [`Certificate for ${domain}`, ` path ${report.path}`];
|
|
533
|
+
if (!report.exists) {
|
|
534
|
+
lines.push(' status not installed');
|
|
535
|
+
}
|
|
536
|
+
else if (report.problem !== undefined) {
|
|
537
|
+
// Surfaced, not swallowed: see certificateExpiry's own warning.
|
|
538
|
+
lines.push(` status expiry unreadable — ${report.problem}`);
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
lines.push(` expires ${report.notAfter?.toISOString() ?? 'unknown'}`);
|
|
542
|
+
lines.push(` remaining ${String(report.daysRemaining)} day(s)`);
|
|
543
|
+
lines.push(` status ${report.dueForRenewal ? 'DUE for renewal' : 'current'}`);
|
|
544
|
+
}
|
|
545
|
+
lines.push(` action ${report.renewed ? 'renewed' : report.reason}`);
|
|
546
|
+
// Whether what's actually served matches the file just described above
|
|
547
|
+
// (#642) -- silent when there was nothing to compare (no certificate, or
|
|
548
|
+
// the live probe could not complete for its own reasons).
|
|
549
|
+
if (served?.checked === true) {
|
|
550
|
+
lines.push(` served ${served.matches === true ? 'matches disk' : 'DOES NOT MATCH disk'}`);
|
|
551
|
+
if (served.matches === false) {
|
|
552
|
+
lines.push(` served: ${served.servedIssuer ?? 'unknown'}`);
|
|
553
|
+
lines.push(` disk: ${served.diskIssuer ?? 'unknown'}`);
|
|
554
|
+
if (runtime !== undefined) {
|
|
555
|
+
lines.push(` remedy ${describeReloadCommand(runtime)}`);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
return lines.join('\n');
|
|
560
|
+
}
|
|
561
|
+
export function runListCommand(options, ctx) {
|
|
562
|
+
const appsRoot = options.appsRoot ?? DEFAULT_APPS_ROOT;
|
|
563
|
+
const entries = collectInventory({ appsRoot });
|
|
564
|
+
if (options.json === true) {
|
|
565
|
+
(ctx?.stdout ?? process.stdout).write(`${JSON.stringify({ appsRoot, deployments: entries }, null, 2)}\n`);
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
(ctx?.stderr ?? process.stderr).write(`${renderInventory(entries, appsRoot)}\n`);
|
|
569
|
+
}
|
|
570
|
+
export async function runDoctorCommand(options, ctx) {
|
|
571
|
+
// ⚠ Resolved through the five ranks, not read off `--root`. See
|
|
572
|
+
// `resolveApp`: with a defaulted `--root` every rank below the first
|
|
573
|
+
// was dead code, including the cwd walk the resolver exists for.
|
|
574
|
+
const app = resolveApp(options, { mayBeAbsent: true });
|
|
575
|
+
const stdout = ctx?.stdout ?? process.stdout;
|
|
576
|
+
const stderr = ctx?.stderr ?? process.stderr;
|
|
577
|
+
const checks = ctx?.checks ?? allChecks();
|
|
578
|
+
const json = options.json === true;
|
|
579
|
+
const run = ctx?.runCommand ?? runCommand;
|
|
580
|
+
// Flags, then what an installed deployment recorded, then detection. Read-
|
|
581
|
+
// only: `docker inspect` and `nginx -v` change nothing, so doctor stays safe
|
|
582
|
+
// to run against production at any time.
|
|
583
|
+
const loaded = readRecordSafely(app.deployRoot);
|
|
584
|
+
// The compose project the containers really run under, before any check
|
|
585
|
+
// names one: see compose-project.ts. Never fails the command.
|
|
586
|
+
const reconciled = await reconcileComposeProject({ deployRoot: app.deployRoot, state: loaded, runCommand: run });
|
|
587
|
+
const recorded = reconciled.state;
|
|
588
|
+
if (reconciled.message !== undefined)
|
|
589
|
+
stderr.write(`${cliName()}: ${reconciled.message}\n`);
|
|
590
|
+
const proxyRuntime = await resolveRecordedProxyRuntime({
|
|
591
|
+
proxyRoot: options.proxyRoot,
|
|
592
|
+
flags: proxyFlags(options),
|
|
593
|
+
recorded,
|
|
594
|
+
runCommand: run,
|
|
595
|
+
});
|
|
596
|
+
// Where the code comes from, and whether git can already read it: decides
|
|
597
|
+
// whether the gh checks are required (#390). `git ls-remote` is read-only.
|
|
598
|
+
const repoUrl = await resolveRepoUrl({
|
|
599
|
+
cwd: process.cwd(),
|
|
600
|
+
runCommand: run,
|
|
601
|
+
...(options.repo === undefined ? {} : { repoFlag: options.repo }),
|
|
602
|
+
...(recorded === undefined ? {} : { state: recorded }),
|
|
603
|
+
});
|
|
604
|
+
const gitCredentialed = await gitCredentialStateFor(repoUrl, run);
|
|
605
|
+
const context = {
|
|
606
|
+
runCommand: run,
|
|
607
|
+
deployRoot: app.deployRoot,
|
|
608
|
+
proxyRoot: options.proxyRoot,
|
|
609
|
+
proxyRuntime,
|
|
610
|
+
// Only a recorded deployment has a project to name; a bare host has none.
|
|
611
|
+
...(recorded === undefined ? {} : { composeProject: composeProjectFor(recorded) }),
|
|
612
|
+
// The compose files `stack-ports-free` renders: the recorded groups, plus the always-on ones.
|
|
613
|
+
...(recorded?.groups === undefined ? {} : { groups: recorded.groups }),
|
|
614
|
+
...(repoUrl === undefined ? {} : { repoUrl }),
|
|
615
|
+
...(gitCredentialed === undefined ? {} : { gitCredentialed }),
|
|
616
|
+
bindPort: Number(options.port),
|
|
617
|
+
...(options.domain === undefined ? {} : { domain: options.domain }),
|
|
618
|
+
// #980: a choice already made (--allow-superuser at install/update) is a
|
|
619
|
+
// warning that names the consequence, not a failure to fix.
|
|
620
|
+
...(superuserAllowedFor(recorded, readEnvironment(app.deployRoot)?.env.get('POSTGRES_USER')) ? { allowSuperuser: true } : {}),
|
|
621
|
+
...(readEnvironment(app.deployRoot) ?? {}),
|
|
622
|
+
};
|
|
623
|
+
// Under --json nothing is written until the end: a partial checklist on
|
|
624
|
+
// stderr is useless to a machine, and colour is never consulted at all so
|
|
625
|
+
// no FORCE_COLOR can inject escapes into the pipe.
|
|
626
|
+
const colour = !json &&
|
|
627
|
+
shouldUseColour({
|
|
628
|
+
// `--no-color` arrives as `color: false`, matching commander's handling
|
|
629
|
+
// of a `--no-` flag; `requested` is undefined when the user said nothing.
|
|
630
|
+
requested: options.color === false ? false : undefined,
|
|
631
|
+
env: process.env,
|
|
632
|
+
isTTY: ctx?.isTty ?? process.stderr.isTTY === true,
|
|
633
|
+
});
|
|
634
|
+
if (!json) {
|
|
635
|
+
stderr.write('\n Prerequisites\n\n');
|
|
636
|
+
stderr.write(` Proxy: ${proxyRuntime.mode === 'container' ? `container ${proxyRuntime.container}` : 'host nginx'} (${proxyRuntime.source})\n\n`);
|
|
637
|
+
}
|
|
638
|
+
const results = await runChecks(checks, context, (result) => {
|
|
639
|
+
// Streamed as each completes: a dozen subprocess probes take long enough
|
|
640
|
+
// that a silent terminal looks like a hang.
|
|
641
|
+
if (!json)
|
|
642
|
+
stderr.write(renderResult(result, colour));
|
|
643
|
+
});
|
|
644
|
+
const report = {
|
|
645
|
+
...buildReport(results),
|
|
646
|
+
proxy: { mode: proxyRuntime.mode, container: proxyRuntime.container, source: proxyRuntime.source },
|
|
647
|
+
};
|
|
648
|
+
if (json) {
|
|
649
|
+
stdout.write(`${JSON.stringify(report)}\n`);
|
|
650
|
+
}
|
|
651
|
+
else {
|
|
652
|
+
stderr.write(renderSummary(report.summary, colour));
|
|
653
|
+
}
|
|
654
|
+
if (!report.ok) {
|
|
655
|
+
const failed = results.filter((result) => result.severity === 'required' && result.status === 'fail');
|
|
656
|
+
throw new PreconditionError(`${failed.length} required check(s) failed: ${failed.map((result) => result.id).join(', ')}`);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* The deployment record, or undefined -- including when it cannot be read.
|
|
661
|
+
*
|
|
662
|
+
* Doctor must work on a server where nothing is installed, and on one whose
|
|
663
|
+
* record is from a newer appctl; neither is a reason not to run the checks.
|
|
664
|
+
*/
|
|
665
|
+
function readRecordSafely(deployRoot) {
|
|
666
|
+
try {
|
|
667
|
+
return readState(deployRoot);
|
|
668
|
+
}
|
|
669
|
+
catch {
|
|
670
|
+
return undefined;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
/** Reads the deployment's .env, when there is one, for the database checks. */
|
|
674
|
+
function readEnvironment(deployRoot) {
|
|
675
|
+
try {
|
|
676
|
+
const contents = readFileSync(join(deployRoot, 'repo', 'infra', 'compose', '.env'), 'utf8');
|
|
677
|
+
return { env: parseEnvFile(contents) };
|
|
678
|
+
}
|
|
679
|
+
catch {
|
|
680
|
+
// Absent before a first install; the database checks then report `skip`.
|
|
681
|
+
return undefined;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
export function buildReport(results) {
|
|
685
|
+
return {
|
|
686
|
+
ok: checksPassed(results),
|
|
687
|
+
checks: results.map((result) => ({
|
|
688
|
+
id: result.id,
|
|
689
|
+
title: result.title,
|
|
690
|
+
severity: result.severity,
|
|
691
|
+
status: result.status,
|
|
692
|
+
detail: result.detail,
|
|
693
|
+
...(result.remedy === undefined ? {} : { remedy: result.remedy }),
|
|
694
|
+
durationMs: result.durationMs,
|
|
695
|
+
})),
|
|
696
|
+
summary: summarise(results),
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
/** The status glyphs, shared with the deploy screens so both say the same thing. */
|
|
700
|
+
export const MARKS = {
|
|
701
|
+
pass: 'OK',
|
|
702
|
+
warn: '!!',
|
|
703
|
+
fail: 'XX',
|
|
704
|
+
skip: '--',
|
|
705
|
+
};
|
|
706
|
+
const COLOURS = {
|
|
707
|
+
pass: '32',
|
|
708
|
+
warn: '33',
|
|
709
|
+
fail: '31',
|
|
710
|
+
skip: '90',
|
|
711
|
+
};
|
|
712
|
+
const TITLE_WIDTH = 30;
|
|
713
|
+
/** Installed, reachable, and not working. Distinct from "not installed". */
|
|
714
|
+
export class DeploymentUnhealthyError extends CliError {
|
|
715
|
+
exitCode = EXIT.FAILURE;
|
|
716
|
+
}
|
|
717
|
+
/** One check, rendered. Exported for its test. */
|
|
718
|
+
export function renderResult(result, colour) {
|
|
719
|
+
// A GLYPH as well as a colour. These are read over SSH, piped into files,
|
|
720
|
+
// and by people who cannot distinguish red from green; colour alone would
|
|
721
|
+
// make the status invisible to all three.
|
|
722
|
+
const mark = MARKS[result.status];
|
|
723
|
+
const painted = colour ? `${ESC}[${COLOURS[result.status]}m${mark}${RESET}` : mark;
|
|
724
|
+
const lines = [` ${painted} ${result.title.padEnd(TITLE_WIDTH)}${result.detail}\n`];
|
|
725
|
+
if (result.remedy !== undefined && (result.status === 'fail' || result.status === 'warn')) {
|
|
726
|
+
// The arrow marks the remedy once; continuation lines are indented to
|
|
727
|
+
// line up under it, so a wrapped sentence reads as one sentence rather
|
|
728
|
+
// than as several separate instructions.
|
|
729
|
+
wrap(result.remedy, 66).forEach((line, index) => {
|
|
730
|
+
lines.push(` ${index === 0 ? '->' : ' '} ${line}\n`);
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
return lines.join('');
|
|
734
|
+
}
|
|
735
|
+
export function renderSummary(summary, colour) {
|
|
736
|
+
const parts = [`${summary.passed} passed`];
|
|
737
|
+
if (summary.warned > 0)
|
|
738
|
+
parts.unshift(`${summary.warned} warning(s)`);
|
|
739
|
+
if (summary.failed > 0)
|
|
740
|
+
parts.unshift(`${summary.failed} failed`);
|
|
741
|
+
if (summary.skipped > 0)
|
|
742
|
+
parts.push(`${summary.skipped} skipped`);
|
|
743
|
+
const line = parts.join(', ');
|
|
744
|
+
const painted = colour && summary.failed > 0 ? `${ESC}[31m${line}${RESET}` : line;
|
|
745
|
+
return `\n ${painted}\n\n`;
|
|
746
|
+
}
|
|
747
|
+
/** Wraps a remedy so it stays readable in an 80-column SSH session. */
|
|
748
|
+
function wrap(text, width) {
|
|
749
|
+
const words = text.split(/\s+/);
|
|
750
|
+
const lines = [];
|
|
751
|
+
let current = '';
|
|
752
|
+
for (const word of words) {
|
|
753
|
+
if (current === '') {
|
|
754
|
+
current = word;
|
|
755
|
+
}
|
|
756
|
+
else if (`${current} ${word}`.length <= width) {
|
|
757
|
+
current = `${current} ${word}`;
|
|
758
|
+
}
|
|
759
|
+
else {
|
|
760
|
+
lines.push(current);
|
|
761
|
+
current = word;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
if (current !== '')
|
|
765
|
+
lines.push(current);
|
|
766
|
+
return lines;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* ⚠ EXITS 0 WHEN THERE IS NO RECORD. An absent document is one of three normal
|
|
770
|
+
* states, not a failure: this command answers "what does this server say it is
|
|
771
|
+
* running", and "nothing has written that down here" is a real answer to it.
|
|
772
|
+
*/
|
|
773
|
+
export function runAboutCommand(options, ctx) {
|
|
774
|
+
const app = resolveApp(options);
|
|
775
|
+
const report = readAbout(app.deployRoot);
|
|
776
|
+
if (options.json === true) {
|
|
777
|
+
(ctx?.stdout ?? process.stdout).write(`${JSON.stringify(report, null, 2)}\n`);
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
(ctx?.stderr ?? process.stderr).write(`${renderAbout(report)}\n`);
|
|
781
|
+
}
|
|
782
|
+
export async function runStatusCommand(options, ctx) {
|
|
783
|
+
// ⚠ Resolved through the five ranks, not read off `--root`. See
|
|
784
|
+
// `resolveApp`: with a defaulted `--root` every rank below the first
|
|
785
|
+
// was dead code, including the cwd walk the resolver exists for.
|
|
786
|
+
const app = resolveApp(options);
|
|
787
|
+
const stdout = ctx?.stdout ?? process.stdout;
|
|
788
|
+
const stderr = ctx?.stderr ?? process.stderr;
|
|
789
|
+
const json = options.json === true;
|
|
790
|
+
// ⚠ EVIDENCE, NOT THE RECORD -- the same wrong question `update` used to
|
|
791
|
+
// ask, from the other side. Guarding on the state file meant a deployment
|
|
792
|
+
// whose record was lost -- containers up, certificate issued, site serving --
|
|
793
|
+
// was reported as "No deployment found" by the ONE command an operator runs
|
|
794
|
+
// when something is wrong. `status` needs no record to do its job: it probes
|
|
795
|
+
// the containers and the endpoints, and the record only supplies the compose
|
|
796
|
+
// project and the deployed revision.
|
|
797
|
+
//
|
|
798
|
+
// "Nothing installed" is still a USAGE problem, distinct from "installed and
|
|
799
|
+
// unhealthy" -- a monitoring script must be able to tell them apart. That
|
|
800
|
+
// distinction is preserved; it is just asked of the deployment rather than of
|
|
801
|
+
// the bookkeeping about it.
|
|
802
|
+
const loaded = readState(app.deployRoot);
|
|
803
|
+
if (loaded === undefined && !isDeployment(app.deployRoot)) {
|
|
804
|
+
throw new UsageError(`No deployment found at ${app.deployRoot}. Run \`${cliName()} deploy install\` first, or pass --root.`);
|
|
805
|
+
}
|
|
806
|
+
// ⚠ The compose project the containers really run under, not merely the
|
|
807
|
+
// recorded one: `status` reads the containers, and asking the wrong project
|
|
808
|
+
// reports a healthy stack as absent. See compose-project.ts; never fails.
|
|
809
|
+
const run = ctx?.runCommand ?? runCommand;
|
|
810
|
+
const reconciled = await reconcileComposeProject({ deployRoot: app.deployRoot, state: loaded, runCommand: run });
|
|
811
|
+
const state = reconciled.state;
|
|
812
|
+
if (reconciled.message !== undefined)
|
|
813
|
+
stderr.write(`${cliName()}: ${reconciled.message}\n`);
|
|
814
|
+
const report = await collectHealth({
|
|
815
|
+
runCommand: run,
|
|
816
|
+
deployRoot: app.deployRoot,
|
|
817
|
+
bindPort: Number(options.port),
|
|
818
|
+
...(options.domain === undefined ? {} : { domain: options.domain }),
|
|
819
|
+
// ⚠ From the RECORD, never derived. `status` reads the containers, so
|
|
820
|
+
// looking in the wrong compose project reports a healthy stack as absent.
|
|
821
|
+
// Absent when the record was lost: `composeProjectFor(undefined)` is the
|
|
822
|
+
// directory-derived default, which is what such a deployment is running
|
|
823
|
+
// under anyway -- it predates the naming or lost the file that recorded it.
|
|
824
|
+
...(state === undefined || composeProjectFor(state) === undefined
|
|
825
|
+
? {}
|
|
826
|
+
: { composeProject: composeProjectFor(state) }),
|
|
827
|
+
...(state === undefined ? {} : { state }),
|
|
828
|
+
// The compose files this stack was started with depend on the groups
|
|
829
|
+
// install recorded (compose-files.ts), plus the always-on ones (#567).
|
|
830
|
+
...(state?.groups === undefined ? {} : { groups: state.groups }),
|
|
831
|
+
...(ctx?.fetch === undefined ? {} : { fetch: ctx.fetch }),
|
|
832
|
+
// #391: the sign-in wiring, from the deployment's own .env. Reported, and
|
|
833
|
+
// deliberately NOT part of `healthy` -- that stays "is it serving", which
|
|
834
|
+
// is what a monitoring script branches on.
|
|
835
|
+
...oauthSmokeTarget(false, statusEnvironment(app.deployRoot)),
|
|
836
|
+
});
|
|
837
|
+
const healthy = isHealthy(report);
|
|
838
|
+
if (json) {
|
|
839
|
+
stdout.write(`${JSON.stringify({ healthy, ...report })}\n`);
|
|
840
|
+
}
|
|
841
|
+
else {
|
|
842
|
+
const colour = shouldUseColour({
|
|
843
|
+
requested: options.color === false ? false : undefined,
|
|
844
|
+
env: process.env,
|
|
845
|
+
isTTY: ctx?.isTty ?? process.stderr.isTTY === true,
|
|
846
|
+
});
|
|
847
|
+
stderr.write(renderHealth(report, healthy, colour));
|
|
848
|
+
}
|
|
849
|
+
if (!healthy) {
|
|
850
|
+
throw new DeploymentUnhealthyError(`The deployment at ${app.deployRoot} is not healthy.`);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
/** The deployment's .env for the OAuth smoke, or undefined when unreadable. */
|
|
854
|
+
function statusEnvironment(deployRoot) {
|
|
855
|
+
const path = resolveEnvPath(deployRoot);
|
|
856
|
+
if (path === undefined)
|
|
857
|
+
return undefined;
|
|
858
|
+
try {
|
|
859
|
+
return readEnvFile(path);
|
|
860
|
+
}
|
|
861
|
+
catch {
|
|
862
|
+
return undefined;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
function probeLine(label, result) {
|
|
866
|
+
const outcome = result.ok
|
|
867
|
+
? `${result.status ?? 'ok'} (${result.durationMs}ms)`
|
|
868
|
+
: (result.error ?? `HTTP ${result.status ?? '?'}`);
|
|
869
|
+
return ` ${label.padEnd(TITLE_WIDTH)}${outcome}\n`;
|
|
870
|
+
}
|
|
871
|
+
/** The human report. Exported for its test. */
|
|
872
|
+
export function renderHealth(report, healthy, colour) {
|
|
873
|
+
const lines = ['\n Deployment\n\n'];
|
|
874
|
+
if (report.deployed !== undefined) {
|
|
875
|
+
lines.push(` ${'Revision'.padEnd(TITLE_WIDTH)}${report.deployed.commitSha.slice(0, 12)} (${report.deployed.ref})\n`);
|
|
876
|
+
lines.push(` ${'Last deployed'.padEnd(TITLE_WIDTH)}${report.deployed.lastDeployedAt} by ${report.deployed.lastCommand}\n`);
|
|
877
|
+
}
|
|
878
|
+
lines.push('\n Containers\n\n');
|
|
879
|
+
if (report.containers.length === 0) {
|
|
880
|
+
lines.push(' none reported\n');
|
|
881
|
+
if (report.composeProblem !== undefined) {
|
|
882
|
+
// docker compose refused over a required variable; say why, indented
|
|
883
|
+
// under the section it explains.
|
|
884
|
+
lines.push(`\n${report.composeProblem.split('\n').map((line) => ` ${line}`).join('\n')}\n`);
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
else {
|
|
888
|
+
for (const container of report.containers) {
|
|
889
|
+
const health = container.health === undefined ? '' : ` (${container.health})`;
|
|
890
|
+
lines.push(` ${container.service.padEnd(TITLE_WIDTH)}${container.state}${health}\n`);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
lines.push('\n Probes\n\n');
|
|
894
|
+
lines.push(probeLine('Liveness', report.local.live));
|
|
895
|
+
lines.push(probeLine('Readiness', report.local.ready));
|
|
896
|
+
lines.push(probeLine('Frontend', report.local.frontend));
|
|
897
|
+
if (report.external !== undefined) {
|
|
898
|
+
lines.push(probeLine('External HTTPS', report.external.probe));
|
|
899
|
+
}
|
|
900
|
+
if (report.oauth !== undefined) {
|
|
901
|
+
const outcome = report.oauth.status === 'pass'
|
|
902
|
+
? 'ok'
|
|
903
|
+
: `${report.oauth.status === 'fail' ? 'FAILED' : 'unverified'}: ${report.oauth.detail}`;
|
|
904
|
+
const painted = colour && report.oauth.status === 'fail' ? `${ESC}[31m${outcome}${RESET}` : outcome;
|
|
905
|
+
lines.push(` ${'Google sign-in'.padEnd(TITLE_WIDTH)}${painted}\n`);
|
|
906
|
+
if (report.oauth.status !== 'pass' && report.oauth.remedy !== undefined) {
|
|
907
|
+
lines.push(` -> ${report.oauth.remedy}\n`);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
lines.push('\n Schema\n\n');
|
|
911
|
+
if (!report.migrations.known) {
|
|
912
|
+
lines.push(` ${'Migrations'.padEnd(TITLE_WIDTH)}could not be determined\n`);
|
|
913
|
+
}
|
|
914
|
+
else if (report.migrations.pending.length > 0) {
|
|
915
|
+
// Readiness can be green while this is red; that is the whole point of
|
|
916
|
+
// reporting it separately.
|
|
917
|
+
lines.push(` ${'Migrations'.padEnd(TITLE_WIDTH)}${report.migrations.pending.length} pending\n`);
|
|
918
|
+
for (const pending of report.migrations.pending) {
|
|
919
|
+
lines.push(` -> ${pending}\n`);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
else {
|
|
923
|
+
lines.push(` ${'Migrations'.padEnd(TITLE_WIDTH)}up to date\n`);
|
|
924
|
+
}
|
|
925
|
+
const verdict = healthy ? 'healthy' : 'NOT healthy';
|
|
926
|
+
const painted = colour && !healthy ? `${ESC}[31m${verdict}${RESET}` : verdict;
|
|
927
|
+
lines.push(`\n ${painted}\n\n`);
|
|
928
|
+
return lines.join('');
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* The role options a run starts with: the flags, over the answers-file keys
|
|
932
|
+
* (`DB_ADMIN_USER`, `DB_ADMIN_PASSWORD`, `APP_DB_USER`), which are removed from
|
|
933
|
+
* the answers so none of them -- the administrative password above all -- can
|
|
934
|
+
* reach `.env`. A flag wins over the file, like `--answer` does.
|
|
935
|
+
*/
|
|
936
|
+
function appRoleOptions(options, fromAnswers) {
|
|
937
|
+
const appDbUser = options.appDbUser ?? fromAnswers.appDbUser;
|
|
938
|
+
const adminUser = options.adminUser ?? fromAnswers.adminUser;
|
|
939
|
+
return {
|
|
940
|
+
...(appDbUser === undefined ? {} : { appDbUser }),
|
|
941
|
+
...(adminUser === undefined ? {} : { adminUser }),
|
|
942
|
+
...(fromAnswers.adminPassword === undefined ? {} : { adminPassword: fromAnswers.adminPassword }),
|
|
943
|
+
...(options.skipRoleProvisioning === true ? { skipRoleProvisioning: true } : {}),
|
|
944
|
+
...(options.allowSuperuser === true ? { allowSuperuser: true } : {}),
|
|
945
|
+
...(options.rotateAppPassword === true ? { rotateAppPassword: true } : {}),
|
|
946
|
+
...(options.provisionAppRole === true ? { provisionAppRole: true } : {}),
|
|
947
|
+
...(options.transferOwnership === true ? { transferOwnership: true } : {}),
|
|
948
|
+
...(options.allowReducedRole === true ? { allowReducedRole: true } : {}),
|
|
949
|
+
...(options.showCredentials === true ? { showCredentials: true } : {}),
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
function collectGroup(value, previous) {
|
|
953
|
+
return [...previous, value];
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* Which deployment a subcommand is acting on.
|
|
957
|
+
*
|
|
958
|
+
* =============================================================================
|
|
959
|
+
* ⚠ THE RESOLVER HAD NO CALLERS
|
|
960
|
+
* =============================================================================
|
|
961
|
+
*
|
|
962
|
+
* `locateApp` and its five ranks shipped with `deploy list` and nothing else,
|
|
963
|
+
* so every other subcommand still read a bare `--root` that defaulted to the
|
|
964
|
+
* apps root. That made ranks 2 through 5 unreachable from the command line:
|
|
965
|
+
* `--name` did not exist, the SOLE-APP case was never tried, the ambiguity
|
|
966
|
+
* refusal could never fire -- and, worst, neither could RANK 3, the cwd walk,
|
|
967
|
+
* which is the one defect the resolver was written to fix. An operator
|
|
968
|
+
* standing inside their own deployment was told to pass a flag that did not
|
|
969
|
+
* exist, by a command run from the directory the error had just left them in.
|
|
970
|
+
*
|
|
971
|
+
* ⚠ AND `--root` CARRIED A DEFAULT, which is what made this invisible. With a
|
|
972
|
+
* default, `options.root` is always defined and rank 1 always wins, so adding
|
|
973
|
+
* the lower ranks would have changed nothing at all. The default is gone; an
|
|
974
|
+
* unpassed `--root` is now genuinely absent.
|
|
975
|
+
* =============================================================================
|
|
976
|
+
*/
|
|
977
|
+
/**
|
|
978
|
+
* Collects a repeated `--answer key=value` into a map.
|
|
979
|
+
*
|
|
980
|
+
* ⚠ SPLIT ON THE FIRST `=` ONLY. A signing secret is base64 and base64 ends in
|
|
981
|
+
* `=` padding, so splitting on every one truncates exactly the values that
|
|
982
|
+
* must not be truncated.
|
|
983
|
+
*/
|
|
984
|
+
function collectAnswer(entry, previous) {
|
|
985
|
+
const at = entry.indexOf('=');
|
|
986
|
+
if (at <= 0) {
|
|
987
|
+
throw new UsageError(`--answer expects KEY=value, not \`${entry}\`.`);
|
|
988
|
+
}
|
|
989
|
+
return new Map(previous).set(entry.slice(0, at), entry.slice(at + 1));
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* The answers a run starts with, from `--answers-file` and `--answer`.
|
|
993
|
+
*
|
|
994
|
+
* ⚠ `--answer` WINS OVER THE FILE. The flag is the narrower, later, more
|
|
995
|
+
* deliberate statement -- an operator overriding one value of a shared answers
|
|
996
|
+
* file on one run. The other order makes the flag silently do nothing.
|
|
997
|
+
*/
|
|
998
|
+
function collectedAnswers(options, warn) {
|
|
999
|
+
const fromFile = options.answersFile === undefined ? undefined : readAnswersFile(options.answersFile);
|
|
1000
|
+
for (const warning of fromFile?.warnings ?? [])
|
|
1001
|
+
warn(warning);
|
|
1002
|
+
const merged = new Map([
|
|
1003
|
+
...(fromFile?.values ?? new Map()),
|
|
1004
|
+
...(options.answer ?? new Map()),
|
|
1005
|
+
]);
|
|
1006
|
+
return merged.size === 0 ? undefined : merged;
|
|
1007
|
+
}
|
|
1008
|
+
function resolveApp(options, { mayBeAbsent = false } = {}) {
|
|
1009
|
+
const request = {
|
|
1010
|
+
...(options.root === undefined ? {} : { root: options.root }),
|
|
1011
|
+
...(options.name === undefined ? {} : { name: options.name }),
|
|
1012
|
+
...(options.appsRoot === undefined ? {} : { appsRoot: options.appsRoot }),
|
|
1013
|
+
};
|
|
1014
|
+
try {
|
|
1015
|
+
return locateApp(request);
|
|
1016
|
+
}
|
|
1017
|
+
catch (error) {
|
|
1018
|
+
// ⚠ `doctor` AND `install` MUST WORK WHEN NOTHING IS INSTALLED. That is
|
|
1019
|
+
// the entire point of a preflight, and install's job is to create the
|
|
1020
|
+
// thing the other commands require. Ranks 4 and 5 both ask "which of the
|
|
1021
|
+
// deployments here?", which is not a question either of them has -- so a
|
|
1022
|
+
// refusal from those ranks becomes the apps root itself, exactly the value
|
|
1023
|
+
// `--root` used to default to.
|
|
1024
|
+
//
|
|
1025
|
+
// ⚠ NOT EXTENDED TO `update`/`status`/`certs`/`uninstall`. Those act on a
|
|
1026
|
+
// deployment that must already exist, and falling back would point them at
|
|
1027
|
+
// a directory nothing was installed into -- turning "which one did you
|
|
1028
|
+
// mean?" into a confusing failure somewhere further in.
|
|
1029
|
+
if (!mayBeAbsent || !(error instanceof UsageError))
|
|
1030
|
+
throw error;
|
|
1031
|
+
const appsRoot = resolve(options.appsRoot ?? DEFAULT_APPS_ROOT);
|
|
1032
|
+
return { name: basename(appsRoot), deployRoot: appsRoot, appsRoot, via: 'root' };
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
export async function runInstallCommand(options, ctx) {
|
|
1036
|
+
// ⚠ Resolved through the five ranks, not read off `--root`. See
|
|
1037
|
+
// `resolveApp`: with a defaulted `--root` every rank below the first
|
|
1038
|
+
// was dead code, including the cwd walk the resolver exists for.
|
|
1039
|
+
const app = resolveApp(options, { mayBeAbsent: true });
|
|
1040
|
+
const proxy = proxyFlags(options);
|
|
1041
|
+
const stdout = ctx?.stdout ?? process.stdout;
|
|
1042
|
+
const stderr = ctx?.stderr ?? process.stderr;
|
|
1043
|
+
const json = options.json === true;
|
|
1044
|
+
const { answers, role } = extractRoleAnswers(collectedAnswers(options, (message) => stderr.write(`warning: ${message}\n`)));
|
|
1045
|
+
const installOptions = {
|
|
1046
|
+
...appRoleOptions(options, role),
|
|
1047
|
+
deployRoot: app.deployRoot,
|
|
1048
|
+
bindPort: Number(options.port),
|
|
1049
|
+
...(options.portIsDefault === true ? { bindPortIsDefault: true } : {}),
|
|
1050
|
+
proxyRoot: options.proxyRoot,
|
|
1051
|
+
...(proxy.mode === undefined ? {} : { proxyMode: proxy.mode }),
|
|
1052
|
+
...(proxy.container === undefined ? {} : { proxyContainer: proxy.container }),
|
|
1053
|
+
groups: options.group,
|
|
1054
|
+
...(options.domain === undefined ? {} : { domain: options.domain }),
|
|
1055
|
+
...(options.repo === undefined ? {} : { repo: options.repo }),
|
|
1056
|
+
...(options.ref === undefined ? {} : { ref: options.ref }),
|
|
1057
|
+
...(options.email === undefined ? {} : { email: options.email }),
|
|
1058
|
+
...(options.all === undefined ? {} : { all: options.all }),
|
|
1059
|
+
...(options.nonInteractive === undefined ? {} : { nonInteractive: options.nonInteractive }),
|
|
1060
|
+
...(options.reinstall === undefined ? {} : { reinstall: options.reinstall }),
|
|
1061
|
+
...(options.resume === undefined ? {} : { resume: options.resume }),
|
|
1062
|
+
...(options.skipDoctor === undefined ? {} : { skipDoctor: options.skipDoctor }),
|
|
1063
|
+
...(options.skipProxy === undefined ? {} : { skipProxy: options.skipProxy }),
|
|
1064
|
+
...(options.skipSeed === undefined ? {} : { skipSeed: options.skipSeed }),
|
|
1065
|
+
...(options.bootstrapProxy === undefined ? {} : { bootstrapProxy: options.bootstrapProxy }),
|
|
1066
|
+
...(options.createDatabase === undefined ? {} : { createDatabase: options.createDatabase }),
|
|
1067
|
+
...(options.skipRenewal === undefined ? {} : { skipRenewal: options.skipRenewal }),
|
|
1068
|
+
...(options.skipOauthCheck === undefined ? {} : { skipOAuthCheck: options.skipOauthCheck }),
|
|
1069
|
+
...(options.cache === false ? { noCache: true } : {}),
|
|
1070
|
+
...(options.force === undefined ? {} : { force: options.force }),
|
|
1071
|
+
...(options.staging === undefined ? {} : { staging: options.staging }),
|
|
1072
|
+
...(options.appVersion === undefined ? {} : { appVersion: options.appVersion }),
|
|
1073
|
+
...(options.versionBump === false ? { noVersionBump: true } : {}),
|
|
1074
|
+
...(answers === undefined ? {} : { answers }),
|
|
1075
|
+
...(ctx?.runCommand === undefined ? {} : { runCommand: ctx.runCommand }),
|
|
1076
|
+
// Rendered as lines on stderr here; #184's screen renders the identical
|
|
1077
|
+
// callbacks as React state. One implementation, two renderers.
|
|
1078
|
+
...(json
|
|
1079
|
+
? {}
|
|
1080
|
+
: {
|
|
1081
|
+
hooks: {
|
|
1082
|
+
onStepStart: ({ title, index, total }) => void stderr.write(`\n [${index + 1}/${total}] ${title}\n`),
|
|
1083
|
+
onStepResult: (result) => void stderr.write(result.outcome === 'ok'
|
|
1084
|
+
? ` done (${result.durationMs}ms)\n`
|
|
1085
|
+
: ` ${result.outcome}: ${result.detail ?? ''}\n`),
|
|
1086
|
+
onProgress: (message) => void stderr.write(` ${message}\n`),
|
|
1087
|
+
onLog: (line) => void stderr.write(` ${line}\n`),
|
|
1088
|
+
},
|
|
1089
|
+
}),
|
|
1090
|
+
};
|
|
1091
|
+
const result = await runInstall(installOptions);
|
|
1092
|
+
if (json) {
|
|
1093
|
+
stdout.write(`${JSON.stringify(result)}\n`);
|
|
1094
|
+
return;
|
|
1095
|
+
}
|
|
1096
|
+
stderr.write([
|
|
1097
|
+
'',
|
|
1098
|
+
' Installed.',
|
|
1099
|
+
'',
|
|
1100
|
+
` Revision ${result.commitSha.slice(0, 12)}`,
|
|
1101
|
+
` Log ${result.journalPath}`,
|
|
1102
|
+
'',
|
|
1103
|
+
` ${result.nextStep}`,
|
|
1104
|
+
'',
|
|
1105
|
+
].join('\n'));
|
|
1106
|
+
writeCredentials(stderr, result.credentials);
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* Shows the generated application database login ONCE, on request
|
|
1110
|
+
* (`--show-credentials`, #980). To the terminal only: never the journal, and
|
|
1111
|
+
* the caller passes nothing unless it was asked.
|
|
1112
|
+
*/
|
|
1113
|
+
function writeCredentials(stderr, credentials) {
|
|
1114
|
+
if (credentials === undefined)
|
|
1115
|
+
return;
|
|
1116
|
+
stderr.write([
|
|
1117
|
+
' Application database login (shown once; it is also in the deployment\'s .env, mode 0600):',
|
|
1118
|
+
` POSTGRES_USER=${credentials.user}`,
|
|
1119
|
+
` POSTGRES_PASSWORD=${credentials.password}`,
|
|
1120
|
+
'',
|
|
1121
|
+
].join('\n'));
|
|
1122
|
+
}
|
|
1123
|
+
export async function runUpdateCommand(options, ctx) {
|
|
1124
|
+
// ⚠ Resolved through the five ranks, not read off `--root`. See
|
|
1125
|
+
// `resolveApp`: with a defaulted `--root` every rank below the first
|
|
1126
|
+
// was dead code, including the cwd walk the resolver exists for.
|
|
1127
|
+
const app = resolveApp(options);
|
|
1128
|
+
const proxy = proxyFlags(options);
|
|
1129
|
+
const stdout = ctx?.stdout ?? process.stdout;
|
|
1130
|
+
const stderr = ctx?.stderr ?? process.stderr;
|
|
1131
|
+
const json = options.json === true;
|
|
1132
|
+
const { answers, role } = extractRoleAnswers(collectedAnswers(options, (message) => stderr.write(`warning: ${message}\n`)));
|
|
1133
|
+
const updateOptions = {
|
|
1134
|
+
...appRoleOptions(options, role),
|
|
1135
|
+
deployRoot: app.deployRoot,
|
|
1136
|
+
...(proxy.mode === undefined ? {} : { proxyMode: proxy.mode }),
|
|
1137
|
+
...(proxy.container === undefined ? {} : { proxyContainer: proxy.container }),
|
|
1138
|
+
...(options.ref === undefined ? {} : { ref: options.ref }),
|
|
1139
|
+
...(options.force === undefined ? {} : { force: options.force }),
|
|
1140
|
+
...(options.cache === false ? { noCache: true } : {}),
|
|
1141
|
+
...(options.nonInteractive === undefined ? {} : { nonInteractive: options.nonInteractive }),
|
|
1142
|
+
...(options.skipSeed === undefined ? {} : { skipSeed: options.skipSeed }),
|
|
1143
|
+
...(options.skipProxy === undefined ? {} : { skipProxy: options.skipProxy }),
|
|
1144
|
+
...(options.createDatabase === undefined ? {} : { createDatabase: options.createDatabase }),
|
|
1145
|
+
...(options.skipRenewal === undefined ? {} : { skipRenewal: options.skipRenewal }),
|
|
1146
|
+
...(options.skipOauthCheck === undefined ? {} : { skipOAuthCheck: options.skipOauthCheck }),
|
|
1147
|
+
...(options.appVersion === undefined ? {} : { appVersion: options.appVersion }),
|
|
1148
|
+
...(options.versionBump === false ? { noVersionBump: true } : {}),
|
|
1149
|
+
...(options.maintenance === undefined ? {} : { maintenance: options.maintenance }),
|
|
1150
|
+
...(answers === undefined ? {} : { answers }),
|
|
1151
|
+
...(ctx?.runCommand === undefined ? {} : { runCommand: ctx.runCommand }),
|
|
1152
|
+
...(json
|
|
1153
|
+
? {}
|
|
1154
|
+
: {
|
|
1155
|
+
hooks: {
|
|
1156
|
+
onStepStart: ({ title, index, total }) => void stderr.write(`\n [${index + 1}/${total}] ${title}\n`),
|
|
1157
|
+
onStepResult: (result) => void stderr.write(result.outcome === 'ok'
|
|
1158
|
+
? ` done (${result.durationMs}ms)\n`
|
|
1159
|
+
: ` ${result.outcome}: ${result.detail ?? ''}\n`),
|
|
1160
|
+
onProgress: (message) => void stderr.write(` ${message}\n`),
|
|
1161
|
+
onLog: (line) => void stderr.write(` ${line}\n`),
|
|
1162
|
+
},
|
|
1163
|
+
}),
|
|
1164
|
+
};
|
|
1165
|
+
const result = await runUpdate(updateOptions);
|
|
1166
|
+
if (json) {
|
|
1167
|
+
stdout.write(`${JSON.stringify(result)}\n`);
|
|
1168
|
+
return;
|
|
1169
|
+
}
|
|
1170
|
+
if (!result.changed) {
|
|
1171
|
+
stderr.write(`\n Already at ${result.commitSha.slice(0, 12)}. Nothing to do.\n\n`);
|
|
1172
|
+
writeCredentials(stderr, result.credentials);
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
stderr.write([
|
|
1176
|
+
'',
|
|
1177
|
+
' Updated.',
|
|
1178
|
+
'',
|
|
1179
|
+
` ${(result.previousSha ?? 'unknown').slice(0, 12)} -> ${result.commitSha.slice(0, 12)}`,
|
|
1180
|
+
` Took ${Math.round(result.durationMs / 1000)}s`,
|
|
1181
|
+
` Log ${result.journalPath}`,
|
|
1182
|
+
'',
|
|
1183
|
+
].join('\n'));
|
|
1184
|
+
writeCredentials(stderr, result.credentials);
|
|
1185
|
+
}
|
|
1186
|
+
//# sourceMappingURL=deploy.js.map
|