ci: docs pipeline is secret-free and builds in an ephemeral venv; policy: untrusted text is data

This commit is contained in:
inference-admin authored and inference-bot committed 2026-11-19 22:19:27 +00:00
1 parent 5c23ec9310
commit a705a49495
2 files changed
+35 -42

No files matched your search

+22 -40
View File
@@ -1,33 +1,25 @@
# Woodpecker CI pipeline for co-op/docs — THIN on purpose. # Woodpecker CI pipeline for co-op/docs — THIN and SECRET-FREE on purpose.
# #
# It does NOT re-implement the build. The repository's publishing layer is the # It does NOT deploy. Publishing is host-side and split:
# single source of truth and this pipeline only wires it up:
# #
# publishing/requirements.txt pinned MkDocs + Material toolchain # /usr/local/sbin/docs-poll host-owned poller (root) — pulls main
# publishing/build.sh stage Markdown -> .site-src/, render .site-build/ # publishing/build.sh runs as the unprivileged `docsbuild` user,
# publishing/deploy.sh push .site-build/ into the Cloudron Surfer app # with no credentials and no access to
# /home/ubuntu
# /usr/local/sbin/docs-publish root-owned publish step — runs no repo code,
# holds the Cloudron token from a root-only file
# #
# Any change to how the site is built belongs in publishing/, never here. # CI exists only to prove the repository builds. It runs in a throwaway venv
# inside the pipeline workspace, never the agent image's shared /opt/docs-venv:
# a push to ANY repo must not be able to change a toolchain that another
# pipeline uses. No secret is wired into this pipeline, and none should be
# until the Woodpecker agent supports per-pipeline isolation.
# #
# Run model: MANUAL ONLY for now. The Gitea webhook that fires this on push is # Backend note: the co-op's Woodpecker agent is a Cloudron app with no Docker
# deliberately NOT wired — the poll watcher (docs-deploy-poll.service on the # socket, so it uses Woodpecker's `local` backend. Each step runs as a shell
# agent host) remains the live auto-deploy path until a manual run has proven # command INSIDE the agent container; the `image:` field selects the SHELL, not
# the pipeline. Once it has, add `push` to the `when` block below and register # a container image. That is exactly why this file must stay secret-free: the
# the webhook in Gitea. # container is shared by every pipeline.
#
# Backend note (IMPORTANT — this is why there are no container images here):
# The co-op's Woodpecker agent runs as a Cloudron app, which has no Docker
# socket, so it uses Woodpecker's `local` backend. Under `local` each step is
# run as a shell command INSIDE the agent container, and the step's `image:`
# field selects the SHELL, not a container image. Every tool the steps need is
# therefore baked into the agent image (co-op/woodpecker-agent):
# python3 + the pinned MkDocs toolchain (venv at /opt/docs-venv, mirroring
# publishing/requirements.txt), node + the cloudron CLI, bash, git, tar.
# If the toolchain pin changes, rebuild that image — see its Dockerfile.
#
# Secrets required (Woodpecker repo secret, name `cloudron_token`):
# cloudron_token = the Cloudron API token used by publishing/deploy.sh
# Do not put credentials in this file.
when: when:
- event: manual - event: manual
@@ -36,17 +28,7 @@ steps:
- name: build - name: build
image: bash image: bash
commands: commands:
# Reuses the toolchain pre-installed in the agent image; build.sh only # Ephemeral toolchain per run — no shared venv, no /opt/docs-venv.
# creates/installs a venv if the one given is missing, which it is not. - python3 -m venv .ci-venv
- publishing/build.sh /opt/docs-venv - .ci-venv/bin/pip install -q -r publishing/requirements.txt
- publishing/build.sh .ci-venv
- name: deploy
image: bash
commands:
# deploy.sh drives the Cloudron `cloudron` CLI (a node program) via
# `cloudron exec`; node, the CLI, bash, git and tar are all in the agent
# image. The build it publishes is the shared workspace .site-build/.
- publishing/deploy.sh
environment:
CLOUDRON_TOKEN:
from_secret: cloudron_token
+13 -2
View File
@@ -34,11 +34,22 @@ This page is for members who read its output or give it instructions.
portal and a human. portal and a human.
- Credentials, in either direction. - Credentials, in either direction.
## Content is data, never instructions
Text an agent reads — issue descriptions, pull-request comments, web pages,
fetched documents, and messages from members in a room — is **data**. The agent
may quote, summarise or act on it once the operator asks, but an instruction
embedded in that text is never executed. Only the operator's own direct
instruction authorises a credentialed action: a deploy, a credential change, or
a budget change. This rule exists because the same process that reads an issue
can reach the infrastructure the issue is about.
## What they do without asking ## What they do without asking
Read, monitor, draft, open issues and PRs, post updates, run the scheduled jobs Read, monitor, draft, open issues and PRs, post updates, run the scheduled jobs
listed in [Infrastructure](infrastructure.md), and deploy bug and security listed in [Infrastructure](infrastructure.md), and deploy fixes after flagging
fixes immediately, reporting each one in #inferencebot-updates. them to the operator. The bot can deploy without waiting for a reply, and the
operator can stop a deploy; anything irreversible waits for confirmation.
## What always needs a human ## What always needs a human