wip
This commit is contained in:
parent
f3bfa9cc8d
commit
0d03fa4e58
@ -255,7 +255,7 @@ variable "compile_boundary_from_source" {
|
|||||||
variable "cli_command" {
|
variable "cli_command" {
|
||||||
type = string
|
type = string
|
||||||
description = "The command to run for the Claude Code CLI app when tasks are disabled."
|
description = "The command to run for the Claude Code CLI app when tasks are disabled."
|
||||||
default = "claude"
|
default = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "coder_env" "claude_code_md_path" {
|
resource "coder_env" "claude_code_md_path" {
|
||||||
@ -345,6 +345,7 @@ resource "coder_script" "install_agent" {
|
|||||||
agent_id = var.agent_id
|
agent_id = var.agent_id
|
||||||
display_name = "Install agent"
|
display_name = "Install agent"
|
||||||
run_on_start = true
|
run_on_start = true
|
||||||
|
log_path = "${path.module}/install.log"
|
||||||
script = <<-EOT
|
script = <<-EOT
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
|||||||
@ -1,9 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ -f "$HOME/.bashrc" ]; then
|
|
||||||
source "$HOME"/.bashrc
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set strict error handling AFTER sourcing bashrc to avoid unbound variable errors from user dotfiles
|
# Set strict error handling AFTER sourcing bashrc to avoid unbound variable errors from user dotfiles
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
@ -58,6 +54,11 @@ bash "/tmp/remove-last-session-id.sh" "$(pwd)" 2> /dev/null
|
|||||||
session_cleanup_exit_code=$?
|
session_cleanup_exit_code=$?
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
CORE_COMMAND=()
|
||||||
|
if [[ "${ARG_REPORT_TASKS}" == "true" ]]; then
|
||||||
|
CORE_COMMAND+=(agentapi server --type claude --term-width 67 --term-height 1190 --)
|
||||||
|
fi
|
||||||
|
|
||||||
case $session_cleanup_exit_code in
|
case $session_cleanup_exit_code in
|
||||||
0)
|
0)
|
||||||
CAN_CONTINUE_CONVERSATION=true
|
CAN_CONTINUE_CONVERSATION=true
|
||||||
@ -186,8 +187,8 @@ function start_agentapi() {
|
|||||||
ARGS+=(--session-id "$TASK_SESSION_ID")
|
ARGS+=(--session-id "$TASK_SESSION_ID")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -n "$ARG_AI_PROMPT" ]; then
|
if [[ -n "${ARG_AI_PROMPT}" ]]; then
|
||||||
if [ "$ARG_REPORT_TASKS" = "true" ]; then
|
if [[ "${ARG_REPORT_TASKS}" = "true" ]]; then
|
||||||
ARGS+=(--dangerously-skip-permissions -- "$ARG_AI_PROMPT")
|
ARGS+=(--dangerously-skip-permissions -- "$ARG_AI_PROMPT")
|
||||||
else
|
else
|
||||||
if [ "$ARG_DANGEROUSLY_SKIP_PERMISSIONS" = "true" ]; then
|
if [ "$ARG_DANGEROUSLY_SKIP_PERMISSIONS" = "true" ]; then
|
||||||
@ -218,31 +219,35 @@ function start_agentapi() {
|
|||||||
BOUNDARY_ARGS+=(--allow "domain=anthropic.com" --allow "domain=registry.npmjs.org" --allow "domain=sentry.io" --allow "domain=claude.ai" --allow "domain=$ARG_CODER_HOST")
|
BOUNDARY_ARGS+=(--allow "domain=anthropic.com" --allow "domain=registry.npmjs.org" --allow "domain=sentry.io" --allow "domain=claude.ai" --allow "domain=$ARG_CODER_HOST")
|
||||||
|
|
||||||
# Add any additional allowed URLs from the variable
|
# Add any additional allowed URLs from the variable
|
||||||
if [ -n "$ARG_BOUNDARY_ADDITIONAL_ALLOWED_URLS" ]; then
|
if [[ -n "${ARG_BOUNDARY_ADDITIONAL_ALLOWED_URLS}" ]]; then
|
||||||
IFS='|' read -ra ADDITIONAL_URLS <<< "$ARG_BOUNDARY_ADDITIONAL_ALLOWED_URLS"
|
IFS='|' read -ra ADDITIONAL_URLS <<< "${ARG_BOUNDARY_ADDITIONAL_ALLOWED_URLS}"
|
||||||
for url in "${ADDITIONAL_URLS[@]}"; do
|
for url in "${ADDITIONAL_URLS[@]}"; do
|
||||||
# Quote the URL to preserve spaces within the allow rule
|
# Quote the URL to preserve spaces within the allow rule
|
||||||
BOUNDARY_ARGS+=(--allow "$url")
|
BOUNDARY_ARGS+=(--allow "${url}")
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set HTTP Proxy port used by Boundary
|
# Set HTTP Proxy port used by Boundary
|
||||||
BOUNDARY_ARGS+=(--proxy-port "$ARG_BOUNDARY_PROXY_PORT")
|
BOUNDARY_ARGS+=(--proxy-port "${ARG_BOUNDARY_PROXY_PORT}")
|
||||||
|
|
||||||
# Set log level for boundary
|
# Set log level for boundary
|
||||||
BOUNDARY_ARGS+=(--log-level "$ARG_BOUNDARY_LOG_LEVEL")
|
BOUNDARY_ARGS+=(--log-level "${ARG_BOUNDARY_LOG_LEVEL}")
|
||||||
|
|
||||||
if [ "${ARG_ENABLE_BOUNDARY_PPROF:-false}" = "true" ]; then
|
if [[ "${ARG_ENABLE_BOUNDARY_PPROF:-false}" = "true" ]]; then
|
||||||
# Enable boundary pprof server on specified port
|
# Enable boundary pprof server on specified port
|
||||||
BOUNDARY_ARGS+=(--pprof)
|
BOUNDARY_ARGS+=(--pprof)
|
||||||
BOUNDARY_ARGS+=(--pprof-port "$ARG_BOUNDARY_PPROF_PORT")
|
BOUNDARY_ARGS+=(--pprof-port "${ARG_BOUNDARY_PPROF_PORT}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
agentapi server --type claude --term-width 67 --term-height 1190 -- \
|
# if [[ "${ARG_REPORT_TASKS}" == "true" ]]; then
|
||||||
boundary-run "${BOUNDARY_ARGS[@]}" -- \
|
# boundary-run "${BOUNDARY_ARGS[@]}" -- \
|
||||||
claude "${ARGS[@]}"
|
# claude "${ARGS[@]}"
|
||||||
|
# else
|
||||||
|
"${CORE_COMMAND[@]}" boundary-run "${BOUNDARY_ARGS[@]}" -- \
|
||||||
|
claude "${ARGS[@]}"
|
||||||
|
# fi
|
||||||
else
|
else
|
||||||
agentapi server --type claude --term-width 67 --term-height 1190 -- claude "${ARGS[@]}"
|
"${CORE_COMMAND[@]}" claude "${ARGS[@]}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user