fix: disinto init: project TOML uses localhost forge_url, breaks agents container (#782)
When DISINTO_CONTAINER=1, load-project.sh now skips overriding env vars that are already set by docker-compose (FORGE_URL, PROJECT_REPO_ROOT, OPS_REPO_ROOT, etc.). This prevents the TOML's host-perspective values (localhost, /home/johba/…) from clobbering the correct container values (forgejo:3000, /home/agent/…). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
bf50647545
commit
1a72ddc1bd
1 changed files with 9 additions and 1 deletions
|
|
@ -80,9 +80,17 @@ if mirrors:
|
|||
return 1 2>/dev/null || exit 1
|
||||
}
|
||||
|
||||
# Export parsed variables
|
||||
# Export parsed variables.
|
||||
# Inside the agents container (DISINTO_CONTAINER=1), compose already sets the
|
||||
# correct FORGE_URL (http://forgejo:3000) and path vars for the container
|
||||
# environment. The TOML carries host-perspective values (localhost, /home/johba/…)
|
||||
# that would break container API calls and path resolution. Skip overriding
|
||||
# any env var that is already set when running inside the container.
|
||||
while IFS='=' read -r _key _val; do
|
||||
[ -z "$_key" ] && continue
|
||||
if [ "${DISINTO_CONTAINER:-}" = "1" ] && [ -n "${!_key:-}" ]; then
|
||||
continue
|
||||
fi
|
||||
export "$_key=$_val"
|
||||
done <<< "$_PROJECT_VARS"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue