openvibers/openvibe.mediahub Commits
MediaHub: openvibe.video answers /release.json (the shared release check and the browser watch read it) (#50)
Changes
@@@ -122,6 +122,10 @@ async function createApp(opts = {}) {app.use('/auth/', rateLimit({ windowMs: 15 * 60_000, limit: 60, standardHeaders: true, legacyHeaders: false }));app.use('/auth', sso.routes());++ // /release.json (and loopback /metrics) answer on both hosts: the shared release check on openvibe.video reads its own++ // origin's /release.json, and so does the host's browser watch.++ release.mount(app, { registry: metrics.registry });++// ── Host routing: openvibe.video is OpenVibe.Video; every other host (openvibe.download) stays// the drive. On the video host the drive's pages, API and legal pages never answer.const videoHost = (() => { try { return new URL(config.video.url).hostname; } catch { return null; } })();@@@ -133,7 +137,6 @@ async function createApp(opts = {}) {// ── Machine endpoints ───────────────────────────────────app.get('/api/health', (_req, res) => res.json({ status: 'ok', service: 'openvibe-media-hub', version: VERSION }));-- release.mount(app, { registry: metrics.registry });const readiness = createServiceReadiness({ s, config, release: release.release, valkey });app.get('/api/ready', readiness.handler);@@@ -221,6 +221,13 @@ function countOccurrences(haystack, needle) {live.setChatDown(false);});++ await check('the video host answers /release.json too (the shared release check reads its own origin)', async () => {++ const r = await getVideo('/release.json');++ assert.strictEqual(r.status, 200);++ const j = JSON.parse(r.text);++ assert.ok(j.release && j.service, JSON.stringify(j).slice(0, 200));++ });++await check('the video home shows both latest grids and links the watch pages', async () => {const r = await getVideo('/');assert.strictEqual(r.status, 200);
@@ -122,6 +122,10 @@ async function createApp(opts = {}) {
@@ -122,6 +122,10 @@ async function createApp(opts = {}) {
app.use('/auth/', rateLimit({ windowMs: 15 * 60_000, limit: 60, standardHeaders: true, legacyHeaders: false }));
app.use('/auth/', rateLimit({ windowMs: 15 * 60_000, limit: 60, standardHeaders: true, legacyHeaders: false }));
app.use('/auth', sso.routes());
app.use('/auth', sso.routes());
+ // /release.json (and loopback /metrics) answer on both hosts: the shared release check on openvibe.video reads its own
+ // origin's /release.json, and so does the host's browser watch.
+ release.mount(app, { registry: metrics.registry });
+
// ── Host routing: openvibe.video is OpenVibe.Video; every other host (openvibe.download) stays
// ── Host routing: openvibe.video is OpenVibe.Video; every other host (openvibe.download) stays
// the drive. On the video host the drive's pages, API and legal pages never answer.
// the drive. On the video host the drive's pages, API and legal pages never answer.
const videoHost = (() => { try { return new URL(config.video.url).hostname; } catch { return null; } })();
const videoHost = (() => { try { return new URL(config.video.url).hostname; } catch { return null; } })();
@@ -133,7 +137,6 @@ async function createApp(opts = {}) {
@@ -133,7 +137,6 @@ async function createApp(opts = {}) {
// ── Machine endpoints ───────────────────────────────────
// ── Machine endpoints ───────────────────────────────────
app.get('/api/health', (_req, res) => res.json({ status: 'ok', service: 'openvibe-media-hub', version: VERSION }));
app.get('/api/health', (_req, res) => res.json({ status: 'ok', service: 'openvibe-media-hub', version: VERSION }));
- release.mount(app, { registry: metrics.registry });
const readiness = createServiceReadiness({ s, config, release: release.release, valkey });
const readiness = createServiceReadiness({ s, config, release: release.release, valkey });
app.get('/api/ready', readiness.handler);
app.get('/api/ready', readiness.handler);
@@ -221,6 +221,13 @@ function countOccurrences(haystack, needle) {
@@ -221,6 +221,13 @@ function countOccurrences(haystack, needle) {
live.setChatDown(false);
live.setChatDown(false);
});
});
+ await check('the video host answers /release.json too (the shared release check reads its own origin)', async () => {
+ const r = await getVideo('/release.json');
+ assert.strictEqual(r.status, 200);
+ const j = JSON.parse(r.text);
+ assert.ok(j.release && j.service, JSON.stringify(j).slice(0, 200));
+ });
+
await check('the video home shows both latest grids and links the watch pages', async () => {
await check('the video home shows both latest grids and links the watch pages', async () => {
const r = await getVideo('/');
const r = await getVideo('/');
assert.strictEqual(r.status, 200);
assert.strictEqual(r.status, 200);