bolt icon indicating copy to clipboard operation
bolt copied to clipboard

[FR] Ability to set `mode`/`group`[/`owner`] in `write_file()` and `upload_file()` functions

Open jay7x opened this issue 1 year ago • 0 comments

Use Case

It'd be nice to have an ability to set an uploaded file mode and ownership.

Describe the Solution You Would Like

upload_file($source, $destination, $targets, $description, {
  run_as => 'root',
  mode => '0600',
  group => 'www-data',
  owner => 'admin',
})

As write_file() calls upload_file() internally, it should just work also.

It's easy from the first sight but it might require a discussion on how to implement this securely.

jay7x avatar Feb 15 '24 11:02 jay7x