Skip to content

Open-source AI coworkers that each get a computer of their own: a browser, files and tools, with every action decided before it happens and recorded after. Bring any AG-UI agent.

fix(config): reject hostless addresses in single-user mode (#795)

Tu Zengjie8bb27368ff4
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5b01d91d..23e5bc23 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -82,6 +82,12 @@ thing itself — a card naming the app, with a Connect button.
access that was withdrawn. An app shared across the deployment still says to ask an administrator,
since the person reading cannot connect it.
+### No-sign-in startup rejects addresses without a host
+
+With `OPENBOT_SINGLE_USER=true`, an address such as `example.com:3010` in `OPENBOT_PUBLIC_URL`,
+`OPENBOT_APP_URL` or `TRUSTED_ORIGINS` now refuses startup. It previously counted as a private
+network address and only warned, even though the missing URL scheme left its host unidentified.
+
### A reply's tool calls fold into one line
A Bot that searched, read two pages and checked Drive before answering drew four lines above its
diff --git a/server/src/config.ts b/server/src/config.ts
index 33710005..51e29edc 100644
--- a/server/src/config.ts
+++ b/server/src/config.ts
@@ -560,6 +560,7 @@ function reachOf(raw: string): Reach {
return "public";
}
bare = bare.replace(/^\[|\]$/g, "").replace(/\.+$/, "");
+ if (!bare) return "public";
if (
bare === "localhost" ||
diff --git a/server/tests/config.test.ts b/server/tests/config.test.ts
index 7e5b1ddb..4651f867 100644
--- a/server/tests/config.test.ts
+++ b/server/tests/config.test.ts
@@ -530,6 +530,15 @@ describe("deployment configuration", () => {
{ TRUSTED_ORIGINS: "http://localhost:3010,https://openbot.example.com" },
],
["an address that is not a URL at all", { OPENBOT_PUBLIC_URL: "openbot" }],
+ [
+ "a public URL missing its scheme",
+ { OPENBOT_PUBLIC_URL: "example.com:3010" },
+ ],
+ ["an app URL missing its scheme", { OPENBOT_APP_URL: "example.com:3010" }],
+ [
+ "a trusted origin missing its scheme",
+ { TRUSTED_ORIGINS: "http://localhost:3010,example.com:3010" },
+ ],
])("refuses no sign-in combined with %s", (_label, published) => {
expect(() =>
loadConfig({ ...withoutSignIn, ...OPEN, ...published }),