Browse Source

fix problem with #1879

Unknwon 9 years ago
parent
commit
75aab86a8d
5 changed files with 4 additions and 3 deletions
  1. 1 1
      gogs.go
  2. 1 1
      models/publickey.go
  3. 0 0
      modules/bindata/bindata.go
  4. 1 0
      modules/setting/setting.go
  5. 1 1
      templates/.VERSION

+ 1 - 1
gogs.go

@@ -17,7 +17,7 @@ import (
 	"github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.6.20.1031 Beta"
+const APP_VER = "0.6.20.1102 Beta"
 
 func init() {
 	runtime.GOMAXPROCS(runtime.NumCPU())

+ 1 - 1
models/publickey.go

@@ -243,7 +243,7 @@ func CheckPublicKeyString(content string) (_ string, err error) {
 		}
 		keyType := strings.Trim(sshKeygenOutput[len(sshKeygenOutput)-1], " ()")
 		if minimumKeySize := setting.Service.MinimumKeySizes[keyType]; minimumKeySize == 0 {
-			return "", errors.New("sorry, unrecognized public key type")
+			return "", fmt.Errorf("unrecognized public key type: %s", keyType)
 		} else if keySize < minimumKeySize {
 			return "", fmt.Errorf("the minimum accepted size of a public key %s is %d", keyType, minimumKeySize)
 		}

File diff suppressed because it is too large
+ 0 - 0
modules/bindata/bindata.go


+ 1 - 0
modules/setting/setting.go

@@ -453,6 +453,7 @@ func newService() {
 	Service.EnableCaptcha = sec.Key("ENABLE_CAPTCHA").MustBool()
 
 	minimumKeySizes := Cfg.Section("service.minimum_key_sizes").Keys()
+	Service.MinimumKeySizes = make(map[string]int)
 	for _, key := range minimumKeySizes {
 		Service.MinimumKeySizes[key.Name()] = key.MustInt()
 	}

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.6.20.1031 Beta
+0.6.20.1102 Beta

Some files were not shown because too many files changed in this diff