additional urls and agentapi required urls

This commit is contained in:
Benjamin 2025-10-06 14:36:30 -05:00
parent 00337b3bdf
commit 4a1bf33b28
2 changed files with 17 additions and 1 deletions

View File

@ -210,6 +210,12 @@ variable "boundary_unprivileged" {
default = true default = true
} }
variable "boundary_additional_allowed_urls" {
type = list(string)
description = "Additional URLs to allow through boundary (in addition to default allowed URLs)"
default = []
}
resource "coder_env" "claude_code_md_path" { resource "coder_env" "claude_code_md_path" {
count = var.claude_md_path == "" ? 0 : 1 count = var.claude_md_path == "" ? 0 : 1
@ -293,6 +299,7 @@ module "agentapi" {
ARG_ENABLE_BOUNDARY='${var.enable_boundary}' \ ARG_ENABLE_BOUNDARY='${var.enable_boundary}' \
ARG_BOUNDARY_LOG_DIR='${var.boundary_log_dir}' \ ARG_BOUNDARY_LOG_DIR='${var.boundary_log_dir}' \
ARG_BOUNDARY_UNPRIVILEGED='${var.boundary_unprivileged}' \ ARG_BOUNDARY_UNPRIVILEGED='${var.boundary_unprivileged}' \
ARG_BOUNDARY_ADDITIONAL_ALLOWED_URLS='${join(" ", var.boundary_additional_allowed_urls)}' \
ARG_CODER_HOST='${local.coder_host}' \ ARG_CODER_HOST='${local.coder_host}' \
/tmp/start.sh /tmp/start.sh
EOT EOT

View File

@ -92,7 +92,16 @@ function start_agentapi() {
if [ "${ARG_BOUNDARY_UNPRIVILEGED:-true}" = "true" ]; then if [ "${ARG_BOUNDARY_UNPRIVILEGED:-true}" = "true" ]; then
BOUNDARY_ARGS+=(--unprivileged) BOUNDARY_ARGS+=(--unprivileged)
fi fi
BOUNDARY_ARGS+=(--allow "*.anthropic.com" --allow "$ARG_CODER_HOST") # Add default allowed URLs
BOUNDARY_ARGS+=(--allow "*.anthropic.com" --allow "registry.npmjs.org" --allow "*.sentry.io" --allow "claude.ai" --allow "$ARG_CODER_HOST")
# Add any additional allowed URLs from the variable
if [ -n "$ARG_BOUNDARY_ADDITIONAL_ALLOWED_URLS" ]; then
IFS=' ' read -ra ADDITIONAL_URLS <<< "$ARG_BOUNDARY_ADDITIONAL_ALLOWED_URLS"
for url in "${ADDITIONAL_URLS[@]}"; do
BOUNDARY_ARGS+=(--allow "$url")
done
fi
agentapi server --type claude --term-width 67 --term-height 1190 -- \ agentapi server --type claude --term-width 67 --term-height 1190 -- \
coder boundary "${BOUNDARY_ARGS[@]}" -- \ coder boundary "${BOUNDARY_ARGS[@]}" -- \