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:
parent
9950f5a5bd
commit
ca96e04e5f
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue