Skip to content

Commit 05ff1d0

Browse files
Merge branch 'main' into sourcegraph-amp-module
2 parents 668d7f8 + 507b73a commit 05ff1d0

File tree

18 files changed

+481
-9
lines changed

18 files changed

+481
-9
lines changed

.github/workflows/deploy-registry.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
paths:
1515
- ".github/workflows/deploy-registry.yaml"
1616
- "registry/**/templates/**"
17+
- "registry/**/README.md"
1718
- ".icons/**"
1819

1920
jobs:

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Create `registry/[your-username]/README.md`:
8989
---
9090
display_name: "Your Name"
9191
bio: "Brief description of who you are and what you do"
92-
avatar_url: "./.images/avatar.png"
92+
avatar: "./.images/avatar.png"
9393
github: "your-username"
9494
linkedin: "https://www.linkedin.com/in/your-username" # Optional
9595
website: "https://yourwebsite.com" # Optional
@@ -102,7 +102,7 @@ status: "community"
102102
Brief description of who you are and what you do.
103103
```
104104

105-
> **Note**: The `avatar_url` must point to `./.images/avatar.png` or `./.images/avatar.svg`.
105+
> **Note**: The `avatar` must point to `./.images/avatar.png` or `./.images/avatar.svg`.
106106
107107
### 2. Generate Module Files
108108

MAINTAINER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ tags: ["tag1", "tag2"]
127127
```yaml
128128
display_name: "Your Name"
129129
bio: "Brief description of who you are and what you do"
130-
avatar_url: "./.images/avatar.png"
130+
avatar: "./.images/avatar.png"
131131
github: "username"
132132
linkedin: "https://www.linkedin.com/in/username" # Optional
133133
website: "https://yourwebsite.com" # Optional

registry/anomaly/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
display_name: "Jay Kumar"
33
bio: "I'm a Software Engineer :)"
4-
avatar_url: "./.images/avatar.png"
4+
avatar: "./.images/avatar.jpeg"
55
github: "35C4n0r"
66
linkedin: "https://www.linkedin.com/in/jaykum4r"
77
support_email: "[email protected]"

registry/coder/modules/agentapi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The AgentAPI module is a building block for modules that need to run an AgentAPI
1616
```tf
1717
module "agentapi" {
1818
source = "registry.coder.com/coder/agentapi/coder"
19-
version = "1.1.0"
19+
version = "1.1.1"
2020
2121
agent_id = var.agent_id
2222
web_app_slug = local.app_slug

registry/coder/modules/agentapi/main.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,17 @@ describe("agentapi", async () => {
236236
}
237237
}
238238
});
239+
240+
test("agentapi-allowed-hosts", async () => {
241+
// verify that the agentapi binary has access to the AGENTAPI_ALLOWED_HOSTS environment variable
242+
// set in main.sh
243+
const { id } = await setup();
244+
await execModuleScript(id);
245+
await expectAgentAPIStarted(id);
246+
const agentApiStartLog = await readFileContainer(
247+
id,
248+
"/home/coder/agentapi-mock.log",
249+
);
250+
expect(agentApiStartLog).toContain("AGENTAPI_ALLOWED_HOSTS: *");
251+
});
239252
});

registry/coder/modules/agentapi/scripts/main.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,7 @@ export LC_ALL=en_US.UTF-8
9595
cd "${WORKDIR}"
9696

9797
export AGENTAPI_CHAT_BASE_PATH="${AGENTAPI_CHAT_BASE_PATH:-}"
98+
# Disable host header check since AgentAPI is proxied by Coder (which does its own validation)
99+
export AGENTAPI_ALLOWED_HOSTS="*"
98100
nohup "$module_path/scripts/agentapi-start.sh" true "${AGENTAPI_PORT}" &>"$module_path/agentapi-start.log" &
99101
"$module_path/scripts/agentapi-wait-for-start.sh" "${AGENTAPI_PORT}"

registry/coder/modules/agentapi/testdata/agentapi-mock.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/usr/bin/env node
22

33
const http = require("http");
4+
const fs = require("fs");
45
const args = process.argv.slice(2);
56
const portIdx = args.findIndex((arg) => arg === "--port") + 1;
67
const port = portIdx ? args[portIdx] : 3284;
78

89
console.log(`starting server on port ${port}`);
10+
fs.writeFileSync("/home/coder/agentapi-mock.log", `AGENTAPI_ALLOWED_HOSTS: ${process.env.AGENTAPI_ALLOWED_HOSTS}`);
911

1012
http
1113
.createServer(function (_request, response) {

registry/coder/modules/claude-code/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude
1313
```tf
1414
module "claude-code" {
1515
source = "registry.coder.com/coder/claude-code/coder"
16-
version = "2.0.6"
16+
version = "2.0.7"
1717
agent_id = coder_agent.example.id
1818
folder = "/home/coder"
1919
install_claude_code = true
@@ -84,7 +84,7 @@ resource "coder_agent" "main" {
8484
module "claude-code" {
8585
count = data.coder_workspace.me.start_count
8686
source = "registry.coder.com/coder/claude-code/coder"
87-
version = "2.0.6"
87+
version = "2.0.7"
8888
agent_id = coder_agent.example.id
8989
folder = "/home/coder"
9090
install_claude_code = true
@@ -102,7 +102,7 @@ Run Claude Code as a standalone app in your workspace. This will install Claude
102102
```tf
103103
module "claude-code" {
104104
source = "registry.coder.com/coder/claude-code/coder"
105-
version = "2.0.6"
105+
version = "2.0.7"
106106
agent_id = coder_agent.example.id
107107
folder = "/home/coder"
108108
install_claude_code = true

registry/coder/modules/claude-code/main.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import path from "path";
1010
import {
1111
execContainer,
1212
findResourceInstance,
13+
readFileContainer,
1314
removeContainer,
1415
runContainer,
1516
runTerraformApply,
@@ -319,4 +320,21 @@ describe("claude-code", async () => {
319320
agentApiUrl: "http://localhost:3284",
320321
});
321322
});
323+
324+
// verify that the agentapi binary has access to the AGENTAPI_ALLOWED_HOSTS environment variable
325+
// set in main.tf
326+
test("agentapi-allowed-hosts", async () => {
327+
const { id } = await setup();
328+
329+
const respModuleScript = await execModuleScript(id);
330+
expect(respModuleScript.exitCode).toBe(0);
331+
332+
await expectAgentAPIStarted(id);
333+
334+
const agentApiStartLog = await readFileContainer(
335+
id,
336+
"/home/coder/agentapi-mock.log",
337+
);
338+
expect(agentApiStartLog).toContain("AGENTAPI_ALLOWED_HOSTS: *");
339+
});
322340
});

0 commit comments

Comments
 (0)