Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Let a job declare the secrets it reads

4ac42680eca3181efc70099f65d6e2c9f45e9dd2 · Keenan Nemetz · 7d ago · parent 0c40a1d3

Let a job declare the secrets it reads

A job now names the repository secrets it needs, and the instance delivers
those values when the job is leased. The workflow carries names only, so the
queue row, the metadata branch and the run record never hold a value: the
record names the version of each value the job ran with, which is what makes a
result say which one it used.

    jobs:
      deploy:
        image: alpine:3.22
        secrets: [DEPLOY_KEY]

A name the repository has no value for is not a failure. The variable is left
unset rather than empty, the step's shell can tell the difference, and the
runner writes one line to the log saying which value was missing. That keeps
an optional secret optional and leaves "required" with the step, where someone
can write the message: ${DEPLOY_KEY:?DEPLOY_KEY is not set}.

The value reaches the step through a file the runner writes into the run
directory it already mounts at /run/vole for an event payload, and each step is
prefixed with `. /run/vole/secrets.env`. That is deliberately not an env-file
argument to the runtime, which cannot carry a line break, and not --env, which
puts the value in the process's argument list where every process on the host
can read it. A local `vole workflow run` writes the same file, reading the
values with the developer's own credential, and says which ones it could not
read.

The name rule and the 128 KiB limit moved to ci, next to the environment rules
they mirror, so the store refuses a name no workflow could declare and the
workflow refuses a name no process environment could carry.

Slice 2 of #154.

ci/agent/validate.go +27

@@ -159,6 +159,33 @@ func validateJob(job *runnerJob) error {
159 159 }
160 160 }
161 161
162 // The values are written into a file the step's shell sources and then into the
163 // step's environment, so the runner checks what it is about to write rather than
164 // trusting the instance to have checked it. A name that could not be a variable,
165 // or a value that no process environment can carry, is refused before the
166 // checkout exists.
167 for name, delivered := range job.Secrets {
168 if err := ci.ValidateSecretName(name); err != nil {
169 add("secret: %v", err)
170 continue
171 }
172 switch {
173 case ci.ReservedEnvName(name):
174 add("secret %s would replace a variable the runner sets", name)
175 case delivered.Version < 1:
176 add("secret %s has no version", name)
177 case strings.ContainsRune(delivered.Value, 0):
178 add("secret %s contains a NUL byte", name)
179 case len(name)+1+len(delivered.Value) > ci.MaxSecretBytes:
180 add("secret %s is larger than one environment variable can hold", name)
181 }
182 }
183 for _, issue := range job.Missing {
184 if ci.ValidateSecretName(issue.Name) != nil || strings.ContainsAny(issue.Reason, "\x00\r\n") {
185 add("missing secret %q is not a name the runner can report", issue.Name)
186 }
187 }
188
162 189 if len(problems) == 0 {
163 190 return nil
164 191 }