Sha256: 81361f78d0681dd249148d4116088e1ceee4587ef2fe957fdacc6dd88f25407f

Contents?: true

Size: 1.64 KB

Versions: 1

Compression:

Stored size: 1.64 KB

Contents

# Capistrano::SimplePermissions

Capistrano task for ensuring specific permissions (including owner and group) on files and folders on deploy.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'capistrano-simple-permissions'
```

Then add it to your `Capfile`:

```ruby
require 'capistrano/simple_permissions'
```

And then:

```sh
$ bundle install
```

## How it works

This gem hooks into Capistrano's deploy process by executing several `chmod` and `chown` commands after the
`deploy:log_revision` portion of Capistrano's [flow](https://capistranorb.com/documentation/getting-started/flow/). See
the source for more details.

## Options

- ```ruby
    set :permissions_folders, []
  ```

  - Sets the folders that should be recursively affected by both `chmod` and `chown`. A sensible setting to use would be
    `set :permissions_folders, [fetch(:deploy_to)]` in your `deploy.rb`

- ```ruby
  set :chmod_folder_permissions, "775"
  ```

  - Sets the permissions for folders that `chmod` will affect

- ```ruby
  set :chmod_file_permissions, "664"
  ```

  - Sets the permissions for files that `chmod` will affect

- ```ruby
  set :chown_owner, ""
  ```

  - Sets the owner of the files for `chown`. Note that the command isn't run as root so changing this to anything other
    than the default of `""` might cause errors unless your deploy user has the correct permissions.

- ```ruby
  set :chown_group, "web"
  ```

  - Sets the group of the files for `chown`.

## Contributing

Bug reports and pull requests are welcome!

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano-simple-permissions-0.1.0 README.md