mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 12:30:41 +01:00
chore(ssh-agent): sock file name
This commit is contained in:
parent
6c0ff218bb
commit
85d9936082
@ -98,7 +98,7 @@ func (key *AccessKey) startSshAgent(logger lib.Logger) (lib.SshAgent, error) {
|
||||
Passphrase: []byte(key.SshKey.Passphrase),
|
||||
},
|
||||
},
|
||||
SocketFile: path.Join(util.Config.TmpPath, fmt.Sprintf("ssh-agent-%d-%d.sock", time.Now().Unix(), 0)),
|
||||
SocketFile: path.Join(util.Config.TmpPath, fmt.Sprintf("ssh-agent-%d-%d.sock", key.ID, time.Now().Unix())),
|
||||
}
|
||||
|
||||
return sshAgent, sshAgent.Listen()
|
||||
|
@ -24,29 +24,6 @@ type Inventory struct {
|
||||
Type string `db:"type" json:"type"`
|
||||
}
|
||||
|
||||
//func (i *Inventory) StartSshAgent(logger lib.Logger) (lib.SshAgent, error) {
|
||||
//
|
||||
// sshAgent := lib.SshAgent{
|
||||
// Logger: logger,
|
||||
// Keys: []lib.SshAgentKey{
|
||||
// {
|
||||
// Key: []byte(i.SSHKey.SshKey.PrivateKey),
|
||||
// Passphrase: []byte(i.SSHKey.SshKey.Passphrase),
|
||||
// },
|
||||
// },
|
||||
// SocketFile: path.Join(util.Config.TmpPath, fmt.Sprintf("ssh-agent-%d-%d.sock", time.Now().Unix(), 0)),
|
||||
// }
|
||||
//
|
||||
// if i.BecomeKeyID != nil {
|
||||
// sshAgent.Keys = append(sshAgent.Keys, lib.SshAgentKey{
|
||||
// Key: []byte(i.BecomeKey.SshKey.PrivateKey),
|
||||
// Passphrase: []byte(i.BecomeKey.SshKey.Passphrase),
|
||||
// })
|
||||
// }
|
||||
//
|
||||
// return sshAgent, sshAgent.Listen()
|
||||
//}
|
||||
|
||||
func FillInventory(d Store, inventory *Inventory) (err error) {
|
||||
if inventory.SSHKeyID != nil {
|
||||
inventory.SSHKey, err = d.GetAccessKey(inventory.ProjectID, *inventory.SSHKeyID)
|
||||
|
Loading…
Reference in New Issue
Block a user