fix(registry/modules/goose): default subdomain to false (#420)

Relates to https://github.com/coder/coder/issues/18779

See also https://github.com/coder/registry/pull/419

By default, we set subdomain = true. Most folks testing this out don't
have a wildcard subdomain setup. This switches to path-based behaviour
by default and adds a note to the troubleshooting section.
This commit is contained in:
Cian Johnston 2025-09-15 09:00:07 +01:00 committed by GitHub
parent 2937286712
commit 213aabb3b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 39 additions and 17 deletions

View File

@ -13,7 +13,7 @@ Run the [Goose](https://block.github.io/goose/) agent in your workspace to gener
```tf
module "goose" {
source = "registry.coder.com/coder/goose/coder"
version = "2.1.1"
version = "2.1.2"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_goose = true
@ -79,7 +79,7 @@ resource "coder_agent" "main" {
module "goose" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/goose/coder"
version = "2.1.1"
version = "2.1.2"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_goose = true
@ -123,4 +123,6 @@ Note: The indentation in the heredoc is preserved, so you can write the YAML nat
## Troubleshooting
By default, this module is configured to run the embedded chat interface as a path-based application. In production, we recommend that you configure a [wildcard access URL](https://coder.com/docs/admin/setup#wildcard-access-url) and set `subdomain = true`. See [here](https://coder.com/docs/tutorials/best-practices/security-best-practices#disable-path-based-apps) for more details.
The module will create log files in the workspace's `~/.goose-module` directory. If you run into any issues, look at them for more information.

View File

@ -2,6 +2,7 @@ import {
test,
afterEach,
describe,
it,
setDefaultTimeout,
beforeAll,
expect,
@ -253,22 +254,41 @@ describe("goose", async () => {
expect(prompt.stderr).toContain("No such file or directory");
});
test("subdomain-false", async () => {
const { id } = await setup({
agentapiMockScript: await loadTestFile(
import.meta.dir,
"agentapi-mock-print-args.js",
),
moduleVariables: {
subdomain: "false",
},
describe("subdomain", async () => {
it("sets AGENTAPI_CHAT_BASE_PATH when false", async () => {
const { id } = await setup({
agentapiMockScript: await loadTestFile(
import.meta.dir,
"agentapi-mock-print-args.js",
),
moduleVariables: {
subdomain: "false",
},
});
await execModuleScript(id);
const agentapiMockOutput = await readFileContainer(id, agentapiStartLog);
expect(agentapiMockOutput).toContain(
"AGENTAPI_CHAT_BASE_PATH=/@default/default.foo/apps/goose/chat",
);
});
await execModuleScript(id);
it("does not set AGENTAPI_CHAT_BASE_PATH when true", async () => {
const { id } = await setup({
agentapiMockScript: await loadTestFile(
import.meta.dir,
"agentapi-mock-print-args.js",
),
moduleVariables: {
subdomain: "true",
},
});
const agentapiMockOutput = await readFileContainer(id, agentapiStartLog);
expect(agentapiMockOutput).toContain(
"AGENTAPI_CHAT_BASE_PATH=/@default/default.foo/apps/goose/chat",
);
await execModuleScript(id);
const agentapiMockOutput = await readFileContainer(id, agentapiStartLog);
expect(agentapiMockOutput).toMatch(/AGENTAPI_CHAT_BASE_PATH=$/m);
});
});
});

View File

@ -69,7 +69,7 @@ variable "agentapi_version" {
variable "subdomain" {
type = bool
description = "Whether to use a subdomain for AgentAPI."
default = true
default = false
}
variable "goose_provider" {