Ask for the model provider on every start

run.sh shows a window (zenity form, terminal prompts without zenity) for
a base URL, token, auth header and optional model list. Left empty,
Claude Desktop starts normally with the claude.ai sign-in. Otherwise it
runs in its third-party gateway mode: run.sh writes the managed config
(inferenceProvider "gateway" and friends) and copies it into the created
container as root, because Claude Desktop ignores
/etc/claude-desktop/managed-settings.json unless root owns it. The host
copy is deleted right away; nothing is kept between starts.

Claude Desktop only allows plain http to loopback, so for an http://
gateway launch-apps.sh runs socat on 127.0.0.1:18080 and forwards to it.
localhost is rewritten to host.docker.internal for servers on the host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-02 18:54:41 +01:00
co-authored by Claude Opus 5.5
parent 9b921eeae5
commit 0315d5816e
5 changed files with 153 additions and 3 deletions
+6
View File
@@ -15,6 +15,12 @@ set -u
# stops everything it started (Ghidra's launch script runs java as a child).
set -m
# Plain-HTTP model gateway chosen in run.sh: Claude Desktop only allows http
# to loopback, so it talks to 127.0.0.1:18080 and socat forwards that.
if [[ -n "${CLAUDE_RE_GATEWAY_FORWARD:-}" ]]; then
socat TCP-LISTEN:18080,bind=127.0.0.1,reuseaddr,fork "TCP:${CLAUDE_RE_GATEWAY_FORWARD}" &
fi
claude-desktop "$@" &
claude=$!
"${GHIDRA_INSTALL_DIR:-/opt/ghidra}/support/launch.sh" fg jdk Ghidra "" "" ghidra.GhidraRun &