Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| The runner no longer runs g1t's own agents. Cloud and self-hosted runners now do what a forge's runner does: Actions jobs, required checks, merge checks and merge-queue test runs, deployments, dependency bumps and backups. Everything that started Claude Code in a sandbox on an issue or pull request is gone, with its prompts, model access, mentions, delegation, plans, reviews, revisions and the workspace agents' computers. | 1 | //! Trusting the certificate a sandbox's HTTPS is re-signed with. |
| Cache hits are counted, not only their bytes | 2 | //! |
| The runner no longer runs g1t's own agents. Cloud and self-hosted runners now do what a forge's runner does: Actions jobs, required checks, merge checks and merge-queue test runs, deployments, dependency bumps and backups. Everything that started Claude Code in a sandbox on an issue or pull request is gone, with its prompts, model access, mentions, delegation, plans, reviews, revisions and the workspace agents' computers. | 3 | //! When a sandbox's network is restricted by its project's guardrails (or a |
| 4 | //! workflow job may be given brokered secrets), its HTTP and HTTPS pass the | |
| 5 | //! runner Worker, which re-signs HTTPS with a certificate Cloudflare puts in | |
| 6 | //! the sandbox. The network list, the credentials a sandbox holds, and | |
| 7 | //! branch protection on g1t's side are what bound a sandbox's work. | |
| Cache hits are counted, not only their bytes | 8 | |
| 9 | use std::path::Path; | |
| 10 | use std::process::{Command, Stdio}; | |
| 11 | ||
| 12 | /// The certificate the sandbox's HTTPS is re-signed with, when it is guarded. | |
| 13 | const EGRESS_CA: &str = "/etc/cloudflare/certs/cloudflare-containers-ca.crt"; | |
| 14 | ||
| 15 | /// Runs a command as root without asking. False where that is not allowed. | |
| The runner no longer runs g1t's own agents. Cloud and self-hosted runners now do what a forge's runner does: Actions jobs, required checks, merge checks and merge-queue test runs, deployments, dependency bumps and backups. Everything that started Claude Code in a sandbox on an issue or pull request is gone, with its prompts, model access, mentions, delegation, plans, reviews, revisions and the workspace agents' computers. | 16 | fn sudo(args: &[&str]) -> bool { |
| 17 | Command::new("sudo") | |
| Cache hits are counted, not only their bytes | 18 | .arg("-n") |
| 19 | .args(args) | |
| The runner no longer runs g1t's own agents. Cloud and self-hosted runners now do what a forge's runner does: Actions jobs, required checks, merge checks and merge-queue test runs, deployments, dependency bumps and backups. Everything that started Claude Code in a sandbox on an issue or pull request is gone, with its prompts, model access, mentions, delegation, plans, reviews, revisions and the workspace agents' computers. | 20 | .stdin(Stdio::null()) |
| Cache hits are counted, not only their bytes | 21 | .stdout(Stdio::null()) |
| 22 | .stderr(Stdio::null()) | |
| The runner no longer runs g1t's own agents. Cloud and self-hosted runners now do what a forge's runner does: Actions jobs, required checks, merge checks and merge-queue test runs, deployments, dependency bumps and backups. Everything that started Claude Code in a sandbox on an issue or pull request is gone, with its prompts, model access, mentions, delegation, plans, reviews, revisions and the workspace agents' computers. | 23 | .status() |
| 24 | .is_ok_and(|status| status.success()) | |
| Cache hits are counted, not only their bytes | 25 | } |
| 26 | ||
| 27 | /// Trusts the certificate a guarded sandbox's HTTPS is re-signed with, so | |
| 28 | /// that git, package managers and this program can reach allowed hosts. | |
| 29 | /// Does nothing in a sandbox whose network is open. Called first thing, | |
| 30 | /// before any request is made. | |
| 31 | pub fn trust_egress_ca() { | |
| 32 | const TRUSTED: &str = "/usr/local/share/ca-certificates/cloudflare-containers-ca.crt"; | |
| The runner no longer runs g1t's own agents. Cloud and self-hosted runners now do what a forge's runner does: Actions jobs, required checks, merge checks and merge-queue test runs, deployments, dependency bumps and backups. Everything that started Claude Code in a sandbox on an issue or pull request is gone, with its prompts, model access, mentions, delegation, plans, reviews, revisions and the workspace agents' computers. | 33 | // Once per sandbox. |
| Cache hits are counted, not only their bytes | 34 | if !Path::new(EGRESS_CA).exists() || Path::new(TRUSTED).exists() { |
| 35 | return; | |
| 36 | } | |
| The runner no longer runs g1t's own agents. Cloud and self-hosted runners now do what a forge's runner does: Actions jobs, required checks, merge checks and merge-queue test runs, deployments, dependency bumps and backups. Everything that started Claude Code in a sandbox on an issue or pull request is gone, with its prompts, model access, mentions, delegation, plans, reviews, revisions and the workspace agents' computers. | 37 | let trusted = sudo(&["cp", EGRESS_CA, TRUSTED]) && sudo(&["update-ca-certificates"]); |
| Cache hits are counted, not only their bytes | 38 | if !trusted { |
| 39 | eprintln!("g1t-runner: could not trust the sandbox's egress certificate; HTTPS will fail"); | |
| 40 | } | |
| 41 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.