agentbbs/pods/Containerfile
Anthony Ettinger 628897609c feat(hub): "Use c0mpute network" session: chat for members, TUI for operators
New hub Sessions entry that opens the c0mpute network (free-tier AI chat on
open models) inside the member's pod, never on the BBS host:

- pods/Containerfile installs the c0mpute client stack (c0mpute binary, pinned
  bun, signed c0mpute-tui) via the official installer with --no-start and no
  peers, under /opt/c0mpute, linked onto PATH. unzip added (bun ships as a
  zip; without it the installer silently skipped the TUI). The build now fails
  if the TUI or bun is missing, and drops the installer's build-time config so
  no node identity ships in the image.
- pods/agentbbs-c0mpute signs the member in to their own c0mpute account on
  first use (device code; free account = free tier), then runs `c0mpute chat`,
  or `c0mpute tui` for operators. The key persists in /home/dev.
- Gated like the pod Shell: members only, verified email, pods available.

Tested: slim image with the same layer on ubuntu:26.04 builds; as uid 1000 with
an empty home the launcher shows the c0mpute.com/cli/approve device code, and
`c0mpute tui` renders (Chat/Jobs/Node/Network/Settings/Fleet).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 11:25:14 +00:00

81 lines
4 KiB
Docker

# AgentBBS member pod image. Built on the host by setup.sh (rootless podman),
# tagged localhost/agentbbs-pod:latest, and used for every member pod via
# AGENTBBS_POD_IMAGE. Members get a full shell here (HOME=/home/dev, persisted
# in a named volume; ~/public_html is bind-mounted to their website).
#
# Beyond a base Ubuntu it ships:
# - git + openssh-client → push to git.profullstack.com (SSH-key auth)
# - Node.js (LTS) → runtime for the AI coding CLIs
# - Claude Code + Codex CLIs → `claude` and `codex`, BYO API key per user
#
# BYO key: nothing here carries credentials. A member exports their own
# ANTHROPIC_API_KEY / OPENAI_API_KEY (or runs the tools' login flow); the keys
# live in their persisted home, never in the image.
FROM docker.io/library/ubuntu:26.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates curl gnupg unzip \
git openssh-client \
vim nano less ripgrep jq \
&& install -d -m 0755 /usr/share/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| gpg --dearmor -o /usr/share/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" \
> /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends nodejs \
&& npm install -g @anthropic-ai/claude-code @openai/codex \
&& npm cache clean --force \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# c0mpute network client (free-tier AI chat on open models): the `c0mpute`
# binary plus `c0mpute tui` (bun + c0mpute-tui), from the signed release via
# the official installer. Client only: --no-start means no worker, and the
# peers (coinpay, infernet) and ffmpeg are skipped. Installed under
# /opt/c0mpute (not $HOME, which is the member's volume) and linked onto PATH.
# Each member signs in with their own c0mpute account; the key lands in their
# persisted home, never in the image. The hub's "Use c0mpute network" entry
# runs /usr/local/bin/agentbbs-c0mpute.
COPY agentbbs-c0mpute /usr/local/bin/agentbbs-c0mpute
RUN mkdir -p /opt/c0mpute \
&& curl -fsSL https://c0mpute.com/install.sh -o /tmp/c0mpute-install.sh \
&& HOME=/opt/c0mpute NO_STORAGE_RELOCATE=1 sh /tmp/c0mpute-install.sh \
--no-start --no-coinpay --no-infernet --no-transcode --no-exec </dev/null \
&& rm -f /tmp/c0mpute-install.sh \
&& ln -sf /opt/c0mpute/.c0mpute/bin/c0mpute /usr/local/bin/c0mpute \
&& ln -sf /opt/c0mpute/.c0mpute/bin/c0mpute-tui /usr/local/bin/c0mpute-tui \
&& ln -sf /opt/c0mpute/.bun/bin/bun /usr/local/bin/bun \
&& chmod -R a+rX /opt/c0mpute \
&& chmod 0755 /usr/local/bin/agentbbs-c0mpute \
&& rm -rf /opt/c0mpute/.config /opt/c0mpute/.local/share \
&& test -x /opt/c0mpute/.c0mpute/bin/c0mpute-tui \
&& bun --version && c0mpute --version
# A login hint so members know the AI tools are present and BYO-key.
RUN printf '%s\n' \
'AgentBBS pod — coding tools ready:' \
' claude (Claude Code) — export ANTHROPIC_API_KEY=... or run: claude' \
' codex (OpenAI Codex) — export OPENAI_API_KEY=... or run: codex' \
' c0mpute (c0mpute.com) — free AI chat: c0mpute chat login, then c0mpute chat' \
' git push → git@git.profullstack.com (your BBS SSH key is your git key)' \
> /etc/motd \
&& printf '[ -n "$PS1" ] && [ -r /etc/motd ] && cat /etc/motd\n' \
> /etc/profile.d/10-agentbbs-motd.sh
# Make `git@git.profullstack.com:...` reach Forgejo's SSH server (port 2222) and
# trust it on first use, so clones/pushes just work with a forwarded agent key.
RUN install -d -m 0755 /etc/ssh/ssh_config.d \
&& printf '%s\n' \
'Host git.profullstack.com' \
' Port 2222' \
' User git' \
' StrictHostKeyChecking accept-new' \
> /etc/ssh/ssh_config.d/10-agentgit.conf \
&& grep -q 'ssh_config.d/\*.conf' /etc/ssh/ssh_config 2>/dev/null \
|| printf '\nInclude /etc/ssh/ssh_config.d/*.conf\n' >> /etc/ssh/ssh_config
CMD ["sleep", "infinity"]