From 6ff21f54e4bce1556c11d89731c739e8569a0b5e Mon Sep 17 00:00:00 2001 From: Claude Agent Date: Tue, 6 Oct 2026 07:43:23 +0000 Subject: [PATCH] node-facts: verbatim operator-verified files (fixture env without dotfile) --- node-facts-test/fixtures/env | 2 ++ node-facts.sh | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 node-facts-test/fixtures/env diff --git a/node-facts-test/fixtures/env b/node-facts-test/fixtures/env new file mode 100644 index 00000000..989ee43b --- /dev/null +++ b/node-facts-test/fixtures/env @@ -0,0 +1,2 @@ +COMPOSE_FILE=base.yml:rpc.yml:avalanche/go/avalanche-mainnet-go-pruned-leveldb.yml:op/reth/op-mainnet-op-reth-pruned-trace--kona.yml:ethereum/geth/ethereum-mainnet-geth-pruned-pebble-path--nimbus.yml +DOMAIN=fixture.local diff --git a/node-facts.sh b/node-facts.sh index 56f6fda0..5b989631 100755 --- a/node-facts.sh +++ b/node-facts.sh @@ -11,6 +11,7 @@ Exit 0 always once .env is readable; exit 2 if .env/COMPOSE_FILE is missing (one import concurrent.futures as cf, datetime, json, os, re, socket, subprocess, sys, time, urllib.request, ssl BASE = os.path.dirname(os.path.abspath(__file__)) +FIXTURES = os.environ.get("NODE_FACTS_FIXTURES") # test mode: answer HTTP from /.json, env from /env, no network INFRA = {"base", "rpc", "monitoring", "backup-http", "drpc", "drpc-free", "squidfura", "squidfura-backend", "oracle", "extra"} NOW = lambda: datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ") SEMVER = re.compile(r"(\d+)\.(\d+)\.(\d+)") @@ -20,7 +21,8 @@ CTX = ssl.create_default_context() def env(): e = {} try: - for line in open(os.path.join(BASE, ".env")): + envfile = os.path.join(FIXTURES, "env") if FIXTURES else os.path.join(BASE, ".env") # fixture mode: no dotfile needed + for line in open(envfile): line = line.strip() if line and not line.startswith("#") and "=" in line: k, v = line.split("=", 1); e[k] = v.strip().strip('"').strip("'") @@ -29,7 +31,6 @@ def env(): return e -FIXTURES = os.environ.get("NODE_FACTS_FIXTURES") # test mode: answer HTTP from /.json, no network def _fixture(url, body):