Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/isolated/bot-social.compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
PORT: "8787"
DATA_DIR: /data
PUBLIC_BASE_URL: ${FLYBOT_WORKSPACE_BOT_SOCIAL_PUBLIC_URL:?Set the FlyBot Workspace public /social URL}
TRUST_PROXY: ${FLYBOT_WORKSPACE_BOT_SOCIAL_TRUST_PROXY:-172.16.0.0/12,10.0.0.0/8,192.168.0.0/16,loopback}
TRUST_PROXY: ${FLYBOT_WORKSPACE_BOT_SOCIAL_TRUST_PROXY:-172.16.0.0/12,10.0.0.0/8,192.168.0.0/16}
volumes:
- bot-social-data:/data
ports:
Expand Down
6 changes: 0 additions & 6 deletions docs/upstream/bot-social-files.json
Original file line number Diff line number Diff line change
Expand Up @@ -1961,12 +1961,6 @@
"mode": "100644",
"bytes": 6881
},
"test/trust_proxy.test.ts": {
"sha256": "b578fa4f1f1e3bc7d7d295b0e638b64d79e0bc22912571a150d22803293539c4",
"git_blob_sha": "eb45874953fd4ffd3eddbdab7bd5ebcfdc5e265c",
"mode": "100644",
"bytes": 6229
},
"test/relationship_request_expiry.test.ts": {
"sha256": "9ba880c302665d30d2fb0b3e3c5f22cd4a51e62fdefd81b3e82e587ba09747d0",
"git_blob_sha": "42626a067df17c4bba43e12c01bccfc8bd194956",
Expand Down
12 changes: 11 additions & 1 deletion docs/upstream/migration-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@
"scripts/install.sh",
"scripts/mcp-smoke.ts"
],
"file_count": 436
"file_count": 435
}
},
"not_imported": {
Expand Down Expand Up @@ -2268,6 +2268,16 @@
"bytes": 3982,
"reason": "Derived the rate-limit notice lower bound from the burst's own duration so the tests stop failing when the suite loads the machine; the rendered sentence and product code are untouched.",
"license_notice": "Apache-2.0 (FlyBot) or MIT (Bot Social) file modified in this snapshot; see ORIGIN.md."
},
"services/bot-social/services/bot-social/test/trust_proxy.test.ts": {
"destination": "services/bot-social",
"path": "test/trust_proxy.test.ts",
"original_sha256": "b578fa4f1f1e3bc7d7d295b0e638b64d79e0bc22912571a150d22803293539c4",
"original_git_blob_sha": "eb45874953fd4ffd3eddbdab7bd5ebcfdc5e265c",
"new_sha256": "b642429ce93673b08e3fdea3702b345f1f899a875cc65bbc35f0cdfee74db2a0",
"bytes": 6992,
"reason": "Added a test that reads the isolated overlay's TRUST_PROXY default and asserts loadTrustProxy accepts it; the snapshot checked the YAML and the parser separately, so the two were never joined.",
"license_notice": "Apache-2.0 (FlyBot) or MIT (Bot Social) file modified in this snapshot; see ORIGIN.md."
}
},
"core_fork_removed": {
Expand Down
15 changes: 15 additions & 0 deletions services/bot-social/test/trust_proxy.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { test } from "node:test";
import { Platform } from "../src/platform.js";
import { buildServer } from "../src/server.js";
Expand Down Expand Up @@ -134,3 +137,15 @@ test("a configured proxy cidr is believed, and only it", async (t) => {
const B = await ownerWithBot(s.app, "sven");
assert.equal(await addressOfCreate(s.app, B, "656565", { remoteAddress: "203.0.113.9", xff: "198.51.100.8" }), "203.0.113.9");
});

test("the isolated Bot Social overlay's TRUST_PROXY default is one the service accepts", () => {
const here = dirname(fileURLToPath(import.meta.url));
const overlay = readFileSync(resolve(here, "../../../deploy/isolated/bot-social.compose.yml"), "utf8");
const line = overlay.split("\n").find((text) => text.includes("TRUST_PROXY:"));
assert.ok(line, "the overlay sets TRUST_PROXY");
const match = /TRUST_PROXY:.*:-([^}]*)\}/.exec(line);
assert.ok(match, "the overlay gives TRUST_PROXY a default");
const parsed = loadTrustProxy(match[1]);
assert.equal(parsed.kind, "cidrs");
assert.ok(parsed.peers.length > 0);
});
Loading