Files
Triple-C/container/triple-c-agent/Cargo.toml
T
shadowdaoandClaude Opus 5.5 fe889a7f16 triple-c-agent: reset exec signal state, chown stdio, bound connections
- Execs reset every catchable signal to SIG_DFL and clear the signal mask
  in pre_exec (raw rt_sigaction/rt_sigprocmask, so libc-reserved RT
  signals are covered too). The supervisor's `trap '' HUP` no longer
  leaks into execs, so a dropped tty attach hangs up its session again.
- runc's fixStdioPermissions: fds 0-2 are fchown'd to the exec user
  (except /dev/null and EINVAL/EPERM/EROFS), so /dev/stdout, /dev/stderr
  and a tty slave are usable by a non-root exec user.
- Own accept loop on hyper's http1 builder with a TokioTimer: a 10s
  header-read timeout and a 256-connection semaphore (wait for a slot,
  not drop). WebSocket upgrades still served; Config gains
  header_read_timeout and max_connections.
- Attach/tunnel WebSockets accept messages and frames of at most 1 MiB.
- The disconnect SIGHUP is sent by the pump, and only while the exec is
  unreaped, so a reused pgid is never signalled.
- Docs: removing TRIPLEC_AGENT_TOKEN does not scrub /proc/<pid>/environ;
  recommend TRIPLEC_AGENT_TOKEN_FILE.
- Tests: inherited_signals.rs (agent with SIGHUP ignored), slowloris and
  connection-cap tests, root-only stdio ownership test; fix the stale
  $USER assertion in the existing root test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:33:29 -08:00

49 lines
1.8 KiB
TOML

[package]
name = "triple-c-agent"
version = "0.1.0"
edition = "2021"
description = "In-container agent: docker-exec parity over authenticated HTTP/WebSocket"
publish = false
# Deliberately not part of any workspace: this binary is built for
# *-unknown-linux-musl and baked into the container image, on its own cadence.
# The empty table stops cargo from walking up and adopting it into one.
[workspace]
[lib]
name = "triple_c_agent"
path = "src/lib.rs"
[[bin]]
name = "triple-c-agent"
path = "src/main.rs"
# Pure-Rust only — no TLS, no openssl, nothing with a C build step — so the
# binary links statically for both musl targets without a C cross toolchain.
[dependencies]
axum = { version = "0.8", default-features = false, features = ["http1", "tokio", "json", "query", "ws"] }
base64 = "0.22"
bytes = "1"
futures-util = { version = "0.3", default-features = false, features = ["std", "sink"] }
# Already in the tree through axum, with these features; named directly for
# the accept loop in `lib.rs::serve` (header-read timeout needs a hyper timer).
hyper = { version = "1", default-features = false, features = ["http1", "server"] }
hyper-util = { version = "0.1", default-features = false, features = ["tokio", "server", "service"] }
libc = "0.2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tar = { version = "0.4", default-features = false }
tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "process", "io-util", "sync", "time", "fs"] }
[dev-dependencies]
reqwest = { version = "0.12", default-features = false, features = ["json"] }
tempfile = "3"
tokio-tungstenite = { version = "0.29", default-features = false, features = ["connect"] }
[profile.release]
opt-level = "s"
lto = true
codegen-units = 1
strip = true
panic = "abort"