openvibers/openvibe.network Commits
openvibe.link: the vhost sends /auth/ to Link's own sign-in (#669)
Changes
@@@ -197,6 +197,20 @@ server {proxy_set_header CF-Connecting-IP $remote_addr;proxy_set_header X-Forwarded-Proto $scheme;}++ # Link's own sign-in (Network#664: the link-web OAuth client; a host-only session on openvibe.link): login,++ # the callback, the session read, refresh and the sign-out form. Without it the catch-all sent /auth/* to++ # openvibe.network, so openvibe.link never signed anyone in (11-08 audit).++ location ^~ /auth/ {++ limit_except GET HEAD POST { deny all; }++ proxy_pass http://127.0.0.1:4000;++ proxy_http_version 1.1;++ proxy_set_header Host $host;++ proxy_set_header X-Real-IP $remote_addr;++ proxy_set_header X-Forwarded-For $remote_addr;++ proxy_set_header CF-Connecting-IP $remote_addr;++ proxy_set_header X-Forwarded-Proto $scheme;++ add_header Cache-Control "no-store" always;++ }# The IndexNow key file (openvibe-shared/indexnow): /<key>.txt, served by Network when INDEXNOW_KEY is set.location ~ "^/[A-Za-z0-9]{8,128}\.txt$" {limit_except GET HEAD { deny all; }@@@ -60,6 +60,9 @@ 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\|/.test(vhost), 'the vhost proxies /machines and /pair to the Link app');++ // …and /auth/* to Link's own sign-in (Network#664), or openvibe.link never signs anyone in (11-08 audit).++ const linkBlock = vhost.slice(vhost.indexOf(' server_name openvibe.link;'));++ assert.ok(/location \^~ \/auth\/ \{[\s\S]*?proxy_pass http:\/\/127\.0\.0\.1:4000;/.test(linkBlock.slice(0, linkBlock.indexOf('\n}\n'))), 'the openvibe.link vhost proxies /auth/ to Network');// ── The page: OpenVibe Link, and every fact the Node page had ──const html = page.render({ release: first, releaseId: 'rel_test' });
@@ -197,6 +197,20 @@ server {
@@ -197,6 +197,20 @@ server {
proxy_set_header CF-Connecting-IP $remote_addr;
proxy_set_header CF-Connecting-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
+ # Link's own sign-in (Network#664: the link-web OAuth client; a host-only session on openvibe.link): login,
+ # the callback, the session read, refresh and the sign-out form. Without it the catch-all sent /auth/* to
+ # openvibe.network, so openvibe.link never signed anyone in (11-08 audit).
+ location ^~ /auth/ {
+ limit_except GET HEAD POST { deny all; }
+ proxy_pass http://127.0.0.1:4000;
+ proxy_http_version 1.1;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header CF-Connecting-IP $remote_addr;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ add_header Cache-Control "no-store" always;
+ }
# The IndexNow key file (openvibe-shared/indexnow): /<key>.txt, served by Network when INDEXNOW_KEY is set.
# The IndexNow key file (openvibe-shared/indexnow): /<key>.txt, served by Network when INDEXNOW_KEY is set.
location ~ "^/[A-Za-z0-9]{8,128}\.txt$" {
location ~ "^/[A-Za-z0-9]{8,128}\.txt$" {
limit_except GET HEAD { deny all; }
limit_except GET HEAD { deny all; }
@@ -60,6 +60,9 @@ const SHAPED = {
@@ -60,6 +60,9 @@ const SHAPED = {
// The vhost must send /machines and /pair to the app (which signposts them), not the catch-all to Network.
// 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');
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');
assert.ok(/location ~ \^\/\(\|install\|machines\|pair\|/.test(vhost), 'the vhost proxies /machines and /pair to the Link app');
+ // …and /auth/* to Link's own sign-in (Network#664), or openvibe.link never signs anyone in (11-08 audit).
+ const linkBlock = vhost.slice(vhost.indexOf(' server_name openvibe.link;'));
+ assert.ok(/location \^~ \/auth\/ \{[\s\S]*?proxy_pass http:\/\/127\.0\.0\.1:4000;/.test(linkBlock.slice(0, linkBlock.indexOf('\n}\n'))), 'the openvibe.link vhost proxies /auth/ to Network');
// ── The page: OpenVibe Link, and every fact the Node page had ──
// ── The page: OpenVibe Link, and every fact the Node page had ──
const html = page.render({ release: first, releaseId: 'rel_test' });
const html = page.render({ release: first, releaseId: 'rel_test' });