Allow adding SSH keys even if SSH server is disabled (#24025)
This is useful in case you want to use them for signature verification. A notice is added to avoid confusion.
This commit is contained in:
parent
d7552c27d3
commit
eb397c3e63
3 changed files with 9 additions and 12 deletions
|
@ -16,7 +16,6 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/process"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
@ -158,10 +157,6 @@ func parseKeyString(content string) (string, error) {
|
|||
// CheckPublicKeyString checks if the given public key string is recognized by SSH.
|
||||
// It returns the actual public key line on success.
|
||||
func CheckPublicKeyString(content string) (_ string, err error) {
|
||||
if setting.SSH.Disabled {
|
||||
return "", db.ErrSSHDisabled{}
|
||||
}
|
||||
|
||||
content, err = parseKeyString(content)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue