This commit is contained in:
parent
4c2bcdd3e7
commit
d465421fa0
1 changed files with 5 additions and 4 deletions
|
@ -16,7 +16,8 @@ import (
|
|||
// username in the containers under which all containers run
|
||||
const appUsername = "app"
|
||||
const passwordFile = "/srv/.rosti"
|
||||
const keyType = "ed25519"
|
||||
const deployKeyType = "ed25519"
|
||||
const deployKeyPrefix = "rosti_deploy"
|
||||
|
||||
// Process contains info about background application usually running in supervisor
|
||||
type Process struct {
|
||||
|
@ -248,7 +249,7 @@ func (c *Container) GenerateDeploySSHKeys() (bool, error) {
|
|||
return false, err
|
||||
}
|
||||
|
||||
_, err = driver.Exec(c.App.Name, []string{"ssh-keygen", "-t", keyType, "-f", "/srv/.ssh/id_" + keyType, "-P", ""}, "", []string{}, true)
|
||||
_, err = driver.Exec(c.App.Name, []string{"ssh-keygen", "-t", deployKeyType, "-f", "/srv/.ssh/" + deployKeyPrefix + "_id_" + deployKeyType, "-P", ""}, "", []string{}, true)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
@ -266,11 +267,11 @@ func (c *Container) GenerateDeploySSHKeys() (bool, error) {
|
|||
func (c *Container) GetDeploySSHKeys() (string, string, error) {
|
||||
driver := c.getDriver()
|
||||
|
||||
privateKey, err := driver.Exec(c.App.Name, []string{"cat", "/srv/.ssh/id_" + keyType}, "", []string{}, true)
|
||||
privateKey, err := driver.Exec(c.App.Name, []string{"cat", "/srv/.ssh/" + deployKeyPrefix + "_id_" + deployKeyType}, "", []string{}, true)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
pubKey, err := driver.Exec(c.App.Name, []string{"cat", "/srv/.ssh/id_" + keyType + ".pub"}, "", []string{}, true)
|
||||
pubKey, err := driver.Exec(c.App.Name, []string{"cat", "/srv/.ssh/" + deployKeyPrefix + "_id_" + deployKeyType + ".pub"}, "", []string{}, true)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue