Use an agent token for Woodpecker agent to stop it from re-registering

With the shared system token, every time the Woodpecker host would
restart, a new Woodpecker agent registration would be created, because
the agent receives a unique ID on first connection using the system
token, which it couldn't store however, because it doesn't have a
writable config file in NixOS.
Use an agent token now, which doesn't require the agent to store a
unique ID in a wrtiable config, therefore not making it re-register.

Also see:
https://woodpecker-ci.org/docs/administration/agent-config#agent-registration
This commit is contained in:
June 2024-06-22 16:26:58 +02:00
commit f5432bd682
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
3 changed files with 11 additions and 18 deletions

View file

@ -19,9 +19,13 @@
# Set via enviornmentFile:
# WOODPECKER_AGENT_SECRET
};
environmentFile = [ "/run/secrets/woodpecker_agent_secret_environment_file" ];
environmentFile = [ "/run/secrets/woodpecker_agent_environment_file" ];
};
# Remainder defined in ../woodpecker-server/woodpecker-server.nix
sops.secrets."woodpecker_agent_secret_environment_file".restartUnits = [ "woodpecker-agent-podman.service" ];
sops.secrets."woodpecker_agent_environment_file" = {
mode = "0440";
owner = "root";
group = "root";
restartUnits = [ "woodpecker-agent-podman.service" ];
};
}