@hyperframes/producer 0.9.90 → 0.9.92

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/README.md CHANGED
@@ -45,10 +45,17 @@ through a proxy name, list that name in `allowedHosts` or in the comma-separated
45
45
  `PRODUCER_ALLOWED_HOSTS` variable. Requests without those headers, such as curl or
46
46
  another service, are unaffected.
47
47
 
48
- The server listens on `127.0.0.1` unless you pass `hostname` or set `PRODUCER_HOST`. To
49
- listen on any other address, also set `authToken` or `PRODUCER_AUTH_TOKEN`. Every route
50
- except `/health` then requires `Authorization: Bearer <token>`, and the server refuses to
51
- start without one. A request's `projectDir` must resolve, symlinks included, inside
48
+ Every route except `/health` requires `Authorization: Bearer <token>`. Set the token with
49
+ `authToken` or `PRODUCER_AUTH_TOKEN`. If you set none, `startServer` makes one for the run
50
+ and writes it to `~/.hyperframes/producer/<port>.token` (or `authTokenFile`, or
51
+ `PRODUCER_AUTH_TOKEN_FILE`), readable only by the account that runs the server, and logs
52
+ that path. Any local account, container or program can reach a loopback port, so the
53
+ server never listens without a token. It listens on `127.0.0.1` unless you pass
54
+ `hostname` or set `PRODUCER_HOST`, and it refuses any other address unless you set the
55
+ token yourself. `createProducerApp` without `authToken`, and `createRenderHandlers`
56
+ always, check no caller: serve them only behind your own authentication.
57
+
58
+ A request's `projectDir` must resolve, symlinks included, inside
52
59
  `projectsDir` (`PRODUCER_PROJECTS_DIR`, default: the working directory). Its `entryFile`
53
60
  must stay inside that project, and `outputPath` must be inside `rendersDir`
54
61
  (`PRODUCER_RENDERS_DIR`, default: a new private folder in the OS temp dir). `debug: true` is refused unless you set
@@ -2554,7 +2554,7 @@ async function downloadAndRewriteUrls(urlSet, html, remoteDir, warnLabel, logLab
2554
2554
  }
2555
2555
  let result = html;
2556
2556
  for (const [url, relPath] of urlToRelPath) {
2557
- result = result.replaceAll(`"${url}"`, `"${relPath}"`).replaceAll(`'${url}'`, `'${relPath}'`);
2557
+ result = result.replaceAll(`"${url}"`, () => `"${relPath}"`).replaceAll(`'${url}'`, () => `'${relPath}'`);
2558
2558
  if (extraRewrite) result = extraRewrite(result, url, relPath);
2559
2559
  }
2560
2560
  defaultLogger.debug(`[Compiler] ${logLabel} ${urlToLocal.size} to ${REMOTE_MEDIA_SUBDIR}/`);
@@ -2609,7 +2609,7 @@ async function localizeRemoteBackgroundImages(html, downloadDir2, assets) {
2609
2609
  assets,
2610
2610
  // Quoted url('..')/url("..") are rewritten by downloadAndRewriteUrls' default
2611
2611
  // replaceAll; this handles the unquoted url(https://..) form.
2612
- (h, url, rel) => h.replaceAll(`url(${url})`, `url(${rel})`)
2612
+ (h, url, rel) => h.replaceAll(`url(${url})`, () => `url(${rel})`)
2613
2613
  );
2614
2614
  }
2615
2615
  function isGoogleFontsUrl(href) {
@@ -2776,7 +2776,7 @@ function localizeFontFaceUrls(html, downloadDir2, assets) {
2776
2776
  style,
2777
2777
  css,
2778
2778
  "</style>".length,
2779
- css.replaceAll(`url(${url})`, `url("${relPath}")`)
2779
+ css.replaceAll(`url(${url})`, () => `url("${relPath}")`)
2780
2780
  )
2781
2781
  )
2782
2782
  );
@@ -1718,6 +1718,7 @@ import {
1718
1718
 
1719
1719
  // src/services/hdrCompositor.ts
1720
1720
  import {
1721
+ TRANSITIONS,
1721
1722
  captureAlphaPng,
1722
1723
  applyDomLayerMask,
1723
1724
  removeDomLayerMask,
@@ -4812,7 +4813,7 @@ async function downloadAndRewriteUrls(urlSet, html, remoteDir, warnLabel, logLab
4812
4813
  }
4813
4814
  let result = html;
4814
4815
  for (const [url, relPath] of urlToRelPath) {
4815
- result = result.replaceAll(`"${url}"`, `"${relPath}"`).replaceAll(`'${url}'`, `'${relPath}'`);
4816
+ result = result.replaceAll(`"${url}"`, () => `"${relPath}"`).replaceAll(`'${url}'`, () => `'${relPath}'`);
4816
4817
  if (extraRewrite) result = extraRewrite(result, url, relPath);
4817
4818
  }
4818
4819
  defaultLogger.debug(`[Compiler] ${logLabel} ${urlToLocal.size} to ${REMOTE_MEDIA_SUBDIR}/`);
@@ -4867,7 +4868,7 @@ async function localizeRemoteBackgroundImages(html, downloadDir, assets) {
4867
4868
  assets,
4868
4869
  // Quoted url('..')/url("..") are rewritten by downloadAndRewriteUrls' default
4869
4870
  // replaceAll; this handles the unquoted url(https://..) form.
4870
- (h, url, rel) => h.replaceAll(`url(${url})`, `url(${rel})`)
4871
+ (h, url, rel) => h.replaceAll(`url(${url})`, () => `url(${rel})`)
4871
4872
  );
4872
4873
  }
4873
4874
  function isGoogleFontsUrl(href) {
@@ -5034,7 +5035,7 @@ function localizeFontFaceUrls(html, downloadDir, assets) {
5034
5035
  style,
5035
5036
  css,
5036
5037
  "</style>".length,
5037
- css.replaceAll(`url(${url})`, `url("${relPath}")`)
5038
+ css.replaceAll(`url(${url})`, () => `url("${relPath}")`)
5038
5039
  )
5039
5040
  )
5040
5041
  );
@@ -8755,13 +8756,13 @@ var DEFAULT_MAX_BYTES = 200 * 1024 * 1024;
8755
8756
 
8756
8757
  // src/services/render/stages/captureHdrSequentialLoop.ts
8757
8758
  import {
8758
- TRANSITIONS,
8759
+ TRANSITIONS as TRANSITIONS2,
8759
8760
  crossfade
8760
8761
  } from "@hyperframes/engine";
8761
8762
 
8762
8763
  // src/services/render/stages/captureHdrHybridLoop.ts
8763
8764
  import {
8764
- TRANSITIONS as TRANSITIONS2,
8765
+ TRANSITIONS as TRANSITIONS3,
8765
8766
  closeCaptureSession as closeCaptureSession6,
8766
8767
  createCaptureSession as createCaptureSession6,
8767
8768
  createFrameReorderBuffer as createFrameReorderBuffer2,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "0.1.0",
3
3
  "buildId": "dev",
4
- "sha256": "17af4db49dd4b1e2549d54cacb033614ee6260cbef0c5f9689d251bfec22844a",
4
+ "sha256": "18bb268d2e9c9b0a6413fd9475a9d3b147a0b01d8302c31f0886266114d393a7",
5
5
  "artifacts": {
6
6
  "iife": "hyperframe.runtime.iife.js",
7
7
  "esm": "hyperframe.runtime.mjs"