capistrano-secure-permissions 0.5.0 → 0.6.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: 3b069c6664b551ed94e521c602a999c7e5f690fc
4
- data.tar.gz: 957052ccd4f3d48c96dd5e9037ca7b70b351a8b2
3
+ metadata.gz: 1d4408c3155757896ba51bac6edb9c08b23dd90b
4
+ data.tar.gz: 1e39b876bb834e65bbabb086d5182efafa8f1481
5
5
  SHA512:
6
- metadata.gz: 9239528ae63b367cd6bf0b78b67d1254046dfa7179e86f2c6d8cab1ef53c89ca8f950d08a57a948a99963b9e52ecfa97b392e9c2b12e14225ba12f4cab0dd012
7
- data.tar.gz: 4a51f89077bddb0f6e418844644170f77d72f1686003728366b7f6febc22565f838a80f2ba158bb5e831cdac9ed842512b4ca348d196535fa440c967007dbc79
6
+ metadata.gz: 5787545d4d7c5da4943a15d2f83368502955524f0e15c76c4ada24931573cef885929a6465bd7b508bfb6b858a72ef6461f678436d987fdc7b46b1107fb6d6bc
7
+ data.tar.gz: 839d0feff3a2cb984fed75ad1a95e08cbfcdc15bdbdeadf4bbc041ac430270f35a365de66bb75cadce0a0baca8e468f466c964c189957d56df342dd38411071b
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.0
@@ -2,16 +2,16 @@
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 0.5.0 ruby lib
5
+ # stub: capistrano-secure-permissions 0.6.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "capistrano-secure-permissions"
9
- s.version = "0.5.0"
9
+ s.version = "0.6.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"]
13
13
  s.authors = ["Rune Schjellerup Philosof"]
14
- s.date = "2016-02-23"
14
+ s.date = "2016-03-29"
15
15
  s.description = "This gem makes it easy to run your app with a user that only has write permissions to the public folder"
16
16
  s.email = "rune.capistrano-secure-permissions@philosof.dk"
17
17
  s.extra_rdoc_files = [
@@ -10,10 +10,6 @@ namespace :deploy do
10
10
  execute :setfacl, "-m", "u:#{web_user}:x", "#{release_path}", "#{shared_path}", "#{shared_path}/public"
11
11
  # Set all except public, tmp, and log readable by app_user.
12
12
  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
- # Set permissions for files in public, readable på web_user and writable by app_user.
14
- execute :find, '-L', "#{release_path}/public", '-user', deploy_user, '-not', '-type', 'l', '-print0', '|', 'xargs', '-0', '--no-run-if-empty', 'setfacl', '-m', "u:#{web_user}:rX,u:#{app_user}:rwX"
15
- # Set defaults for directories in public (that is permissions for new files made by the app).
16
- execute :find, "#{shared_path}/public", '-user', deploy_user, '-type', 'd', '-print0', '|', 'xargs', '-0', '--no-run-if-empty', 'setfacl', '-m', "d:u:#{web_user}:rX,d:u:#{app_user}:rwX"
17
13
  # Set log and tmp writable by app_user.
18
14
  execute :find, '-L', "#{release_path}/log", "#{release_path}/tmp", '-user', deploy_user, '-print0', '|', 'xargs', '-0', '--no-run-if-empty', 'setfacl', '-m', "u:#{app_user}:rwX"
19
15
  end
@@ -31,6 +27,18 @@ namespace :secure_permissions do
31
27
  end
32
28
  end
33
29
  end
30
+
31
+ desc 'Sets permissions on the public folder, only needs to be done once, not on every deploy. And there might be a lot of files, so it might take a while.'
32
+ task :setup do
33
+ web_user = fetch(:web_user)
34
+ app_user = fetch(:app_user)
35
+ deploy_user = server.user
36
+
37
+ # Set permissions for files in public, readable by web_user and writable by app_user.
38
+ execute :find, '-L', "#{release_path}/public", '-user', deploy_user, '-not', '-type', 'l', '-print0', '|', 'xargs', '-0', '--no-run-if-empty', 'setfacl', '-m', "u:#{web_user}:rX,u:#{app_user}:rwX"
39
+ # Set defaults for directories in public (that is permissions for new files made by the app).
40
+ execute :find, "#{shared_path}/public", '-user', deploy_user, '-type', 'd', '-print0', '|', 'xargs', '-0', '--no-run-if-empty', 'setfacl', '-m', "d:u:#{web_user}:rX,d:u:#{app_user}:rwX"
41
+ end
34
42
  end
35
43
 
36
44
  Capistrano::DSL.stages.each do |stage|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-secure-permissions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rune Schjellerup Philosof
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-23 00:00:00.000000000 Z
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc