openvibers/openvibe.media Commits
The OpenVibe Frame from this site's own pinned copy: /shared/* is served by openvibe-shared/serve (1.12.0) and every page references it by content hash (/shared/<file>?v=<hash>), so this site's pin decides what its pages run and its navbar and footer keep working while openvibe.network is down
Changes
@@@ -18,7 +18,7 @@"multer": "^1.4.5-lts.1","openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.33.0","openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.5.0",-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.11.1",++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.12.0","sharp": "^0.33.4"}},@@@ -1944,9 +1944,9 @@}},"node_modules/openvibe-shared": {-- "version": "1.11.1",-- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.11.1",-- "integrity": "sha512-hBaZlZRVZjkGfsPQE16rQIou2lUuusADea3Evx1tVjB84FTHGHS7ZALfcXaNOk7dR53HOVTJrQ0njmScdreUiw==",++ "version": "1.12.0",++ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.12.0",++ "integrity": "sha512-Qpy4YVoPMs1q/0/08/5ZODI0+7ev+Krk75nsRPsTjNCm7Eu91tt1LPnUNLt4kYfRj6duS+N9icm02gksnlMiyA==","license": "MIT","dependencies": {"jsonwebtoken": "^9.0.0"@@@ -20,7 +20,7 @@"dotenv": "^16.4.5","express": "^4.19.2","multer": "^1.4.5-lts.1",-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.11.1",++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.12.0","sharp": "^0.33.4"}}@@@ -76,6 +76,8 @@ app.use((req, _res, next) => {});{ const legal = require('openvibe-shared/legal'); app.get(legal.PATHS, legal.handler({ id: 'media', service: 'media', host: 'openvibe.media', name: 'OpenVibe.Media', profile: 'hosting' })); app.get('/tos', (_req, res) => res.redirect(301, '/terms')); }// Brand assets: icon set + web app manifest generated by openvibe-shared/scripts/build-app-icons.js++// This site's own pinned copy of the OpenVibe Frame's browser files (openvibe-shared/serve).++app.use('/shared', require('openvibe-shared/serve').handler());app.use('/assets', express.static(require('path').join(__dirname, 'brand'), { maxAge: '7d' }));app.get('/manifest.webmanifest', (_req, res) => res.type('application/manifest+json').sendFile(require('path').join(__dirname, 'brand', 'manifest.webmanifest')));// ── Internal: avatar ingestion (the Network asks; see server/avatars/ingest.js) ──@@@ -10,6 +10,7 @@'use strict';const config = require('../config');++const ovServe = require('openvibe-shared/serve');const NETWORK_URL = (config.network && config.network.url) || 'https://openvibe.network';const SITE_NAME = 'OpenVibe.Media';@@@ -79,7 +80,7 @@ function headTags(seo) {`<meta name="description" content="${description}">`,// Applies the user's theme to <html> synchronously; must run before any CSS paints.require('openvibe-shared/app-icon').headTags({ site: 'media', iconBase: '/assets' }),-- `<script src="${NETWORK_URL}/shared/theme-loader.js" defer></script>`,++ `<script src="${ovServe.url('theme-loader.js')}" defer></script>`,seo.canonical ? `<link rel="canonical" href="${esc(seo.canonical)}">` : '',`<meta name="robots" content="${esc(seo.robots || 'index, follow')}">`,`<meta property="og:site_name" content="${SITE_NAME}">`,@@@ -144,8 +145,8 @@ function frameScripts({ history, footer } = {}) {mount: '#ov-footer',updates: '/updates', // the footer's "shipped X ago" line and Updates link open this site's log};-- return `<script src="${NETWORK_URL}/shared/navbar.js" defer></script>--<script src="${NETWORK_URL}/shared/footer.js" defer></script>++ return `<script src="${ovServe.url('navbar.js')}" defer></script>++<script src="${ovServe.url('footer.js')}" defer></script><script>(function () {var tries = 0;@@@ -23,6 +23,7 @@'use strict';const express = require('express');++const ovServe = require('openvibe-shared/serve');const path = require('path');const fs = require('fs');const db = require('../db/database');@@@ -336,7 +337,7 @@ router.get('/updates', (req, res) => {const frame = require('openvibe-shared/frame');res.set('Cache-Control', 'public, max-age=60').type('html').send(pf.page({seo: { title: 'What shipped on OpenVibe.Media', description: 'Every change deployed to OpenVibe.Media, newest first, with the Patch notes that gather them.', canonical: pf.abs('/updates') },-- body: frame.updatesBody({ service: 'media', siteName: 'OpenVibe.Media' }) + frame.shippedScript(),++ body: frame.updatesBody({ service: 'media', siteName: 'OpenVibe.Media' }) + `<script src="${ovServe.url('shipped.js')}" defer></script>`,footer: { variant: 'full' },}));});@@@ -37,9 +37,9 @@ const html = pages.renderWatchPage('vod', vod);assert.ok(html.includes('<title>Late night <build> — OpenVibe.Media</title>'));assert.ok(html.includes('<link rel="canonical" href="https://openvibe.live/vod/42">'), 'Live-owned VOD is canonical on Live');assert.ok(html.includes('<meta name="robots" content="noindex, follow">'));--assert.ok(html.includes('https://openvibe.network/shared/theme-loader.js'));++assert.ok(/\/shared\/theme-loader\.js\?v=[0-9a-f]{12}/.test(html), 'this site\'s own pinned Frame files');assert.ok(html.indexOf('theme-loader.js') < html.indexOf('<style>'), 'theme-loader runs before the styles');--assert.ok(html.includes('https://openvibe.network/shared/navbar.js') && html.includes('https://openvibe.network/shared/footer.js'));++assert.ok(/\/shared\/navbar\.js\?v=[0-9a-f]{12}/.test(html) && /\/shared\/footer\.js\?v=[0-9a-f]{12}/.test(html), 'the Frame from this site\'s own pinned copy');assert.ok(html.includes('"service":"media"') && html.includes('"history":{"type":"vod","title":"Late night <build>"}'.replace('<', '\\u003c')));assert.ok(html.includes('"variant":"compact"'));assert.ok(html.includes('<meta property="og:type" content="video.other">'));
@@ -18,7 +18,7 @@
@@ -18,7 +18,7 @@
"multer": "^1.4.5-lts.1",
"multer": "^1.4.5-lts.1",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.33.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.33.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.5.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.5.0",
- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.11.1",
+ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.12.0",
"sharp": "^0.33.4"
"sharp": "^0.33.4"
}
}
},
},
@@ -1944,9 +1944,9 @@
@@ -1944,9 +1944,9 @@
}
}
},
},
"node_modules/openvibe-shared": {
"node_modules/openvibe-shared": {
- "version": "1.11.1",
- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.11.1",
- "integrity": "sha512-hBaZlZRVZjkGfsPQE16rQIou2lUuusADea3Evx1tVjB84FTHGHS7ZALfcXaNOk7dR53HOVTJrQ0njmScdreUiw==",
+ "version": "1.12.0",
+ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.12.0",
+ "integrity": "sha512-Qpy4YVoPMs1q/0/08/5ZODI0+7ev+Krk75nsRPsTjNCm7Eu91tt1LPnUNLt4kYfRj6duS+N9icm02gksnlMiyA==",
"license": "MIT",
"license": "MIT",
"dependencies": {
"dependencies": {
"jsonwebtoken": "^9.0.0"
"jsonwebtoken": "^9.0.0"
@@ -20,7 +20,7 @@
@@ -20,7 +20,7 @@
"dotenv": "^16.4.5",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"express": "^4.19.2",
"multer": "^1.4.5-lts.1",
"multer": "^1.4.5-lts.1",
- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.11.1",
+ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.12.0",
"sharp": "^0.33.4"
"sharp": "^0.33.4"
}
}
}
}
@@ -76,6 +76,8 @@ app.use((req, _res, next) => {
@@ -76,6 +76,8 @@ app.use((req, _res, next) => {
});
});
{ const legal = require('openvibe-shared/legal'); app.get(legal.PATHS, legal.handler({ id: 'media', service: 'media', host: 'openvibe.media', name: 'OpenVibe.Media', profile: 'hosting' })); app.get('/tos', (_req, res) => res.redirect(301, '/terms')); }
{ const legal = require('openvibe-shared/legal'); app.get(legal.PATHS, legal.handler({ id: 'media', service: 'media', host: 'openvibe.media', name: 'OpenVibe.Media', profile: 'hosting' })); app.get('/tos', (_req, res) => res.redirect(301, '/terms')); }
// Brand assets: icon set + web app manifest generated by openvibe-shared/scripts/build-app-icons.js
// Brand assets: icon set + web app manifest generated by openvibe-shared/scripts/build-app-icons.js
+// This site's own pinned copy of the OpenVibe Frame's browser files (openvibe-shared/serve).
+app.use('/shared', require('openvibe-shared/serve').handler());
app.use('/assets', express.static(require('path').join(__dirname, 'brand'), { maxAge: '7d' }));
app.use('/assets', express.static(require('path').join(__dirname, 'brand'), { maxAge: '7d' }));
app.get('/manifest.webmanifest', (_req, res) => res.type('application/manifest+json').sendFile(require('path').join(__dirname, 'brand', 'manifest.webmanifest')));
app.get('/manifest.webmanifest', (_req, res) => res.type('application/manifest+json').sendFile(require('path').join(__dirname, 'brand', 'manifest.webmanifest')));
// ── Internal: avatar ingestion (the Network asks; see server/avatars/ingest.js) ──
// ── Internal: avatar ingestion (the Network asks; see server/avatars/ingest.js) ──
@@ -10,6 +10,7 @@
@@ -10,6 +10,7 @@
'use strict';
'use strict';
const config = require('../config');
const config = require('../config');
+const ovServe = require('openvibe-shared/serve');
const NETWORK_URL = (config.network && config.network.url) || 'https://openvibe.network';
const NETWORK_URL = (config.network && config.network.url) || 'https://openvibe.network';
const SITE_NAME = 'OpenVibe.Media';
const SITE_NAME = 'OpenVibe.Media';
@@ -79,7 +80,7 @@ function headTags(seo) {
@@ -79,7 +80,7 @@ function headTags(seo) {
`<meta name="description" content="${description}">`,
`<meta name="description" content="${description}">`,
// Applies the user's theme to <html> synchronously; must run before any CSS paints.
// Applies the user's theme to <html> synchronously; must run before any CSS paints.
require('openvibe-shared/app-icon').headTags({ site: 'media', iconBase: '/assets' }),
require('openvibe-shared/app-icon').headTags({ site: 'media', iconBase: '/assets' }),
- `<script src="${NETWORK_URL}/shared/theme-loader.js" defer></script>`,
+ `<script src="${ovServe.url('theme-loader.js')}" defer></script>`,
seo.canonical ? `<link rel="canonical" href="${esc(seo.canonical)}">` : '',
seo.canonical ? `<link rel="canonical" href="${esc(seo.canonical)}">` : '',
`<meta name="robots" content="${esc(seo.robots || 'index, follow')}">`,
`<meta name="robots" content="${esc(seo.robots || 'index, follow')}">`,
`<meta property="og:site_name" content="${SITE_NAME}">`,
`<meta property="og:site_name" content="${SITE_NAME}">`,
@@ -144,8 +145,8 @@ function frameScripts({ history, footer } = {}) {
@@ -144,8 +145,8 @@ function frameScripts({ history, footer } = {}) {
mount: '#ov-footer',
mount: '#ov-footer',
updates: '/updates', // the footer's "shipped X ago" line and Updates link open this site's log
updates: '/updates', // the footer's "shipped X ago" line and Updates link open this site's log
};
};
- return `<script src="${NETWORK_URL}/shared/navbar.js" defer></script>
-<script src="${NETWORK_URL}/shared/footer.js" defer></script>
+ return `<script src="${ovServe.url('navbar.js')}" defer></script>
+<script src="${ovServe.url('footer.js')}" defer></script>
<script>
<script>
(function () {
(function () {
var tries = 0;
var tries = 0;
@@ -23,6 +23,7 @@
@@ -23,6 +23,7 @@
'use strict';
'use strict';
const express = require('express');
const express = require('express');
+const ovServe = require('openvibe-shared/serve');
const path = require('path');
const path = require('path');
const fs = require('fs');
const fs = require('fs');
const db = require('../db/database');
const db = require('../db/database');
@@ -336,7 +337,7 @@ router.get('/updates', (req, res) => {
@@ -336,7 +337,7 @@ router.get('/updates', (req, res) => {
const frame = require('openvibe-shared/frame');
const frame = require('openvibe-shared/frame');
res.set('Cache-Control', 'public, max-age=60').type('html').send(pf.page({
res.set('Cache-Control', 'public, max-age=60').type('html').send(pf.page({
seo: { title: 'What shipped on OpenVibe.Media', description: 'Every change deployed to OpenVibe.Media, newest first, with the Patch notes that gather them.', canonical: pf.abs('/updates') },
seo: { title: 'What shipped on OpenVibe.Media', description: 'Every change deployed to OpenVibe.Media, newest first, with the Patch notes that gather them.', canonical: pf.abs('/updates') },
- body: frame.updatesBody({ service: 'media', siteName: 'OpenVibe.Media' }) + frame.shippedScript(),
+ body: frame.updatesBody({ service: 'media', siteName: 'OpenVibe.Media' }) + `<script src="${ovServe.url('shipped.js')}" defer></script>`,
footer: { variant: 'full' },
footer: { variant: 'full' },
}));
}));
});
});
@@ -37,9 +37,9 @@ const html = pages.renderWatchPage('vod', vod);
@@ -37,9 +37,9 @@ const html = pages.renderWatchPage('vod', vod);
assert.ok(html.includes('<title>Late night <build> — OpenVibe.Media</title>'));
assert.ok(html.includes('<title>Late night <build> — OpenVibe.Media</title>'));
assert.ok(html.includes('<link rel="canonical" href="https://openvibe.live/vod/42">'), 'Live-owned VOD is canonical on Live');
assert.ok(html.includes('<link rel="canonical" href="https://openvibe.live/vod/42">'), 'Live-owned VOD is canonical on Live');
assert.ok(html.includes('<meta name="robots" content="noindex, follow">'));
assert.ok(html.includes('<meta name="robots" content="noindex, follow">'));
-assert.ok(html.includes('https://openvibe.network/shared/theme-loader.js'));
+assert.ok(/\/shared\/theme-loader\.js\?v=[0-9a-f]{12}/.test(html), 'this site\'s own pinned Frame files');
assert.ok(html.indexOf('theme-loader.js') < html.indexOf('<style>'), 'theme-loader runs before the styles');
assert.ok(html.indexOf('theme-loader.js') < html.indexOf('<style>'), 'theme-loader runs before the styles');
-assert.ok(html.includes('https://openvibe.network/shared/navbar.js') && html.includes('https://openvibe.network/shared/footer.js'));
+assert.ok(/\/shared\/navbar\.js\?v=[0-9a-f]{12}/.test(html) && /\/shared\/footer\.js\?v=[0-9a-f]{12}/.test(html), 'the Frame from this site\'s own pinned copy');
assert.ok(html.includes('"service":"media"') && html.includes('"history":{"type":"vod","title":"Late night <build>"}'.replace('<', '\\u003c')));
assert.ok(html.includes('"service":"media"') && html.includes('"history":{"type":"vod","title":"Late night <build>"}'.replace('<', '\\u003c')));
assert.ok(html.includes('"variant":"compact"'));
assert.ok(html.includes('"variant":"compact"'));
assert.ok(html.includes('<meta property="og:type" content="video.other">'));
assert.ok(html.includes('<meta property="og:type" content="video.other">'));