Set owner of metadata
This commit is contained in:
parent
5513da35b3
commit
45899f3b0c
12
glue/main.go
12
glue/main.go
@ -655,6 +655,18 @@ func (p *Processor) SaveMetadata(metadata string) error {
|
|||||||
return err
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@ package glue
|
|||||||
|
|
||||||
import "github.com/rosti-cz/node-api/apps"
|
import "github.com/rosti-cz/node-api/apps"
|
||||||
|
|
||||||
|
const ownerUID = 1000
|
||||||
|
const ownerGID = 1000
|
||||||
|
|
||||||
// Path where authorized keys are
|
// Path where authorized keys are
|
||||||
const sshPubKeysLocation = "/srv/.ssh/authorized_keys"
|
const sshPubKeysLocation = "/srv/.ssh/authorized_keys"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user