Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

chore(website): keep a local account name out of the vendored document

Etienne Lescot2c980eb88efb
diff --git a/website/scripts/gen-recreation.mjs b/website/scripts/gen-recreation.mjs
index 077a2ff52..2bce88850 100644
--- a/website/scripts/gen-recreation.mjs
+++ b/website/scripts/gen-recreation.mjs
@@ -219,7 +219,18 @@ if (doc.schemaVersion !== SCHEMA_VERSION) {
* recording's audio, the recording is 8 MB and lives outside the repo, and the
* generator has to run in CI without it — so its 320 decoded amplitudes are
* vendored beside the document for exactly the reason the document itself is.
+ *
+ * Scrubbed: the two stored paths. They are absolute paths in the store of
+ * whoever last ran `--vendor`, which is a local account name committed to a
+ * public repository. Nothing here reads more than the file name — `decodePeaks`
+ * names its source with it, and the recreation never opens either file — so the
+ * directory is replaced with a placeholder home rather than dropped, and the
+ * document keeps the shape schemaVersion 7 gives it.
*/
+const VENDOR_HOME = "/Users/example/Library/Application Support/openscreen/recordings";
+const scrubPath = (p) =>
+ typeof p === "string" ? `${VENDOR_HOME}/${p.replace(/^.*[/\\]/, "")}` : p;
+
function vendorFixture() {
const full = JSON.parse(readFileSync(DOC_PATH, "utf8"));
if (full.schemaVersion !== SCHEMA_VERSION) {
@@ -228,7 +239,13 @@ function vendorFixture() {
const slim = {
schemaVersion: full.schemaVersion,
project: full.project,
- assets: full.assets,
+ assets: full.assets.map((a) => ({
+ ...a,
+ originalPath: scrubPath(a.originalPath),
+ ...(a.cameraTrack
+ ? { cameraTrack: { ...a.cameraTrack, sourcePath: scrubPath(a.cameraTrack.sourcePath) } }
+ : {}),
+ })),
transcript: {
assetId: full.transcript.assetId,
language: full.transcript.language,
diff --git a/website/src/components/Recreation/fixture-slim.json b/website/src/components/Recreation/fixture-slim.json
index bd527a702..fd0fb3450 100644
--- a/website/src/components/Recreation/fixture-slim.json
+++ b/website/src/components/Recreation/fixture-slim.json
@@ -12,7 +12,7 @@
"id": "asset_98800b62-9429-4a8a-9c12-fef7af70b160",
"kind": "video",
"label": "Bellrock — docs walkthrough",
- "originalPath": "/Users/m1/Library/Application Support/openscreen/recordings/recording-1786032000000.mp4",
+ "originalPath": "/Users/example/Library/Application Support/openscreen/recordings/recording-1786032000000.mp4",
"durationSec": 40.033,
"sizeBytes": 8194081,
"video": {
@@ -22,7 +22,7 @@
"fps": 0
},
"cameraTrack": {
- "sourcePath": "/Users/m1/Library/Application Support/openscreen/recordings/recording-1786032000000-webcam.mp4",
+ "sourcePath": "/Users/example/Library/Application Support/openscreen/recordings/recording-1786032000000-webcam.mp4",
"startMs": 0,
"offsetMs": 0,
"visible": false