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:
parent
2937286712
commit
213aabb3b0
@ -13,7 +13,7 @@ Run the [Goose](https://block.github.io/goose/) agent in your workspace to gener
|
|||||||
```tf
|
```tf
|
||||||
module "goose" {
|
module "goose" {
|
||||||
source = "registry.coder.com/coder/goose/coder"
|
source = "registry.coder.com/coder/goose/coder"
|
||||||
version = "2.1.1"
|
version = "2.1.2"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
folder = "/home/coder"
|
folder = "/home/coder"
|
||||||
install_goose = true
|
install_goose = true
|
||||||
@ -79,7 +79,7 @@ resource "coder_agent" "main" {
|
|||||||
module "goose" {
|
module "goose" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/goose/coder"
|
source = "registry.coder.com/coder/goose/coder"
|
||||||
version = "2.1.1"
|
version = "2.1.2"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
folder = "/home/coder"
|
folder = "/home/coder"
|
||||||
install_goose = true
|
install_goose = true
|
||||||
@ -123,4 +123,6 @@ Note: The indentation in the heredoc is preserved, so you can write the YAML nat
|
|||||||
|
|
||||||
## Troubleshooting
|
## 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.
|
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.
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import {
|
|||||||
test,
|
test,
|
||||||
afterEach,
|
afterEach,
|
||||||
describe,
|
describe,
|
||||||
|
it,
|
||||||
setDefaultTimeout,
|
setDefaultTimeout,
|
||||||
beforeAll,
|
beforeAll,
|
||||||
expect,
|
expect,
|
||||||
@ -253,7 +254,8 @@ describe("goose", async () => {
|
|||||||
expect(prompt.stderr).toContain("No such file or directory");
|
expect(prompt.stderr).toContain("No such file or directory");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("subdomain-false", async () => {
|
describe("subdomain", async () => {
|
||||||
|
it("sets AGENTAPI_CHAT_BASE_PATH when false", async () => {
|
||||||
const { id } = await setup({
|
const { id } = await setup({
|
||||||
agentapiMockScript: await loadTestFile(
|
agentapiMockScript: await loadTestFile(
|
||||||
import.meta.dir,
|
import.meta.dir,
|
||||||
@ -271,4 +273,22 @@ describe("goose", async () => {
|
|||||||
"AGENTAPI_CHAT_BASE_PATH=/@default/default.foo/apps/goose/chat",
|
"AGENTAPI_CHAT_BASE_PATH=/@default/default.foo/apps/goose/chat",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
await execModuleScript(id);
|
||||||
|
|
||||||
|
const agentapiMockOutput = await readFileContainer(id, agentapiStartLog);
|
||||||
|
expect(agentapiMockOutput).toMatch(/AGENTAPI_CHAT_BASE_PATH=$/m);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -69,7 +69,7 @@ variable "agentapi_version" {
|
|||||||
variable "subdomain" {
|
variable "subdomain" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Whether to use a subdomain for AgentAPI."
|
description = "Whether to use a subdomain for AgentAPI."
|
||||||
default = true
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "goose_provider" {
|
variable "goose_provider" {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user