fix(aws): copy-at-connect review fixes — lock, ~/.ssh off EFS, secret history

- triple-c-apply-connect: the background re-clone closes the apply lock's
  fd, so a later connect never waits on it; --prepare takes the lock.
- R6: under copy-at-connect Hybrid/EFS no longer link ~/.ssh to EFS; the
  copied keys vanish with the task (UI says so, and that old keys on EFS
  stay until removed).
- R7: a copy-at-connect start that finds credentials still in the secret
  force-deletes it and creates it again (retrying ~30 s while AWS finishes),
  so no AWSPREVIOUS version keeps them.
- TRIPLE_C_CUSTOM_ENV (unsalted fingerprint) left out of the secret.
- Terminals get only the credential pairs (no file reads; keychain off the
  runtime), so a bad SSH/CA file never drops the API keys.
- ConnectBundle values are Zeroizing; UI copy updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Opus 5.5 committed 2026-11-16 08:43:12 -08:00
1 parent 8510797c22
commit 820bfab25c
15 files changed
+502 -59

No files matched your search

@@ -164,8 +164,18 @@ describe("HostSection", () => {
renderHost(p);
const note = screen.getByRole("note", { name: "Copied when you connect" });
expect(note).toHaveTextContent("Private repositories clone after you connect.");
expect(note).toHaveTextContent("Scheduled jobs can't use these credentials while the app is closed.");
expect(note).toHaveTextContent(
"Scheduled jobs and the setup script never get the API keys or custom variables; Git and SSH work once the app has connected.",
);
expect(note).toHaveTextContent("~/.ssh is not kept on EFS");
expect(note).toHaveTextContent("/mnt/triple-c-home/.ssh stay there until you remove them");
expect(note).not.toHaveTextContent(/gateway/);
expect(screen.getByText(/repositories and SSH keys included, starts fresh/)).toBeInTheDocument();
cleanup();
// Ephemeral: nothing is kept anyway, so no SSH note.
renderHost({ ...p, aws: { ...p.aws!, storage: "ephemeral" } });
expect(screen.getByRole("note", { name: "Copied when you connect" })).not.toHaveTextContent("~/.ssh");
cleanup();
p.aws = { ...p.aws!, gateway_sidecar: true };
@@ -5,6 +5,7 @@ import { useAppState } from "../../../../store/appState";
import {
COPY_AT_CONNECT_GATEWAY_NOTE,
COPY_AT_CONNECT_HINT,
COPY_AT_CONNECT_SSH_NOTE,
COPY_AT_CONNECT_WARNINGS,
SECRETS_MANAGER_HINT,
EFS_HINT,
@@ -225,12 +226,14 @@ export default function HostSection({ project, save, disabled }: Props) {
</p>
) : aws.storage === "efs" ? (
<p className="mt-1 text-xs text-[var(--text-secondary)]">
<span>{EFS_HINT}</span>. The Claude login, history and SSH keys are kept on EFS too.
<span>{EFS_HINT}</span>. The Claude login and history
{aws.secrets_delivery === "copy_at_connect" ? "" : ", and SSH keys,"} are kept on EFS too.
</p>
) : (
<p className="mt-1 text-xs text-[var(--text-secondary)]">
The Claude login, history and SSH keys are kept on EFS between starts; everything
else, repositories included, starts fresh.
{aws.secrets_delivery === "copy_at_connect"
? "The Claude login and history are kept on EFS between starts; everything else, repositories and SSH keys included, starts fresh."
: "The Claude login, history and SSH keys are kept on EFS between starts; everything else, repositories included, starts fresh."}
</p>
)}
{keptWorkspaceFiles && (
@@ -368,6 +371,7 @@ export default function HostSection({ project, save, disabled }: Props) {
{COPY_AT_CONNECT_WARNINGS.map((w) => (
<li key={w}>{w}</li>
))}
{aws.storage !== "ephemeral" && <li>{COPY_AT_CONNECT_SSH_NOTE}</li>}
{aws.gateway_sidecar && <li>{COPY_AT_CONNECT_GATEWAY_NOTE}</li>}
</ul>
</>
+4 -1
View File
@@ -144,8 +144,11 @@ export const COPY_AT_CONNECT_HINT =
"API keys, the Git token, custom environment variables and the SSH and CA files are not stored in AWS: Triple-C copies them into the running workspace each time it connects.";
export const COPY_AT_CONNECT_WARNINGS = [
"Private repositories clone after you connect.",
"Scheduled jobs can't use these credentials while the app is closed.",
"Scheduled jobs and the setup script never get the API keys or custom variables; Git and SSH work once the app has connected.",
];
/** Hybrid/EFS under copy-at-connect (ruling R6): ~/.ssh stays off EFS. */
export const COPY_AT_CONNECT_SSH_NOTE =
"~/.ssh is not kept on EFS: SSH keys copied in, or made in the workspace, are gone when it stops. Keys an earlier start left in /mnt/triple-c-home/.ssh stay there until you remove them.";
export const COPY_AT_CONNECT_GATEWAY_NOTE =
"The LLM gateway's keys are still stored in AWS: the gateway starts before Triple-C connects.";
export const SECRETS_MANAGER_HINT =