Skip to content
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ Newest first. `Unreleased` is what is on `main` and not yet tagged.
`code_required` (below). A server and a computer must be upgraded together: an older computer has
no `/sign-in/code`.

### 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.

### The Bot's screen opens only when there is something to watch

Asking a Bot a question it answered in words could still open its computer beside the conversation,
Expand Down
1 change: 1 addition & 0 deletions server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ function reachOf(raw: string): Reach {
return "public";
}
bare = bare.replace(/^\[|\]$/g, "").replace(/\.+$/, "");
if (!bare) return "public";

if (
bare === "localhost" ||
Expand Down
9 changes: 9 additions & 0 deletions server/tests/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
Expand Down