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

OP OpenVibers committed 24 Sept 2026 · 3c3ddf5140 · 6 files, +15 −11


Changes

ddiff --git a/package-lock.json b/package-lock.json
iindex 1416444..7ff0348 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -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"
ddiff --git a/package.json b/package.json
iindex 0ac9ef8..475a07a 100644
---- a/package.json
++++ b/package.json
@@@ -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"
}
}
ddiff --git a/server/index.js b/server/index.js
iindex fde849a..6d8cf19 100644
---- a/server/index.js
++++ b/server/index.js
@@@ -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) ──
ddiff --git a/server/public/page-frame.js b/server/public/page-frame.js
iindex a3c790c..f46d266 100644
---- a/server/public/page-frame.js
++++ b/server/public/page-frame.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;
ddiff --git a/server/public/routes.js b/server/public/routes.js
iindex 67bdbf4..d059e09 100644
---- a/server/public/routes.js
++++ b/server/public/routes.js
@@@ -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' },
}));
});
ddiff --git a/test/public-pages.test.js b/test/public-pages.test.js
iindex 69886b9..2ad038f 100644
---- a/test/public-pages.test.js
++++ b/test/public-pages.test.js
@@@ -37,9 +37,9 @@ const html = pages.renderWatchPage('vod', vod);
assert.ok(html.includes('<title>Late night &lt;build&gt; — 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">'));