mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-24 02:05:27 +02:00
fix linter
This commit is contained in:
@@ -36,7 +36,7 @@ func SSHKeys(ctx *context.Context) {
|
||||
|
||||
publicKeyWithComment, _ := keypair.GetPublicKeyWithComment(ctx)
|
||||
ctx.Data["SSHKeypair"] = struct {
|
||||
*user_model.UserSSHKeypair
|
||||
*user_model.SSHKeypair
|
||||
PublicKeyWithComment string
|
||||
}{keypair, publicKeyWithComment}
|
||||
|
||||
@@ -45,7 +45,7 @@ func SSHKeys(ctx *context.Context) {
|
||||
|
||||
// RegenerateSSHKey regenerates the SSH keypair for organization mirror operations
|
||||
func RegenerateSSHKey(ctx *context.Context) {
|
||||
_, err := user_model.RegenerateUserSSHKeypair(ctx, ctx.Org.Organization.ID)
|
||||
_, err := user_model.RegenerateSSHKeypair(ctx, ctx.Org.Organization.ID)
|
||||
if err != nil {
|
||||
ctx.ServerError("RegenerateSSHKeypairForOrg", err)
|
||||
return
|
||||
|
||||
@@ -350,10 +350,10 @@ func loadKeysData(ctx *context.Context) {
|
||||
// Create a struct with the public key including comment
|
||||
publicKeyWithComment, _ := mirrorKeypair.GetPublicKeyWithComment(ctx)
|
||||
mirrorKeyData := struct {
|
||||
*user_model.UserSSHKeypair
|
||||
*user_model.SSHKeypair
|
||||
PublicKeyWithComment string
|
||||
}{
|
||||
UserSSHKeypair: mirrorKeypair,
|
||||
SSHKeypair: mirrorKeypair,
|
||||
PublicKeyWithComment: publicKeyWithComment,
|
||||
}
|
||||
|
||||
@@ -363,9 +363,9 @@ func loadKeysData(ctx *context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// RegenerateUserSSHKeypair regenerates the SSH keypair for repository mirroring
|
||||
func RegenerateUserSSHKeypair(ctx *context.Context) {
|
||||
_, err := user_model.RegenerateUserSSHKeypair(ctx, ctx.Doer.ID)
|
||||
// RegenerateSSHKeypair regenerates the SSH keypair for repository mirroring
|
||||
func RegenerateSSHKeypair(ctx *context.Context) {
|
||||
_, err := user_model.RegenerateSSHKeypair(ctx, ctx.Doer.ID)
|
||||
if err != nil {
|
||||
ctx.ServerError("RegenerateSSHKeypairForUser", err)
|
||||
return
|
||||
|
||||
+1
-1
@@ -673,7 +673,7 @@ func registerWebRoutes(m *web.Router, webAuth *AuthMiddleware) {
|
||||
m.Combo("/keys").Get(user_setting.Keys).
|
||||
Post(web.Bind(forms.AddKeyForm{}), user_setting.KeysPost)
|
||||
m.Post("/keys/delete", user_setting.DeleteKey)
|
||||
m.Post("/keys/mirror-ssh/regenerate", user_setting.RegenerateUserSSHKeypair)
|
||||
m.Post("/keys/mirror-ssh/regenerate", user_setting.RegenerateSSHKeypair)
|
||||
m.Group("/packages", func() {
|
||||
m.Get("", user_setting.Packages)
|
||||
m.Group("/rules", func() {
|
||||
|
||||
Reference in New Issue
Block a user