Set owner of metadata
Unittests / unittests (push) Successful in 9s Details
Unittests / deploy-dev (push) Successful in 45s Details

This commit is contained in:
Adam Štrauch 2024-01-31 00:16:40 +01:00
parent 5513da35b3
commit 45899f3b0c
Signed by: cx
GPG Key ID: 7262DAFE292BCE20
2 changed files with 15 additions and 0 deletions

View File

@ -655,6 +655,18 @@ func (p *Processor) SaveMetadata(metadata string) error {
return err
}
// Set permissions
err = os.Chmod(path.Join(volumePath, ".metadata.json"), 0600)
if err != nil {
return err
}
// Set owner
err = os.Chown(path.Join(volumePath, ".metadata.json"), ownerUID, ownerGID)
if err != nil {
return err
}
return nil
}

View File

@ -2,6 +2,9 @@ package glue
import "github.com/rosti-cz/node-api/apps"
const ownerUID = 1000
const ownerGID = 1000
// Path where authorized keys are
const sshPubKeysLocation = "/srv/.ssh/authorized_keys"