0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-23 15:53:07 -05:00

#1681 carry --config flag for builtin SSH

This commit is contained in:
Unknwon 2015-11-30 15:40:05 -05:00
parent 9950f5a5bd
commit ca96e04e5f

View file

@ -65,7 +65,10 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) {
cmdName := strings.TrimLeft(payload, "'()")
os.Setenv("SSH_ORIGINAL_COMMAND", 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()
if err != nil {
@ -153,6 +156,7 @@ func Listen(port int) {
if err != nil {
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)