openvibers/openvibe.network Commits

Route the Node front door to signed-in Machines (#843)

OP OpenVibers committed 1 days ago · aed2154c81 · 2 files, +7 −1

* Route the Node front door to signed-in Machines

* Merge origin/main into signin-node-arrival-1111

* Allow the retired Node host only as a Machines redirect

Changes

ddiff --git a/server/index.js b/server/index.js
iindex 7784acef..06d98d67 100644
---- a/server/index.js
++++ b/server/index.js
@@@ -1156,6 +1156,9 @@ app.get('/apps', connectPage);
app.get('/apps.html', (req, res) => redirectWithoutHtml(req, res, '/apps'));
app.get('/', (req, res, next) => {
if (getRequestHost(req) === 'connect.openvibe.network') return connectPage(req, res);
++ // The Node host has no browser session of its own. Send its front door to the
++ // signed-in Machines hub instead of serving the Network home under another origin.
++ if (getRequestHost(req) === 'node.openvibe.network') return res.redirect(302, 'https://openvibe.link/machines');
return next();
});
app.get('/pay/:id', (_req, res) => sendPayPage(res));
ddiff --git a/test/link-brand.test.js b/test/link-brand.test.js
iindex 18c35526..fe26a903 100644
---- a/test/link-brand.test.js
++++ b/test/link-brand.test.js
@@@ -6,5 +6,8 @@ const root = path.resolve(__dirname, '..');
const oldName = ['OpenVibe[ .-]No' + 'de', 'openvibe-' + 'node', 'no' + 'd_', 'node[.]openvibe[.]network', 'node:lnk_', 'openvibe[.](bot|my|network)/mach' + 'ines', 'platform[.]node-capabilities', 'network[.]node[.@]', 'platform[.]node[.@]'].join('|');
const result = spawnSync('git', ['grep', '-n', '-I', '-i', '-E', oldName, '--', '.', ':!migrations/**', ':!test/link-brand.test.js'], { cwd: root, encoding: 'utf8' });
assert.ok(result.status === 0 || result.status === 1, result.stderr || 'git grep failed');
--assert.equal(result.status, 1, `Old Link brand or principal returned:\n${(result.stdout || '').split('\n').slice(0, 10).join('\n')}`);
++// The retired host is kept only as an arrival redirect to the Machines hub.
++const hits = (result.stdout || '').split('\n').filter(Boolean).filter(line =>
++ !/^server\/index\.js:\d+:\s+if \(getRequestHost\(req\) === 'node\.openvibe\.network'\) return res\.redirect\(302, 'https:\/\/openvibe\.link\/machines'\);$/.test(line));
++assert.deepEqual(hits, [], `Old Link brand or principal returned:\n${hits.slice(0, 10).join('\n')}`);
console.log(' ok old Link brand and principal IDs are absent');