Skip to content

fix(deployments): resolve local clone credentials for Docker builds on local host - #655

Closed
chbndrhnns wants to merge 1 commit into
oblien:mainfrom
chbndrhnns:fix/local-docker-clone-plan
Closed

fix(deployments): resolve local clone credentials for Docker builds on local host#655
chbndrhnns wants to merge 1 commit into
oblien:mainfrom
chbndrhnns:fix/local-docker-clone-plan

Conversation

@chbndrhnns

Copy link
Copy Markdown
Contributor

Summary

Fixes #654

When a Docker deployment targets the local host ("This Server" row in self-hosted mode / platform.localHost === true), DockerRuntime connects over the local Unix socket (/var/run/docker.sock). Because it has no SSH executor, it cannot clone on the server and must create the build context on the API host via createDockerBuildContext.

Previously, resolveClonePlan treated any server deploy with serverId + repoIsGithub: true as runsOnServer = true and cloneBuildStrategy = "server". When the host machine had ambient gh credentials, resolveBuildGitToken returned { ambient: { via: "gh" } } without resolving a token (gitToken = undefined). DockerRuntime.build then fell through to createDockerBuildContext, which failed with fatal: Authentication failed inside the API container because gitToken was undefined.

Changes

  • clone-plan.ts:
    • Added isLocalHost?: boolean to ClonePlanInput.
    • Defined isLocalDockerBuild = !input.runtimeIsBare && (isLocalHost || (input.buildStrategy === "local" && input.cloneStrategy !== "server")).
    • When isLocalDockerBuild is true, sets runsOnServer = false, dockerServerSide = false, and cloneBuildStrategy = "local".
  • build-pipeline.ts: Threaded isLocalHost: resolved.platform.localHost into resolveClonePlan.
  • preflight.ts: Resolved isLocalTarget via isLocalHostRow and passed isLocalHost: isLocalTarget into resolveClonePlan.
  • clone-plan.test.ts: Added reproduction test cases for Docker builds on localHost and buildStrategy="local" with repoIsGithub: true.
  • ssh-manager.ts: Fixed relative import paths.

Verification

  • bun x vitest run apps/api/src/modules/deployments/clone-plan.test.ts apps/api/test/modules/deployments/clone-plan.test.ts (19/19 passing)
  • Full deployment test suite: bun x vitest run apps/api/test/modules/deployments/ (32/32 files, 345/345 passing)

@Hydralerne

Copy link
Copy Markdown
Member

fixed alread sorry

@Hydralerne Hydralerne closed this Aug 23, 2026
@chbndrhnns
chbndrhnns deleted the fix/local-docker-clone-plan branch August 23, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker deployments targeting local host fail with git clone auth error when ambient git is detected

2 participants