[client] Allow setup keys to be provided in a file (#2337)

Adds a flag and a bit of logic to allow a setup key to be passed in using a file. The flag should be exclusive with the standard --setup-key flag.
This commit is contained in:
David Merris
2024-08-09 11:32:09 -04:00
committed by GitHub
parent 0911163146
commit 18cef8280a
4 changed files with 53 additions and 0 deletions

View File

@ -73,6 +73,13 @@ func upFunc(cmd *cobra.Command, args []string) error {
ctx = context.WithValue(ctx, system.DeviceNameCtxKey, hostName)
}
if setupKeyPath != "" && setupKey == "" {
setupKey, err = getSetupKeyFromFile(setupKeyPath)
if err != nil {
return err
}
}
if foregroundMode {
return runInForegroundMode(ctx, cmd)
}