@ts-cloud/core 0.5.25 → 0.5.27
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/index.js +16 -1
- package/dist/presets/management-dashboard.d.ts +9 -0
- package/dist/types.d.ts +36 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -22347,6 +22347,21 @@ function resolveManagementDashboardSite(config, environment, opts) {
|
|
|
22347
22347
|
const domain = resolveDashboardDomain(config, environment, opts.domain);
|
|
22348
22348
|
if (!domain)
|
|
22349
22349
|
return null;
|
|
22350
|
+
const auth2 = opts.password ? { auth: { username: opts.username || "admin", password: opts.password, realm: opts.realm } } : {};
|
|
22351
|
+
if (opts.live) {
|
|
22352
|
+
const port = opts.port ?? 7676;
|
|
22353
|
+
const site2 = {
|
|
22354
|
+
root: opts.uiRoot,
|
|
22355
|
+
deploy: "server",
|
|
22356
|
+
domain,
|
|
22357
|
+
start: `cloud dashboard:serve --box --host 127.0.0.1 --port ${port}`,
|
|
22358
|
+
port,
|
|
22359
|
+
ssl: { provider: "letsencrypt" },
|
|
22360
|
+
...opts.build === false || opts.build === undefined ? {} : { build: opts.build },
|
|
22361
|
+
...auth2
|
|
22362
|
+
};
|
|
22363
|
+
return { name: "dashboard", site: site2 };
|
|
22364
|
+
}
|
|
22350
22365
|
const site = {
|
|
22351
22366
|
root: opts.uiRoot,
|
|
22352
22367
|
deploy: "server",
|
|
@@ -22354,7 +22369,7 @@ function resolveManagementDashboardSite(config, environment, opts) {
|
|
|
22354
22369
|
domain,
|
|
22355
22370
|
ssl: { provider: "letsencrypt" },
|
|
22356
22371
|
...opts.build === false || opts.build === undefined ? {} : { build: opts.build },
|
|
22357
|
-
...
|
|
22372
|
+
...auth2
|
|
22358
22373
|
};
|
|
22359
22374
|
return { name: "dashboard", site };
|
|
22360
22375
|
}
|
|
@@ -24,6 +24,15 @@ export interface ManagementDashboardOptions {
|
|
|
24
24
|
password?: string;
|
|
25
25
|
/** Browser auth realm. */
|
|
26
26
|
realm?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Live mode: deploy the dashboard as a server-app (a `cloud dashboard:serve
|
|
29
|
+
* --box` service on the box) instead of static files, so it serves the
|
|
30
|
+
* project's LIVE data + a working control API on the server. The proxy routes
|
|
31
|
+
* the dashboard host to its loopback port (behind Basic auth).
|
|
32
|
+
*/
|
|
33
|
+
live?: boolean;
|
|
34
|
+
/** Loopback port for the live (box-mode) dashboard service. @default 7676 */
|
|
35
|
+
port?: number;
|
|
27
36
|
}
|
|
28
37
|
/**
|
|
29
38
|
* Derive a dashboard hostname (`dashboard.<apex>`) from the project's configured
|
package/dist/types.d.ts
CHANGED
|
@@ -744,17 +744,43 @@ export interface SiteCacheConfig {
|
|
|
744
744
|
/** Front this origin with a CDN (CloudFront on AWS; advisory on Hetzner). */
|
|
745
745
|
cdn?: boolean;
|
|
746
746
|
}
|
|
747
|
+
/**
|
|
748
|
+
* A redirect-only site target: the gateway answers the site's `domain` with an
|
|
749
|
+
* HTTP redirect to `to`, appending the request path + query by default so deep
|
|
750
|
+
* links survive.
|
|
751
|
+
*/
|
|
752
|
+
export interface SiteRedirectConfig {
|
|
753
|
+
/** Target base URL, e.g. `https://verygoodadblock.org` (a path prefix is allowed). */
|
|
754
|
+
to: string;
|
|
755
|
+
/** HTTP status. Default `301` (permanent). */
|
|
756
|
+
status?: 301 | 302 | 307 | 308;
|
|
757
|
+
/** Append the request path + query to `to`. Default `true`. */
|
|
758
|
+
preservePath?: boolean;
|
|
759
|
+
}
|
|
747
760
|
export interface SiteConfig {
|
|
748
761
|
/**
|
|
749
762
|
* Directory to deploy.
|
|
750
763
|
* - For static sites: the built static files to upload to S3 (e.g., 'dist').
|
|
751
764
|
* - For SSR sites: the build output to tar+ship to EC2 (e.g., '.output').
|
|
765
|
+
*
|
|
766
|
+
* Optional: a redirect-only site (see {@link redirect}) ships nothing and so
|
|
767
|
+
* needs no `root`.
|
|
752
768
|
*/
|
|
753
|
-
root
|
|
769
|
+
root?: string;
|
|
754
770
|
/** Path prefix for deployment (usually '/') */
|
|
755
771
|
path?: string;
|
|
756
772
|
/** Custom domain for the site (e.g., 'stage.easyotc.com') */
|
|
757
773
|
domain?: string;
|
|
774
|
+
/**
|
|
775
|
+
* Make this a **redirect-only site**: the reverse-proxy gateway answers this
|
|
776
|
+
* site's `domain` with an HTTP redirect to the target instead of deploying any
|
|
777
|
+
* app or static files. Use it to point an alternate/parked domain at its
|
|
778
|
+
* canonical host (e.g. `very-good-adblock.org` → `https://verygoodadblock.org`),
|
|
779
|
+
* just like a Forge "Redirect" site. Requires `domain`; `root`/`start` are not
|
|
780
|
+
* needed and are ignored. A bare string is shorthand for a permanent (301),
|
|
781
|
+
* path-preserving redirect.
|
|
782
|
+
*/
|
|
783
|
+
redirect?: string | SiteRedirectConfig;
|
|
758
784
|
/**
|
|
759
785
|
* S3 bucket name. Default: `{slug}-{environment}-site` for `main`,
|
|
760
786
|
* else `{slug}-{environment}-{siteKey}`.
|
|
@@ -2472,6 +2498,15 @@ export interface ComputeProxyConfig {
|
|
|
2472
2498
|
onDemandTls?: boolean;
|
|
2473
2499
|
/** Contact email for the ACME account when {@link onDemandTls} is enabled. */
|
|
2474
2500
|
onDemandTlsEmail?: string;
|
|
2501
|
+
/**
|
|
2502
|
+
* Webroot the gateway serves ACME http-01 challenge tokens from on `:80` (and
|
|
2503
|
+
* that the deploy-time issuance + renewal cron write tokens into). Only used
|
|
2504
|
+
* when {@link onDemandTls} is enabled, where ts-cloud also installs a daily
|
|
2505
|
+
* `tlsx acme:renew` timer so certs for every routed domain are issued on deploy
|
|
2506
|
+
* and renewed before expiry — with no downtime (the running gateway answers the
|
|
2507
|
+
* challenge). @default '/var/www/acme-challenge'
|
|
2508
|
+
*/
|
|
2509
|
+
acmeWebroot?: string;
|
|
2475
2510
|
/**
|
|
2476
2511
|
* Put a CDN (CloudFront) in front of this self-hosted gateway. A CDN custom
|
|
2477
2512
|
* origin can't be a bare IP and can't be one of the public aliases (it would
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ts-cloud/core",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.27",
|
|
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.5.
|
|
34
|
+
"@ts-cloud/aws-types": "0.5.27"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"typescript": "^5.9.3"
|