env/instances: Guarantee that right 'authorized_keys' file is created
This commit is contained in:
parent
086b359e17
commit
477152814a
2 changed files with 7 additions and 9 deletions
10
env/instances.go
vendored
10
env/instances.go
vendored
|
|
@ -245,14 +245,12 @@ func (instance Instance) Stack() stack.Installable {
|
||||||
"GLOBAL_AUTHORIZED_KEYS_FILE": instance.dis.Config.GlobalAuthorizedKeysFile,
|
"GLOBAL_AUTHORIZED_KEYS_FILE": instance.dis.Config.GlobalAuthorizedKeysFile,
|
||||||
},
|
},
|
||||||
|
|
||||||
CopyContextFiles: nil,
|
|
||||||
|
|
||||||
TouchFiles: []string{
|
|
||||||
"authorized_keys",
|
|
||||||
},
|
|
||||||
|
|
||||||
MakeDirsPerm: fs.ModeDir | fs.ModePerm,
|
MakeDirsPerm: fs.ModeDir | fs.ModePerm,
|
||||||
MakeDirs: []string{"data", ".composer"},
|
MakeDirs: []string{"data", ".composer"},
|
||||||
|
|
||||||
|
TouchFiles: []string{
|
||||||
|
filepath.Join("data", "authorized_keys"),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,10 @@ type Installable struct {
|
||||||
|
|
||||||
CopyContextFiles []string // Files to copy from the installation context
|
CopyContextFiles []string // Files to copy from the installation context
|
||||||
|
|
||||||
TouchFiles []string // Files to 'touch', i.e. ensure that exist
|
|
||||||
|
|
||||||
MakeDirsPerm fs.FileMode // permission for diretories, defaults to fs.ModeDir
|
MakeDirsPerm fs.FileMode // permission for diretories, defaults to fs.ModeDir
|
||||||
MakeDirs []string // directories to ensure that exist
|
MakeDirs []string // directories to ensure that exist
|
||||||
|
|
||||||
|
TouchFiles []string // Files to 'touch', i.e. ensure that exist; guaranteed to be run after MakeDirs
|
||||||
}
|
}
|
||||||
|
|
||||||
// InstallationContext is a context to install data in
|
// InstallationContext is a context to install data in
|
||||||
|
|
@ -61,7 +61,7 @@ func (is Installable) Install(io stream.IOStream, context InstallationContext) e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure that certain files exist
|
// make sure that certain dirs exist
|
||||||
for _, name := range is.MakeDirs {
|
for _, name := range is.MakeDirs {
|
||||||
// find the destination!
|
// find the destination!
|
||||||
dst := filepath.Join(is.Dir, name)
|
dst := filepath.Join(is.Dir, name)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue