@stacksjs/ts-cloud 0.7.21 → 0.7.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +308 -307
- package/dist/{chunk-49nmy775.js → chunk-0tfwdnmf.js} +9 -6
- package/dist/{chunk-qgnyzfmx.js → chunk-5mejsd43.js} +1 -1
- package/dist/{chunk-296n8hvt.js → chunk-c3yy2xyq.js} +2 -2
- package/dist/{chunk-eapb9et8.js → chunk-js3vrvvn.js} +4 -4
- package/dist/{chunk-xgnxz5dz.js → chunk-kcxxwg3j.js} +89 -12
- package/dist/deploy/index.js +4 -4
- package/dist/deploy/management-dashboard.d.ts +45 -15
- package/dist/drivers/index.js +2 -2
- package/dist/drivers/shared/deploy-script.d.ts +7 -0
- package/dist/index.js +8 -4
- package/dist/ui/index.html +3 -3
- package/dist/ui/server/actions.html +3 -3
- package/dist/ui/server/backups.html +3 -3
- package/dist/ui/server/database.html +3 -3
- package/dist/ui/server/deployments.html +3 -3
- package/dist/ui/server/firewall.html +3 -3
- package/dist/ui/server/logs.html +3 -3
- package/dist/ui/server/services.html +3 -3
- package/dist/ui/server/sites.html +3 -3
- package/dist/ui/server/ssh-keys.html +3 -3
- package/dist/ui/server/team.html +3 -3
- package/dist/ui/server/terminal.html +3 -3
- package/dist/ui/server/workers.html +3 -3
- package/dist/ui/serverless/alarms.html +3 -3
- package/dist/ui/serverless/assets.html +3 -3
- package/dist/ui/serverless/data.html +3 -3
- package/dist/ui/serverless/deployments.html +3 -3
- package/dist/ui/serverless/functions.html +3 -3
- package/dist/ui/serverless/logs.html +3 -3
- package/dist/ui/serverless/queues.html +3 -3
- package/dist/ui/serverless/scheduler.html +3 -3
- package/dist/ui/serverless/secrets.html +3 -3
- package/dist/ui/serverless/traces.html +3 -3
- package/dist/ui/serverless.html +3 -3
- package/package.json +3 -3
|
@@ -21901,6 +21901,8 @@ function createDashboardSite(options) {
|
|
|
21901
21901
|
}
|
|
21902
21902
|
};
|
|
21903
21903
|
}
|
|
21904
|
+
var DASHBOARD_STATE_DIR = ".ts-cloud";
|
|
21905
|
+
var DASHBOARD_ENTRY = "./node_modules/@stacksjs/ts-cloud/dist/bin/cli.js";
|
|
21904
21906
|
function apexOf(domain) {
|
|
21905
21907
|
const parts = domain.split(".").filter(Boolean);
|
|
21906
21908
|
return parts.length <= 2 ? domain : parts.slice(-2).join(".");
|
|
@@ -21963,7 +21965,7 @@ function resolveManagementDashboardSites(config, environment, opts) {
|
|
|
21963
21965
|
return [];
|
|
21964
21966
|
const auth2 = opts.password ? { auth: { username: opts.username || "admin", password: opts.password, realm: opts.realm } } : {};
|
|
21965
21967
|
const build = opts.build === false || opts.build === undefined ? {} : { build: opts.build };
|
|
21966
|
-
if (opts.live) {
|
|
21968
|
+
if (opts.live !== false) {
|
|
21967
21969
|
const domain = resolveDashboardDomain(config, environment, opts.domain);
|
|
21968
21970
|
if (!domain)
|
|
21969
21971
|
return [];
|
|
@@ -21972,11 +21974,12 @@ function resolveManagementDashboardSites(config, environment, opts) {
|
|
|
21972
21974
|
root: opts.uiRoot,
|
|
21973
21975
|
deploy: "server",
|
|
21974
21976
|
domain,
|
|
21975
|
-
|
|
21977
|
+
preStart: ["bun install --production --no-save"],
|
|
21978
|
+
start: `bun ${DASHBOARD_ENTRY} dashboard:serve --box --host 127.0.0.1 --port ${port}`,
|
|
21976
21979
|
port,
|
|
21977
|
-
|
|
21978
|
-
|
|
21979
|
-
|
|
21980
|
+
sharedPaths: [DASHBOARD_STATE_DIR],
|
|
21981
|
+
healthCheck: { path: "/login" },
|
|
21982
|
+
ssl: { provider: "letsencrypt" }
|
|
21980
21983
|
};
|
|
21981
21984
|
return [{ name: managementDashboardSiteName(domain), site }];
|
|
21982
21985
|
}
|
|
@@ -46152,4 +46155,4 @@ class ResourceManagementManager {
|
|
|
46152
46155
|
}
|
|
46153
46156
|
var resourceManagementManager = new ResourceManagementManager;
|
|
46154
46157
|
|
|
46155
|
-
export { detectServiceRegion, signRequest, signRequestAsync, createPresignedUrl, createPresignedUrlAsync, makeAWSRequest, makeAWSRequestOnce, makeAWSRequestAsync, parseXMLResponse, parseJSONResponse, clearSigningKeyCache, getSigningKeyCacheSize, isNodeCryptoAvailable, isWebCryptoAvailable, QueuePresets, RealtimePresets, detectDeploymentTargets, resolveDeploymentMode, deploymentCoexistenceError, resolveCloudProvider, TemplateBuilder, Pseudo, generateResourceName, generateLogicalId, getTimestamp, sanitizeName, resolveProjectStackName, resolveSiteStackName, resolveSiteResourceName, resolveSiteBucketName, resolveStorageBucketName, resolveDeployBucketName, resolveServerlessAppStackName, resolveServerlessArtifactBucketName, resolveServerlessAssetBucketName, DependencyGraph, analyzeStackDiff, formatDiff, Storage, Registry, CDN, DNS, Security, Compute, Network, FileSystem, Email, exports_incoming_call, Phone, Queue, JobLoader, StacksIntegration, exports_send, SMS, AI, Database, Cache, Permissions, ApiGateway, Messaging, Workflow, Monitoring, Auth, Deployment, AssetHasher, Secrets, ParameterStore, Search, Redirects, Communication, Fn2, Arn, AWS_PSEUDO_PARAMETERS, CloudFormationBuilder, buildCloudFormationTemplate, createStaticSitePreset, createNodeJsServerPreset, createNodeJsServerlessPreset, createServerlessNodePreset, createFullStackAppPreset, createApiBackendPreset, createWordPressPreset, createJamstackPreset, createMicroservicesPreset, createRealtimeAppPreset, createDataPipelinePreset, createMLApiPreset, createTraditionalWebAppPreset, createLaravelPreset, createServerlessLaravelPreset, createDashboardSite, resolveDashboardDomain, resolveDashboardDomains, hasManagementDashboardSite, MANAGEMENT_DASHBOARD_SITE_PREFIX, managementDashboardSiteName, isManagementDashboardSiteName, resolveManagementDashboardSites, resolveManagementDashboardSite, extendPreset, composePresets, createPreset, mergeInfrastructure, withMonitoring, withSecurity, withDatabase, withCache, withCDN, withQueue, fromEnvironment, fromSharedCredentials, fromEC2Metadata, fromECSMetadata, fromWebIdentity, getCredentials, createCredentialProvider, resolveCredentials, resolveRegion, getAccountId, S3Error, createS3Client, CloudError, ConfigurationError, CredentialError, DeploymentError, ValidationError, AWSAPIError, ErrorCodes, getErrorDetails, createError, DebugLogger, validateConfiguration, detectMisconfigurations, validateCredentials, checkIAMPermissions, getRequiredPermissions, suggestIAMPolicy, DEFAULT_SERVICE_LIMITS, checkServiceQuotas, getQuotaUsageSummary, suggestQuotaIncrease, FileCache, TemplateCache, templateCache, hashFile, hashString, hashBuffer, hashDirectory, hashManifest, quickHash, findChangedFiles, HashCache, parallel, batch, parallelMap, parallelWithRetry, sequence, withTimeout, RateLimiter, chunk, processInChunks, diffTemplates, getDiffSummary, requiresReplacement, categorizeChanges, getDeploymentStrategy, getDiffStats, cloud_config_schema_default, validateAgainstSchema, defaultLocalConfig, getLocalConfig, isLocalDevelopment, getLocalEndpoint, getLocalCredentials, getLocalEnvVars, MockCloudFormation, MockS3, MockDynamoDB, createMockAWS, PreviewEnvironmentManager, previewManager, generatePreviewWorkflow, generateCleanupWorkflow, generateCostReportWorkflow, PreviewNotificationService, previewNotifications, formatTable, formatTree, formatProgressBar, formatBytes, formatDuration, formatList, formatKeyValue, ProgressBar, MultiStepProgress, Spinner, TaskList, suggestCommand, formatSuggestion, isLikelyTypo, getContextualHelp, searchCommands, autocomplete, suggestFlags, formatFlagSuggestions, getCommandUsage, validateCommand, REPL, REPLContext, REPLCommandBuilder, CommandHistory, formatHistory, formatHistoryStats, MultiRegionManager, multiRegionManager, CrossRegionReferenceManager, GlobalResourceManager, RegionPairManager, StackDependencyManager, crossRegionReferenceManager, globalResourceManager, regionPairManager, stackDependencyManager, AWS_REGIONS, getRegion, getAllRegions, getRegionsByLocation, getRegionsByCompliance, getRegionsByPricingTier, isValidRegion, getClosestRegion, suggestRegions, suggestRegionPairs, formatRegion, formatRegionList, getRegionStats, MultiAccountManager, OrganizationManager, multiAccountManager, organizationManager, RECOMMENDED_ACCOUNT_STRUCTURES, RECOMMENDED_SCPS, COMMON_CROSS_ACCOUNT_ROLES, getRecommendedStructure, generateCrossAccountRoleCF, validateAccountStructure, formatAccountStructure, generateDeploymentWorkflow, generateMultiEnvWorkflow, generatePRPreviewWorkflow, generateScheduledWorkflow, generateMatrixWorkflow, generateDeploymentPipeline, generateMultiEnvPipeline, generatePreviewPipeline, generateScheduledPipeline, generateManualPipeline, generateDeploymentConfig, generateMultiEnvConfig, generateScheduledConfig, generateApprovalConfig, generateParallelConfig, BackupManager, backupManager, DisasterRecoveryManager, drManager, AWSConfigManager, awsConfigManager, CloudTrailManager, cloudTrailManager, GuardDutyManager, guardDutyManager, SecurityHubManager, securityHubManager, BlueGreenManager, blueGreenManager, CanaryManager, canaryManager, ABTestManager, abTestManager, ProgressiveDeploymentManager, progressiveDeploymentManager, XRayManager, xrayManager, MetricsManager, metricsManager, LogsManager, logsManager, SyntheticsManager, syntheticsManager, MigrationManager, migrationManager, ReplicaManager, replicaManager, PerformanceManager, performanceManager, DatabaseUserManager, databaseUserManager, SecretsRotationManager, secretsRotationManager, SecretsManager, secretsManager, CertificateManager, certificateManager, SecurityScanningManager, securityScanningManager, ImageScanningManager, imageScanningManager, BuildOptimizationManager, buildOptimizationManager, ContainerRegistryManager, containerRegistryManager, ServiceMeshManager, serviceMeshManager, LambdaLayersManager, lambdaLayersManager, LambdaVersionsManager, lambdaVersionsManager, LambdaConcurrencyManager, lambdaConcurrencyManager, LambdaDestinationsManager, lambdaDestinationsManager, LambdaVPCManager, lambdaVPCManager, LambdaDLQManager, lambdaDLQManager, Route53RoutingManager, route53RoutingManager, DNSSECManager, dnssecManager, Route53ResolverManager, route53ResolverManager, BounceComplaintHandler, bounceComplaintHandler, EmailAnalyticsManager, emailAnalyticsManager, SenderReputationManager, senderReputationManager, EmailTemplateManager, emailTemplateManager, exports_advanced, exports_inbound, exports_advanced2, exports_advanced3, FIFOQueueManager, fifoQueueManager, DLQMonitoringManager, dlqMonitoringManager, BatchProcessingManager, batchProcessingManager, QueueManagementManager, queueManagementManager, createZip, generateBootstrap, runBuildHooks, sha256, artifactKey, packageServerlessApp, MANAGED_NODE_VERSIONS, resolveServerlessRuntime, resolveQueues, resolveQueueNames, composeServerlessAppTemplate, PHP_LAYER_EXTENSIONS, phpLayerPackages, phpLayerBuildStage, generatePhpLayerDockerfile, generateAppImageDockerfile, sharedRuntimeLoop, buildNodeRuntimeLayerZip, buildBunRuntimeLayerZip, resolveApp, eventToRequest, responseToResult, createHttpHandler, createQueueHandler, createCliHandler, createHandlers, generatePhpFpmConfig, phpRuntimeLayerAssets, laravelServerlessEnvDefaults, LARAVEL_SERVERLESS_BUILD_STEPS, buildPhpRuntimeLayerZip, PHP_DEFAULT_EXCLUDES, runPhpBuildHooks, collectPhpAppEntries, packagePhpApp, StaticSiteManager, staticSiteManager, StorageAdvancedManager, storageAdvancedManager, HealthCheckManager, healthCheckManager, NetworkSecurityManager, networkSecurityManager, ResourceManagementManager, resourceManagementManager };
|
|
46158
|
+
export { detectServiceRegion, signRequest, signRequestAsync, createPresignedUrl, createPresignedUrlAsync, makeAWSRequest, makeAWSRequestOnce, makeAWSRequestAsync, parseXMLResponse, parseJSONResponse, clearSigningKeyCache, getSigningKeyCacheSize, isNodeCryptoAvailable, isWebCryptoAvailable, QueuePresets, RealtimePresets, detectDeploymentTargets, resolveDeploymentMode, deploymentCoexistenceError, resolveCloudProvider, TemplateBuilder, Pseudo, generateResourceName, generateLogicalId, getTimestamp, sanitizeName, resolveProjectStackName, resolveSiteStackName, resolveSiteResourceName, resolveSiteBucketName, resolveStorageBucketName, resolveDeployBucketName, resolveServerlessAppStackName, resolveServerlessArtifactBucketName, resolveServerlessAssetBucketName, DependencyGraph, analyzeStackDiff, formatDiff, Storage, Registry, CDN, DNS, Security, Compute, Network, FileSystem, Email, exports_incoming_call, Phone, Queue, JobLoader, StacksIntegration, exports_send, SMS, AI, Database, Cache, Permissions, ApiGateway, Messaging, Workflow, Monitoring, Auth, Deployment, AssetHasher, Secrets, ParameterStore, Search, Redirects, Communication, Fn2, Arn, AWS_PSEUDO_PARAMETERS, CloudFormationBuilder, buildCloudFormationTemplate, createStaticSitePreset, createNodeJsServerPreset, createNodeJsServerlessPreset, createServerlessNodePreset, createFullStackAppPreset, createApiBackendPreset, createWordPressPreset, createJamstackPreset, createMicroservicesPreset, createRealtimeAppPreset, createDataPipelinePreset, createMLApiPreset, createTraditionalWebAppPreset, createLaravelPreset, createServerlessLaravelPreset, createDashboardSite, DASHBOARD_STATE_DIR, DASHBOARD_ENTRY, resolveDashboardDomain, resolveDashboardDomains, hasManagementDashboardSite, MANAGEMENT_DASHBOARD_SITE_PREFIX, managementDashboardSiteName, isManagementDashboardSiteName, resolveManagementDashboardSites, resolveManagementDashboardSite, extendPreset, composePresets, createPreset, mergeInfrastructure, withMonitoring, withSecurity, withDatabase, withCache, withCDN, withQueue, fromEnvironment, fromSharedCredentials, fromEC2Metadata, fromECSMetadata, fromWebIdentity, getCredentials, createCredentialProvider, resolveCredentials, resolveRegion, getAccountId, S3Error, createS3Client, CloudError, ConfigurationError, CredentialError, DeploymentError, ValidationError, AWSAPIError, ErrorCodes, getErrorDetails, createError, DebugLogger, validateConfiguration, detectMisconfigurations, validateCredentials, checkIAMPermissions, getRequiredPermissions, suggestIAMPolicy, DEFAULT_SERVICE_LIMITS, checkServiceQuotas, getQuotaUsageSummary, suggestQuotaIncrease, FileCache, TemplateCache, templateCache, hashFile, hashString, hashBuffer, hashDirectory, hashManifest, quickHash, findChangedFiles, HashCache, parallel, batch, parallelMap, parallelWithRetry, sequence, withTimeout, RateLimiter, chunk, processInChunks, diffTemplates, getDiffSummary, requiresReplacement, categorizeChanges, getDeploymentStrategy, getDiffStats, cloud_config_schema_default, validateAgainstSchema, defaultLocalConfig, getLocalConfig, isLocalDevelopment, getLocalEndpoint, getLocalCredentials, getLocalEnvVars, MockCloudFormation, MockS3, MockDynamoDB, createMockAWS, PreviewEnvironmentManager, previewManager, generatePreviewWorkflow, generateCleanupWorkflow, generateCostReportWorkflow, PreviewNotificationService, previewNotifications, formatTable, formatTree, formatProgressBar, formatBytes, formatDuration, formatList, formatKeyValue, ProgressBar, MultiStepProgress, Spinner, TaskList, suggestCommand, formatSuggestion, isLikelyTypo, getContextualHelp, searchCommands, autocomplete, suggestFlags, formatFlagSuggestions, getCommandUsage, validateCommand, REPL, REPLContext, REPLCommandBuilder, CommandHistory, formatHistory, formatHistoryStats, MultiRegionManager, multiRegionManager, CrossRegionReferenceManager, GlobalResourceManager, RegionPairManager, StackDependencyManager, crossRegionReferenceManager, globalResourceManager, regionPairManager, stackDependencyManager, AWS_REGIONS, getRegion, getAllRegions, getRegionsByLocation, getRegionsByCompliance, getRegionsByPricingTier, isValidRegion, getClosestRegion, suggestRegions, suggestRegionPairs, formatRegion, formatRegionList, getRegionStats, MultiAccountManager, OrganizationManager, multiAccountManager, organizationManager, RECOMMENDED_ACCOUNT_STRUCTURES, RECOMMENDED_SCPS, COMMON_CROSS_ACCOUNT_ROLES, getRecommendedStructure, generateCrossAccountRoleCF, validateAccountStructure, formatAccountStructure, generateDeploymentWorkflow, generateMultiEnvWorkflow, generatePRPreviewWorkflow, generateScheduledWorkflow, generateMatrixWorkflow, generateDeploymentPipeline, generateMultiEnvPipeline, generatePreviewPipeline, generateScheduledPipeline, generateManualPipeline, generateDeploymentConfig, generateMultiEnvConfig, generateScheduledConfig, generateApprovalConfig, generateParallelConfig, BackupManager, backupManager, DisasterRecoveryManager, drManager, AWSConfigManager, awsConfigManager, CloudTrailManager, cloudTrailManager, GuardDutyManager, guardDutyManager, SecurityHubManager, securityHubManager, BlueGreenManager, blueGreenManager, CanaryManager, canaryManager, ABTestManager, abTestManager, ProgressiveDeploymentManager, progressiveDeploymentManager, XRayManager, xrayManager, MetricsManager, metricsManager, LogsManager, logsManager, SyntheticsManager, syntheticsManager, MigrationManager, migrationManager, ReplicaManager, replicaManager, PerformanceManager, performanceManager, DatabaseUserManager, databaseUserManager, SecretsRotationManager, secretsRotationManager, SecretsManager, secretsManager, CertificateManager, certificateManager, SecurityScanningManager, securityScanningManager, ImageScanningManager, imageScanningManager, BuildOptimizationManager, buildOptimizationManager, ContainerRegistryManager, containerRegistryManager, ServiceMeshManager, serviceMeshManager, LambdaLayersManager, lambdaLayersManager, LambdaVersionsManager, lambdaVersionsManager, LambdaConcurrencyManager, lambdaConcurrencyManager, LambdaDestinationsManager, lambdaDestinationsManager, LambdaVPCManager, lambdaVPCManager, LambdaDLQManager, lambdaDLQManager, Route53RoutingManager, route53RoutingManager, DNSSECManager, dnssecManager, Route53ResolverManager, route53ResolverManager, BounceComplaintHandler, bounceComplaintHandler, EmailAnalyticsManager, emailAnalyticsManager, SenderReputationManager, senderReputationManager, EmailTemplateManager, emailTemplateManager, exports_advanced, exports_inbound, exports_advanced2, exports_advanced3, FIFOQueueManager, fifoQueueManager, DLQMonitoringManager, dlqMonitoringManager, BatchProcessingManager, batchProcessingManager, QueueManagementManager, queueManagementManager, createZip, generateBootstrap, runBuildHooks, sha256, artifactKey, packageServerlessApp, MANAGED_NODE_VERSIONS, resolveServerlessRuntime, resolveQueues, resolveQueueNames, composeServerlessAppTemplate, PHP_LAYER_EXTENSIONS, phpLayerPackages, phpLayerBuildStage, generatePhpLayerDockerfile, generateAppImageDockerfile, sharedRuntimeLoop, buildNodeRuntimeLayerZip, buildBunRuntimeLayerZip, resolveApp, eventToRequest, responseToResult, createHttpHandler, createQueueHandler, createCliHandler, createHandlers, generatePhpFpmConfig, phpRuntimeLayerAssets, laravelServerlessEnvDefaults, LARAVEL_SERVERLESS_BUILD_STEPS, buildPhpRuntimeLayerZip, PHP_DEFAULT_EXCLUDES, runPhpBuildHooks, collectPhpAppEntries, packagePhpApp, StaticSiteManager, staticSiteManager, StorageAdvancedManager, storageAdvancedManager, HealthCheckManager, healthCheckManager, NetworkSecurityManager, networkSecurityManager, ResourceManagementManager, resourceManagementManager };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildAndPushServerlessImage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5mejsd43.js";
|
|
4
4
|
import"./chunk-hsk6fe6x.js";
|
|
5
|
-
import"./chunk-
|
|
5
|
+
import"./chunk-0tfwdnmf.js";
|
|
6
6
|
import"./chunk-arsh1g5h.js";
|
|
7
7
|
import"./chunk-v0bahtg2.js";
|
|
8
8
|
export {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
step,
|
|
7
7
|
success,
|
|
8
8
|
warn
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5mejsd43.js";
|
|
10
10
|
import {
|
|
11
11
|
CloudWatchLogsClient,
|
|
12
12
|
CostExplorerClient,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
resolveSiteKind,
|
|
29
29
|
resolveUiSource,
|
|
30
30
|
siteInstallBase
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-kcxxwg3j.js";
|
|
32
32
|
import {
|
|
33
33
|
artifactKey,
|
|
34
34
|
composeServerlessAppTemplate,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
resolveServerlessArtifactBucketName,
|
|
43
43
|
resolveServerlessAssetBucketName,
|
|
44
44
|
resolveServerlessRuntime
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-0tfwdnmf.js";
|
|
46
46
|
import {
|
|
47
47
|
deployStaticSiteWithExternalDnsFull
|
|
48
48
|
} from "./chunk-d7p84vz5.js";
|
|
@@ -347,7 +347,7 @@ async function deployServerlessApp(config, environment, opts = {}) {
|
|
|
347
347
|
}
|
|
348
348
|
if (imageMode) {
|
|
349
349
|
step("Building + pushing container image");
|
|
350
|
-
const { buildAndPushServerlessImage } = await import("./chunk-
|
|
350
|
+
const { buildAndPushServerlessImage } = await import("./chunk-c3yy2xyq.js");
|
|
351
351
|
const built = await buildAndPushServerlessImage({
|
|
352
352
|
app,
|
|
353
353
|
projectRoot,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
resolveCloudProvider,
|
|
6
6
|
resolveManagementDashboardSites,
|
|
7
7
|
resolveProjectStackName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-0tfwdnmf.js";
|
|
9
9
|
import {
|
|
10
10
|
EC2Client,
|
|
11
11
|
SSMClient
|
|
@@ -3579,7 +3579,9 @@ function releasePaths(base, releaseId) {
|
|
|
3579
3579
|
}
|
|
3580
3580
|
function isFileSharedPath(p) {
|
|
3581
3581
|
const name = p.split("/").pop() || p;
|
|
3582
|
-
|
|
3582
|
+
if (name === ".env" || name.startsWith(".env."))
|
|
3583
|
+
return true;
|
|
3584
|
+
return /\.[a-z0-9]+$/i.test(name);
|
|
3583
3585
|
}
|
|
3584
3586
|
function buildEnsureReleaseLayout(paths, sharedPaths = DEFAULT_SHARED_PATHS) {
|
|
3585
3587
|
const lines = [
|
|
@@ -3706,7 +3708,7 @@ function buildSiteDeployScript(options) {
|
|
|
3706
3708
|
const paths = releasePaths(base, releaseId);
|
|
3707
3709
|
const unitBase = `${slug}-${siteName}`;
|
|
3708
3710
|
const serviceName = `${unitBase}.service`;
|
|
3709
|
-
const sharedPaths = [".env"];
|
|
3711
|
+
const sharedPaths = [...new Set([".env", ...options.sharedPaths ?? []])];
|
|
3710
3712
|
const envFile = formatEnvFile(envEntries);
|
|
3711
3713
|
const preStart = preStartCommands.length > 0 ? [`cd ${paths.release}`, ...preStartCommands] : [];
|
|
3712
3714
|
const stageRelease = [
|
|
@@ -3816,14 +3818,14 @@ function buildLocalArtifactFetch(localPath, siteName) {
|
|
|
3816
3818
|
];
|
|
3817
3819
|
}
|
|
3818
3820
|
// src/drivers/shared/compute-deploy.ts
|
|
3819
|
-
import { copyFileSync } from "node:fs";
|
|
3821
|
+
import { copyFileSync as copyFileSync2 } from "node:fs";
|
|
3820
3822
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
3821
3823
|
import { join as join5 } from "node:path";
|
|
3822
3824
|
|
|
3823
3825
|
// src/deploy/management-dashboard.ts
|
|
3824
3826
|
import { execSync as execSync2 } from "node:child_process";
|
|
3825
3827
|
import { randomBytes } from "node:crypto";
|
|
3826
|
-
import { chmodSync, existsSync as existsSync2, mkdirSync, readFileSync as readFileSync3, writeFileSync } from "node:fs";
|
|
3828
|
+
import { chmodSync, copyFileSync, existsSync as existsSync2, mkdirSync, readFileSync as readFileSync3, writeFileSync } from "node:fs";
|
|
3827
3829
|
import { tmpdir } from "node:os";
|
|
3828
3830
|
import { dirname, isAbsolute, join as join4 } from "node:path";
|
|
3829
3831
|
import { fileURLToPath } from "node:url";
|
|
@@ -3862,6 +3864,57 @@ var noopLogger = { info: () => {}, warn: () => {} };
|
|
|
3862
3864
|
function truthy(v) {
|
|
3863
3865
|
return v != null && v !== "" && v !== "0" && v.toLowerCase() !== "false";
|
|
3864
3866
|
}
|
|
3867
|
+
var LIVE_STAGE_DIR = join4(".ts-cloud", "dashboard-release");
|
|
3868
|
+
var CONFIG_CANDIDATES = [
|
|
3869
|
+
["config", "cloud.ts"],
|
|
3870
|
+
["config", "cloud.js"],
|
|
3871
|
+
["cloud.config.ts"],
|
|
3872
|
+
["cloud.config.js"]
|
|
3873
|
+
];
|
|
3874
|
+
function resolveDashboardVersion() {
|
|
3875
|
+
const explicit = process.env.TS_CLOUD_UI_VERSION?.trim();
|
|
3876
|
+
if (explicit)
|
|
3877
|
+
return explicit;
|
|
3878
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
3879
|
+
for (const candidate of [join4(here, "..", "..", "package.json"), join4(here, "..", "package.json")]) {
|
|
3880
|
+
try {
|
|
3881
|
+
const pkg = JSON.parse(readFileSync3(candidate, "utf8"));
|
|
3882
|
+
if (pkg.name === "@stacksjs/ts-cloud" && pkg.version)
|
|
3883
|
+
return `^${pkg.version}`;
|
|
3884
|
+
} catch {}
|
|
3885
|
+
}
|
|
3886
|
+
return "latest";
|
|
3887
|
+
}
|
|
3888
|
+
function stageLiveDashboardRoot(cwd, logger) {
|
|
3889
|
+
const source = CONFIG_CANDIDATES.map((parts) => join4(cwd, ...parts)).find((file) => existsSync2(file));
|
|
3890
|
+
if (!source) {
|
|
3891
|
+
logger.warn("Management dashboard: no cloud config found to ship — skipping the live dashboard.");
|
|
3892
|
+
return null;
|
|
3893
|
+
}
|
|
3894
|
+
const stage = join4(cwd, LIVE_STAGE_DIR);
|
|
3895
|
+
try {
|
|
3896
|
+
mkdirSync(stage, { recursive: true });
|
|
3897
|
+
const isStacksLayout = source.endsWith(join4("config", "cloud.ts")) || source.endsWith(join4("config", "cloud.js"));
|
|
3898
|
+
if (isStacksLayout) {
|
|
3899
|
+
mkdirSync(join4(stage, "config"), { recursive: true });
|
|
3900
|
+
copyFileSync(source, join4(stage, "config", source.endsWith(".ts") ? "cloud.ts" : "cloud.js"));
|
|
3901
|
+
} else {
|
|
3902
|
+
copyFileSync(source, join4(stage, source.endsWith(".ts") ? "cloud.config.ts" : "cloud.config.js"));
|
|
3903
|
+
}
|
|
3904
|
+
const pkg = {
|
|
3905
|
+
name: "ts-cloud-dashboard",
|
|
3906
|
+
private: true,
|
|
3907
|
+
type: "module",
|
|
3908
|
+
dependencies: { "@stacksjs/ts-cloud": resolveDashboardVersion() }
|
|
3909
|
+
};
|
|
3910
|
+
writeFileSync(join4(stage, "package.json"), `${JSON.stringify(pkg, null, 2)}
|
|
3911
|
+
`);
|
|
3912
|
+
return LIVE_STAGE_DIR;
|
|
3913
|
+
} catch (error) {
|
|
3914
|
+
logger.warn(`Management dashboard: could not stage the live release (${error?.message ?? error}) — skipping.`);
|
|
3915
|
+
return null;
|
|
3916
|
+
}
|
|
3917
|
+
}
|
|
3865
3918
|
function resolveUiSource(cwd) {
|
|
3866
3919
|
if (existsSync2(join4(cwd, "packages", "ui", "pages")) || existsSync2(join4(cwd, "packages", "ui", "package.json"))) {
|
|
3867
3920
|
return { uiRoot: "packages/ui/dist", build: "cd packages/ui && bun install && bun run build" };
|
|
@@ -3888,6 +3941,32 @@ function ensureManagementDashboard(config, options = {}) {
|
|
|
3888
3941
|
}
|
|
3889
3942
|
if (hasManagementDashboardSite(config))
|
|
3890
3943
|
return config;
|
|
3944
|
+
const environment = config.environments && Object.keys(config.environments)[0];
|
|
3945
|
+
const domain = process.env.TS_CLOUD_UI_DOMAIN?.trim() || undefined;
|
|
3946
|
+
const port = Number(process.env.TS_CLOUD_UI_PORT) || undefined;
|
|
3947
|
+
const sites = { ...config.sites ?? {} };
|
|
3948
|
+
if (!truthy(process.env.TS_CLOUD_UI_STATIC)) {
|
|
3949
|
+
const uiRoot = stageLiveDashboardRoot(cwd, logger);
|
|
3950
|
+
if (!uiRoot)
|
|
3951
|
+
return config;
|
|
3952
|
+
const resolved2 = resolveManagementDashboardSites(config, environment ?? "production", {
|
|
3953
|
+
uiRoot,
|
|
3954
|
+
build: false,
|
|
3955
|
+
domain,
|
|
3956
|
+
port,
|
|
3957
|
+
live: true
|
|
3958
|
+
});
|
|
3959
|
+
if (resolved2.length === 0) {
|
|
3960
|
+
logger.info("Management dashboard: no domain resolved (set TS_CLOUD_UI_DOMAIN or configure a site domain) — skipping.");
|
|
3961
|
+
return config;
|
|
3962
|
+
}
|
|
3963
|
+
for (const { name, site } of resolved2) {
|
|
3964
|
+
sites[name] = site;
|
|
3965
|
+
logger.info(`Management dashboard → https://${site.domain} (sign in with your ts-cloud account; the first deploy prints an admin password once)`);
|
|
3966
|
+
}
|
|
3967
|
+
config.sites = sites;
|
|
3968
|
+
return config;
|
|
3969
|
+
}
|
|
3891
3970
|
const ui = resolveUiSource(cwd);
|
|
3892
3971
|
if (!ui) {
|
|
3893
3972
|
logger.info("Management dashboard: UI not found (no local ui/ or packaged dist/ui) — skipping auto-deploy.");
|
|
@@ -3895,17 +3974,14 @@ function ensureManagementDashboard(config, options = {}) {
|
|
|
3895
3974
|
}
|
|
3896
3975
|
const username = process.env.TS_CLOUD_UI_USERNAME?.trim() || "admin";
|
|
3897
3976
|
const auth = resolveDashboardAuth(cwd, username, logger);
|
|
3898
|
-
const environment = config.environments && Object.keys(config.environments)[0];
|
|
3899
|
-
const live = truthy(process.env.TS_CLOUD_UI_LIVE);
|
|
3900
|
-
const port = Number(process.env.TS_CLOUD_UI_PORT) || undefined;
|
|
3901
3977
|
const resolved = resolveManagementDashboardSites(config, environment ?? "production", {
|
|
3902
3978
|
uiRoot: ui.uiRoot,
|
|
3903
3979
|
build: ui.build,
|
|
3904
|
-
domain
|
|
3980
|
+
domain,
|
|
3905
3981
|
username,
|
|
3906
3982
|
password: auth.password,
|
|
3907
3983
|
realm: process.env.TS_CLOUD_UI_REALM?.trim() || undefined,
|
|
3908
|
-
live,
|
|
3984
|
+
live: false,
|
|
3909
3985
|
port
|
|
3910
3986
|
});
|
|
3911
3987
|
if (resolved.length === 0) {
|
|
@@ -3913,7 +3989,7 @@ function ensureManagementDashboard(config, options = {}) {
|
|
|
3913
3989
|
return config;
|
|
3914
3990
|
}
|
|
3915
3991
|
const authNote = auth.source === "public" ? "NO AUTH — TS_CLOUD_UI_PUBLIC is set (dashboard is publicly reachable)" : auth.source === "env" ? "htpasswd-protected (TS_CLOUD_UI_PASSWORD)" : `htpasswd-protected (auto-generated — see ${DASHBOARD_CREDENTIALS_FILE})`;
|
|
3916
|
-
|
|
3992
|
+
logger.warn("Management dashboard: static mode — one shared password, and no per-site collaborators. Unset TS_CLOUD_UI_STATIC for the live dashboard.");
|
|
3917
3993
|
for (const { name, site } of resolved) {
|
|
3918
3994
|
sites[name] = site;
|
|
3919
3995
|
logger.info(`Management dashboard → https://${site.domain} (${authNote})`);
|
|
@@ -4566,6 +4642,7 @@ async function deploySiteRelease(driver, options, logger = noopLogger2) {
|
|
|
4566
4642
|
envEntries: site.env || {},
|
|
4567
4643
|
port: site.port,
|
|
4568
4644
|
preStartCommands: site.preStart,
|
|
4645
|
+
sharedPaths: site.sharedPaths,
|
|
4569
4646
|
zeroDowntime: site.zeroDowntime !== false,
|
|
4570
4647
|
healthCheckPath: site.healthCheck?.path
|
|
4571
4648
|
});
|
|
@@ -4652,7 +4729,7 @@ async function deployAllComputeSites(options) {
|
|
|
4652
4729
|
}
|
|
4653
4730
|
try {
|
|
4654
4731
|
const copy = join5(tmpdir2(), `${slug}-${name}-${sha}.tar.gz`);
|
|
4655
|
-
|
|
4732
|
+
copyFileSync2(dashboardTarball, copy);
|
|
4656
4733
|
dashboardTarballBySite.set(name, copy);
|
|
4657
4734
|
} catch {
|
|
4658
4735
|
dashboardTarballBySite.set(name, dashboardTarball);
|
package/dist/deploy/index.js
CHANGED
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
sanitizeCloudConfig,
|
|
13
13
|
setMaintenance,
|
|
14
14
|
startLocalDashboardServer
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-js3vrvvn.js";
|
|
16
16
|
import {
|
|
17
17
|
buildAndPushServerlessImage
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-5mejsd43.js";
|
|
19
19
|
import"../chunk-b82pbxyp.js";
|
|
20
20
|
import"../chunk-hsk6fe6x.js";
|
|
21
21
|
import {
|
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
resolveUiSource,
|
|
31
31
|
siteInstallBase,
|
|
32
32
|
validateDeploymentConfig
|
|
33
|
-
} from "../chunk-
|
|
34
|
-
import"../chunk-
|
|
33
|
+
} from "../chunk-kcxxwg3j.js";
|
|
34
|
+
import"../chunk-0tfwdnmf.js";
|
|
35
35
|
import"../chunk-93hjhs78.js";
|
|
36
36
|
import {
|
|
37
37
|
deleteStaticSite,
|
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Auto-deploy of the ts-cloud management dashboard
|
|
3
|
-
*
|
|
2
|
+
* Auto-deploy of the ts-cloud management dashboard on every server
|
|
3
|
+
* provision/deploy, so every box ships with a cockpit.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
5
|
+
* **Live (the default).** The dashboard runs as a service on the box
|
|
6
|
+
* (`cloud dashboard:serve --box`) behind the proxy. It serves live data and the
|
|
7
|
+
* control API, and authenticates itself: a login page, sessions, and per-site
|
|
8
|
+
* collaborator grants. The release is tiny — the project's cloud config plus a
|
|
9
|
+
* `package.json` — and the box installs `@stacksjs/ts-cloud` from npm, which
|
|
10
|
+
* carries both the CLI and the UI it serves.
|
|
11
|
+
*
|
|
12
|
+
* On the first live deploy the box mints an admin and prints the password once
|
|
13
|
+
* into the deploy log. Users and the session key live in the site's shared
|
|
14
|
+
* `.ts-cloud/`, so they survive later deploys.
|
|
15
|
+
*
|
|
16
|
+
* **Static (`TS_CLOUD_UI_STATIC`).** The built UI shipped as files behind
|
|
17
|
+
* htpasswd. One shared password, all data baked in at build time, and therefore
|
|
18
|
+
* no collaborators. Kept for boxes that cannot run the service.
|
|
13
19
|
*
|
|
14
20
|
* Env:
|
|
21
|
+
* - `TS_CLOUD_UI_STATIC` set truthy for the old static + htpasswd model
|
|
22
|
+
* - `TS_CLOUD_UI_DOMAIN` explicit dashboard host (else `dashboard.<apex>`)
|
|
23
|
+
* - `TS_CLOUD_UI_PORT` loopback port for the live service (default 7676)
|
|
24
|
+
* - `TS_CLOUD_UI_VERSION` ts-cloud version the box installs (default: this one)
|
|
25
|
+
* - `TS_CLOUD_UI_DISABLE` set truthy to skip auto-deploy
|
|
26
|
+
*
|
|
27
|
+
* Static mode only:
|
|
15
28
|
* - `TS_CLOUD_UI_PASSWORD` htpasswd password (unset ⇒ auto-generated + saved)
|
|
16
29
|
* - `TS_CLOUD_UI_PUBLIC` set truthy to serve WITHOUT auth (opt-out, insecure)
|
|
17
30
|
* - `TS_CLOUD_UI_USERNAME` htpasswd user (default `admin`)
|
|
18
|
-
* - `TS_CLOUD_UI_DOMAIN` explicit dashboard host (else `dashboard.<apex>`)
|
|
19
31
|
* - `TS_CLOUD_UI_REALM` browser auth realm
|
|
20
|
-
* - `TS_CLOUD_UI_DISABLE` set truthy to skip auto-deploy
|
|
21
32
|
*/
|
|
22
33
|
import type { CloudConfig } from '@ts-cloud/core';
|
|
23
34
|
/**
|
|
@@ -51,10 +62,29 @@ export interface EnsureDashboardLogger {
|
|
|
51
62
|
info: (msg: string) => void;
|
|
52
63
|
warn: (msg: string) => void;
|
|
53
64
|
}
|
|
65
|
+
/** Where the live dashboard's release is staged, inside the project checkout. */
|
|
66
|
+
export declare const LIVE_STAGE_DIR: string;
|
|
67
|
+
/**
|
|
68
|
+
* The ts-cloud version the box should install. Reads this package's own version
|
|
69
|
+
* so a box runs a dashboard matching the CLI that deployed it, rather than
|
|
70
|
+
* drifting to whatever `latest` happens to be mid-deploy.
|
|
71
|
+
*/
|
|
72
|
+
export declare function resolveDashboardVersion(): string;
|
|
73
|
+
/**
|
|
74
|
+
* Stage the live dashboard's release: the project's cloud config (so the box
|
|
75
|
+
* can resolve the same sites) plus a `package.json` whose install pulls the CLI
|
|
76
|
+
* and UI from npm.
|
|
77
|
+
*
|
|
78
|
+
* Returns the staged directory relative to `cwd`, or null when the project has
|
|
79
|
+
* no cloud config to ship — without one the dashboard on the box would have
|
|
80
|
+
* nothing to describe.
|
|
81
|
+
*/
|
|
82
|
+
export declare function stageLiveDashboardRoot(cwd: string, logger: EnsureDashboardLogger): string | null;
|
|
54
83
|
/**
|
|
55
|
-
* Resolve the UI source to ship
|
|
56
|
-
*
|
|
57
|
-
*
|
|
84
|
+
* Resolve the UI source to ship (STATIC mode only — the live dashboard gets its
|
|
85
|
+
* UI from the npm package it installs on the box). Prefers the repo's local
|
|
86
|
+
* `packages/ui/` (built on the deploy machine), then the prebuilt UI bundled in
|
|
87
|
+
* the installed package. Returns `{ uiRoot, build }` or null when unavailable.
|
|
58
88
|
*/
|
|
59
89
|
export declare function resolveUiSource(cwd: string): {
|
|
60
90
|
uiRoot: string;
|
package/dist/drivers/index.js
CHANGED
|
@@ -48,8 +48,8 @@ import {
|
|
|
48
48
|
waitForCloudInit,
|
|
49
49
|
waitForSsh,
|
|
50
50
|
wrapCloudInitUserData
|
|
51
|
-
} from "../chunk-
|
|
52
|
-
import"../chunk-
|
|
51
|
+
} from "../chunk-kcxxwg3j.js";
|
|
52
|
+
import"../chunk-0tfwdnmf.js";
|
|
53
53
|
import"../chunk-93hjhs78.js";
|
|
54
54
|
import"../chunk-qpj3edwz.js";
|
|
55
55
|
import"../chunk-vd87cpvn.js";
|
|
@@ -25,6 +25,13 @@ export interface BuildSiteDeployScriptOptions {
|
|
|
25
25
|
* `node_modules`.
|
|
26
26
|
*/
|
|
27
27
|
preStartCommands?: string[];
|
|
28
|
+
/**
|
|
29
|
+
* Extra paths kept in `shared/` and symlinked into each release, so they
|
|
30
|
+
* survive a deploy. `.env` is always shared; anything the app WRITES and must
|
|
31
|
+
* keep (a state directory, a database file) has to be listed here or the next
|
|
32
|
+
* release silently starts from empty.
|
|
33
|
+
*/
|
|
34
|
+
sharedPaths?: readonly string[];
|
|
28
35
|
/**
|
|
29
36
|
* True zero-downtime cutover for ported sites: the new release runs as its
|
|
30
37
|
* own systemd instance (`<slug>-<site>@<releaseId>`) that binds the same
|
package/dist/index.js
CHANGED
|
@@ -55,10 +55,10 @@ import {
|
|
|
55
55
|
sanitizeCloudConfig,
|
|
56
56
|
setMaintenance,
|
|
57
57
|
startLocalDashboardServer
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-js3vrvvn.js";
|
|
59
59
|
import {
|
|
60
60
|
buildAndPushServerlessImage
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-5mejsd43.js";
|
|
62
62
|
import {
|
|
63
63
|
CloudWatchLogsClient,
|
|
64
64
|
EFSClient,
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
waitForCloudInit,
|
|
106
106
|
waitForSsh,
|
|
107
107
|
wrapCloudInitUserData
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-kcxxwg3j.js";
|
|
109
109
|
import {
|
|
110
110
|
ABTestManager,
|
|
111
111
|
AI,
|
|
@@ -137,6 +137,8 @@ import {
|
|
|
137
137
|
ContainerRegistryManager,
|
|
138
138
|
CredentialError,
|
|
139
139
|
CrossRegionReferenceManager,
|
|
140
|
+
DASHBOARD_ENTRY,
|
|
141
|
+
DASHBOARD_STATE_DIR,
|
|
140
142
|
DEFAULT_SERVICE_LIMITS,
|
|
141
143
|
DLQMonitoringManager,
|
|
142
144
|
DNS,
|
|
@@ -504,7 +506,7 @@ import {
|
|
|
504
506
|
withSecurity,
|
|
505
507
|
withTimeout,
|
|
506
508
|
xrayManager
|
|
507
|
-
} from "./chunk-
|
|
509
|
+
} from "./chunk-0tfwdnmf.js";
|
|
508
510
|
import {
|
|
509
511
|
EC2Client,
|
|
510
512
|
SSMClient
|
|
@@ -5118,6 +5120,8 @@ export {
|
|
|
5118
5120
|
DNS,
|
|
5119
5121
|
DLQMonitoringManager,
|
|
5120
5122
|
DEFAULT_SERVICE_LIMITS,
|
|
5123
|
+
DASHBOARD_STATE_DIR,
|
|
5124
|
+
DASHBOARD_ENTRY,
|
|
5121
5125
|
DASHBOARD_CREDENTIALS_FILE,
|
|
5122
5126
|
CrossRegionReferenceManager,
|
|
5123
5127
|
CredentialError,
|