mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 14:03:24 +09:00
feat(ssh): auto generate additional ssh keys (#33974)
adds capabilities for gitea to generate ecdsa and ed25519 keys by default adds cli for built-in ssh key generation helpers closes: https://github.com/go-gitea/gitea/issues/33783 --------- Co-authored-by: Nicolas <bircni@icloud.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
co-authored by
Nicolas
wxiaoguang
Giteabot
parent
ade76fe838
commit
d76a974b24
+5
-12
@@ -38,22 +38,15 @@ func argsSet(c *cli.Command, args ...string) error {
|
||||
}
|
||||
|
||||
// confirm waits for user input which confirms an action
|
||||
func confirm() (bool, error) {
|
||||
func confirm(stdin io.Reader, stdout io.Writer, msg string, args ...any) bool {
|
||||
var response string
|
||||
|
||||
_, err := fmt.Scanln(&response)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
_, _ = fmt.Fprintf(stdout, msg, args...)
|
||||
_, _ = fmt.Fscanln(stdin, &response)
|
||||
switch strings.ToLower(response) {
|
||||
case "y", "yes":
|
||||
return true, nil
|
||||
case "n", "no":
|
||||
return false, nil
|
||||
default:
|
||||
return false, errors.New(response + " isn't a correct confirmation string")
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func initDB(ctx context.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user