mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 20:26:33 +00:00
When a node serves a role on several networks, the runner picks one of the role's vhosts at random and keeps that pick for the flake retry. The .env is rendered for the picked vhost, so APP_BASE_URL follows its network, and CANONICAL_DOMAIN moves to its sibling there. Reports of a pick outside the canonical network land under <application_id>+<network>. network-leak.spec.js is staged next to every role spec and skipped unless the role is served on more than one network. It fails when a request leaves the network of the document that issued it, or when the browser blocks mixed content. Only the SSO issuer may cross networks, so an onion pick reaches it past the Tor proxy. Onion detection reads the host of APP_BASE_URL before CANONICAL_DOMAIN, so roles without CANONICAL_DOMAIN also get the onion timeouts and Tor retries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
21 lines
618 B
JavaScript
21 lines
618 B
JavaScript
const fs = require("node:fs");
|
|
const path = require("node:path");
|
|
|
|
const PROJECT_ROOT = path.resolve(__dirname, "../../../..");
|
|
const KEY = "INFINITO_DOMAIN=";
|
|
|
|
/**
|
|
* Returns:
|
|
* The INFINITO_DOMAIN value declared in default.env.
|
|
*/
|
|
function defaultDomainPrimary() {
|
|
const line = fs
|
|
.readFileSync(path.join(PROJECT_ROOT, "default.env"), "utf8")
|
|
.split("\n")
|
|
.find((entry) => entry.startsWith(KEY));
|
|
if (!line) throw new Error(`default.env declares no ${KEY.slice(0, -1)}`);
|
|
return line.slice(KEY.length).trim().replace(/^["']|["']$/g, "");
|
|
}
|
|
|
|
module.exports = { DOMAIN: defaultDomainPrimary() };
|