Skip to content

Commit

Permalink
buildkite-agent: demotivate potential secrecy regressions through doc…
Browse files Browse the repository at this point in the history
…umentation

# Conflicts:
#	nixos/modules/services/continuous-integration/buildkite-agent.nix
  • Loading branch information
deepfire authored and domenkozar committed Nov 25, 2017
1 parent 815dc9d commit d6069f8
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -86,10 +86,13 @@ in
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
environment.HOME = "/var/lib/buildkite-agent";

## NB: maximum care is taken so that secrets (ssh keys and the CI token)
## don't end up in the Nix store.
preStart = ''
${pkgs.coreutils}/bin/mkdir -m 0700 -p /var/lib/buildkite-agent/.ssh
${copyOrEcho cfg.openssh.privateKey "/var/lib/buildkite-agent/.ssh/id_rsa" 600}
${copyOrEcho cfg.openssh.publicKey "/var/lib/buildkite-agent/.ssh/id_rsa.pub" 600}
${copyOrEcho (toString cfg.openssh.privateKey) "/var/lib/buildkite-agent/.ssh/id_rsa" 600}
${copyOrEcho (toString cfg.openssh.publicKey) "/var/lib/buildkite-agent/.ssh/id_rsa.pub" 600}
cat > "/var/lib/buildkite-agent/buildkite-agent.cfg" <<EOF
token="${catOrLiteral cfg.token}"
Expand Down

0 comments on commit d6069f8

Please sign in to comment.