mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-06-28 01:27:50 +02:00
Register: add --token-file flag
At the moment, the only way to pass the secret Gitea token to the runner CLI is directly through a CLI parameter. That's an issue on a multi-user system where the CLI parameters are world-readable through /proc/PID/cmdline. On a Linux system, there's sadly no way to hide the cmdline parameters. We usually go around this limitation by storing the secrets in a file and protect it through tight ACL rules. Adding a way to inject the secret token via a file during the register command. As a nice side-effect, this improves the systemd integration by allowing us to directly use the LoadCredential mechanism.
This commit is contained in:
@ -37,6 +37,7 @@ func Execute(ctx context.Context) {
|
||||
registerCmd.Flags().BoolVar(®Args.NoInteractive, "no-interactive", false, "Disable interactive mode")
|
||||
registerCmd.Flags().StringVar(®Args.InstanceAddr, "instance", "", "Gitea instance address")
|
||||
registerCmd.Flags().StringVar(®Args.Token, "token", "", "Runner token")
|
||||
registerCmd.Flags().StringVar(®Args.TokenFile, "token-file", "", "Path to a file containing the runner token")
|
||||
registerCmd.Flags().StringVar(®Args.RunnerName, "name", "", "Runner name")
|
||||
registerCmd.Flags().StringVar(®Args.Labels, "labels", "", "Runner tags, comma separated")
|
||||
rootCmd.AddCommand(registerCmd)
|
||||
|
Reference in New Issue
Block a user