mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-04 14:46:57 -05:00
#1681 carry --config flag for builtin SSH
This commit is contained in:
parent
9950f5a5bd
commit
ca96e04e5f
@ -65,7 +65,10 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) {
|
|||||||
cmdName := strings.TrimLeft(payload, "'()")
|
cmdName := strings.TrimLeft(payload, "'()")
|
||||||
os.Setenv("SSH_ORIGINAL_COMMAND", cmdName)
|
os.Setenv("SSH_ORIGINAL_COMMAND", cmdName)
|
||||||
log.Trace("Payload: %v", cmdName)
|
log.Trace("Payload: %v", cmdName)
|
||||||
cmd := exec.Command(setting.AppPath, "serv", "key-"+keyID)
|
|
||||||
|
args := []string{"serv", "key-" + keyID, "--config=" + setting.CustomConf}
|
||||||
|
log.Trace("Arguments: %v", args)
|
||||||
|
cmd := exec.Command(setting.AppPath, args...)
|
||||||
|
|
||||||
stdout, err := cmd.StdoutPipe()
|
stdout, err := cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -153,6 +156,7 @@ func Listen(port int) {
|
|||||||
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))
|
||||||
}
|
}
|
||||||
|
log.Trace("New private key is generateed: %s", keyPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
privateBytes, err := ioutil.ReadFile(keyPath)
|
privateBytes, err := ioutil.ReadFile(keyPath)
|
||||||
|
Loading…
Reference in New Issue
Block a user