mirror of https://github.com/gogs/gogs.git
modules/ssh: SSH_KEYGEN_PATH not used for exec ssh-keygen (#4124)
parent
0386b5ae54
commit
e24d62e583
|
@ -166,7 +166,7 @@ func Listen(host string, port int, ciphers []string) {
|
||||||
keyPath := filepath.Join(setting.AppDataPath, "ssh/gogs.rsa")
|
keyPath := filepath.Join(setting.AppDataPath, "ssh/gogs.rsa")
|
||||||
if !com.IsExist(keyPath) {
|
if !com.IsExist(keyPath) {
|
||||||
os.MkdirAll(filepath.Dir(keyPath), os.ModePerm)
|
os.MkdirAll(filepath.Dir(keyPath), os.ModePerm)
|
||||||
_, stderr, err := com.ExecCmd("ssh-keygen", "-f", keyPath, "-t", "rsa", "-N", "")
|
_, stderr, err := com.ExecCmd(setting.SSH.KeygenPath, "-f", keyPath, "-t", "rsa", "-N", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Sprintf("Fail to generate private key: %v - %s", err, stderr))
|
panic(fmt.Sprintf("Fail to generate private key: %v - %s", err, stderr))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue