openvibers/openvibe.network Commits

Network: route Link add-computer flow (#759)

OP OpenVibers committed 3 days ago · 8bac4750dc · 2 files, +4 −3

Changes

ddiff --git a/deploy/nginx/parked-domains.conf b/deploy/nginx/parked-domains.conf
iindex 14569fe2..8a9dbe11 100644
---- a/deploy/nginx/parked-domains.conf
++++ b/deploy/nginx/parked-domains.conf
@@@ -187,7 +187,7 @@ server {
location ~* ^/(metrics|internal)(/|$) { return 404; }
-- # Link's page, its installer redirect, its machines and pairing signposts, its Markdown twin and the agent files.
++ # Link's page, its installer and add-computer redirects, machines and pairing signposts, Markdown twin and agent files.
location ~ ^/api/v1/me/nodes/(send-keys|send)$ {
# Link Send from the browser: the key list (GET) and one encrypted file (POST, up to 20 MB before base64).
limit_except GET HEAD POST { deny all; }
@@@ -202,7 +202,7 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
add_header Cache-Control "no-store" always;
}
-- location ~ ^/(|install|machines(/.*)?|pair|index\.md|send\.js|egress-settings\.js|locker\.mjs|llms\.txt|llms-full\.txt|robots\.txt|sitemap\.xml|\.well-known/agent\.json)$ {
++ location ~ ^/(|install|add-computer(/complete)?|machines(/.*)?|pair|index\.md|send\.js|egress-settings\.js|locker\.mjs|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 c13e8ff7..faefa5d9 100644
---- a/test/link-home.test.js
++++ b/test/link-home.test.js
@@@ -64,7 +64,8 @@ const SHAPED = {
// 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\|index\\\.md\|send\\\.js\|egress-settings\\\.js\|locker\\\.mjs\|/.test(vhost), 'the vhost passes the page\'s scripts (send.js, egress-settings.js), the machine hub and its old sub-paths, and the Locker bundle to Network');
++ assert.ok(/location ~ \^\/\(\|install\|add-computer\(\/complete\)\?\|machines(?:\(\/\.\*\)\?)?\|pair\|index\\\.md\|send\\\.js\|egress-settings\\\.js\|locker\\\.mjs\|/.test(vhost), 'the vhost passes the add flow, page scripts, machine hub and its old sub-paths, and Locker bundle to Network');
++ assert.ok(vhost.includes('add-computer(/complete)?'), 'the add-computer return flow reaches Link before the openvibe.network catch-all');
const sendApi = vhost.slice(vhost.indexOf('location ~ ^/api/v1/me/nodes/(send-keys|send)$ {'));
assert.ok(sendApi.length < vhost.length && /client_max_body_size 40m;/.test(sendApi.slice(0, sendApi.indexOf('\n }'))), 'the Link Send API has its own location with a body limit that fits a file');
// …and /auth/* to Link's own sign-in (Network#664), or openvibe.link never signs anyone in (11-08 audit).