@stacksjs/ts-cloud 0.16.21 → 0.16.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/aws/index.js +1 -1
- package/dist/aws/xml-result.d.ts +20 -0
- package/dist/{chunk-g6g33pt9.js → bin/chunk-09d5qe73.js} +7 -7
- package/dist/bin/chunk-0cefbrxg.js +1 -0
- package/dist/bin/{chunk-ys5n5c84.js → chunk-12q8xrct.js} +5 -5
- package/dist/bin/chunk-1srmd473.js +1 -0
- package/dist/bin/{chunk-mxvekmdx.js → chunk-24njmb7d.js} +114 -114
- package/dist/bin/chunk-27ka240w.js +1 -0
- package/dist/bin/{chunk-ngyqqy6d.js → chunk-2gd8kqzq.js} +5 -5
- package/dist/bin/{chunk-djjj62c0.js → chunk-330kytpm.js} +2 -2
- package/dist/bin/{chunk-h1rb8qvt.js → chunk-3425j97b.js} +2 -2
- package/dist/bin/chunk-3bq69jqk.js +1 -0
- package/dist/bin/chunk-4pysr1ky.js +1 -0
- package/dist/bin/chunk-56zfvf7e.js +1 -0
- package/dist/bin/chunk-59nav625.js +1 -0
- package/dist/bin/{chunk-6kx50dyc.js → chunk-5bsknbr7.js} +1 -1
- package/dist/bin/{chunk-t10e32an.js → chunk-636jsmnz.js} +6 -6
- package/dist/bin/chunk-7kj8f72p.js +2 -0
- package/dist/bin/{chunk-e55fdn0r.js → chunk-7xr71hnt.js} +3 -3
- package/dist/bin/chunk-87f5d9qj.js +2 -0
- package/dist/bin/{chunk-tq172j2x.js → chunk-8agf66wn.js} +3 -3
- package/dist/bin/chunk-8fjzcr2w.js +1 -0
- package/dist/bin/{chunk-apnhhfkj.js → chunk-8wnkx3jf.js} +2 -2
- package/dist/bin/{chunk-z1dtdw3j.js → chunk-95v6ry1x.js} +5 -5
- package/dist/bin/chunk-9fq0bezb.js +1 -0
- package/dist/bin/chunk-9wpy7r9f.js +1 -0
- package/dist/bin/{chunk-5a7sxtwn.js → chunk-a0me5fed.js} +2 -2
- package/dist/bin/{chunk-148x1zq8.js → chunk-and7khsv.js} +2 -2
- package/dist/bin/{chunk-6wqjk007.js → chunk-ardzx4dw.js} +130 -130
- package/dist/bin/{chunk-0trtkv9g.js → chunk-c04dygzg.js} +6 -6
- package/dist/bin/chunk-eetz9jgy.js +1 -0
- package/dist/bin/chunk-eg6156wp.js +1 -0
- package/dist/bin/chunk-ezpz96kp.js +1 -0
- package/dist/bin/chunk-f2qpsrrj.js +1 -0
- package/dist/bin/chunk-f3sbq7pw.js +2 -0
- package/dist/bin/chunk-gmabk4qn.js +1 -0
- package/dist/bin/{chunk-9vmtm7nq.js → chunk-hmnaen1z.js} +2 -2
- package/dist/bin/{chunk-x63yz8xg.js → chunk-jp23ed1q.js} +1 -1
- package/dist/bin/{chunk-0f1qpmd6.js → chunk-k6apknm8.js} +5 -5
- package/dist/bin/{chunk-2mv692y4.js → chunk-k97ms0bs.js} +5 -5
- package/dist/bin/chunk-kr51h4gk.js +1 -0
- package/dist/bin/{chunk-290bzm2m.js → chunk-m51vpvr6.js} +3 -3
- package/dist/bin/{chunk-mx9ppkmn.js → chunk-mbqwrs7a.js} +4 -4
- package/dist/bin/{chunk-rbtt23vx.js → chunk-mz2jbtcs.js} +3 -3
- package/dist/bin/{chunk-dyh0vndw.js → chunk-n7hmjzgd.js} +4 -4
- package/dist/bin/{chunk-dmdg23a5.js → chunk-n8dsby4k.js} +2 -2
- package/dist/bin/chunk-nx8gpr90.js +34 -0
- package/dist/bin/chunk-q62ggp3g.js +1 -0
- package/dist/bin/chunk-q957s44c.js +1 -0
- package/dist/bin/{chunk-k7wh1wr5.js → chunk-qqqx70g6.js} +2 -2
- package/dist/bin/{chunk-gfr2215x.js → chunk-rm59bcnw.js} +60 -60
- package/dist/bin/chunk-rm6qnyce.js +2 -0
- package/dist/bin/chunk-rxehseyz.js +1 -0
- package/dist/bin/chunk-tfz7djw9.js +1 -0
- package/dist/bin/chunk-tr8901hb.js +1 -0
- package/dist/bin/{chunk-3n733cgx.js → chunk-v5bjbyve.js} +2 -2
- package/dist/bin/{chunk-90102shh.js → chunk-v980gs11.js} +2 -2
- package/dist/bin/chunk-vqb80dyg.js +1 -0
- package/dist/bin/{chunk-1j8b1d58.js → chunk-vskhr9qy.js} +2 -2
- package/dist/bin/{chunk-e24bscb0.js → chunk-wqydambz.js} +17 -17
- package/dist/bin/chunk-wysyyysg.js +1 -0
- package/dist/bin/chunk-xfs7rscr.js +1 -0
- package/dist/bin/cli.js +356 -356
- package/dist/bin/dashboard-server.js +1 -1
- package/dist/chunk-2ap78e1s.js +5 -0
- package/dist/{chunk-k53agv2m.js → chunk-2dextjqf.js} +2 -2
- package/dist/chunk-2fa9cdyf.js +1 -0
- package/dist/{chunk-z3wynefj.js → chunk-3jkc3s8c.js} +19 -19
- package/dist/chunk-3zzm5f28.js +92 -0
- package/dist/{chunk-e8e1h2h9.js → chunk-5dz6bzdj.js} +2 -2
- package/dist/chunk-6d5e10md.js +1 -0
- package/dist/chunk-9gypn8w9.js +1 -0
- package/dist/{chunk-hyeeqga9.js → chunk-9p89msvs.js} +6 -6
- package/dist/{chunk-31tvc877.js → chunk-9s24pbbc.js} +18 -18
- package/dist/chunk-badb5mf3.js +34 -0
- package/dist/{chunk-w9jhyy09.js → chunk-cfrv8110.js} +4 -4
- package/dist/{bin/chunk-8jbkphmg.js → chunk-dv1jkay7.js} +6 -6
- package/dist/{chunk-e52me1c6.js → chunk-ezgpamw6.js} +1 -1
- package/dist/chunk-j6a577hr.js +1 -0
- package/dist/chunk-jt49qs0f.js +2 -0
- package/dist/{chunk-aw1tp3p3.js → chunk-khatwx29.js} +99 -99
- package/dist/{chunk-v2p7c7s4.js → chunk-kpyhx96m.js} +133 -133
- package/dist/{chunk-3rahpgb9.js → chunk-kw852q5m.js} +164 -164
- package/dist/{chunk-3m9ghthh.js → chunk-mgg0psgc.js} +2 -2
- package/dist/{chunk-9wmer0zx.js → chunk-ms4dnha2.js} +2 -2
- package/dist/{chunk-qcaqc5b8.js → chunk-np8vgbv0.js} +3 -3
- package/dist/chunk-p0b08g9f.js +114 -0
- package/dist/{chunk-srrscggm.js → chunk-pcns0kz4.js} +5 -5
- package/dist/{chunk-kczzc599.js → chunk-pffebjr8.js} +31 -31
- package/dist/{chunk-vs0qrm09.js → chunk-pwywwdq2.js} +1 -1
- package/dist/{chunk-5far81q7.js → chunk-w4s3rswa.js} +2 -2
- package/dist/chunk-whdbz3h8.js +1 -0
- package/dist/{chunk-bxrzsth8.js → chunk-x60w04y3.js} +2 -2
- package/dist/{chunk-zx8ecz8b.js → chunk-y6k0vwfn.js} +4 -4
- package/dist/deploy/index.js +1 -1
- package/dist/dns/index.js +1 -1
- package/dist/drivers/index.js +1 -1
- package/dist/index.js +85 -85
- package/dist/operations/index.js +1 -1
- package/dist/protection/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 +1 -1
- package/dist/ui/data/backups.html +5 -5
- package/dist/ui/data/services.html +5 -5
- package/dist/ui/data/volumes.html +6 -6
- package/dist/ui/index.html +6 -6
- package/dist/ui/infrastructure/topology.html +6 -6
- package/dist/ui/integrations.html +1 -1
- package/dist/ui/operations/alerts.html +6 -6
- package/dist/ui/operations/configuration.html +6 -6
- package/dist/ui/operations/jobs.html +5 -5
- package/dist/ui/operations/maintenance.html +6 -6
- package/dist/ui/operations/observability.html +6 -6
- 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 +6 -6
- package/dist/ui/operations/workloads.html +6 -6
- package/dist/ui/security.html +2 -2
- package/dist/ui/server/actions.html +6 -6
- package/dist/ui/server/activity.html +2 -2
- package/dist/ui/server/capacity.html +5 -5
- package/dist/ui/server/database.html +6 -6
- package/dist/ui/server/deployments.html +5 -5
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +6 -6
- package/dist/ui/server/fleet.html +6 -6
- package/dist/ui/server/logs.html +6 -6
- package/dist/ui/server/metrics.html +5 -5
- package/dist/ui/server/security.html +1 -1
- package/dist/ui/server/services.html +1 -1
- package/dist/ui/server/sites.html +5 -5
- package/dist/ui/server/ssh-keys.html +5 -5
- package/dist/ui/server/team.html +6 -6
- package/dist/ui/server/terminal.html +2 -2
- package/dist/ui/serverless/alarms.html +6 -6
- package/dist/ui/serverless/assets.html +2 -2
- package/dist/ui/serverless/cost.html +2 -2
- package/dist/ui/serverless/data.html +5 -5
- package/dist/ui/serverless/deployments.html +1 -1
- package/dist/ui/serverless/firewall.html +1 -1
- package/dist/ui/serverless/functions.html +5 -5
- package/dist/ui/serverless/logs.html +6 -6
- package/dist/ui/serverless/metrics.html +1 -1
- package/dist/ui/serverless/queues.html +6 -6
- package/dist/ui/serverless/secrets.html +6 -6
- package/dist/ui/serverless/traces.html +5 -5
- package/dist/ui/serverless.html +6 -6
- package/package.json +3 -3
- package/dist/bin/chunk-0h6cggyt.js +0 -1
- package/dist/bin/chunk-2g2zrtjs.js +0 -2
- package/dist/bin/chunk-35rkh66r.js +0 -1
- package/dist/bin/chunk-4cs098d1.js +0 -1
- package/dist/bin/chunk-52fhq35h.js +0 -1
- package/dist/bin/chunk-6se7ygxa.js +0 -1
- package/dist/bin/chunk-72g1hr4z.js +0 -1
- package/dist/bin/chunk-840arz58.js +0 -34
- package/dist/bin/chunk-c7vxdwth.js +0 -1
- package/dist/bin/chunk-e0c3agf2.js +0 -1
- package/dist/bin/chunk-egn33pr9.js +0 -2
- package/dist/bin/chunk-gf7yavs5.js +0 -1
- package/dist/bin/chunk-gp5w7e4c.js +0 -1
- package/dist/bin/chunk-gt7g41js.js +0 -1
- package/dist/bin/chunk-hagakkgm.js +0 -1
- package/dist/bin/chunk-hr3vbg6y.js +0 -1
- package/dist/bin/chunk-hyb5v8wr.js +0 -1
- package/dist/bin/chunk-nqb1faqj.js +0 -1
- package/dist/bin/chunk-p831sptd.js +0 -1
- package/dist/bin/chunk-qxx1a51w.js +0 -1
- package/dist/bin/chunk-sh248v2y.js +0 -1
- package/dist/bin/chunk-swfmx4f8.js +0 -1
- package/dist/bin/chunk-vjkyj3xy.js +0 -2
- package/dist/bin/chunk-w78chy9x.js +0 -1
- package/dist/bin/chunk-w8k1gyzr.js +0 -1
- package/dist/bin/chunk-wagzxm7z.js +0 -1
- package/dist/bin/chunk-xdxk6baf.js +0 -1
- package/dist/bin/chunk-ysv52qcc.js +0 -1
- package/dist/chunk-07rjctzz.js +0 -1
- package/dist/chunk-49vvjfrd.js +0 -1
- package/dist/chunk-6kcmbymp.js +0 -1
- package/dist/chunk-7xnwa0s8.js +0 -5
- package/dist/chunk-89p8mshq.js +0 -114
- package/dist/chunk-9asn5fpt.js +0 -92
- package/dist/chunk-d46p0h6t.js +0 -34
- package/dist/chunk-dak9hfrd.js +0 -1
- package/dist/chunk-ptq9v346.js +0 -2
- package/dist/chunk-z4xzd43p.js +0 -1
package/dist/aws/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{he,rr,as,cs,Su,Ma,Fa,ds,ls,Ua,Ze,j,et,ie,E,fe,hn,Qa,_e,Ha,fn,An,yn,Ch,Eh,Ry,Dy,Py,Ny,vt,ky,By,_y,xy,Tt,bh,vh,Th,wt,wh,Rh,Dh,In,Oy,Ly,$y,nr,My,Fy,Uy,Ga,qa,Cu,Qy,Hy,Gy,ir,Ph,Nh,sr,tt,Sn,Va,Eu,qy,bu,Vy,Rt,jy,zy,Ky,Wy,se,Jy,Xy,Yy,Zy,or,eI,tI,rI,Cn,ja,za,vu,Tu,Ka,ar}from"../chunk-p0b08g9f.js";import{Ae,rt,En,kh}from"../chunk-badb5mf3.js";import{y}from"../chunk-9s24pbbc.js";import{xe}from"../chunk-w4s3rswa.js";import{z}from"../chunk-2dextjqf.js";import{nt,oe,Oe,ye,Dt,vn,ps,gs,cr,dr,Tn,lr,ms,hs,fs,As,K,ys,Is,Ss,Cs,ae,Es,bs,vs,w,Xa,wn,Ya,ce,ur}from"../chunk-5dz6bzdj.js";import{I}from"../chunk-ms4dnha2.js";import{vr,ve}from"../chunk-np8vgbv0.js";import{h}from"../chunk-jt49qs0f.js";import{o}from"../chunk-3zzm5f28.js";import{Tr,n,l,Yh}from"../chunk-y6k0vwfn.js";export{ce as ACMClient,ur as ACMDnsValidator,n as AWSClient,Va as ApplicationAutoScalingClient,rr as AwsBackupClient,Eh as BedrockAgentClient,Ch as BedrockAgentRuntimeClient,yn as BedrockClient,An as BedrockRuntimeClient,h as CloudFormationClient,y as CloudFrontClient,fe as CloudWatchLogsClient,ye as CloudflareProvider,vt as ComprehendClient,hn as ConnectClient,ls as CostExplorerClient,wn as DnsProviderFactory,_e as DynamoDBClient,vr as EC2Client,xe as ECRClient,Ze as ECSClient,ar as EFSClient,Qa as ELBv2Client,tt as ElastiCacheClient,En as EmailClient,sr as EventBridgeClient,Oe as GoDaddyProvider,Ae as IAMClient,Eu as ImapServer,ir as KendraClient,E as LambdaClient,Ha as OpenSearchClient,nt as PROXIABLE_RECORD_TYPES,Ga as PersonalizeClient,Cu as PersonalizeEventsClient,qa as PersonalizeRuntimeClient,In as PollyClient,oe as PorkbunProvider,z as RDSClient,Tt as RekognitionClient,I as Route53Client,Ua as Route53DomainsClient,K as Route53Provider,o as S3Client,rt as SESClient,et as SNSClient,ie as SQSClient,ve as SSMClient,he as STSClient,Sn as SchedulerClient,j as SecretsManagerClient,Rt as SmsClient,Ka as SmsVoiceClient,bu as SmtpServer,Cn as SupportClient,ja as SupportTemplates,wt as TextractClient,fn as TranscribeClient,nr as TranslateClient,ae as UnifiedDnsValidator,or as VoiceClient,ky as analyzeSentiment,fs as applyDeclaredZoneSettings,Ss as applyZoneMigration,l as buildQueryParams,Py as completeWithClaude,xy as containsPii,vh as countFacesInS3Image,Wy as createDeliveryReceiptHandler,w as createDnsProvider,bs as createGoDaddyValidator,ds as createObjectStorageClient,Es as createPorkbunValidator,tI as createRecordingHandler,vs as createRoute53Validator,$y as createSSML,zy as createScheduledSmsHandler,Ky as createSmsClient,jy as createSmsInboxHandler,Tu as createSmsInfrastructure,rI as createVoiceClient,eI as createVoicemailHandler,lr as delegateZone,ms as delegateZoneFromConfig,hs as describeDelegation,As as describeZoneSettings,Yh as detectCredentialSource,Xa as detectDnsProvider,bh as detectLabelsFromS3,_y as detectLanguage,Ya as dnsProviders,kh as email,ys as exportRoute53Zone,By as extractEntities,Rh as extractFormsFromS3,Dh as extractTablesFromS3,wh as extractTextFromS3,Jy as formatPhoneNumber,Ny as generateEmbeddings,Yy as getCountryCode,Qy as getRecommendations,Hy as getSimilarItems,vu as getSmsInfrastructureStatus,Th as isContentSafe,cr as isNameserverRegistrar,Zy as isSamePhoneNumber,Xy as isValidPhoneNumber,dr as isZoneHost,cs as keyMatchesFilters,Dy as listClaudeModels,Uy as listLanguages,Ly as listVoices,Su as migrateObjectStorage,se as normalizePhoneNumber,Is as planZoneMigration,Dt as policyTag,Ma as providerEndpoint,vn as qualifyName,gs as reconcileDeclaredRecords,as as remapKey,Ry as requestModelAccess,ps as resolveDeclaredRecords,Fa as resolveObjectStorage,Tr as resolveS3Endpoint,Nh as retrieveForRag,Tn as sameNameservers,Ph as search,za as setupSmsInfrastructure,qy as startImapServer,Vy as startSmtpServer,Oy as textToSpeech,Gy as trackEvent,My as translate,Fy as translateToMultiple,Cs as verifyZoneParity};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Readers for the shapes AWSClient.parseXmlResponse produces.
|
|
3
|
+
*
|
|
4
|
+
* The parser strips a response's single root element, so a query-API body
|
|
5
|
+
* `<CreateTopicResponse><CreateTopicResult>..</CreateTopicResult>..` arrives
|
|
6
|
+
* as `{ CreateTopicResult: .., ResponseMetadata: .. }`. Reading through
|
|
7
|
+
* `result.CreateTopicResponse` finds nothing, and so does reading the result's
|
|
8
|
+
* fields straight off `result`. It also turns a lone list element into a bare
|
|
9
|
+
* object and `true`/`123` text into a boolean or number.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The `<{Action}Result>` of a query-API (SNS, SQS, SES v1, CloudFormation,
|
|
13
|
+
* ...) response. The wrapped form is accepted too, in case the parser ever
|
|
14
|
+
* stops unwrapping.
|
|
15
|
+
*/
|
|
16
|
+
export declare function queryResult(result: any, action: string): any;
|
|
17
|
+
/** A repeated XML element as an array: the parser yields one as a bare value and none as `''` or undefined. */
|
|
18
|
+
export declare function asList<T = any>(value: unknown): T[];
|
|
19
|
+
/** An XML boolean, whether the parser kept it as text or converted it. */
|
|
20
|
+
export declare function isTrue(value: unknown): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
1
|
+
var hd={newConnectionsPerSecond:50,concurrentPerSource:100,synPerSecond:2000,burst:100,icmpPerSecond:5,banSeconds:600};function h(e){return{...hd,...e.thresholds}}var _=/^(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,2})?$|^[0-9a-f:]+(?:\/\d{1,3})?$/i;function Qi(e){if(!_.test(e))return!1;let[t,n]=e.split("/");if(t.includes(":"))return n==null||Number(n)>=0&&Number(n)<=128;let s=t.split(".");if(s.length!==4||s.some((a)=>Number(a)>255||a===""))return!1;return n==null||Number(n)>=0&&Number(n)<=32}function f(e){return[...new Set((e??[]).map((t)=>t.trim()).filter(Qi))]}function y(e){let t=(e??[80,443]).filter((n)=>Number.isInteger(n)&&n>=1&&n<=65535);return[...new Set(t)].sort((n,s)=>n-s)}function yd(e={}){let t=h(e);return{"net.ipv4.tcp_syncookies":"1","net.ipv4.tcp_max_syn_backlog":String(Math.max(4096,t.synPerSecond*4)),"net.ipv4.tcp_synack_retries":"2","net.ipv4.tcp_abort_on_overflow":"1","net.ipv4.tcp_fin_timeout":"15","net.ipv4.tcp_keepalive_time":"300","net.ipv4.tcp_keepalive_intvl":"30","net.ipv4.tcp_keepalive_probes":"3","net.core.somaxconn":"4096","net.core.netdev_max_backlog":"16384","net.ipv4.conf.all.rp_filter":"1","net.ipv4.conf.default.rp_filter":"1","net.ipv4.conf.all.accept_source_route":"0","net.ipv4.conf.all.accept_redirects":"0","net.ipv4.conf.all.send_redirects":"0","net.ipv6.conf.all.accept_redirects":"0","net.ipv6.conf.all.accept_source_route":"0","net.ipv4.icmp_echo_ignore_broadcasts":"1","net.ipv4.icmp_ignore_bogus_error_responses":"1","net.netfilter.nf_conntrack_max":"262144","net.netfilter.nf_conntrack_tcp_timeout_established":"3600"}}function Sd(e={}){let t=["# Managed by ts-cloud. Edits are overwritten on the next deploy.","# Network hardening against L3/L4 floods.",""];for(let[n,s]of Object.entries(yd(e)))t.push(`${n} = ${s}`);return`${t.join(`
|
|
2
2
|
`)}
|
|
3
|
-
`}function
|
|
4
|
-
`)}function
|
|
3
|
+
`}function bd(e={}){let t=h(e),n=y(e.ports),s=f(e.allowlist),a=f(e.blocklist),l=e.monitorOnly?"counter":"counter drop",i=e.originProtection?.enabled?f(e.originProtection.cdnRanges):[],c=s.filter((r)=>!r.includes(":")),p=s.filter((r)=>r.includes(":")),u=a.filter((r)=>!r.includes(":")),o=["#!/usr/sbin/nft -f","# Managed by ts-cloud. Edits are overwritten on the next deploy.","","table inet ts_cloud_ddos","delete table inet ts_cloud_ddos","","table inet ts_cloud_ddos {"," # Sources that tripped a limit, with a timeout so a ban self-expires.",` set banned4 { type ipv4_addr; flags timeout; timeout ${t.banSeconds}s; }`,` set banned6 { type ipv6_addr; flags timeout; timeout ${t.banSeconds}s; }`];if(c.length>0)o.push(` set allow4 { type ipv4_addr; flags interval; elements = { ${c.join(", ")} } }`);if(p.length>0)o.push(` set allow6 { type ipv6_addr; flags interval; elements = { ${p.join(", ")} } }`);if(u.length>0)o.push(` set block4 { type ipv4_addr; flags interval; elements = { ${u.join(", ")} } }`);if(i.length>0)o.push(` set cdn4 { type ipv4_addr; flags interval; elements = { ${i.filter((r)=>!r.includes(":")).join(", ")} } }`);if(o.push(""," chain input {"," type filter hook input priority -150; policy accept;",""," # Established traffic is already paid for; never re-inspect it."," ct state established,related accept"," iif lo accept",""," # Invalid packets are never legitimate and are cheap to drop early."," ct state invalid counter drop"),c.length>0)o.push(" ip saddr @allow4 accept");if(p.length>0)o.push(" ip6 saddr @allow6 accept");if(u.length>0)o.push(" ip saddr @block4 counter drop");if(o.push(" ip saddr @banned4 counter drop"," ip6 saddr @banned6 counter drop",""),o.push(" # Nonsense TCP flag combinations: scanners and stack fingerprinting."," tcp flags & (fin|syn) == (fin|syn) counter drop"," tcp flags & (syn|rst) == (syn|rst) counter drop"," tcp flags & (fin|rst) == (fin|rst) counter drop"," tcp flags & (fin|ack) == fin counter drop"," tcp flags & (syn|fin|ack|rst|psh|urg) == 0x0 counter drop",""," # Ping stays usable, ping floods do not.",` ip protocol icmp icmp type echo-request limit rate ${t.icmpPerSecond}/second burst ${t.burst} packets accept`," ip protocol icmp icmp type echo-request counter drop",""),n.length>0){let r=n.join(", ");if(o.push(" # Platform-wide SYN ceiling. Above it the kernel falls back to cookies.",` tcp dport { ${r} } ct state new limit rate ${t.synPerSecond}/second burst ${t.burst} packets accept`,""," # Per-source new-connection rate. This is what stops one host hammering.",` tcp dport { ${r} } ct state new meter conn_rate4 { ip saddr limit rate over ${t.newConnectionsPerSecond}/second burst ${t.burst} packets } add @banned4 { ip saddr } ${l}`,` tcp dport { ${r} } ct state new meter conn_rate6 { ip6 saddr limit rate over ${t.newConnectionsPerSecond}/second burst ${t.burst} packets } add @banned6 { ip6 saddr } ${l}`,""," # Concurrency ceiling per source: the slow-loris defence.",` tcp dport { ${r} } ct state new meter conn_count4 { ip saddr ct count over ${t.concurrentPerSource} } ${l}`,` tcp dport { ${r} } ct state new meter conn_count6 { ip6 saddr ct count over ${t.concurrentPerSource} } ${l}`,""),i.length>0)o.push(" # Origin protection: reject traffic that skipped the CDN and came"," # straight to the box, which is how an attacker bypasses the edge.",` tcp dport { ${r} } ip saddr != @cdn4 counter drop`,"")}return o.push(" }","}",""),o.join(`
|
|
4
|
+
`)}function hr(e={}){return`#!/usr/bin/env bash
|
|
5
5
|
# Managed by ts-cloud. Installs L3/L4 flood mitigation.
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
|
|
@@ -13,11 +13,11 @@ fi
|
|
|
13
13
|
|
|
14
14
|
install -d -m 0755 /etc/ts-cloud /etc/nftables.d
|
|
15
15
|
cat > /etc/sysctl.d/90-ts-cloud-ddos.conf <<'SYSCTL_EOF'
|
|
16
|
-
${
|
|
16
|
+
${Sd(e)}SYSCTL_EOF
|
|
17
17
|
sysctl --system >/dev/null
|
|
18
18
|
|
|
19
19
|
cat > /etc/nftables.d/ts-cloud-ddos.nft.new <<'NFT_EOF'
|
|
20
|
-
${
|
|
20
|
+
${bd(e)}NFT_EOF
|
|
21
21
|
|
|
22
22
|
# Syntax-check before applying: a bad ruleset would leave the box unprotected.
|
|
23
23
|
if ! nft -c -f /etc/nftables.d/ts-cloud-ddos.nft.new; then
|
|
@@ -40,5 +40,5 @@ include "/etc/nftables.d/ts-cloud-ddos.nft"
|
|
|
40
40
|
fi
|
|
41
41
|
systemctl enable nftables >/dev/null 2>&1 || true
|
|
42
42
|
echo "ts-cloud: L3/L4 mitigation active"
|
|
43
|
-
`}var b=["off","monitor","rate_limit","challenge","lockdown"];function
|
|
44
|
-
export{
|
|
43
|
+
`}var b=["off","monitor","rate_limit","challenge","lockdown"];function sp(e,t=[]){let n=[],s=Math.max(1,e.baselineRequestsPerSecond),a=e.requestsPerSecond/s,l=0,i=(g,v)=>{n.push(v),l=Math.max(l,b.indexOf(g))},c=a>=3;if(c)i("monitor",`Traffic is ${a.toFixed(1)}x the baseline.`);let p=e.topSourceShare>=0.25,u=e.errorRate>=0.25,o=(e.suspiciousAgentShare??0)>=0.5,r=e.uniqueSources>0&&e.requestsPerSecond/e.uniqueSources>=50;if(c&&p)i("rate_limit",`One source accounts for ${(e.topSourceShare*100).toFixed(0)}% of traffic.`);if(c&&r)i("rate_limit","Request rate per unique source is far above what a browser produces.");if(c&&u)i("challenge",`Error rate is ${(e.errorRate*100).toFixed(0)}% under load.`);if(c&&o)i("challenge","Most requests carry no recognisable browser agent.");if(a>=20&&(p||u||o||r))i("lockdown",`Traffic is ${a.toFixed(0)}x the baseline with attack-shaped characteristics.`);if(!c&&e.topSourceShare>=0.6&&e.requestsPerSecond>s)i("rate_limit","A single source dominates traffic without an overall surge.");let d=b[l],m={off:1,monitor:1,rate_limit:0.5,challenge:0.25,lockdown:0.1}[d];return{level:d,reasons:n,rateLimitFactor:m,challengeEnabled:d==="challenge"||d==="lockdown",staticOnly:d==="lockdown",banCandidates:d==="off"||d==="monitor"?[]:f(t)}}function Yi(e,t){return Math.max(1,Math.floor(e*t.rateLimitFactor))}
|
|
44
|
+
export{hd,Qi,yd,Sd,bd,hr,sp,Yi};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{vd,ic,Td,so,ao,co,bs}from"./chunk-12q8xrct.js";import"./chunk-24njmb7d.js";export{vd as MANAGEMENT_DASHBOARD_SITE,bs as buildManagementDashboardArtifact,ic as dashboardCredentialsFile,ao as ensureManagementDashboard,co as managementDashboardSiteNames,Td as resolveDashboardAuth,so as resolveUiSource};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)}var
|
|
1
|
+
import{Ze,A,Ht,Rr,Ti}from"./chunk-24njmb7d.js";import{execSync as D}from"node:child_process";import{randomBytes as R}from"node:crypto";import{chmodSync as j,copyFileSync as x,existsSync as u,mkdirSync as w,readFileSync as U,statSync as N,writeFileSync as m}from"node:fs";import{tmpdir as E}from"node:os";import{basename as P,dirname as v,isAbsolute as O,join as a,resolve as B}from"node:path";import{fileURLToPath as C}from"node:url";function h(e){if(!e||typeof e!=="object")return e;return Object.fromEntries(Object.keys(e).map((r)=>[r,""]))}function M(e){let r=JSON.parse(JSON.stringify(e??{}));if(r.hetzner)delete r.hetzner.apiToken;delete r.aws,delete r.stateDir;for(let t of Object.values(r.sites??{})){if(t?.env)t.env=h(t.env);if(t?.environment)t.environment=h(t.environment)}for(let t of Object.values(r.environments??{}))if(t?.variables)t.variables=h(t.variables);for(let t of Object.values(r.infrastructure?.databases??{}))if(t?.password)t.password="";if(r.infrastructure?.appDatabase?.password)r.infrastructure.appDatabase.password="";if(r.infrastructure?.compute?.database?.password)r.infrastructure.compute.database.password="";if(r.infrastructure?.compute?.managedServices?.vitess?.password)r.infrastructure.compute.managedServices.vitess.password="";return r}function y(e){let r=M(e);return["// Generated by ts-cloud for the management dashboard — do not edit.","//","// This is the project's resolved cloud config, inlined so it needs no","// imports on the box. Credentials are deliberately absent.",`export default ${JSON.stringify(r,null,2)}`,""].join(`
|
|
2
|
+
`)}var vd="dashboard";function ic(){return Ze("dashboard-credentials.json")}function F(){return R(24).toString("base64url")}function Td(e,r,t){let s=process.env.TS_CLOUD_UI_PASSWORD?.trim();if(s)return{password:s,source:"env"};if(b(process.env.TS_CLOUD_UI_PUBLIC))return{password:void 0,source:"public"};let n=ic(),i=A(e,"dashboard-credentials.json");try{if(u(i)){let o=JSON.parse(U(i,"utf8"));if(o?.password)return{password:o.password,source:"generated"}}}catch{}let d=F();try{w(v(i),{recursive:!0}),m(i,`${JSON.stringify({username:r,password:d,generatedAt:new Date().toISOString()},null,2)}
|
|
3
3
|
`),j(i,384),t.info(`Management dashboard: generated a password for '${r}' and saved it to ${n} (read it there — it is not printed). Set TS_CLOUD_UI_PASSWORD to pin your own, or TS_CLOUD_UI_PUBLIC=1 to serve without auth.`)}catch(o){t.warn(`Management dashboard: could not persist the generated password (${o?.message??o}). Using it for this deploy only — pass: ${d}
|
|
4
|
-
This password is now in your deploy log. Set TS_CLOUD_UI_PASSWORD to a value of your own and redeploy once ${n} is writable.`)}return{password:d,source:"generated"}}var I={info:()=>{},warn:()=>{}};function b(e){return e!=null&&e!==""&&e!=="0"&&e.toLowerCase()!=="false"}function J(){return
|
|
5
|
-
`),J()}catch(n){return t.warn(`Management dashboard: could not stage the live release (${n?.message??n}) — skipping.`),null}}function
|
|
6
|
-
export{
|
|
4
|
+
This password is now in your deploy log. Set TS_CLOUD_UI_PASSWORD to a value of your own and redeploy once ${n} is writable.`)}return{password:d,source:"generated"}}var I={info:()=>{},warn:()=>{}};function b(e){return e!=null&&e!==""&&e!=="0"&&e.toLowerCase()!=="false"}function J(){return Ze("dashboard-release")}function L(){let e=v(C(import.meta.url));for(let r of[a(e,"..","..","package.json"),a(e,"..","package.json")])try{let t=JSON.parse(U(r,"utf8"));if(t.name==="@stacksjs/ts-cloud"&&t.version)return`^${t.version}`}catch{}return"latest"}function z(){return process.env.TS_CLOUD_UI_VERSION?.trim()||L()}function V(e,r,t){if(!e?.project?.slug)return t.warn("Management dashboard: the cloud config has no project slug — skipping the live dashboard."),null;let s=A(r,"dashboard-release");try{w(s,{recursive:!0}),m(a(s,"cloud.config.ts"),y(e));let n=z();if(n.startsWith("file:")){let d=n.slice(5),o=O(d)?d:B(r,d);if(!u(o)||!N(o).isFile())n=L(),t.warn(`Management dashboard: TS_CLOUD_UI_VERSION points to a missing package file (${o}); using the deploying ts-cloud version ${n} instead.`);else{let c=P(o),l=a(s,c);if(o!==l)x(o,l);n=`file:./${c}`}}let i={name:"ts-cloud-dashboard",private:!0,type:"module",dependencies:{"@stacksjs/ts-cloud":n}};return m(a(s,"package.json"),`${JSON.stringify(i,null,2)}
|
|
5
|
+
`),J()}catch(n){return t.warn(`Management dashboard: could not stage the live release (${n?.message??n}) — skipping.`),null}}function so(e){if(u(a(e,"packages","ui","pages"))||u(a(e,"packages","ui","package.json")))return{uiRoot:"packages/ui/dist",build:"cd packages/ui && bun install && bun run build"};let r=v(C(import.meta.url)),t=[a(r,"ui"),a(r,"..","ui"),a(r,"..","..","ui"),a(r,"..","dist","ui")];for(let s of t)if(u(a(s,"index.html"))||u(a(s,"serverless.html")))return{uiRoot:s,build:!1};return null}function ao(e,r={}){let t=r.logger??I,s=r.cwd??process.cwd();if(b(process.env.TS_CLOUD_UI_DISABLE))return t.info("Management dashboard: skipped (TS_CLOUD_UI_DISABLE set)."),e;if(e.cloud?.attachTo)return t.info(`Management dashboard: ${e.project.slug} is attached to ${e.cloud.attachTo}; the server owner's dashboard monitors every attached project.`),e;if(Ht(e))return e;let n=e.environments&&Object.keys(e.environments)[0],i=process.env.TS_CLOUD_UI_DOMAIN?.trim()||void 0,d=Number(process.env.TS_CLOUD_UI_PORT)||void 0,o={...e.sites??{}};if(!b(process.env.TS_CLOUD_UI_STATIC)){let g=V(e,s,t);if(!g)return e;let p=Ti(e,n??"production",{uiRoot:g,build:!1,domain:i,port:d,live:!0});if(p.length===0)return t.info("Management dashboard: no domain resolved (set TS_CLOUD_UI_DOMAIN or configure a site domain) — skipping."),e;for(let{name:k,site:_}of p)o[k]=_,t.info(`Management dashboard → https://${_.domain} (sign in with your ts-cloud account; the first deploy prints an admin password once)`);return e.sites=o,e}let c=so(s);if(!c)return t.info("Management dashboard: UI not found (no local ui/ or packaged dist/ui) — skipping auto-deploy."),e;let l=process.env.TS_CLOUD_UI_USERNAME?.trim()||"admin",f=Td(s,l,t),S=Ti(e,n??"production",{uiRoot:c.uiRoot,build:c.build,domain:i,username:l,password:f.password,realm:process.env.TS_CLOUD_UI_REALM?.trim()||void 0,live:!1,port:d});if(S.length===0)return t.info("Management dashboard: no domain resolved (set TS_CLOUD_UI_DOMAIN or configure a site domain) — skipping."),e;let T=f.source==="public"?"NO AUTH — TS_CLOUD_UI_PUBLIC is set (dashboard is publicly reachable)":f.source==="env"?"htpasswd-protected (TS_CLOUD_UI_PASSWORD)":`htpasswd-protected (auto-generated — see ${ic()})`;t.warn("Management dashboard: static mode — one shared password, and no per-site collaborators. Unset TS_CLOUD_UI_STATIC for the live dashboard.");for(let{name:g,site:p}of S)o[g]=p,t.info(`Management dashboard → https://${p.domain} (${T})`);return e.sites=o,e}function co(e){return Object.keys(e.sites??{}).filter(Rr)}function bs(e,r){if(!e?.root)return null;let t=r.cwd??process.cwd(),s=r.logger??I;try{if(typeof e.build==="string"&&e.build.trim())s.info(`Management dashboard: building UI (${e.build})`),D(e.build,{cwd:t,stdio:"inherit"});let n=O(e.root)?e.root:a(t,e.root);if(!u(n))return s.warn(`Management dashboard: build output not found at ${n} — skipping dashboard artifact.`),null;let i=a(E(),`${r.slug}-${r.siteName??vd}-${r.sha}.tar.gz`);return D(`tar czf "${i}" -C "${n}" .`,{stdio:"inherit"}),i}catch(n){return s.warn(`Management dashboard: failed to build artifact — ${n?.message??n}. Skipping dashboard deploy.`),null}}
|
|
6
|
+
export{vd,ic,Td,so,ao,co,bs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j}from"./chunk-7kj8f72p.js";import"./chunk-mbqwrs7a.js";export{j as SQSClient};
|