sc deploy cannot build a service whose build needs a secret #46
Labels
No labels
⏳in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grey.ooo/someones.computer_agent#46
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's missing
sc deployhas no way to carry a build-time secret (e.g.GIT_AUTH_TOKENfor aprivate git build context or context authenticated composer/npm install) from
a compose file's
build.secrets:through to the platform. Confirmed against areal service (minf's
sw-front/sw-core, git.grey.ooo/Shapeways):App\Service\Compose\ComposeParser::build()on the server side (Someones.Computer)keeps only
dockerfileandadditional_contextsfrom a service'sbuild:block —argsandsecretsare dropped before the manifest is even built. Documented indocs/agent-cli.md, closed out of #704 as a real gap ("build-time
args,dockerfile_inlineandsecretsare not supported anywhere in the pipelinetoday... a feature request rather than a doc fix").
scCLI (this repo) has no corresponding client-side support either —nothing reads
build.secrets, packages secret material, or sends it in thebundle manifest.
Impact
Any service whose Dockerfile needs a secret to build — a private git context, an
authenticated composer/npm install to dodge GitHub's unauthenticated rate limit —
cannot be built by
sc deployat all today. The only workaround is building theimage locally (where the secret is available) and letting
scforward thealready-built image instead of building it — works, but means
sc deployisn'tactually driving the build for those services, which defeats a chunk of the point
of
sc deployfor exactly the kind of private-repo service most teams have.Scope (rough — needs real design, not a docs tweak)
contexts[].secrets[](name +how the client should resolve its value — an env var, a file, a credential
helper) without ever writing the value to disk unencrypted or logging it.
sc(client): readbuild.secrets:from the compose file, resolve eachnamed secret the same way
docker compose builddoes (env var interpolation,.env, etc.), and send it alongside the bundle — analogous to how contexts arepackaged and uploaded today, but for a value that must never land in the
uploaded tarball itself or in any log.
ComposeParserneeds to keepbuild.secrets,BundleContext/BundleManifestneed a field for it, andApp\Service\Build\BuildKitBuilderneeds to mount each one as a BuildKit--secretfor the build (the same mechanism it already uses for its ownGIT_AUTH_TOKENwhen cloning a primary git context — this would extend thatto tenant-supplied secrets).
credential material crossing the trust boundary into the platform's build
worker. It should probably be short-lived, scoped to the one build, and never
persisted past that build's lifetime — closer to how the registry push token
is handled than to how a
Variable(/cli/applications/{slug}/variables) is.Where this came from
Hit while getting minf (git.grey.ooo/Shapeways/minf) running on
someones.computer service-by-service:
sw-front's only build context is aprivate Forgejo repo (needs
FORGEJO_AUTH_TOKENjust to clone), andsw-core'scomposer install needs
GIT_AUTH_TOKENto avoid GitHub's rate limit on ~78concurrent dist fetches (minf's own compose.yml flags this exact problem as
unresolved for its own local builds). Both are cross-built locally and forwarded
as a workaround for now; this issue is what would let
sc deploybuild themdirectly instead.