capistrano-secure-permissions 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5e063cf2332cf561a787adad1400f7d3a3f61bf
4
- data.tar.gz: e6ece33f6fa10e0387adacf95c99e517304217be
3
+ metadata.gz: dcb168baea26dd687cd2069239b4e69c83a6518c
4
+ data.tar.gz: f61bab29029db23bcea09eb215e4e80d3b84534a
5
5
  SHA512:
6
- metadata.gz: bb21ab8f1acd791d874b8970420016ed88de81b06ed9cf25bf41be79ac2098595f450d65806eb20ee7fe1a0a5e46d14cc16796e3136e318ad17c2e037a9fe1b3
7
- data.tar.gz: a45217ee314566b085c9384a2c9586aeda647085e688d73462a09b3d166594f6756858b0adeacf748489a1feba874fc80dbc83b45decf4419b795de123d86510
6
+ metadata.gz: 9c5dba3b8eeb5e0a6e36d6d45cacdc4050e6010b516a53368ac18973b06159c774d762f5b61ac4ce45d80fb89619327c70613ed10dd7a966d0b6b052af5fa80e
7
+ data.tar.gz: 73f2d924ff63a97b72bfdfa9ba6edfc2cc58a3a220c7e12fe4ea3f259c949d1eaf8a078c9094a9468537e0e9465ce0423eb64ae7b4581952f17d20ff7f358cdd
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.1.0
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: capistrano-secure-permissions 1.0.1 ruby lib
5
+ # stub: capistrano-secure-permissions 1.1.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "capistrano-secure-permissions"
9
- s.version = "1.0.1"
9
+ s.version = "1.1.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -5,9 +5,15 @@ namespace :deploy do
5
5
  web_user = fetch(:web_user)
6
6
  app_user = fetch(:app_user)
7
7
  deploy_user = server.user
8
+ linked_dirs = fetch(:linked_dirs)
8
9
 
9
10
  # Set parent folders accessable by web_user.
10
- execute :setfacl, "-m", "u:#{web_user}:x", "#{release_path}", "#{shared_path}", "#{shared_path}/public"
11
+ parent_folders = [
12
+ release_path,
13
+ shared_path,
14
+ ]
15
+ parent_folders << "#{shared_path}/public" if linked_dirs.any? { |d| d.start_with?('public') }
16
+ execute :setfacl, "-m", "u:#{web_user}:x", *parent_folders
11
17
  # Set all except public, tmp, and log readable by app_user.
12
18
  execute :find, release_path, '-regex', '\./\(public\|tmp\|log\)', '-prune', '-o', '-user', deploy_user, '-print0', '|', 'xargs', '-0', '--no-run-if-empty', 'setfacl', '-m', "u:#{app_user}:rX"
13
19
  # Set log and tmp writable by app_user.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-secure-permissions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rune Schjellerup Philosof