mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-14 03:41:51 +02:00
Fix perms for http/ssh clone (#288)
This commit is contained in:
@ -89,6 +89,14 @@ func sshKeysProcess(ctx echo.Context) error {
|
||||
}
|
||||
key.Content = strings.TrimSpace(string(ssh.MarshalAuthorizedKey(pubKey)))
|
||||
|
||||
if exists, err := db.SSHKeyDoesExists(key.Content); exists {
|
||||
if err != nil {
|
||||
return errorRes(500, "Cannot check if SSH key exists", err)
|
||||
}
|
||||
addFlash(ctx, tr(ctx, "settings.ssh-key-exists"), "error")
|
||||
return redirect(ctx, "/settings")
|
||||
}
|
||||
|
||||
if err := key.Create(); err != nil {
|
||||
return errorRes(500, "Cannot add SSH key", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user