capistrano-secure-permissions 2.0.1 → 2.0.2
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 +4 -4
- data/VERSION +1 -1
- data/capistrano-secure-permissions.gemspec +2 -2
- data/lib/capistrano/tasks/secure-permissions.rake +13 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d04ac83ff009a67d9344c79aaa65ceb30df544f
|
4
|
+
data.tar.gz: 58e630cf73831fb1fdc3d29f44bb2dad886d2e37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59cda97ac2c3362347b96c159fef6a1fa213700a7a1838150f447610bf596a242b06b1a1eee7837b5e12336fa725af5a402edace6a973ffc816310064e40a739
|
7
|
+
data.tar.gz: ce07c047574a95f733cc14c22d7dfafacc4a6e0be08132f8d6cbcb1c15773e05e5e592423eedf68ea202763df926b15ceb156005856737b6b1159fe08e75c004
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.2
|
@@ -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 2.0.
|
5
|
+
# stub: capistrano-secure-permissions 2.0.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "capistrano-secure-permissions"
|
9
|
-
s.version = "2.0.
|
9
|
+
s.version = "2.0.2"
|
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"]
|
@@ -34,19 +34,22 @@ namespace :secure_permissions do
|
|
34
34
|
# Public is writable by app_user by default, so exclude that one.
|
35
35
|
# To avoid going through the files twice.
|
36
36
|
writable_dirs = fetch(:writable_dirs, fetch(:linked_dirs)).
|
37
|
-
reject { |dir| dir.start_with?('public/') }
|
38
|
-
map { |dir| shared_path.join(dir) }
|
37
|
+
reject { |dir| dir.start_with?('public/') }
|
39
38
|
# All of shared readable by app_user.
|
40
|
-
|
39
|
+
# Try to subtract the writable_dirs, to avoid going through them twice.
|
40
|
+
# But won't subtract public/system for instance... :(
|
41
|
+
readable_dirs = within(shared_path) { capture(:ls, '-A').lines.map(&:chomp) } - writable_dirs
|
41
42
|
|
42
43
|
execute :setfacl, '-m', "u:#{web_user}:x,d:u:#{web_user}:x,u:#{app_user}:rx,d:u:#{app_user}:rx", shared_path
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
within shared_path do
|
45
|
+
execute :setfacl, '-R', '-m', "u:#{app_user}:rx,d:u:#{app_user}:rx", *readable_dirs
|
46
|
+
# Set permissions for files in public, readable by web_user and writable by app_user.
|
47
|
+
# Also make sure that deploy_user retains access, to the files that app_user creates.
|
48
|
+
execute :setfacl, '-R', '-m', "u:#{web_user}:rx,u:#{app_user}:rwx,u:#{deploy_user}:rwx,d:u:#{deploy_user}:rwx,d:u:#{web_user}:rx,d:u:#{app_user}:rwx", 'public'
|
49
|
+
# Allow app_user access to writable_dirs in shared
|
50
|
+
# Also make sure that deploy_user retains access, to the files that app_user creates.
|
51
|
+
execute :setfacl, '-R', '-m', "u:#{app_user}:rwx,d:u:#{app_user}:rwx", *writable_dirs
|
52
|
+
end
|
50
53
|
end
|
51
54
|
end
|
52
55
|
end
|