Skip to content

Commit d378263

Browse files
authored
chore: rename claudetainer to codetainer (#75)
All references updated across all case variants: - claudetainer → codetainer (lowercase) - Claudetainer → Codetainer (title case) - CLAUDETAINER → CODETAINER (env vars, iptables prefix)
1 parent 566b4d9 commit d378263

9 files changed

Lines changed: 41 additions & 41 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Claudetainer
1+
# Codetainer
22

33
## Security Framework
44

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Claudetainer
1+
# Codetainer
22

33
A hardened Docker container that runs [Claude Code](https://claude.ai/code) on [Fly.io](https://fly.io), accessible via SSH. Designed for long-running, autonomous coding sessions with container hardening and strict network isolation.
44

@@ -93,7 +93,7 @@ Pick the [Fly.io region](https://fly.io/docs/reference/regions/) closest to you
9393
**Option A: Prebuilt image (fastest)**
9494

9595
```bash
96-
fly machine run ghcr.io/perezd/claudetainer:latest \
96+
fly machine run ghcr.io/perezd/codetainer:latest \
9797
--app <your-app-name> \
9898
--region <your-region> \
9999
--restart no \
@@ -108,7 +108,7 @@ fly machine run ghcr.io/perezd/claudetainer:latest \
108108
To give Claude an immediate task, add an initialization prompt:
109109

110110
```bash
111-
fly machine run ghcr.io/perezd/claudetainer:latest \
111+
fly machine run ghcr.io/perezd/codetainer:latest \
112112
--app <your-app-name> \
113113
--region <your-region> \
114114
--restart no \
@@ -128,8 +128,8 @@ Claude will begin working on the prompt as soon as the container is ready, befor
128128
If you want to customize the image (e.g. change installed tools or network allowlists), clone the repo and build directly:
129129

130130
```bash
131-
git clone https://github.com/perezd/claudetainer.git
132-
cd claudetainer
131+
git clone https://github.com/perezd/codetainer.git
132+
cd codetainer
133133

134134
fly machine run . --dockerfile Dockerfile \
135135
--app <your-app-name> \
@@ -168,7 +168,7 @@ Fine-grained tokens are recommended when the target repo belongs to a GitHub **o
168168
**How to create a fine-grained token (recommended):**
169169

170170
1. Log into the robot GitHub account and go to [github.com/settings/tokens](https://github.com/settings/tokens?type=beta). Click **Generate new token** (fine-grained)
171-
2. Give it a descriptive name (e.g. `claudetainer - my-repo`)
171+
2. Give it a descriptive name (e.g. `codetainer - my-repo`)
172172
3. Under **Resource owner**, select the org or user that owns the repo
173173
4. Under **Repository access**, select **Only select repositories** and pick the single repo you want Claude to work in
174174
5. Under **Repository permissions**, grant exactly these:
@@ -230,15 +230,15 @@ See [Telemetry](#telemetry-optional) below for what gets exported and privacy co
230230

231231
These are set via `--env` flags on `fly machine run`. They are not sensitive and don't need to be secrets.
232232

233-
| Variable | Required | Default | Description |
234-
| -------------------------- | -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
235-
| `GIT_USER_NAME` | No | `claudetainer` | Git commit author name |
236-
| `GIT_USER_EMAIL` | No | `claudetainer@noreply.github.com` | Git commit author email |
237-
| `REPO_URL` | No | _(none)_ | HTTPS URL of a GitHub repo to clone on startup. Cloned to `/workspace/repo`. Must be accessible with the `GH_PAT`. |
238-
| `CLAUDE_PROMPT` | No | _(none)_ | Initialization prompt for Claude Code. When set, Claude immediately begins working on this prompt at boot. Typically a GitHub issue URL (e.g., `https://github.com/org/repo/issues/42`). Visible via `fly machine status` — do not include secrets. |
239-
| `OTEL_LOG_USER_PROMPTS` | No | `1` | Set to `0` to exclude user prompt content from telemetry events (only prompt length is recorded). Requires Grafana Cloud telemetry to be enabled. |
240-
| `OTEL_LOG_TOOL_DETAILS` | No | `1` | Set to `0` to exclude tool parameters from telemetry events (only tool name is recorded). Requires Grafana Cloud telemetry to be enabled. |
241-
| `OTEL_RESOURCE_ATTRIBUTES` | No | _(auto: Fly identity)_ | Comma-separated `key=value` pairs added to all metrics and events. `fly.app_name` and `fly.machine_id` are auto-injected; operator values are appended. Requires Grafana Cloud telemetry to be enabled. |
233+
| Variable | Required | Default | Description |
234+
| -------------------------- | -------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
235+
| `GIT_USER_NAME` | No | `codetainer` | Git commit author name |
236+
| `GIT_USER_EMAIL` | No | `codetainer@noreply.github.com` | Git commit author email |
237+
| `REPO_URL` | No | _(none)_ | HTTPS URL of a GitHub repo to clone on startup. Cloned to `/workspace/repo`. Must be accessible with the `GH_PAT`. |
238+
| `CLAUDE_PROMPT` | No | _(none)_ | Initialization prompt for Claude Code. When set, Claude immediately begins working on this prompt at boot. Typically a GitHub issue URL (e.g., `https://github.com/org/repo/issues/42`). Visible via `fly machine status` — do not include secrets. |
239+
| `OTEL_LOG_USER_PROMPTS` | No | `1` | Set to `0` to exclude user prompt content from telemetry events (only prompt length is recorded). Requires Grafana Cloud telemetry to be enabled. |
240+
| `OTEL_LOG_TOOL_DETAILS` | No | `1` | Set to `0` to exclude tool parameters from telemetry events (only tool name is recorded). Requires Grafana Cloud telemetry to be enabled. |
241+
| `OTEL_RESOURCE_ATTRIBUTES` | No | _(auto: Fly identity)_ | Comma-separated `key=value` pairs added to all metrics and events. `fly.app_name` and `fly.machine_id` are auto-injected; operator values are appended. Requires Grafana Cloud telemetry to be enabled. |
242242

243243
## Usage
244244

@@ -281,7 +281,7 @@ The machine is configured with `--restart no` and `--autostart=false`, so it sta
281281

282282
## Telemetry (Optional)
283283

284-
Claudetainer can export Claude Code's native OpenTelemetry metrics and events to [Grafana Cloud](https://grafana.com/products/cloud/) via direct OTLP push. This gives you dashboards for token usage, costs, session activity, and full prompt-level event traces — all in Grafana.
284+
Codetainer can export Claude Code's native OpenTelemetry metrics and events to [Grafana Cloud](https://grafana.com/products/cloud/) via direct OTLP push. This gives you dashboards for token usage, costs, session activity, and full prompt-level event traces — all in Grafana.
285285

286286
The feature is **opt-in** and **disabled by default**. It activates only when all three Grafana Cloud secrets are set (`GRAFANA_INSTANCE_ID`, `GRAFANA_API_TOKEN`, `GRAFANA_OTLP_ENDPOINT`). When off, there is zero telemetry, zero outbound traffic, and no behavior change.
287287

@@ -397,7 +397,7 @@ Edit `claude-settings.json` to add entries under `mcpServers`. The default confi
397397
| `shared-cpu-2x` / 4GB | Heavy | Large repos, parallel builds |
398398

399399
```bash
400-
fly machine run ghcr.io/perezd/claudetainer:latest \
400+
fly machine run ghcr.io/perezd/codetainer:latest \
401401
--vm-memory 2048 \
402402
--vm-size shared-cpu-2x \
403403
...
@@ -432,7 +432,7 @@ fly machine run ghcr.io/perezd/claudetainer:latest \
432432
### Source Repository Layout
433433

434434
```
435-
claudetainer/
435+
codetainer/
436436
├── network/ # Network isolation layer
437437
│ ├── domains.conf # Domain allowlist (one per line)
438438
│ └── Corefile.template # CoreDNS base config (catch-all NXDOMAIN)
@@ -516,10 +516,10 @@ All scripts live in `scripts/` and are copied to `/usr/local/bin/` during the Do
516516
The GitHub Actions workflow (`.github/workflows/build.yml`) builds and pushes the container image to GHCR on every push to `main`:
517517

518518
```
519-
ghcr.io/perezd/claudetainer:latest
519+
ghcr.io/perezd/codetainer:latest
520520
```
521521

522-
The GHCR package must be set to **public** visibility so Fly.io can pull it without registry credentials. To set this, go to the GitHub repo → Packages → `claudetainer` → Package settings → Change visibility → Public.
522+
The GHCR package must be set to **public** visibility so Fly.io can pull it without registry credentials. To set this, go to the GitHub repo → Packages → `codetainer` → Package settings → Change visibility → Public.
523523

524524
## Troubleshooting
525525

docs/accepted-risks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ Each entry includes: risk title, affected layer(s), why it can't be resolved, co
5151
### Single PAT for GitHub API and npm registry auth
5252

5353
- **Affected layer:** Container Hardening
54-
- **Description:** Both `GH_TOKEN` (GitHub API / git credential helper) and `CLAUDETAINER_NPM_TOKEN` (GitHub Packages npm registry) are derived from the same `GH_PAT` at runtime. Compromise of either access path exposes the full PAT, which may have scopes beyond what each consumer needs individually.
54+
- **Description:** Both `GH_TOKEN` (GitHub API / git credential helper) and `CODETAINER_NPM_TOKEN` (GitHub Packages npm registry) are derived from the same `GH_PAT` at runtime. Compromise of either access path exposes the full PAT, which may have scopes beyond what each consumer needs individually.
5555
- **Why it can't be resolved:** GitHub fine-grained PATs do not yet support the scope separation needed to create two tokens with disjoint permissions for `gh` CLI operations vs. npm registry access. The operational complexity of managing two classic PATs with minimal-overlap scopes exceeds the security benefit in a single-purpose container.
56-
- **Compensating controls:** The `CLAUDETAINER_NPM_TOKEN` abstraction allows a future split to separate tokens without changing consumer code. Network isolation limits where either token can be used. Operators should follow least-privilege guidance: prefer fine-grained PATs with minimal scopes.
56+
- **Compensating controls:** The `CODETAINER_NPM_TOKEN` abstraction allows a future split to separate tokens without changing consumer code. Network isolation limits where either token can be used. Operators should follow least-privilege guidance: prefer fine-grained PATs with minimal scopes.
5757
- **Severity:** Low
5858
- **Date identified:** 2026-04-02 (identified during panel review of #32)
5959
- **Last updated:** 2026-04-06 (removed command approval references — layer pending replacement)

fly/config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env bash
22
# Shared configuration for fly machine run commands.
33

4-
APP="claudetainer"
5-
IMAGE="ghcr.io/perezd/claudetainer:latest"
4+
APP="codetainer"
5+
IMAGE="ghcr.io/perezd/codetainer:latest"
66

77
COMMON_FLAGS=(
88
--app "$APP"

scripts/attach-claude.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ for i in $(seq 1 60); do
3737
done
3838

3939
# Wait for entrypoint readiness (boot may still be cloning repo, setting up network, etc.)
40-
READY_FILE="/tmp/claudetainer-ready"
40+
READY_FILE="/tmp/codetainer-ready"
4141
if [[ ! -f "$READY_FILE" ]]; then
4242
for i in $(seq 1 300); do
4343
[[ -f "$READY_FILE" ]] && break

scripts/entrypoint.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
echo "[ENTRYPOINT] Starting claudetainer..."
4+
echo "[ENTRYPOINT] Starting codetainer..."
55

66
# === 0. Validate required secrets ===
77
missing=()
@@ -131,8 +131,8 @@ echo "nameserver 127.0.0.53" > /etc/resolv.conf
131131

132132
# === 3. Git + GitHub configuration ===
133133

134-
git config --system user.name "${GIT_USER_NAME:-claudetainer}"
135-
git config --system user.email "${GIT_USER_EMAIL:-claudetainer@noreply.github.com}"
134+
git config --system user.name "${GIT_USER_NAME:-codetainer}"
135+
git config --system user.email "${GIT_USER_EMAIL:-codetainer@noreply.github.com}"
136136

137137
# Force HTTPS for all GitHub URLs (container has no SSH client)
138138
git config --system url."https://github.com/".insteadOf "git@github.com:"
@@ -167,7 +167,7 @@ fi
167167
# Uses env var substitution — npm/bun expand ${VAR} at runtime from the process environment.
168168
# The file contains only the variable reference, not the plaintext token.
169169
cat > /home/claude/.npmrc <<'NPMRC'
170-
//npm.pkg.github.com/:_authToken=${CLAUDETAINER_NPM_TOKEN}
170+
//npm.pkg.github.com/:_authToken=${CODETAINER_NPM_TOKEN}
171171
NPMRC
172172
chown root:root /home/claude/.npmrc
173173
chmod 644 /home/claude/.npmrc
@@ -332,11 +332,11 @@ if [[ -n "${REPO_URL:-}" ]] && [[ ! -d /workspace/repo/.git ]]; then
332332
fi
333333

334334
if [[ "$READY" == "true" ]]; then
335-
touch /tmp/claudetainer-ready
335+
touch /tmp/codetainer-ready
336336
echo "[ENTRYPOINT] Ready. All checks passed."
337337
else
338338
echo "[ENTRYPOINT] WARN: Some checks failed, starting anyway."
339-
touch /tmp/claudetainer-ready
339+
touch /tmp/codetainer-ready
340340
fi
341341

342342
# Start Claude Code initialization in background (synchronized via flock)

scripts/refresh-iptables.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if [[ -f "$EXTRA_DOMAINS_FILE" ]] && [[ ! -L "$EXTRA_DOMAINS_FILE" ]]; then
4949
fi
5050

5151
echo "-A OUTPUT -p udp -j DROP" >> "$RULES_FILE"
52-
echo '-A OUTPUT -j NFLOG --nflog-prefix "CLAUDETAINER_DROP" --nflog-group 100' >> "$RULES_FILE"
52+
echo '-A OUTPUT -j NFLOG --nflog-prefix "CODETAINER_DROP" --nflog-group 100' >> "$RULES_FILE"
5353
echo "COMMIT" >> "$RULES_FILE"
5454

5555
iptables-restore < "$RULES_FILE"

scripts/start-claude.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ run_as_claude() {
2121
HOME="$CLAUDE_HOME" \
2222
PATH="$CLAUDE_HOME/.local/bin:$CLAUDE_HOME/.bun/bin:$PATH" \
2323
GH_TOKEN="$GH_PAT" \
24-
CLAUDETAINER_NPM_TOKEN="$GH_PAT" \
24+
CODETAINER_NPM_TOKEN="$GH_PAT" \
2525
CLAUDE_CODE_OAUTH_TOKEN="$CLAUDE_CODE_OAUTH_TOKEN" \
2626
LANG="$LANG" \
2727
LC_ALL="$LC_ALL" \
@@ -46,13 +46,13 @@ fi
4646
exec > >(tee -a "$START_LOG") 2>&1
4747

4848
# --- Wait for readiness ---
49-
echo "Waiting for claudetainer to be ready..."
49+
echo "Waiting for codetainer to be ready..."
5050
for i in $(seq 1 60); do
51-
[[ -f /tmp/claudetainer-ready ]] && break
51+
[[ -f /tmp/codetainer-ready ]] && break
5252
sleep 1
5353
done
5454

55-
if [[ ! -f /tmp/claudetainer-ready ]]; then
55+
if [[ ! -f /tmp/codetainer-ready ]]; then
5656
echo "WARNING: Timed out waiting for readiness (60s). Starting anyway."
5757
fi
5858

@@ -143,7 +143,7 @@ sudo -u claude \
143143
HOME="$CLAUDE_HOME" \
144144
PATH="$CLAUDE_HOME/.local/bin:$CLAUDE_HOME/.bun/bin:$PATH" \
145145
GH_TOKEN="$GH_PAT" \
146-
CLAUDETAINER_NPM_TOKEN="$GH_PAT" \
146+
CODETAINER_NPM_TOKEN="$GH_PAT" \
147147
CLAUDE_CODE_OAUTH_TOKEN="$CLAUDE_CODE_OAUTH_TOKEN" \
148148
COLORTERM="truecolor" \
149149
LANG="$LANG" \
@@ -158,7 +158,7 @@ sudo -u claude \
158158
HOME="$CLAUDE_HOME" \
159159
PATH="$CLAUDE_HOME/.local/bin:$CLAUDE_HOME/.bun/bin:$PATH" \
160160
GH_TOKEN="$GH_PAT" \
161-
CLAUDETAINER_NPM_TOKEN="$GH_PAT" \
161+
CODETAINER_NPM_TOKEN="$GH_PAT" \
162162
COLORTERM="truecolor" \
163163
LANG="$LANG" \
164164
LC_ALL="$LC_ALL" \

scripts/status.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
echo "=== Claudetainer Status ==="
4+
echo "=== Codetainer Status ==="
55
echo ""
66

77
echo "--- Recent iptables Drops ---"
8-
dmesg 2>/dev/null | grep "CLAUDETAINER_DROP" | tail -5 || echo " (none)"
8+
dmesg 2>/dev/null | grep "CODETAINER_DROP" | tail -5 || echo " (none)"
99
echo ""
1010

1111
echo "--- CoreDNS ---"

0 commit comments

Comments
 (0)