openvibers/openvibe.network Commits

openvibe.link: proxy /machines and /pair to Link's app (#667)

OP OpenVibers committed 5 days ago · 78470fa703 · 2 files, +6 −2

The app already signposts both paths to the signed-in machines hub, but the nginx location for Link's own paths did
not list them, so its catch-all sent them to openvibe.network (where /pair is a 404). Add them to the proxied paths
and check the vhost's line in the Link test.

Changes

ddiff --git a/deploy/nginx/parked-domains.conf b/deploy/nginx/parked-domains.conf
iindex 5422f6ca..de33226f 100644
---- a/deploy/nginx/parked-domains.conf
++++ b/deploy/nginx/parked-domains.conf
@@@ -186,8 +186,8 @@ server {
location ~* ^/(metrics|internal)(/|$) { return 404; }
-- # Link's page, its installer redirect, its Markdown twin and the agent files.
-- location ~ ^/(|install|index\.md|llms\.txt|llms-full\.txt|robots\.txt|sitemap\.xml|\.well-known/agent\.json)$ {
++ # Link's page, its installer redirect, its machines and pairing signposts, its Markdown twin and the agent files.
++ location ~ ^/(|install|machines|pair|index\.md|llms\.txt|llms-full\.txt|robots\.txt|sitemap\.xml|\.well-known/agent\.json)$ {
limit_except GET HEAD { deny all; }
proxy_pass http://127.0.0.1:4000;
proxy_http_version 1.1;
ddiff --git a/test/link-home.test.js b/test/link-home.test.js
iindex 5ebee548..851103a0 100644
---- a/test/link-home.test.js
++++ b/test/link-home.test.js
@@@ -57,6 +57,10 @@ const SHAPED = {
assert.strictEqual(broken.stale, true, 'and it is marked as the last one read');
assert.ok(broken.installUrl.startsWith('https://github.com/OpenVibers/OpenVibe.Node/releases/download/'), 'the installer link still works');
++ // The vhost must send /machines and /pair to the app (which signposts them), not the catch-all to Network.
++ const vhost = fs.readFileSync(path.join(__dirname, '..', 'deploy', 'nginx', 'parked-domains.conf'), 'utf8');
++ assert.ok(/location ~ \^\/\(\|install\|machines\|pair\|/.test(vhost), 'the vhost proxies /machines and /pair to the Link app');
++
// ── The page: OpenVibe Link, and every fact the Node page had ──
const html = page.render({ release: first, releaseId: 'rel_test' });
assert.ok(html.includes('<title>OpenVibe Link: your machines, connected</title>'), 'the title is Link\'s');