@ts-cloud/core 0.13.1 → 0.15.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.
Files changed (2) hide show
  1. package/dist/types.d.ts +61 -0
  2. package/package.json +2 -2
package/dist/types.d.ts CHANGED
@@ -1792,6 +1792,60 @@ export interface SftpConfig {
1792
1792
  /** System account the box server runs as. Defaults to `ts-sftp`. */
1793
1793
  serviceUser?: string;
1794
1794
  }
1795
+ /**
1796
+ * Zone settings reconciled on every deploy, where the provider has them.
1797
+ *
1798
+ * Cloudflare's defaults are not the right ones for an origin ts-cloud built.
1799
+ * A new zone lands on `ssl: 'full'`, which encrypts to the origin but does not
1800
+ * VALIDATE it — so anything that can get between the edge and the box can
1801
+ * present its own certificate and be believed. The origin here terminates a
1802
+ * real Let's Encrypt certificate, so `'strict'` costs nothing and closes that.
1803
+ *
1804
+ * Declared rather than defaulted. Turning `strict` on implicitly would be the
1805
+ * right call for a ts-cloud origin and the wrong one for a zone pointed at
1806
+ * something else — a self-signed appliance, a third-party host — where it
1807
+ * takes the site down on the next deploy. Saying it in config is cheap; having
1808
+ * a deploy silently change how TLS is verified is not.
1809
+ *
1810
+ * Only settings named here are touched. Anything else in the zone is left
1811
+ * alone, including things somebody set by hand.
1812
+ */
1813
+ export interface DnsZoneConfig {
1814
+ /**
1815
+ * TLS between the edge and the origin.
1816
+ *
1817
+ * - `strict` — encrypt AND validate the origin certificate. Correct for any
1818
+ * origin with a real certificate, which is every ts-cloud server deploy.
1819
+ * - `full` — encrypt without validating. Cloudflare's default for a new zone.
1820
+ * - `flexible` — plaintext to the origin. With an origin that redirects to
1821
+ * HTTPS this produces an infinite redirect loop, which is the single most
1822
+ * common way a Cloudflare migration appears to break the site.
1823
+ * - `off` — no TLS at the edge at all.
1824
+ */
1825
+ ssl?: 'off' | 'flexible' | 'full' | 'strict';
1826
+ /** Redirect http:// to https:// at the edge. */
1827
+ alwaysUseHttps?: boolean;
1828
+ /**
1829
+ * Send the visitor's city, region and coordinates to the origin.
1830
+ *
1831
+ * A Cloudflare zone sends `CF-IPCountry` and nothing else by default, so an
1832
+ * origin that reads `cf-ipcity` or `cf-iplatitude` — anything doing
1833
+ * "near you" — receives no value and silently falls back, with a request
1834
+ * that otherwise looks completely normal. Cloudflare models this as a
1835
+ * managed header transform rather than a zone setting, which is why it is
1836
+ * not reachable through the settings API and is easy to miss entirely.
1837
+ *
1838
+ * Off unless declared: these headers carry a visitor's approximate location
1839
+ * to the application, and that is a decision a project should make out loud.
1840
+ */
1841
+ visitorLocationHeaders?: boolean;
1842
+ /**
1843
+ * Oldest TLS version the edge will negotiate. `1.2` is the usual floor;
1844
+ * some plans reject anything above `1.0`, and a rejected setting is
1845
+ * reported rather than failing the deploy.
1846
+ */
1847
+ minTlsVersion?: '1.0' | '1.1' | '1.2' | '1.3';
1848
+ }
1795
1849
  /**
1796
1850
  * The registrar half of {@link DnsConfig}.
1797
1851
  */
@@ -1866,6 +1920,13 @@ export interface DnsConfig {
1866
1920
  * }
1867
1921
  */
1868
1922
  registrar?: DnsRegistrarConfig;
1923
+ /**
1924
+ * Zone settings to reconcile on every deploy — see {@link DnsZoneConfig}.
1925
+ *
1926
+ * Chiefly `ssl: 'strict'`, which a Cloudflare zone does not get by default
1927
+ * and which is the correct setting for an origin holding a real certificate.
1928
+ */
1929
+ zone?: DnsZoneConfig;
1869
1930
  /**
1870
1931
  * Records to publish on every deploy, alongside the address records ts-cloud
1871
1932
  * derives from `sites`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ts-cloud/core",
3
3
  "type": "module",
4
- "version": "0.13.1",
4
+ "version": "0.15.0",
5
5
  "description": "Core CloudFormation generation library for ts-cloud",
6
6
  "author": "Chris Breuer <chris@stacksjs.com>",
7
7
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "typecheck": "tsc --noEmit"
32
32
  },
33
33
  "dependencies": {
34
- "@ts-cloud/aws-types": "0.13.1"
34
+ "@ts-cloud/aws-types": "0.15.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "typescript": "^7.0.2"