openvibers/openvibe.network Commits
Route the Node front door to signed-in Machines (#843)
Changes
@@@ -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));@@@ -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');
@@ -1156,6 +1156,9 @@ app.get('/apps', connectPage);
@@ -1156,6 +1156,9 @@ app.get('/apps', connectPage);
app.get('/apps.html', (req, res) => redirectWithoutHtml(req, res, '/apps'));
app.get('/apps.html', (req, res) => redirectWithoutHtml(req, res, '/apps'));
app.get('/', (req, res, next) => {
app.get('/', (req, res, next) => {
if (getRequestHost(req) === 'connect.openvibe.network') return connectPage(req, res);
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();
return next();
});
});
app.get('/pay/:id', (_req, res) => sendPayPage(res));
app.get('/pay/:id', (_req, res) => sendPayPage(res));
@@ -6,5 +6,8 @@ const root = path.resolve(__dirname, '..');
@@ -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 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' });
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.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');
console.log(' ok old Link brand and principal IDs are absent');