@stacksjs/ts-cloud 0.9.4 → 0.11.0
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/aws/index.js +1 -1
- package/dist/bin/chunk-0djsffn6.js +1 -0
- package/dist/bin/chunk-0t3sev1j.js +1 -0
- package/dist/bin/chunk-0y89hs67.js +6 -0
- package/dist/bin/chunk-21gggxvf.js +2 -0
- package/dist/bin/chunk-26cj89s6.js +1 -0
- package/dist/bin/chunk-35xstvnq.js +1 -0
- package/dist/bin/chunk-41yqpdv7.js +2 -0
- package/dist/bin/chunk-4a85nk2q.js +92 -0
- package/dist/bin/{chunk-rxcvf10f.js → chunk-4a97kbk1.js} +129 -129
- package/dist/bin/chunk-4kbhbfq8.js +34 -0
- package/dist/bin/chunk-4vdv41nh.js +70 -0
- package/dist/bin/chunk-67jsyn0g.js +111 -0
- package/dist/bin/chunk-6tct7e89.js +1 -0
- package/dist/bin/chunk-6vjrts39.js +1 -0
- package/dist/bin/chunk-7v5ff3vc.js +1 -0
- package/dist/bin/chunk-80nra92y.js +1 -0
- package/dist/bin/chunk-9mydnqr6.js +2 -0
- package/dist/bin/chunk-9rsn48qg.js +3 -0
- package/dist/bin/chunk-a2t1e5yb.js +1 -0
- package/dist/bin/chunk-akbfefwq.js +1 -0
- package/dist/bin/chunk-b704nznp.js +1 -0
- package/dist/bin/chunk-c1j9v7ee.js +2 -0
- package/dist/bin/chunk-cjz36ths.js +1 -0
- package/dist/bin/chunk-cxd5cevb.js +2 -0
- package/dist/bin/chunk-dbv8w56s.js +50 -0
- package/dist/bin/chunk-dxchg0g1.js +1 -0
- package/dist/bin/{chunk-tx0tqq2k.js → chunk-e1bfd1yv.js} +6 -6
- package/dist/bin/chunk-fpcghdr3.js +585 -0
- package/dist/bin/chunk-ftse39wf.js +9 -0
- package/dist/bin/chunk-g0ewbkbq.js +1 -0
- package/dist/bin/chunk-gskbezam.js +141 -0
- package/dist/bin/chunk-gvs85t2j.js +1 -0
- package/dist/bin/chunk-hej39dwr.js +2 -0
- package/dist/bin/chunk-jce28gnz.js +2 -0
- package/dist/bin/chunk-kbtrr0c3.js +1 -0
- package/dist/bin/chunk-khrye4x9.js +1 -0
- package/dist/bin/{chunk-mh0kdzqp.js → chunk-ks4ewy1s.js} +1 -1
- package/dist/bin/chunk-mbnwt3r5.js +2 -0
- package/dist/bin/chunk-md2k3n21.js +37 -0
- package/dist/bin/chunk-memfxrcn.js +1 -0
- package/dist/bin/chunk-mwgxyc0z.js +44 -0
- package/dist/bin/chunk-neampxq1.js +4 -0
- package/dist/bin/chunk-nkpf91d3.js +1 -0
- package/dist/bin/chunk-nmkm1f68.js +2 -0
- package/dist/bin/chunk-nyc2jxd8.js +2 -0
- package/dist/bin/chunk-pqr8jqnd.js +1 -0
- package/dist/bin/chunk-q182t9ba.js +3 -0
- package/dist/bin/chunk-r6x7beew.js +60 -0
- package/dist/bin/chunk-rfqk5xym.js +1 -0
- package/dist/bin/{chunk-etrb03mt.js → chunk-ww770qpn.js} +30 -30
- package/dist/bin/chunk-wy20ztb6.js +1 -0
- package/dist/bin/chunk-wzepfqf4.js +512 -0
- package/dist/bin/chunk-xcqmwphz.js +1 -0
- package/dist/bin/chunk-xev7qr2h.js +3 -0
- package/dist/bin/chunk-y3rm37z1.js +6 -0
- package/dist/bin/chunk-zejwh9cy.js +6 -0
- package/dist/bin/chunk-zwwnt4x1.js +1 -0
- package/dist/bin/cli.js +431 -418
- package/dist/bin/dashboard-server.js +1 -1
- package/dist/{chunk-dskvqt67.js → chunk-0hj552t7.js} +127 -127
- package/dist/chunk-1ypkh8g6.js +5 -0
- package/dist/chunk-2m09t0c0.js +60 -0
- package/dist/chunk-7fkyfh65.js +1 -0
- package/dist/chunk-7xpxzbkr.js +442 -0
- package/dist/chunk-8e0az001.js +2 -0
- package/dist/chunk-b10cbk8z.js +44 -0
- package/dist/chunk-gk58959n.js +6 -0
- package/dist/chunk-h1rc94df.js +114 -0
- package/dist/chunk-hbhxk5a0.js +4 -0
- package/dist/chunk-hz7k9ymh.js +1 -0
- package/dist/chunk-kj7gzdj6.js +1 -0
- package/dist/chunk-ky5c6t5y.js +2 -0
- package/dist/chunk-mch30cyc.js +1 -0
- package/dist/chunk-n04a3bgf.js +1 -0
- package/dist/chunk-nnqxmh7f.js +34 -0
- package/dist/chunk-p6vszgc2.js +92 -0
- package/dist/chunk-q2njk4hx.js +141 -0
- package/dist/chunk-qjk1v1gs.js +50 -0
- package/dist/chunk-qtp90j44.js +2 -0
- package/dist/chunk-r5natbed.js +37 -0
- package/dist/chunk-rcxq9aaa.js +704 -0
- package/dist/{chunk-gahsdmxf.js → chunk-s3rpd72x.js} +52 -52
- package/dist/{chunk-xt3s24vr.js → chunk-spx89gaw.js} +1 -1
- package/dist/chunk-t0kh8haz.js +2 -0
- package/dist/chunk-vz95qy3n.js +1 -0
- package/dist/deploy/attach-credentials.d.ts +4 -8
- package/dist/deploy/index.js +1 -1
- package/dist/dns/cloudflare.d.ts +27 -0
- package/dist/dns/godaddy.d.ts +18 -1
- package/dist/dns/index.d.ts +2 -0
- package/dist/dns/index.js +1 -1
- package/dist/dns/zone-migration.d.ts +92 -0
- package/dist/dns/zone-migration.test.d.ts +1 -0
- package/dist/drivers/hetzner/driver.d.ts +8 -1
- package/dist/drivers/index.js +1 -1
- package/dist/drivers/shared/app-updates.d.ts +36 -0
- package/dist/drivers/shared/compute-provision.d.ts +14 -2
- package/dist/drivers/shared/db-provision.d.ts +3 -2
- package/dist/drivers/shared/mail-provision.d.ts +116 -0
- package/dist/drivers/shared/mail-provision.test.d.ts +1 -0
- package/dist/drivers/shared/managed-services-probe.d.ts +47 -0
- package/dist/drivers/shared/managed-services-probe.test.d.ts +1 -0
- package/dist/drivers/shared/package-manager.d.ts +1 -0
- package/dist/drivers/shared/remote-failure.d.ts +21 -0
- package/dist/drivers/shared/remote-failure.test.d.ts +1 -0
- package/dist/drivers/shared/sqlite-shared-path.d.ts +50 -0
- package/dist/drivers/shared/sqlite-shared-path.test.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +92 -89
- package/dist/operations/plan.d.ts +136 -0
- package/dist/operations/plan.test.d.ts +1 -0
- package/dist/operations/server-rename.d.ts +84 -0
- package/dist/operations/server-rename.test.d.ts +1 -0
- package/dist/operations/site-move.d.ts +263 -0
- package/dist/operations/site-move.test.d.ts +1 -0
- package/dist/protection/index.js +1 -1
- package/dist/push/index.js +1 -1
- package/dist/spend/index.js +1 -1
- package/dist/ui/404.html +1 -1
- package/dist/ui/accept-invitation.html +1 -1
- package/dist/ui/access-denied.html +1 -1
- package/dist/ui/account/automation.html +6 -6
- package/dist/ui/account/security.html +2 -2
- package/dist/ui/applications/compose.html +6 -6
- package/dist/ui/applications/new.html +2 -2
- package/dist/ui/data/backups.html +80 -80
- package/dist/ui/data/services.html +78 -78
- package/dist/ui/data/volumes.html +50 -50
- package/dist/ui/index.html +50 -50
- package/dist/ui/infrastructure/topology.html +118 -118
- package/dist/ui/integrations.html +2 -2
- package/dist/ui/operations/alerts.html +48 -48
- package/dist/ui/operations/configuration.html +6 -6
- package/dist/ui/operations/jobs.html +75 -75
- package/dist/ui/operations/maintenance.html +6 -6
- package/dist/ui/operations/observability.html +82 -82
- package/dist/ui/operations/previews.html +6 -6
- package/dist/ui/operations/queue.html +6 -6
- package/dist/ui/operations/regions.html +6 -6
- package/dist/ui/operations/releases.html +6 -6
- package/dist/ui/operations/spend.html +54 -54
- package/dist/ui/operations/workloads.html +104 -104
- package/dist/ui/security.html +2 -2
- package/dist/ui/server/actions.html +56 -56
- package/dist/ui/server/activity.html +1 -1
- package/dist/ui/server/capacity.html +6 -6
- package/dist/ui/server/database.html +106 -106
- package/dist/ui/server/deployments.html +50 -50
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +76 -76
- package/dist/ui/server/fleet.html +34 -34
- package/dist/ui/server/logs.html +24 -24
- package/dist/ui/server/metrics.html +112 -112
- package/dist/ui/server/security.html +2 -2
- package/dist/ui/server/services.html +27 -27
- package/dist/ui/server/sites.html +120 -120
- package/dist/ui/server/ssh-keys.html +52 -52
- package/dist/ui/server/team.html +144 -144
- package/dist/ui/server/terminal.html +15 -15
- package/dist/ui/serverless/alarms.html +52 -52
- package/dist/ui/serverless/assets.html +27 -27
- package/dist/ui/serverless/cost.html +2 -2
- package/dist/ui/serverless/data.html +36 -36
- package/dist/ui/serverless/deployments.html +27 -27
- package/dist/ui/serverless/firewall.html +1 -1
- package/dist/ui/serverless/functions.html +40 -40
- package/dist/ui/serverless/logs.html +24 -24
- package/dist/ui/serverless/metrics.html +2 -2
- package/dist/ui/serverless/queues.html +48 -48
- package/dist/ui/serverless/secrets.html +51 -51
- package/dist/ui/serverless/traces.html +6 -6
- package/dist/ui/serverless.html +53 -53
- package/dist/ui-src/src/charts.ts +17499 -12662
- package/dist/ui-src/src/topology.ts +2 -2
- package/package.json +3 -3
- package/dist/bin/chunk-00kg80qg.js +0 -1
- package/dist/bin/chunk-09nwf2gy.js +0 -34
- package/dist/bin/chunk-1k5kszjp.js +0 -111
- package/dist/bin/chunk-21e0mavm.js +0 -1
- package/dist/bin/chunk-271gk1n2.js +0 -6
- package/dist/bin/chunk-2empps47.js +0 -2
- package/dist/bin/chunk-38pq971s.js +0 -2
- package/dist/bin/chunk-3gykfyq4.js +0 -37
- package/dist/bin/chunk-3vqfexc4.js +0 -70
- package/dist/bin/chunk-4vrqm9h0.js +0 -2
- package/dist/bin/chunk-598yf4bs.js +0 -1
- package/dist/bin/chunk-5ectjq0b.js +0 -1
- package/dist/bin/chunk-5erkxpt7.js +0 -512
- package/dist/bin/chunk-5mrtzemj.js +0 -1
- package/dist/bin/chunk-5n9fmabb.js +0 -1
- package/dist/bin/chunk-9knpg30y.js +0 -1
- package/dist/bin/chunk-9pvsff8g.js +0 -1
- package/dist/bin/chunk-ax9mr6wm.js +0 -44
- package/dist/bin/chunk-axhnkn5g.js +0 -2
- package/dist/bin/chunk-c1vcdgvr.js +0 -1
- package/dist/bin/chunk-ctd2vg9w.js +0 -2
- package/dist/bin/chunk-dbgffky8.js +0 -1
- package/dist/bin/chunk-ddk4rt4j.js +0 -6
- package/dist/bin/chunk-dwr30vbv.js +0 -1
- package/dist/bin/chunk-e0rkrq70.js +0 -1
- package/dist/bin/chunk-e3xrwh9z.js +0 -1
- package/dist/bin/chunk-fhc6ntvd.js +0 -2
- package/dist/bin/chunk-fpm59y25.js +0 -6
- package/dist/bin/chunk-fvbxvq6b.js +0 -1
- package/dist/bin/chunk-fy8j3y8p.js +0 -92
- package/dist/bin/chunk-fz21b57w.js +0 -1
- package/dist/bin/chunk-gavvf0pg.js +0 -141
- package/dist/bin/chunk-ggn7ax8p.js +0 -4
- package/dist/bin/chunk-gpe2prkm.js +0 -1
- package/dist/bin/chunk-h5pa5men.js +0 -2
- package/dist/bin/chunk-hm08xdxf.js +0 -2
- package/dist/bin/chunk-hzgz13nf.js +0 -1
- package/dist/bin/chunk-j703btc5.js +0 -50
- package/dist/bin/chunk-k9t9wvms.js +0 -1
- package/dist/bin/chunk-m669wtgr.js +0 -1
- package/dist/bin/chunk-m7dgskt1.js +0 -1
- package/dist/bin/chunk-mr0atd2s.js +0 -2
- package/dist/bin/chunk-mz0wbbsj.js +0 -3
- package/dist/bin/chunk-ngcyftm2.js +0 -1
- package/dist/bin/chunk-p66ptpmr.js +0 -2
- package/dist/bin/chunk-qk9qgepa.js +0 -1
- package/dist/bin/chunk-rytk89az.js +0 -60
- package/dist/bin/chunk-tga3hhwk.js +0 -6
- package/dist/bin/chunk-vek8a0w6.js +0 -1
- package/dist/bin/chunk-vm3q5gf2.js +0 -3
- package/dist/bin/chunk-y7s5r8y6.js +0 -3
- package/dist/bin/chunk-yv9sth30.js +0 -1
- package/dist/bin/chunk-zmegvjp8.js +0 -581
- package/dist/chunk-0ccta6z6.js +0 -6
- package/dist/chunk-0k1cs6pp.js +0 -1
- package/dist/chunk-1egjn203.js +0 -704
- package/dist/chunk-2wx29qga.js +0 -5
- package/dist/chunk-5m5rqmv7.js +0 -1
- package/dist/chunk-8ea5022g.js +0 -114
- package/dist/chunk-8xqn3c0w.js +0 -2
- package/dist/chunk-b4esxhmw.js +0 -2
- package/dist/chunk-b8e5wzwn.js +0 -44
- package/dist/chunk-bggt4n6e.js +0 -2
- package/dist/chunk-cwkg37rs.js +0 -37
- package/dist/chunk-gnv3r2jg.js +0 -1
- package/dist/chunk-hg3c48cp.js +0 -34
- package/dist/chunk-m5azeva3.js +0 -2
- package/dist/chunk-r3qf56b3.js +0 -92
- package/dist/chunk-sdqa9ghv.js +0 -141
- package/dist/chunk-svrvvcm7.js +0 -1
- package/dist/chunk-v0p3hpc3.js +0 -60
- package/dist/chunk-wdzjbecg.js +0 -50
- package/dist/chunk-ww8k3g7j.js +0 -1
- package/dist/chunk-xmqfc62w.js +0 -1
- package/dist/chunk-xrebj679.js +0 -435
- package/dist/chunk-y21zk0pn.js +0 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as a}from"node:module";var c=a(import.meta.url);
|
|
2
|
-
export{c as
|
|
2
|
+
export{c as zt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Yh as l,Zh as a}from"./chunk-gk58959n.js";class g{client;region;constructor(e="us-east-1"){this.region=e,this.client=new l}async describeDBInstances(e){let r={Action:"DescribeDBInstances",Version:"2014-10-31"};if(e?.DBInstanceIdentifier)r.DBInstanceIdentifier=e.DBInstanceIdentifier;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;if(e?.Filters)e.Filters.forEach((o,c)=>{r[`Filters.Filter.${c+1}.Name`]=o.Name,o.Values.forEach((u,d)=>{r[`Filters.Filter.${c+1}.Values.Value.${d+1}`]=u})});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBInstancesResult||n,s=i.DBInstances?.DBInstance||[];if(!Array.isArray(s))s=s?[s]:[];return{DBInstances:s,Marker:i.Marker}}async describeDBInstance(e){return(await this.describeDBInstances({DBInstanceIdentifier:e})).DBInstances?.[0]}async describeDBClusters(e){let r={Action:"DescribeDBClusters",Version:"2014-10-31"};if(e?.DBClusterIdentifier)r.DBClusterIdentifier=e.DBClusterIdentifier;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;if(e?.Filters)e.Filters.forEach((o,c)=>{r[`Filters.Filter.${c+1}.Name`]=o.Name,o.Values.forEach((u,d)=>{r[`Filters.Filter.${c+1}.Values.Value.${d+1}`]=u})});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBClustersResult||n,s=i.DBClusters?.DBCluster||[];if(!Array.isArray(s))s=s?[s]:[];return{DBClusters:s,Marker:i.Marker}}async describeDBSnapshots(e){let r={Action:"DescribeDBSnapshots",Version:"2014-10-31"};if(e?.DBInstanceIdentifier)r.DBInstanceIdentifier=e.DBInstanceIdentifier;if(e?.DBSnapshotIdentifier)r.DBSnapshotIdentifier=e.DBSnapshotIdentifier;if(e?.SnapshotType)r.SnapshotType=e.SnapshotType;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBSnapshotsResult||n,s=i.DBSnapshots?.DBSnapshot||[];if(!Array.isArray(s))s=s?[s]:[];return{DBSnapshots:s,Marker:i.Marker}}async describeDBSubnetGroups(e){let r={Action:"DescribeDBSubnetGroups",Version:"2014-10-31"};if(e?.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e?.MaxRecords)r.MaxRecords=e.MaxRecords;if(e?.Marker)r.Marker=e.Marker;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}),i=n.DescribeDBSubnetGroupsResult||n,s=i.DBSubnetGroups?.DBSubnetGroup||[];if(!Array.isArray(s))s=s?[s]:[];return{DBSubnetGroups:s,Marker:i.Marker}}async createDBInstance(e){let r={Action:"CreateDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBInstanceClass:e.DBInstanceClass,Engine:e.Engine};if(e.DBClusterIdentifier)r.DBClusterIdentifier=e.DBClusterIdentifier;if(e.MasterUsername)r.MasterUsername=e.MasterUsername;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DBName)r.DBName=e.DBName;if(e.AllocatedStorage)r.AllocatedStorage=e.AllocatedStorage;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.AvailabilityZone)r.AvailabilityZone=e.AvailabilityZone;if(e.PreferredMaintenanceWindow)r.PreferredMaintenanceWindow=e.PreferredMaintenanceWindow;if(e.PreferredBackupWindow)r.PreferredBackupWindow=e.PreferredBackupWindow;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.LicenseModel)r.LicenseModel=e.LicenseModel;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.StorageType)r.StorageType=e.StorageType;if(e.StorageEncrypted!==void 0)r.StorageEncrypted=e.StorageEncrypted;if(e.KmsKeyId)r.KmsKeyId=e.KmsKeyId;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=s});if(e.Tags)e.Tags.forEach((s,o)=>{r[`Tags.Tag.${o+1}.Key`]=s.Key,r[`Tags.Tag.${o+1}.Value`]=s.Value});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.CreateDBInstanceResult||n).DBInstance}}async createDBCluster(e){let r={Action:"CreateDBCluster",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,Engine:e.Engine};if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.MasterUsername)r.MasterUsername=e.MasterUsername;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DatabaseName)r.DatabaseName=e.DatabaseName;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.StorageEncrypted!==void 0)r.StorageEncrypted=e.StorageEncrypted;if(e.KmsKeyId)r.KmsKeyId=e.KmsKeyId;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;e.VpcSecurityGroupIds?.forEach((i,s)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${s+1}`]=i});let t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(r)).toString()});return{DBCluster:(t.CreateDBClusterResult||t).DBCluster}}async deleteDBInstance(e){let r={Action:"DeleteDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.SkipFinalSnapshot!==void 0)r.SkipFinalSnapshot=e.SkipFinalSnapshot;if(e.FinalDBSnapshotIdentifier)r.FinalDBSnapshotIdentifier=e.FinalDBSnapshotIdentifier;if(e.DeleteAutomatedBackups!==void 0)r.DeleteAutomatedBackups=e.DeleteAutomatedBackups;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.DeleteDBInstanceResult||n).DBInstance}}async modifyDBInstance(e){let r={Action:"ModifyDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.DBInstanceClass)r.DBInstanceClass=e.DBInstanceClass;if(e.AllocatedStorage)r.AllocatedStorage=e.AllocatedStorage;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.PreferredBackupWindow)r.PreferredBackupWindow=e.PreferredBackupWindow;if(e.PreferredMaintenanceWindow)r.PreferredMaintenanceWindow=e.PreferredMaintenanceWindow;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.ApplyImmediately!==void 0)r.ApplyImmediately=e.ApplyImmediately;if(e.StorageType)r.StorageType=e.StorageType;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=s});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.ModifyDBInstanceResult||n).DBInstance}}async modifyDBCluster(e){let r={Action:"ModifyDBCluster",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier};if(e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;if(e.BackupRetentionPeriod!==void 0)r.BackupRetentionPeriod=e.BackupRetentionPeriod;if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.MasterUserPassword)r.MasterUserPassword=e.MasterUserPassword;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.ApplyImmediately!==void 0)r.ApplyImmediately=e.ApplyImmediately;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBCluster:(n.ModifyDBClusterResult||n).DBCluster}}async rebootDBCluster(e){let r={Action:"FailoverDBCluster",Version:"2014-10-31",DBClusterIdentifier:e},t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(r)).toString()});return{DBCluster:(t.FailoverDBClusterResult||t).DBCluster}}async createDBClusterSnapshot(e,r){let t={Action:"CreateDBClusterSnapshot",Version:"2014-10-31",DBClusterIdentifier:e,DBClusterSnapshotIdentifier:r};return this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(t)).toString()})}async describeDBClusterSnapshots(e={}){let r={Action:"DescribeDBClusterSnapshots",Version:"2014-10-31",...e},t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(r)).toString()}),n=t.DescribeDBClusterSnapshotsResult||t,i=n.DBClusterSnapshots?.DBClusterSnapshot??n.DBClusterSnapshots??[];return{DBClusterSnapshots:Array.isArray(i)?i:[i]}}async deleteDBClusterSnapshot(e){await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a({Action:"DeleteDBClusterSnapshot",Version:"2014-10-31",DBClusterSnapshotIdentifier:e})).toString()})}async deleteDBCluster(e,r){let t={Action:"DeleteDBCluster",Version:"2014-10-31",DBClusterIdentifier:e,SkipFinalSnapshot:!r};if(r)t.FinalDBSnapshotIdentifier=r;let n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(t)).toString()});return{DBCluster:(n.DeleteDBClusterResult||n).DBCluster}}async restoreDBClusterToPointInTime(e){let r={Action:"RestoreDBClusterToPointInTime",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,SourceDBClusterIdentifier:e.SourceDBClusterIdentifier};if(e.RestoreToTime)r.RestoreToTime=e.RestoreToTime.toISOString();if(e.UseLatestRestorableTime)r.UseLatestRestorableTime=!0;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=s});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBCluster:(n.RestoreDBClusterToPointInTimeResult||n).DBCluster}}async restoreDBClusterFromSnapshot(e){let r={Action:"RestoreDBClusterFromSnapshot",Version:"2014-10-31",DBClusterIdentifier:e.DBClusterIdentifier,SnapshotIdentifier:e.SnapshotIdentifier,Engine:e.Engine};if(e.EngineVersion)r.EngineVersion=e.EngineVersion;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds?.forEach((i,s)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${s+1}`]=i}),e.ServerlessV2ScalingConfiguration)r["ServerlessV2ScalingConfiguration.MinCapacity"]=e.ServerlessV2ScalingConfiguration.MinCapacity,r["ServerlessV2ScalingConfiguration.MaxCapacity"]=e.ServerlessV2ScalingConfiguration.MaxCapacity;let t=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a(r)).toString()});return{DBCluster:(t.RestoreDBClusterFromSnapshotResult||t).DBCluster}}async startDBInstance(e){let t=new URLSearchParams(a({Action:"StartDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e})).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.StartDBInstanceResult||n).DBInstance}}async stopDBInstance(e){let r={Action:"StopDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.DBSnapshotIdentifier)r.DBSnapshotIdentifier=e.DBSnapshotIdentifier;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.StopDBInstanceResult||n).DBInstance}}async rebootDBInstance(e){let r={Action:"RebootDBInstance",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier};if(e.ForceFailover!==void 0)r.ForceFailover=e.ForceFailover;let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.RebootDBInstanceResult||n).DBInstance}}async createDBSnapshot(e){let r={Action:"CreateDBSnapshot",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBSnapshotIdentifier:e.DBSnapshotIdentifier};if(e.Tags)e.Tags.forEach((s,o)=>{r[`Tags.Tag.${o+1}.Key`]=s.Key,r[`Tags.Tag.${o+1}.Value`]=s.Value});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBSnapshot:(n.CreateDBSnapshotResult||n).DBSnapshot}}async deleteDBSnapshot(e){let t=new URLSearchParams(a({Action:"DeleteDBSnapshot",Version:"2014-10-31",DBSnapshotIdentifier:e})).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBSnapshot:(n.DeleteDBSnapshotResult||n).DBSnapshot}}async restoreDBInstanceFromDBSnapshot(e){let r={Action:"RestoreDBInstanceFromDBSnapshot",Version:"2014-10-31",DBInstanceIdentifier:e.DBInstanceIdentifier,DBSnapshotIdentifier:e.DBSnapshotIdentifier};if(e.DBInstanceClass)r.DBInstanceClass=e.DBInstanceClass;if(e.Port)r.Port=e.Port;if(e.AvailabilityZone)r.AvailabilityZone=e.AvailabilityZone;if(e.DBSubnetGroupName)r.DBSubnetGroupName=e.DBSubnetGroupName;if(e.MultiAZ!==void 0)r.MultiAZ=e.MultiAZ;if(e.PubliclyAccessible!==void 0)r.PubliclyAccessible=e.PubliclyAccessible;if(e.AutoMinorVersionUpgrade!==void 0)r.AutoMinorVersionUpgrade=e.AutoMinorVersionUpgrade;if(e.StorageType)r.StorageType=e.StorageType;if(e.DeletionProtection!==void 0)r.DeletionProtection=e.DeletionProtection;if(e.VpcSecurityGroupIds)e.VpcSecurityGroupIds.forEach((s,o)=>{r[`VpcSecurityGroupIds.VpcSecurityGroupId.${o+1}`]=s});if(e.Tags)e.Tags.forEach((s,o)=>{r[`Tags.Tag.${o+1}.Key`]=s.Key,r[`Tags.Tag.${o+1}.Value`]=s.Value});let t=new URLSearchParams(a(r)).toString(),n=await this.client.request({service:"rds",region:this.region,method:"POST",path:"/",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t});return{DBInstance:(n.RestoreDBInstanceFromDBSnapshotResult||n).DBInstance}}async waitForDBInstanceAvailable(e,r=60,t=30000){for(let n=0;n<r;n++){let i=await this.describeDBInstance(e);if(i?.DBInstanceStatus==="available")return i;if(["deleted","failed","incompatible-restore","incompatible-parameters"].includes(i?.DBInstanceStatus||""))throw Error(`DB instance ${e} is in terminal state: ${i?.DBInstanceStatus}`);await new Promise((s)=>setTimeout(s,t))}throw Error(`Timeout waiting for DB instance ${e} to become available`)}async waitForDBInstanceDeleted(e,r=60,t=30000){for(let n=0;n<r;n++)try{let i=await this.describeDBInstance(e);if(i?.DBInstanceStatus==="deleting"){await new Promise((s)=>setTimeout(s,t));continue}throw Error(`DB instance ${e} is in state: ${i?.DBInstanceStatus}`)}catch(i){if(i.code==="DBInstanceNotFound"||i.code==="DBInstanceNotFoundFault")return;throw i}throw Error(`Timeout waiting for DB instance ${e} to be deleted`)}}
|
|
2
|
+
export{g as uf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{rl as w}from"./chunk-b10cbk8z.js";var L="\x00";function k(t,i){if(t==="*"||t==="**")return!0;let e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"\x01").replace(/\*/g,"[^/]*").replace(/\u0001/g,".*");return new RegExp(`^${e}$`).test(i)}function y(t,i){if(t.startsWith("*.")){let e=t.slice(1);return i.endsWith(e)&&i.length>e.length}return t===i}function d(t,i){if(t.enabled===!1)return!1;if(t.methods?.length&&!t.methods.some((e)=>e.toUpperCase()===i.method.toUpperCase()))return!1;if(t.path&&!k(t.path,i.path))return!1;if(t.host&&!y(t.host,i.host??""))return!1;return!0}function m(t,i){let e=t.key??{source:"ip"},o=e.fallbackToIp!==!1,r;if(e.source==="ip")r=i.ip;else if(e.source==="global")r="global";else if(e.source==="host")r=i.host??"";else if(e.source==="path")r=i.path;else if(e.source==="header")r=e.name?i.headers?.[e.name.toLowerCase()]:void 0;else if(e.source==="cookie")r=e.name?i.cookies?.[e.name]:void 0;if(!r&&e.source!=="global")r=o?i.ip:"__missing__";return`${t.id}\x00${r}`}class A{clock;maxTrackedKeys;buckets=new Map;windows=new Map;rules;constructor(t,i=()=>Date.now(),e=1e5){this.clock=i;this.maxTrackedKeys=e;this.rules=[...t].sort((o,r)=>(o.priority??0)-(r.priority??0))}check(t){let i=this.clock(),e=this.rules.filter((n)=>d(n,t)),o;for(let n of e){let s=this.test(n,t,i);if(s.allowed)continue;if(!o||p(s.action)>p(o.action))o=s}if(o)return o;let r={action:"allow",allowed:!0};for(let n of e){let s=this.consume(n,t,i);if(s.remaining!=null&&(r.remaining??1/0)>s.remaining)r=s}return r}test(t,i,e){let o=m(t,i);if((t.algorithm??"token_bucket")==="token_bucket"){let n=t.burst??t.limit,s=this.buckets.get(o),a=s?Math.min(n,s.tokens+this.refill(t,e-s.updatedAt)):n;if(a>=1)return{action:"allow",allowed:!0};return this.blocked(t,o,0,this.msPerToken(t)*(1-a),e)}let r=(this.windows.get(o)?.hits??[]).filter((n)=>n>e-t.windowMs);if(r.length<t.limit)return{action:"allow",allowed:!0};return this.blocked(t,o,0,r[0]+t.windowMs-e,e)}peek(t){let i=this.clock();for(let e of this.rules){if(!d(e,t))continue;let o=this.test(e,t,i);if(!o.allowed)return o}return{action:"allow",allowed:!0}}msPerToken(t){return t.windowMs/Math.max(1,t.limit)}refill(t,i){return Math.max(0,i)/this.msPerToken(t)}blocked(t,i,e,o,r){let n=t.action??"deny";return{action:n,allowed:n==="allow"||n==="log",ruleId:t.id,limit:t.limit,remaining:e,retryAfterMs:Math.max(0,Math.ceil(o)),resetAt:r+Math.max(0,o),key:i}}consume(t,i,e){let o=m(t,i);if((t.algorithm??"token_bucket")==="token_bucket"){let l=t.burst??t.limit,u=this.buckets.get(o)??{tokens:l,updatedAt:e},c=Math.min(l,u.tokens+this.refill(t,e-u.updatedAt));if(c<1)return this.buckets.set(o,{tokens:c,updatedAt:e}),this.blocked(t,o,0,this.msPerToken(t)*(1-c),e);return this.evictIfNeeded(this.buckets),this.buckets.set(o,{tokens:c-1,updatedAt:e}),{action:"allow",allowed:!0,ruleId:t.id,limit:l,remaining:Math.floor(c-1),resetAt:e+this.msPerToken(t)*(l-(c-1)),key:o}}let n=this.windows.get(o)??{hits:[]},s=e-t.windowMs,a=n.hits.filter((l)=>l>s);if(a.length>=t.limit)return this.windows.set(o,{hits:a}),this.blocked(t,o,0,a[0]+t.windowMs-e,e);return a.push(e),this.evictIfNeeded(this.windows),this.windows.set(o,{hits:a}),{action:"allow",allowed:!0,ruleId:t.id,limit:t.limit,remaining:t.limit-a.length,resetAt:a[0]+t.windowMs,key:o}}evictIfNeeded(t){if(t.size<this.maxTrackedKeys)return;let i=t.size-this.maxTrackedKeys+1,e=0;for(let o of t.keys())if(t.delete(o),++e>=i)break}sweep(){let t=this.clock(),i=0;for(let[e,o]of this.windows){let r=e.split("\x00")[0],n=this.rules.find((s)=>s.id===r);if(!n){this.windows.delete(e),i++;continue}if(o.hits.every((s)=>s<=t-n.windowMs))this.windows.delete(e),i++}for(let[e,o]of this.buckets){let r=e.split("\x00")[0],n=this.rules.find((s)=>s.id===r);if(!n||t-o.updatedAt>n.windowMs*2)this.buckets.delete(e),i++}return i}get trackedKeys(){return this.buckets.size+this.windows.size}}function p(t){return{allow:0,log:1,throttle:2,challenge:3,deny:4}[t]}function I(t){let i={};if(t.limit!=null)i["ratelimit-limit"]=String(t.limit);if(t.remaining!=null)i["ratelimit-remaining"]=String(t.remaining);if(t.resetAt!=null)i["ratelimit-reset"]=String(Math.max(0,Math.ceil((t.resetAt-Date.now())/1000)));if(!t.allowed&&t.retryAfterMs!=null)i["retry-after"]=String(Math.max(1,Math.ceil(t.retryAfterMs/1000)));return i}function C(){return[{id:"global-ip",limit:600,windowMs:60000,burst:100,key:{source:"ip"},action:"deny",priority:100},{id:"api-ip",limit:120,windowMs:60000,burst:30,path:"/api/**",key:{source:"ip"},action:"deny",priority:50},{id:"auth-ip",limit:10,windowMs:60000,algorithm:"sliding_window",path:"/auth/**",methods:["POST"],key:{source:"ip"},action:"challenge",priority:10}]}var h="protection.controls",b=24,x=4,M={ipRules:{allow:[],block:[]}};function f(t,i){if(!t?.enabled)return;return new Date(t.expiresAt).getTime()>i.getTime()?t:void 0}function g(t,i){let e=Number.isFinite(t)?Number(t):i;return Math.min(b,Math.max(0.25,e))}var R=500;class P{controlPlane;options;constructor(t,i={}){this.controlPlane=t;this.options=i}now(){return this.options.now?.()??new Date}read(){let t=this.controlPlane.getSetting(h);if(!t||typeof t!=="object"||Array.isArray(t))return{...M,ipRules:{allow:[],block:[]}};let i=t;return{attackMode:i.attackMode,mitigationPause:i.mitigationPause,ipRules:{allow:Array.isArray(i.ipRules?.allow)?i.ipRules.allow:[],block:Array.isArray(i.ipRules?.block)?i.ipRules.block:[]},updatedAt:i.updatedAt}}write(t){let i={...t,updatedAt:this.now().toISOString()};return this.controlPlane.setSetting(h,i),i}raw(){return this.read()}current(){let t=this.now(),i=this.read();return{attackMode:f(i.attackMode,t),mitigationPause:f(i.mitigationPause,t),ipRules:i.ipRules}}enableAttackMode(t){let i=this.now(),e={enabled:!0,startedAt:i.toISOString(),expiresAt:new Date(i.getTime()+g(t.hours,x)*3600000).toISOString(),reason:t.reason.trim()||"Attack mode enabled by an operator.",actorId:t.actorId};return this.write({...this.read(),attackMode:e}),e}disableAttackMode(){let t=this.read();if(!t.attackMode?.enabled)return!1;return this.write({...t,attackMode:{...t.attackMode,enabled:!1}}),!0}pauseMitigations(t){let i=t.reason.trim();if(!i)throw Error("Pausing mitigations requires a reason: you are liable for the traffic it admits.");let e=this.now(),o={enabled:!0,startedAt:e.toISOString(),expiresAt:new Date(e.getTime()+g(t.hours,b)*3600000).toISOString(),reason:i,actorId:t.actorId};return this.write({...this.read(),mitigationPause:o}),o}resumeMitigations(){let t=this.read();if(!t.mitigationPause?.enabled)return!1;return this.write({...t,mitigationPause:{...t.mitigationPause,enabled:!1}}),!0}addIpRule(t,i){let e=i.trim();if(!w(e))throw Error(`Not a valid IP or CIDR: ${i}`);let o=this.read(),r={...o.ipRules,[t]:[...new Set([...o.ipRules[t],e])]};if(r[t].length>R)throw Error(`At most ${R} ${t} rules are supported.`);let n=t==="allow"?"block":"allow";return r[n]=r[n].filter((s)=>s!==e),this.write({...o,ipRules:r}),r}removeIpRule(t,i){let e=this.read(),o={...e.ipRules,[t]:e.ipRules[t].filter((r)=>r!==i.trim())};return this.write({...e,ipRules:o}),o}}function D(t){if(t.mitigationPause)return{attackMode:!!t.attackMode,mitigationPaused:!0,summary:`Automatic mitigation is paused until ${t.mitigationPause.expiresAt}. All traffic is being served and billed.`,expiresAt:t.mitigationPause.expiresAt};if(t.attackMode)return{attackMode:!0,mitigationPaused:!1,summary:`Attack mode is on until ${t.attackMode.expiresAt}. Every visitor is being challenged.`,expiresAt:t.attackMode.expiresAt};return{attackMode:!1,mitigationPaused:!1,summary:"Protection is in its normal posture."}}function E(t,i){if(i.mitigationPause)return t.map((e)=>({...e,enabled:!1}));if(!i.attackMode)return[...t];return t.map((e)=>({...e,action:e.action==="deny"?"deny":"challenge",burst:Math.max(1,Math.min(e.burst??e.limit,5))}))}function T(t,i){let e=[...new Set([...t.allowlist??[],...i.ipRules.allow])],o=[...new Set([...t.blocklist??[],...i.ipRules.block])];if(i.mitigationPause)return{...t,allowlist:e,blocklist:o,monitorOnly:!0};if(!i.attackMode)return{...t,allowlist:e,blocklist:o};let r=t.thresholds??{};return{...t,allowlist:e,blocklist:o,thresholds:{...r,newConnectionsPerSecond:Math.max(1,Math.floor((r.newConnectionsPerSecond??50)/5)),concurrentPerSource:Math.max(1,Math.floor((r.concurrentPerSource??100)/5))}}}function v(t,i){let e=t?.infrastructure?.compute;if(!e||e.ddos===!1)return t;let o=typeof e.ddos==="object"&&e.ddos!==null?e.ddos:{};return{...t,infrastructure:{...t.infrastructure,compute:{...e,ddos:T(o,i)}}}}export{L as Xk,k as Yk,d as Zk,m as _k,A as $k,I as al,C as bl,h as cl,b as dl,x as el,P as fl,D as gl,E as hl,T as il,v as jl};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
+
import type { ReachableResource } from '@ts-cloud/core';
|
|
1
2
|
/**
|
|
2
|
-
* The minimum a driver has to produce for a server to be attributed
|
|
3
|
-
*
|
|
4
|
-
* Structural rather than a provider type so a Hetzner server satisfies it as-is
|
|
5
|
-
* and another driver can satisfy it without importing anything.
|
|
3
|
+
* The minimum a driver has to produce for a server to be attributed — the shape
|
|
4
|
+
* `CloudDriver.listReachableResources()` returns.
|
|
6
5
|
*/
|
|
7
|
-
export
|
|
8
|
-
name: string;
|
|
9
|
-
labels?: Record<string, string>;
|
|
10
|
-
}
|
|
6
|
+
export type ReachableServer = ReachableResource;
|
|
11
7
|
export interface CredentialReach {
|
|
12
8
|
/** Every server the credential enumerated. */
|
|
13
9
|
total: number;
|
package/dist/deploy/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ac as Z,Bc as
|
|
1
|
+
import{Ac as Z,Bc as aa,Cc as ba,Dc as ca,Ec as da,Fc as ea,Gc as fa,Hc as ga,Ic as ha,Jc as ia,Kc as ja,Lc as ka,Mc as la,Nc as ma,Oc as na,ic as y,jc as z,kc as A,lc as B,mc as C,nc as D,oc as E,od as oa,pc as O,pd as pa,qc as P,qd as qa,rc as Q,rd as ra,sc as R,tc as S,uc as T,vc as U,wc as V,xc as W,yc as X,zc as Y}from"../chunk-rcxq9aaa.js";import{Ad as N,sd as F,td as G,ud as H,vd as I,wd as J,xd as K,yd as L,zd as M}from"../chunk-2m09t0c0.js";import{Id as _}from"../chunk-1ypkh8g6.js";import"../chunk-h1rc94df.js";import"../chunk-nnqxmh7f.js";import"../chunk-q2njk4hx.js";import"../chunk-ky5c6t5y.js";import"../chunk-t0kh8haz.js";import"../chunk-qtp90j44.js";import"../chunk-qjk1v1gs.js";import{Dh as s,Eh as t,Fh as u,Gh as v,Hh as w,Ih as x,Uf as a,Vf as b,Wf as c,Xf as d,Yf as e,Zf as f,_f as g,gg as h,hg as i,ig as j,jg as k,kg as l,lg as m,mg as n,ng as o,og as p,pg as q,qg as r}from"../chunk-7xpxzbkr.js";import"../chunk-hbhxk5a0.js";import"../chunk-8e0az001.js";import"../chunk-p6vszgc2.js";import"../chunk-gk58959n.js";import"../chunk-s3rpd72x.js";import"../chunk-r5natbed.js";import"../chunk-b10cbk8z.js";import"../chunk-0hj552t7.js";import"../chunk-spx89gaw.js";export{d as IPV6_EXCLUDED_HOST_LABELS,s as MANAGEMENT_DASHBOARD_SITE,Z as buildAndPushContainerImage,_ as buildAndPushServerlessImage,ba as buildFunctionEnv,x as buildManagementDashboardArtifact,ha as buildServerTopology,ia as buildServerlessTopology,ja as buildTopology,na as collectEgressMetrics,a as collectServerDnsDomains,Y as createContainerImageDependencies,T as createExistingStaticFullStackDependencies,P as createStaticApiOriginDependencies,pa as dashboardActions,t as dashboardCredentialsFile,C as dashboardPageRoutes,M as deleteStaticSite,V as deployExistingStaticFullStack,ca as deployServerlessApp,r as deployShipsFiles,O as deploySite,Q as deployStaticApiOrigin,J as deployStaticSite,N as deployStaticSiteFull,G as deployStaticSiteWithExternalDns,H as deployStaticSiteWithExternalDnsFull,la as egressReportMetrics,y as ensureDashboardActor,w as ensureManagementDashboard,W as estimateExistingStaticFullStackMonthlyCost,S as estimateStaticApiOriginMonthlyCost,ma as fetchEgressReport,U as generateExistingStaticFullStackTemplate,F as generateExternalDnsStaticSiteTemplate,I as generateStaticSiteTemplate,n as hasComputeConfigured,k as hasProxyUpstream,X as hashContainerContext,e as hostAcceptsIpv6,aa as infraEnvFromOutputs,z as initializeDashboardControlPlane,L as invalidateCache,i as isPhpSite,c as normalizePublicIpv6,f as reconcileAddressRecords,da as redeployServerlessApp,b as removeStaleServerAddressRecords,qa as resolveDashboardAction,u as resolveDashboardAuth,ka as resolveDashboardData,D as resolveLegacyDashboardRoute,j as resolveProxyUpstreams,l as resolveSiteDeployTarget,m as resolveSiteKind,v as resolveUiSource,ea as rollbackServerlessApp,E as routesForDashboard,ga as runRemoteCommand,oa as sanitizeCloudConfig,fa as setMaintenance,p as shipsARelease,q as shipsToBucket,h as siteInstallBase,ra as startLocalDashboardServer,A as synchronizeDashboardUsers,B as trackDashboardOperation,K as uploadStaticFiles,o as validateDeploymentConfig,g as verifyAddressRecord,R as verifyStaticApiOrigin};
|
package/dist/dns/cloudflare.d.ts
CHANGED
|
@@ -104,6 +104,33 @@ export declare class CloudflareProvider implements DnsProvider {
|
|
|
104
104
|
* List all domains (zones) managed by this Cloudflare account
|
|
105
105
|
*/
|
|
106
106
|
listDomains(): Promise<string[]>;
|
|
107
|
+
/**
|
|
108
|
+
* Create a zone in this account, or return the one already there.
|
|
109
|
+
*
|
|
110
|
+
* Idempotent on purpose. A zone migration is re-run far more often than it
|
|
111
|
+
* succeeds first time — a too-narrow token, a half-imported record set, a
|
|
112
|
+
* nameserver flip that has not propagated — and every one of those reruns
|
|
113
|
+
* would otherwise die on Cloudflare's "zone already exists" (code 1061)
|
|
114
|
+
* before reaching the import that actually needed fixing.
|
|
115
|
+
*
|
|
116
|
+
* `accountId` is required by the API for anything but a single-account token,
|
|
117
|
+
* so it falls back to {@link CloudflareProviderOptions.accountId} and fails
|
|
118
|
+
* loudly rather than letting Cloudflare pick an account for you.
|
|
119
|
+
*
|
|
120
|
+
* The returned `nameServers` are the pair the registrar has to be pointed at.
|
|
121
|
+
* They are assigned at creation and never change for the life of the zone, so
|
|
122
|
+
* they can be read once here and used to drive the registrar update.
|
|
123
|
+
*/
|
|
124
|
+
createZone(domain: string, options?: {
|
|
125
|
+
accountId?: string;
|
|
126
|
+
jumpStart?: boolean;
|
|
127
|
+
}): Promise<{
|
|
128
|
+
id: string;
|
|
129
|
+
name: string;
|
|
130
|
+
status: string;
|
|
131
|
+
nameServers: string[];
|
|
132
|
+
created: boolean;
|
|
133
|
+
}>;
|
|
107
134
|
/**
|
|
108
135
|
* Get zone details (Cloudflare-specific)
|
|
109
136
|
*/
|
package/dist/dns/godaddy.d.ts
CHANGED
|
@@ -49,7 +49,24 @@ export declare class GoDaddyProvider implements DnsProvider {
|
|
|
49
49
|
expires?: string;
|
|
50
50
|
} | null>;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Read the nameservers the REGISTRY has this domain delegated to.
|
|
53
|
+
*
|
|
54
|
+
* Note this is the delegation, not the zone's own `NS` records. The two can
|
|
55
|
+
* disagree — that is exactly the state a half-finished migration leaves
|
|
56
|
+
* behind — and only the delegation decides who actually answers queries.
|
|
57
|
+
*/
|
|
58
|
+
getNameServers(domain: string): Promise<string[]>;
|
|
59
|
+
/**
|
|
60
|
+
* Delegate a domain to a different set of nameservers.
|
|
61
|
+
*
|
|
62
|
+
* This PATCHes the DOMAIN, which is the registrar operation that changes the
|
|
63
|
+
* delegation at the registry. The obvious-looking alternative —
|
|
64
|
+
* `PUT /v1/domains/{domain}/records/NS` — writes `NS` records into GoDaddy's
|
|
65
|
+
* own hosted zone instead. That call succeeds, returns 200, and changes
|
|
66
|
+
* nothing about who is authoritative: the registry still points at the old
|
|
67
|
+
* provider. For a migration whose whole purpose is the cutover, that is the
|
|
68
|
+
* worst possible failure, because every check short of an external `dig +trace`
|
|
69
|
+
* reports success.
|
|
53
70
|
*/
|
|
54
71
|
updateNameServers(domain: string, nameservers: string[]): Promise<boolean>;
|
|
55
72
|
/**
|
package/dist/dns/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { CloudflareProvider } from './cloudflare';
|
|
|
9
9
|
export type { DeclaredRecord, DeclaredRecordInput, DeclaredRecordOutcome, DeclaredRecordsReport, } from './declared-records';
|
|
10
10
|
export { policyTag, qualifyName, reconcileDeclaredRecords, resolveDeclaredRecords, } from './declared-records';
|
|
11
11
|
export { Route53Provider } from './route53-adapter';
|
|
12
|
+
export type { MigratedRecord, SkippedRecord, ZoneMigrationPlan, ZoneMigrationReport, ZoneParityReport, } from './zone-migration';
|
|
13
|
+
export { applyZoneMigration, exportRoute53Zone, planZoneMigration, verifyZoneParity, } from './zone-migration';
|
|
12
14
|
export { UnifiedDnsValidator, createPorkbunValidator, createGoDaddyValidator, createRoute53Validator, } from './validator';
|
|
13
15
|
import type { DnsProvider, DnsProviderConfig } from './types';
|
|
14
16
|
/**
|
package/dist/dns/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Af as e,Bf as f,Cf as g,Df as h,Ef as i,Ff as j,Gf as k,Hf as l,If as m,Jf as n,Kf as o,Lf as p,Mf as q,vf as a,wf as b,xf as c,zf as d}from"../chunk-
|
|
1
|
+
import{Af as e,Bf as f,Cf as g,Df as h,Ef as i,Ff as j,Gf as k,Hf as l,If as m,Jf as n,Kf as o,Lf as p,Mf as q,Nf as r,Of as s,Pf as t,Qf as u,vf as a,wf as b,xf as c,zf as d}from"../chunk-qtp90j44.js";import"../chunk-qjk1v1gs.js";import"../chunk-gk58959n.js";import"../chunk-spx89gaw.js";export{d as CloudflareProvider,t as DnsProviderFactory,c as GoDaddyProvider,a as PROXIABLE_RECORD_TYPES,b as PorkbunProvider,i as Route53Provider,n as UnifiedDnsValidator,l as applyZoneMigration,r as createDnsProvider,p as createGoDaddyValidator,o as createPorkbunValidator,q as createRoute53Validator,s as detectDnsProvider,u as dnsProviders,j as exportRoute53Zone,k as planZoneMigration,e as policyTag,f as qualifyName,h as reconcileDeclaredRecords,g as resolveDeclaredRecords,m as verifyZoneParity};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zone migration — move a whole zone onto another provider, record for record.
|
|
3
|
+
*
|
|
4
|
+
* This exists because the interesting part of a nameserver migration is not the
|
|
5
|
+
* nameserver change, it is everything that silently fails to come with it. A
|
|
6
|
+
* deploy derives the address records for the sites it owns; it knows nothing
|
|
7
|
+
* about mail, domain-verification tokens, certificate-validation CNAMEs or the
|
|
8
|
+
* service records a calendar client autodiscovers with. Those are exactly the
|
|
9
|
+
* records nobody notices are gone until someone reports that mail stopped, and
|
|
10
|
+
* by then the old zone may already have been deleted.
|
|
11
|
+
*
|
|
12
|
+
* So the flow here is deliberately: **export everything → translate → import →
|
|
13
|
+
* diff → only then flip the nameservers.** The diff is the point. A migration
|
|
14
|
+
* that reports "imported 91 records" without comparing against the source is
|
|
15
|
+
* indistinguishable from one that dropped seven of them.
|
|
16
|
+
*/
|
|
17
|
+
import type { DnsProvider, DnsRecord, DnsRecordType } from './types';
|
|
18
|
+
import type { ResourceRecordSet, Route53Client } from '../aws/route53';
|
|
19
|
+
/** A record as it will exist at the destination. */
|
|
20
|
+
export interface MigratedRecord extends DnsRecord {
|
|
21
|
+
name: string;
|
|
22
|
+
type: DnsRecordType;
|
|
23
|
+
content: string;
|
|
24
|
+
/**
|
|
25
|
+
* Set when this record is not a faithful copy but a translation — an ALIAS
|
|
26
|
+
* flattened to a CNAME, for instance. Carried through to the report so the
|
|
27
|
+
* operator sees which records changed shape rather than having to spot it.
|
|
28
|
+
*/
|
|
29
|
+
translatedFrom?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface SkippedRecord {
|
|
32
|
+
name: string;
|
|
33
|
+
type: string;
|
|
34
|
+
reason: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ZoneMigrationPlan {
|
|
37
|
+
zone: string;
|
|
38
|
+
records: MigratedRecord[];
|
|
39
|
+
skipped: SkippedRecord[];
|
|
40
|
+
warnings: string[];
|
|
41
|
+
}
|
|
42
|
+
export interface ZoneMigrationReport {
|
|
43
|
+
applied: MigratedRecord[];
|
|
44
|
+
failed: Array<{
|
|
45
|
+
record: MigratedRecord;
|
|
46
|
+
message: string;
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
export interface ZoneParityReport {
|
|
50
|
+
/** Planned records confirmed present at the destination. */
|
|
51
|
+
matched: MigratedRecord[];
|
|
52
|
+
/** Planned records absent, or present with different content. */
|
|
53
|
+
missing: Array<{
|
|
54
|
+
record: MigratedRecord;
|
|
55
|
+
found?: string;
|
|
56
|
+
}>;
|
|
57
|
+
ok: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Read every record set in a Route53 hosted zone.
|
|
61
|
+
*
|
|
62
|
+
* Paginates to exhaustion rather than taking the first page. Route53 returns
|
|
63
|
+
* 100 record sets by default and a zone that has quietly grown past that is
|
|
64
|
+
* precisely the zone whose tail records — added last, so most likely to be the
|
|
65
|
+
* recent mail or verification entries — would be dropped by a single call.
|
|
66
|
+
*/
|
|
67
|
+
export declare function exportRoute53Zone(client: Route53Client, hostedZoneId: string): Promise<ResourceRecordSet[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Translate a Route53 zone into records another provider can hold.
|
|
70
|
+
*
|
|
71
|
+
* Nothing is written here. The plan is the reviewable artifact — a migration
|
|
72
|
+
* that cannot be read before it runs is one that gets run twice.
|
|
73
|
+
*/
|
|
74
|
+
export declare function planZoneMigration(sets: ResourceRecordSet[], zone: string): ZoneMigrationPlan;
|
|
75
|
+
/**
|
|
76
|
+
* Write a plan to the destination provider.
|
|
77
|
+
*
|
|
78
|
+
* Upserts rather than creates, so a half-finished migration can simply be run
|
|
79
|
+
* again. Failures are collected instead of thrown: one rejected record should
|
|
80
|
+
* not strand the other ninety, and the parity check afterwards is what decides
|
|
81
|
+
* whether the migration is actually complete.
|
|
82
|
+
*/
|
|
83
|
+
export declare function applyZoneMigration(provider: DnsProvider, plan: ZoneMigrationPlan): Promise<ZoneMigrationReport>;
|
|
84
|
+
/**
|
|
85
|
+
* Compare what was planned against what the destination actually holds.
|
|
86
|
+
*
|
|
87
|
+
* This is the step that makes a migration safe to act on. Provider writes
|
|
88
|
+
* report success far more reliably than they take effect — a silently coerced
|
|
89
|
+
* value, a record rejected by a rule, a name written into the wrong zone — and
|
|
90
|
+
* the only way to know the new zone can replace the old one is to read it back.
|
|
91
|
+
*/
|
|
92
|
+
export declare function verifyZoneParity(provider: DnsProvider, plan: ZoneMigrationPlan): Promise<ZoneParityReport>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CloudDriver, ComputeStackOutputs, ComputeTarget, FindComputeTargetsOptions, ProvisionComputeOptions, RemoteDeployResult, RunRemoteDeployOptions, UploadReleaseOptions, UploadReleaseResult } from '@ts-cloud/core';
|
|
1
|
+
import type { CloudDriver, ComputeStackOutputs, ComputeTarget, FindComputeTargetsOptions, ProvisionComputeOptions, ReachableResource, RemoteDeployResult, RunRemoteDeployOptions, UploadReleaseOptions, UploadReleaseResult } from '@ts-cloud/core';
|
|
2
2
|
import { HetznerClient } from './client';
|
|
3
3
|
export declare function formatSshFailure(error: unknown): string;
|
|
4
4
|
export interface HetznerDriverOptions {
|
|
@@ -102,6 +102,13 @@ export declare class HetznerDriver implements CloudDriver {
|
|
|
102
102
|
* even when several unrelated managed boxes exist in the Hetzner project.
|
|
103
103
|
*/
|
|
104
104
|
private attachToComputeInfrastructure;
|
|
105
|
+
/**
|
|
106
|
+
* Every server this token can see. On Hetzner that is every server in the
|
|
107
|
+
* provider project, because a Cloud API token is project-scoped with Read or
|
|
108
|
+
* Read & Write and no per-resource scoping — so "can see" and "can delete"
|
|
109
|
+
* are the same set, and the count is the honest blast radius.
|
|
110
|
+
*/
|
|
111
|
+
listReachableResources(): Promise<ReachableResource[]>;
|
|
105
112
|
runRemoteDeploy(options: RunRemoteDeployOptions): Promise<RemoteDeployResult>;
|
|
106
113
|
/**
|
|
107
114
|
* Ensure the local SSH public key is registered in the Hetzner project and
|
package/dist/drivers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$g as
|
|
1
|
+
import{$g as J,Ag as j,Ah as ha,Bg as k,Bh as ia,Cg as l,Ch as ja,Dg as m,Eg as n,Fg as o,Hg as p,Ig as q,Jg as r,Kg as s,Kh as ka,Lg as t,Lh as la,Mg as u,Mh as ma,Ng as v,Nh as na,Og as w,Oh as oa,Pg as x,Ph as pa,Qg as y,Qh as qa,Rg as z,Rh as ra,Sg as A,Tg as B,Ug as C,Vg as D,Wg as E,Xg as F,Yg as G,Zg as H,_g as I,ah as K,bh as L,ch as M,dh as N,eh as O,fh as P,gh as Q,hh as R,ih as S,jh as T,kh as U,lh as V,mh as W,nh as X,oh as Y,ph as Z,qh as _,rg as a,rh as aa,sg as b,sh as ba,tg as c,th as ca,ug as d,vg as e,wg as f,wh as da,xg as g,xh as ea,yg as h,yh as fa,zg as i,zh as ga}from"../chunk-7xpxzbkr.js";import"../chunk-hbhxk5a0.js";import"../chunk-8e0az001.js";import"../chunk-p6vszgc2.js";import"../chunk-gk58959n.js";import"../chunk-r5natbed.js";import"../chunk-b10cbk8z.js";import"../chunk-0hj552t7.js";import"../chunk-spx89gaw.js";export{ba as AwsBoxProvisioner,o as AwsDriver,x as CloudDriverFactory,a as DEFAULT_RPX_CERTS_DIR,aa as HetznerBoxProvisioner,p as HetznerClient,t as HetznerDriver,u as LocalBoxDriver,pa as MANAGED_CACHE_POLICY_DISABLED,oa as MANAGED_CACHE_POLICY_OPTIMIZED,qa as MANAGED_ORIGIN_REQUEST_POLICY_ALL_VIEWER,i as RPX_DIR,j as RPX_LAUNCHER_PATH,k as RPX_SERVICE_NAME,Z as UBUNTU_2404_AMI_PARAM,U as acquireResizeLock,N as applyHetznerHostOptimization,ha as buildAwsArtifactFetch,_ as buildBoxUserData,ra as buildCloudFrontOriginConfig,M as buildHetznerHostOptimizationScript,ja as buildHostCleanupScript,ia as buildLocalArtifactFetch,f as buildRpxConfig,m as buildRpxFragmentRefreshScript,g as buildRpxLbConfig,l as buildRpxProvisionScript,ea as buildSiteDeployScript,C as buildSshArgs,fa as buildStaticSiteDeployScript,y as cloudDrivers,O as collectHetznerHostOptimizationReport,I as collectHetznerResizeManifest,ca as createBoxProvisioner,w as createCloudDriver,la as deployAllComputeSites,ka as deploySiteRelease,e as deriveRouteId,W as ensureFirewall,X as ensureServer,V as ensureSshKey,B as executeHetznerServerResize,c as gatewayHostnames,n as generateUbuntuAppCloudInit,b as hasAutoWwwVariant,v as isBoxMode,A as isHetznerCapacityError,d as normalizeRoutePath,r as normalizeSshPublicKey,z as planHetznerServerResize,J as prepareHetznerResize,S as readResizeCheckpoint,ga as releaseTarballTmpPath,ma as reloadRpxGateway,h as renderRpxLauncher,na as renewRpxCertificates,Q as resizeCheckpointPath,R as resizeLockPath,da as resolveExecStart,q as resolveHetznerApiToken,L as resolveHetznerHostOptimizationPlan,F as scpUpload,Y as serverPublicIpv4,D as sshExec,E as sshExecOrThrow,P as verifyHetznerHostOptimization,K as verifyHetznerResize,H as waitForCloudInit,G as waitForSsh,s as wrapCloudInitUserData,T as writeResizeCheckpoint};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keep self-updating binaries current on a box.
|
|
3
|
+
*
|
|
4
|
+
* A tool that ships as a GitHub release and knows how to replace itself
|
|
5
|
+
* (`<binary> upgrade`) still needs something to *call* it on a schedule. Every
|
|
6
|
+
* project was writing that something by hand — a systemd service, a timer, an
|
|
7
|
+
* env file, a daemon-reload — into its own `userData`. That is boilerplate the
|
|
8
|
+
* framework should own: it is identical everywhere except for the binary path
|
|
9
|
+
* and the unit to restart, and both of those are already config.
|
|
10
|
+
*
|
|
11
|
+
* So `compute.appUpdates` takes the two facts that differ and renders the rest:
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* compute: {
|
|
15
|
+
* appUpdates: [{ service: 'mail', binary: '/opt/mail/mail-server' }],
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Safety is delegated, deliberately. This module schedules; it does not swap
|
|
20
|
+
* binaries. The tool's own `upgrade` command is responsible for skipping when
|
|
21
|
+
* it is already current (so a daily tick does not restart a live service for
|
|
22
|
+
* nothing), for refusing to move backwards, and for rolling back if the new
|
|
23
|
+
* binary will not start. A tool without those properties should not be listed
|
|
24
|
+
* here.
|
|
25
|
+
*/
|
|
26
|
+
import type { ComputeAppUpdateTarget } from '@ts-cloud/core';
|
|
27
|
+
/** Where the per-target pause switch lives. */
|
|
28
|
+
export declare function appUpdateEnvPath(service: string): string;
|
|
29
|
+
/** Unit basename for a target's updater. */
|
|
30
|
+
export declare function appUpdateUnitBase(service: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Render the provisioning lines for every configured target. Returns `[]` when
|
|
33
|
+
* nothing is configured, matching every other builder in this directory, so the
|
|
34
|
+
* caller can splat it unconditionally.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildAppUpdatesScript(targets?: ComputeAppUpdateTarget[]): string[];
|
|
@@ -19,11 +19,23 @@ export interface ComputeProvisionScripts {
|
|
|
19
19
|
phpBox: boolean;
|
|
20
20
|
/** nginx + php-fpm + Composer install commands (undefined for non-PHP boxes). */
|
|
21
21
|
phpProvision?: string[];
|
|
22
|
-
/** services + db + firewall + updates + monitoring + ssh + notifier + backups. */
|
|
22
|
+
/** services + db + mail + firewall + updates + monitoring + ssh + notifier + backups. */
|
|
23
23
|
servicesProvision?: string[];
|
|
24
24
|
}
|
|
25
|
+
/** Which environment the box is being provisioned for. See {@link buildComputeProvisionScripts}. */
|
|
26
|
+
export interface ComputeProvisionOptions {
|
|
27
|
+
/**
|
|
28
|
+
* The environment name, e.g. `'production'`.
|
|
29
|
+
*
|
|
30
|
+
* Only mail reads it today, and it reads it for a reason worth stating: an
|
|
31
|
+
* omitted environment resolves to a mail **catcher**, never a server. The
|
|
32
|
+
* caller that forgets to pass it gets a box that traps its own mail rather
|
|
33
|
+
* than one that offers SMTP to the internet.
|
|
34
|
+
*/
|
|
35
|
+
environment?: string;
|
|
36
|
+
}
|
|
25
37
|
/**
|
|
26
38
|
* Build the machine provisioning scripts from a CloudConfig. Returns the
|
|
27
39
|
* pieces the Ubuntu bootstrap (and the image bake) splice in.
|
|
28
40
|
*/
|
|
29
|
-
export declare function buildComputeProvisionScripts(config: CloudConfig): ComputeProvisionScripts;
|
|
41
|
+
export declare function buildComputeProvisionScripts(config: CloudConfig, options?: ComputeProvisionOptions): ComputeProvisionScripts;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* are on PATH via `pantry env`. Admin commands (db setup, dumps, restores)
|
|
11
11
|
* connect over the engine's local unix socket — see {@link pgAdminCommand}.
|
|
12
12
|
*/
|
|
13
|
-
import type { ComputeServicesConfig, DatabaseConfig } from '@ts-cloud/core';
|
|
13
|
+
import type { ComputeServicesConfig, DatabaseConfig, ResolvedMailService } from '@ts-cloud/core';
|
|
14
14
|
/**
|
|
15
15
|
* True when the database is co-located with the box (the managed-services
|
|
16
16
|
* engine): no host configured, or an explicit loopback host. Anything else is
|
|
@@ -42,8 +42,9 @@ export declare function pgAdminCommand(database: DatabaseConfig | undefined, too
|
|
|
42
42
|
* `options.bindPrivate` is accepted for fleet compatibility; pantry's services
|
|
43
43
|
* already bind all interfaces behind the firewall.
|
|
44
44
|
*/
|
|
45
|
-
export declare function buildServicesProvisionScript(services?: ComputeServicesConfig,
|
|
45
|
+
export declare function buildServicesProvisionScript(services?: ComputeServicesConfig, options?: {
|
|
46
46
|
bindPrivate?: boolean;
|
|
47
|
+
mail?: ResolvedMailService;
|
|
47
48
|
}): string[];
|
|
48
49
|
/**
|
|
49
50
|
* Build the commands that create the application database + user on the on-box
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mail server provisioning — `mail`, the Zig SMTP/IMAP server, installed from
|
|
3
|
+
* pantry and run as a systemd unit, with its own webmail UI.
|
|
4
|
+
*
|
|
5
|
+
* ## One binary, two jobs
|
|
6
|
+
*
|
|
7
|
+
* Development mail traps and production mail servers are conventionally two
|
|
8
|
+
* different programs, and that difference is where mail breaks: a message that
|
|
9
|
+
* renders in mailpit has been through a parser nothing in production will ever
|
|
10
|
+
* run, and a `From` that mailpit accepts is one no MTA would. The bugs that
|
|
11
|
+
* costs are the ones nobody can reproduce locally.
|
|
12
|
+
*
|
|
13
|
+
* So a `'catcher'` here is not a different program. It is the same binary with
|
|
14
|
+
* delivery switched off, authentication switched off, bound to loopback, on
|
|
15
|
+
* mailpit's ports — one parser, one Maildir, one UI, all the way from a
|
|
16
|
+
* developer's laptop to production. See {@link ResolvedMailService}.
|
|
17
|
+
*
|
|
18
|
+
* ## What is deliberately not automated
|
|
19
|
+
*
|
|
20
|
+
* **DNS.** The MX, SPF and DMARC records, and the DKIM record for the key
|
|
21
|
+
* generated below, are printed rather than published. They belong to a zone
|
|
22
|
+
* this provisioner may not own, and a wrong MX does not fail — it silently
|
|
23
|
+
* routes somebody's mail somewhere else, which is discovered days later by the
|
|
24
|
+
* person who did not get it. {@link mailDnsRecords} returns them so the CLI
|
|
25
|
+
* and the dashboard can show the same set.
|
|
26
|
+
*
|
|
27
|
+
* **The DKIM private key is generated once and never rewritten.** Regenerating
|
|
28
|
+
* it on every provision would invalidate every signature already in flight,
|
|
29
|
+
* so the key is created only when the file is absent.
|
|
30
|
+
*/
|
|
31
|
+
import type { ResolvedMailService } from '@ts-cloud/core';
|
|
32
|
+
/** Where the generated config, environment file and DKIM keys live. */
|
|
33
|
+
export declare const MAIL_CONFIG_DIR = "/etc/mail";
|
|
34
|
+
/** The unprivileged account the mail server runs as. */
|
|
35
|
+
export declare const MAIL_USER = "mail-server";
|
|
36
|
+
/** systemd unit name, so callers can restart it without re-deriving the string. */
|
|
37
|
+
export declare const MAIL_UNIT = "mail";
|
|
38
|
+
/** The package spec to install, honouring a pinned version. */
|
|
39
|
+
export declare function mailPackages(mail: ResolvedMailService): string[];
|
|
40
|
+
/** Absolute path of a domain's DKIM private key. */
|
|
41
|
+
export declare function dkimKeyPath(mail: ResolvedMailService, domain: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* The mail server's `config.toml`.
|
|
44
|
+
*
|
|
45
|
+
* Only the keys the server actually reads (`packages/zig/src/core/config.zig`)
|
|
46
|
+
* are written. Everything the TOML has no section for — webmail, IMAP, DKIM
|
|
47
|
+
* keys, delivery method — goes in the environment file instead; see
|
|
48
|
+
* {@link buildMailEnvFile}. Splitting them is not a choice, it is where the
|
|
49
|
+
* server looks.
|
|
50
|
+
*/
|
|
51
|
+
export declare function buildMailConfigToml(mail: ResolvedMailService): string;
|
|
52
|
+
/**
|
|
53
|
+
* The systemd `EnvironmentFile`.
|
|
54
|
+
*
|
|
55
|
+
* Everything the server configures through the environment rather than the
|
|
56
|
+
* TOML: the webmail listener, IMAP and submission ports, DKIM keys, the
|
|
57
|
+
* delivery method, and the database path.
|
|
58
|
+
*/
|
|
59
|
+
export declare function buildMailEnvFile(mail: ResolvedMailService): string;
|
|
60
|
+
/** The systemd unit that runs the server. */
|
|
61
|
+
export declare function buildMailUnit(mail: ResolvedMailService): string;
|
|
62
|
+
/** A DNS record an operator has to publish for mail to work. */
|
|
63
|
+
export interface MailDnsRecord {
|
|
64
|
+
type: 'MX' | 'TXT' | 'CNAME';
|
|
65
|
+
/** Record name, e.g. `example.com` or `default._domainkey.example.com`. */
|
|
66
|
+
name: string;
|
|
67
|
+
/**
|
|
68
|
+
* Record value. For DKIM this is a placeholder — the real one is derived
|
|
69
|
+
* from the public key on the box, which does not exist until provisioning
|
|
70
|
+
* has run. The shell prints the actual value; see {@link buildDkimScript}.
|
|
71
|
+
*/
|
|
72
|
+
value: string;
|
|
73
|
+
/** MX preference, when the type is MX. */
|
|
74
|
+
priority?: number;
|
|
75
|
+
/** Why this record exists, shown beside it wherever it is presented. */
|
|
76
|
+
note: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The records an operator has to publish. Returned rather than created: see
|
|
80
|
+
* the module comment for why DNS is not automated here.
|
|
81
|
+
*/
|
|
82
|
+
export declare function mailDnsRecords(mail: ResolvedMailService): MailDnsRecord[];
|
|
83
|
+
/**
|
|
84
|
+
* Generate a DKIM key per domain, once, and print the record to publish.
|
|
85
|
+
*
|
|
86
|
+
* Guarded on the file's absence rather than on a flag: a re-provision that
|
|
87
|
+
* regenerated the key would invalidate every signature already in flight, and
|
|
88
|
+
* the mail affected is mail that was already accepted by somebody's server and
|
|
89
|
+
* is now failing verification at their end.
|
|
90
|
+
*/
|
|
91
|
+
export declare function buildDkimScript(mail: ResolvedMailService): string[];
|
|
92
|
+
/**
|
|
93
|
+
* Create the declared mailboxes.
|
|
94
|
+
*
|
|
95
|
+
* Both `create` and `change-password` run, unconditionally, and that is not
|
|
96
|
+
* belt-and-braces. `mail user:local create` on an existing account prints
|
|
97
|
+
* "already exists" and **exits 0**, so a `create || change-password` chain
|
|
98
|
+
* would never reach the second command — an operator who rotated a password in
|
|
99
|
+
* the config and redeployed would get a box that kept the old one and reported
|
|
100
|
+
* success. Running both means the declaration is the truth on every deploy.
|
|
101
|
+
*
|
|
102
|
+
* Each is tolerated failing so one bad account cannot abort a provision that
|
|
103
|
+
* has already installed and started the server, and each runs as the service
|
|
104
|
+
* account with the server's own `SMTP_DB_PATH` — as root it would create a
|
|
105
|
+
* second database beside the one the server reads, and the accounts would
|
|
106
|
+
* exist in a file nothing opens.
|
|
107
|
+
*/
|
|
108
|
+
export declare function buildMailAccountScript(mail: ResolvedMailService): string[];
|
|
109
|
+
/**
|
|
110
|
+
* The whole provisioning sequence for the mail service.
|
|
111
|
+
*
|
|
112
|
+
* Idempotent throughout: every step is guarded, so this runs on a cold boot,
|
|
113
|
+
* on a golden-image bake, and on every redeploy with the same result. Returns
|
|
114
|
+
* `[]` when mail is not declared.
|
|
115
|
+
*/
|
|
116
|
+
export declare function buildMailProvisionScript(mail: ResolvedMailService): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check that a box actually runs the on-box services a project declares.
|
|
3
|
+
*
|
|
4
|
+
* This exists for attach mode (`cloud.attachTo`). A project that attaches rides
|
|
5
|
+
* a box its OWNER provisioned, and attach mode deliberately provisions nothing:
|
|
6
|
+
* installing engines on someone else's server is not a tenant's business. But
|
|
7
|
+
* the tenant's config still carries `managedServices`, and ts-cloud used to act
|
|
8
|
+
* on it regardless — creating a role and database against an engine that was
|
|
9
|
+
* never there. The result was a deploy that shipped every release and then
|
|
10
|
+
* failed at the database step, with no statement anywhere that the two settings
|
|
11
|
+
* are structurally incompatible.
|
|
12
|
+
*
|
|
13
|
+
* A declared service is considered present when its binary is on PATH (pantry
|
|
14
|
+
* puts the engines there) OR something is listening on its port. Either alone
|
|
15
|
+
* is enough on purpose: a stopped service and an engine installed outside
|
|
16
|
+
* pantry are both "the owner has this", and a preflight that fails on those
|
|
17
|
+
* would block deploys it has no business blocking. The case worth catching is
|
|
18
|
+
* the unambiguous one — no binary, no listener, no engine.
|
|
19
|
+
*/
|
|
20
|
+
import type { ComputeServicesConfig } from '@ts-cloud/core';
|
|
21
|
+
/**
|
|
22
|
+
* The service names a config declares, in a stable order. Unknown keys are
|
|
23
|
+
* skipped rather than guessed at: a service this module cannot recognize is one
|
|
24
|
+
* it cannot honestly report as missing.
|
|
25
|
+
*/
|
|
26
|
+
export declare function declaredManagedServices(services: ComputeServicesConfig | undefined): string[];
|
|
27
|
+
/**
|
|
28
|
+
* Shell that reports which of `names` the box provides, one `ts-cloud-service:`
|
|
29
|
+
* line each. Always exits 0 — a missing service is a finding to report, not a
|
|
30
|
+
* remote command failure to guess at.
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildManagedServicesProbeScript(names: readonly string[]): string[];
|
|
33
|
+
/**
|
|
34
|
+
* The declared services the box reported as missing.
|
|
35
|
+
*
|
|
36
|
+
* A service the probe said nothing about is NOT reported missing: silence means
|
|
37
|
+
* the probe did not run (an older box, a truncated capture), and inventing a
|
|
38
|
+
* failure from missing evidence would block deploys that are perfectly fine.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseMissingManagedServices(output: string | undefined, declared: readonly string[]): string[];
|
|
41
|
+
/**
|
|
42
|
+
* The message an operator gets when the host does not provide what the tenant
|
|
43
|
+
* declared. Names the setting, the owner, the host, and the two ways out —
|
|
44
|
+
* because the one thing that is NOT an option is waiting for ts-cloud to
|
|
45
|
+
* install it.
|
|
46
|
+
*/
|
|
47
|
+
export declare function formatMissingManagedServicesError(missing: readonly string[], ownerSlug: string, host: string | undefined): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -32,6 +32,7 @@ export declare const PANTRY_PACKAGES: {
|
|
|
32
32
|
readonly redis: 'redis.io';
|
|
33
33
|
readonly memcached: 'memcached.org';
|
|
34
34
|
readonly meilisearch: 'meilisearch.com';
|
|
35
|
+
readonly mail: 'github.com/mail-os/mail';
|
|
35
36
|
readonly git: 'git-scm.com';
|
|
36
37
|
readonly certbot: 'certbot.eff.org';
|
|
37
38
|
readonly bun: 'bun.sh';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turn per-instance remote-execution results into ONE operator-facing error.
|
|
3
|
+
*
|
|
4
|
+
* Both drivers used to collapse a failed remote run to a fixed sentence —
|
|
5
|
+
* "One or more SSH deploy commands failed" — while the thing that explains the
|
|
6
|
+
* failure (the remote command's stderr) sat right there in `perInstance`. The
|
|
7
|
+
* operator was left with a deploy that had failed for no stated reason, and no
|
|
8
|
+
* flag, not even `--verbose`, would print it: nothing had kept it.
|
|
9
|
+
*
|
|
10
|
+
* The remote output is already redacted where it is captured (the deploy script
|
|
11
|
+
* embeds a here-document with the full runtime environment; see
|
|
12
|
+
* `formatSshFailure`), so this only has to decide what is worth showing.
|
|
13
|
+
*/
|
|
14
|
+
import type { RemoteDeployInstanceResult } from '@ts-cloud/core';
|
|
15
|
+
/**
|
|
16
|
+
* Build the `error` for a {@link import('@ts-cloud/core').RemoteDeployResult}
|
|
17
|
+
* whose run did not fully succeed. `summary` is the one-line what-failed (e.g.
|
|
18
|
+
* "One or more SSH deploy commands failed"); the detail of each failing
|
|
19
|
+
* instance is appended beneath it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function summarizeRemoteFailures(perInstance: readonly RemoteDeployInstanceResult[], summary: string): string;
|