@ts-cloud/core 0.2.24 → 0.2.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/types.d.ts +73 -0
  2. package/package.json +2 -2
package/dist/types.d.ts CHANGED
@@ -1538,6 +1538,79 @@ export interface ComputeConfig {
1538
1538
  * Set to `true` only if you need traditional SSH access.
1539
1539
  */
1540
1540
  allowSsh?: boolean;
1541
+ /**
1542
+ * Reverse-proxy gateway to provision on the box. When set to an engine,
1543
+ * `buddy deploy` generates the gateway's route config from the `sites` model
1544
+ * (mapping each non-bucket site to a route by `domain`/`path`) and installs +
1545
+ * starts the gateway on :80/:443.
1546
+ *
1547
+ * Opt-in and **off by default** (`undefined` → no gateway provisioned, the
1548
+ * operator runs their own), so existing deploys are unaffected.
1549
+ *
1550
+ * Currently the only engine is `rpx` (`@stacksjs/rpx`), which natively
1551
+ * supports path-based routing within a host, on-demand TLS, and serving
1552
+ * static dirs — so an app, docs, and a public site can share one domain.
1553
+ */
1554
+ proxy?: ComputeProxyConfig;
1555
+ }
1556
+ /**
1557
+ * Reverse-proxy gateway provisioning for a compute box. The gateway is
1558
+ * generated from the `sites` model and installed by the driver's cloud-init /
1559
+ * deploy flow. See {@link ComputeConfig.proxy}.
1560
+ */
1561
+ export interface ComputeProxyConfig {
1562
+ /**
1563
+ * Gateway engine. `rpx` provisions `@stacksjs/rpx` as a systemd service
1564
+ * (`rpx-gateway.service`) reading a generated config. This is the only
1565
+ * supported engine today.
1566
+ */
1567
+ engine: 'rpx';
1568
+ /**
1569
+ * npm version/range of `@stacksjs/rpx` to install on the box.
1570
+ * @default 'latest'
1571
+ */
1572
+ version?: string;
1573
+ /**
1574
+ * Directory on the box holding real TLS certs (PEM `<domain>.crt`/`.key`),
1575
+ * served per-SNI by rpx. @default '/etc/rpx/certs'
1576
+ */
1577
+ certsDir?: string;
1578
+ /**
1579
+ * Enable rpx on-demand TLS: lazily issue a real (Let's Encrypt) cert for an
1580
+ * approved host the first time it's needed. The site domains are used as the
1581
+ * allowlist. Off by default.
1582
+ */
1583
+ onDemandTls?: boolean;
1584
+ /** Contact email for the ACME account when {@link onDemandTls} is enabled. */
1585
+ onDemandTlsEmail?: string;
1586
+ /**
1587
+ * Put a CDN (CloudFront) in front of this self-hosted gateway. A CDN custom
1588
+ * origin can't be a bare IP and can't be one of the public aliases (it would
1589
+ * resolve back to the CDN — an infinite loop), so it needs a dedicated origin
1590
+ * hostname pointing at this box. Requests then flow
1591
+ * `viewer → CDN → originDomain (this box)`.
1592
+ *
1593
+ * When {@link CdnFrontConfig.secret} is set, the CDN injects it as a header
1594
+ * on the origin hop and the gateway rejects any request to the fronted hosts
1595
+ * that lacks it — so the publicly-resolvable origin can't be used to bypass
1596
+ * the CDN (origin lockdown via rpx `createOriginGuard`). Pair with
1597
+ * `buildCloudFrontOriginConfig` for the matching AWS distribution config.
1598
+ */
1599
+ cdn?: CdnFrontConfig;
1600
+ }
1601
+ /** CDN-in-front-of-gateway configuration (see {@link ComputeProxyConfig.cdn}). */
1602
+ export interface CdnFrontConfig {
1603
+ /**
1604
+ * Hostname the CDN connects to (e.g. `origin.example.com`). MUST resolve to
1605
+ * this box and MUST NOT be one of {@link frontedHosts} (else the CDN loops).
1606
+ */
1607
+ originDomain: string;
1608
+ /** Public hosts served through the CDN (its aliases) — locked down when {@link secret} is set. */
1609
+ frontedHosts: string[];
1610
+ /** Shared secret the CDN injects on the origin hop; the gateway enforces it on {@link frontedHosts}. */
1611
+ secret?: string;
1612
+ /** Header name carrying {@link secret}. @default 'X-Origin-Verify' */
1613
+ secretHeader?: string;
1541
1614
  }
1542
1615
  export interface DatabaseItemConfig {
1543
1616
  engine?: 'dynamodb' | 'postgres' | 'mysql';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-cloud/core",
3
- "version": "0.2.24",
3
+ "version": "0.2.26",
4
4
  "type": "module",
5
5
  "description": "Core CloudFormation generation library for ts-cloud",
6
6
  "author": "Chris Breuer <chris@stacksjs.com>",
@@ -31,7 +31,7 @@
31
31
  "typecheck": "tsc --noEmit"
32
32
  },
33
33
  "dependencies": {
34
- "@ts-cloud/aws-types": "0.2.24"
34
+ "@ts-cloud/aws-types": "0.2.26"
35
35
  },
36
36
  "devDependencies": {
37
37
  "typescript": "^5.9.3"