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. |
| Billing and Usage reconcile: own-provider runs leave Billing's at-price total, and Usage's not-charged part is at price less charged | 2 | //! |
| Guardrails no longer restrict the network: every sandbox on g1t's machines reaches the internet, as a GitHub-hosted runner does, and the settings for it are gone at every level, the workspace's defaults and each project's overrides: Only allowed hosts (restrict_network), the package registries, allowed domains and workflow-only domains. Guardrails are now the time caps on checks, the merge queue and merge checks, and nothing else. | 3 | //! When a workflow job may be given brokered secrets, its HTTP and HTTPS |
| 4 | //! pass the runner Worker, which fills them in and re-signs HTTPS with a | |
| 5 | //! certificate Cloudflare puts in the sandbox. Other sandboxes reach the | |
| 6 | //! internet directly. The credentials a sandbox holds and branch | |
| 7 | //! protection on g1t's side are what bound a sandbox's work. | |
| Billing and Usage reconcile: own-provider runs leave Billing's at-price total, and Usage's not-charged part is at price less charged | 8 | |
| 9 | use std::path::Path; | |
| 10 | use std::process::{Command, Stdio}; | |
| 11 | ||
| Guardrails no longer restrict the network: every sandbox on g1t's machines reaches the internet, as a GitHub-hosted runner does, and the settings for it are gone at every level, the workspace's defaults and each project's overrides: Only allowed hosts (restrict_network), the package registries, allowed domains and workflow-only domains. Guardrails are now the time caps on checks, the merge queue and merge checks, and nothing else. | 12 | /// The certificate the sandbox's HTTPS is re-signed with, when it passes |
| 13 | /// the Worker. | |
| Billing and Usage reconcile: own-provider runs leave Billing's at-price total, and Usage's not-charged part is at price less charged | 14 | const EGRESS_CA: &str = "/etc/cloudflare/certs/cloudflare-containers-ca.crt"; |
| 15 | ||
| 16 | /// 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. | 17 | fn sudo(args: &[&str]) -> bool { |
| 18 | Command::new("sudo") | |
| Billing and Usage reconcile: own-provider runs leave Billing's at-price total, and Usage's not-charged part is at price less charged | 19 | .arg("-n") |
| 20 | .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. | 21 | .stdin(Stdio::null()) |
| Billing and Usage reconcile: own-provider runs leave Billing's at-price total, and Usage's not-charged part is at price less charged | 22 | .stdout(Stdio::null()) |
| 23 | .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. | 24 | .status() |
| 25 | .is_ok_and(|status| status.success()) | |
| Billing and Usage reconcile: own-provider runs leave Billing's at-price total, and Usage's not-charged part is at price less charged | 26 | } |
| 27 | ||
| Guardrails no longer restrict the network: every sandbox on g1t's machines reaches the internet, as a GitHub-hosted runner does, and the settings for it are gone at every level, the workspace's defaults and each project's overrides: Only allowed hosts (restrict_network), the package registries, allowed domains and workflow-only domains. Guardrails are now the time caps on checks, the merge queue and merge checks, and nothing else. | 28 | /// Trusts the certificate a sandbox's HTTPS is re-signed with, so that |
| 29 | /// git, package managers and this program can reach the hosts it | |
| 30 | /// intercepts. Does nothing where Cloudflare put no certificate. Called | |
| 31 | /// first thing, before any request is made. | |
| Billing and Usage reconcile: own-provider runs leave Billing's at-price total, and Usage's not-charged part is at price less charged | 32 | pub fn trust_egress_ca() { |
| 33 | 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. | 34 | // Once per sandbox. |
| Billing and Usage reconcile: own-provider runs leave Billing's at-price total, and Usage's not-charged part is at price less charged | 35 | if !Path::new(EGRESS_CA).exists() || Path::new(TRUSTED).exists() { |
| 36 | return; | |
| 37 | } | |
| 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. | 38 | let trusted = sudo(&["cp", EGRESS_CA, TRUSTED]) && sudo(&["update-ca-certificates"]); |
| Billing and Usage reconcile: own-provider runs leave Billing's at-price total, and Usage's not-charged part is at price less charged | 39 | if !trusted { |
| 40 | eprintln!("g1t-runner: could not trust the sandbox's egress certificate; HTTPS will fail"); | |
| 41 | } | |
| 42 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.