SSH keys related logging
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/promote/production Build is failing Details

This commit is contained in:
Adam Štrauch 2023-06-30 00:46:15 +02:00
parent 4a4da2c080
commit e9fb6a6b46
Signed by: cx
GPG Key ID: 018304FFA8988F8D
1 changed files with 3 additions and 0 deletions

View File

@ -244,7 +244,9 @@ func (p *Processor) Create(appTemplate apps.App) error {
time.Sleep(5 * time.Second) // We wait for a little bit longer to make sure the container is fully started
// Setup SSH keys if it's noted in the request
log.Println("Checking if SSH key is required")
if len(appTemplate.Setup.SSHKeys) > 0 && len(appTemplate.Snapshot) == 0 {
log.Println("Setting up SSH keys")
err = p.UpdateKeys(appTemplate.Setup.SSHKeys)
if err != nil {
return fmt.Errorf("failed to update keys: %v", err)
@ -456,6 +458,7 @@ func (p *Processor) UpdateKeys(keys string) error {
return err
}
log.Println("Storing keys into " + sshPubKeysLocation)
err = container.AppendFile(sshPubKeysLocation, keys+"\n", "0600")
if err != nil {
return err