capistrano-secure-permissions 0.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 +7 -0
- data/.document +5 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +56 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +47 -0
- data/Rakefile +36 -0
- data/VERSION +1 -0
- data/capistrano-secure-permissions.gemspec +57 -0
- data/lib/capistrano/secure-permissions.rb +1 -0
- data/lib/capistrano/tasks/secure-permissions.rake +34 -0
- data/lib/secure-permissions.rb +0 -0
- metadata +99 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e824ee671212d702cafa026d37d55f783d4610db
|
4
|
+
data.tar.gz: a259d9b73e71f3bae4600fd0efd1164b0ddd7403
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 475a21e599e5437cf74697e1e9416da8214b8e9c55e3183d21384b8f5c39f92157eae5b6a40f8859bc342b2aab5290fa4066f376e35895682dcf93fe56a12713
|
7
|
+
data.tar.gz: 1c8e39235a16ac2bae7233dfd18e764ac9d9f4f4357578153889a96e68247d8725f14fe0be33ee90fe7ddedd73180870a6e2b007ff6978392d82a3d46d66fe24
|
data/.document
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
addressable (2.3.7)
|
5
|
+
builder (3.2.2)
|
6
|
+
descendants_tracker (0.0.4)
|
7
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
8
|
+
faraday (0.9.1)
|
9
|
+
multipart-post (>= 1.2, < 3)
|
10
|
+
git (1.2.9.1)
|
11
|
+
github_api (0.12.3)
|
12
|
+
addressable (~> 2.3)
|
13
|
+
descendants_tracker (~> 0.0.4)
|
14
|
+
faraday (~> 0.8, < 0.10)
|
15
|
+
hashie (>= 3.3)
|
16
|
+
multi_json (>= 1.7.5, < 2.0)
|
17
|
+
nokogiri (~> 1.6.3)
|
18
|
+
oauth2
|
19
|
+
hashie (3.4.0)
|
20
|
+
highline (1.7.1)
|
21
|
+
jeweler (2.0.1)
|
22
|
+
builder
|
23
|
+
bundler (>= 1.0)
|
24
|
+
git (>= 1.2.5)
|
25
|
+
github_api
|
26
|
+
highline (>= 1.6.15)
|
27
|
+
nokogiri (>= 1.5.10)
|
28
|
+
rake
|
29
|
+
rdoc
|
30
|
+
json (1.8.2)
|
31
|
+
jwt (1.4.1)
|
32
|
+
mini_portile (0.6.2)
|
33
|
+
multi_json (1.11.0)
|
34
|
+
multi_xml (0.5.5)
|
35
|
+
multipart-post (2.0.0)
|
36
|
+
nokogiri (1.6.6.2)
|
37
|
+
mini_portile (~> 0.6.0)
|
38
|
+
oauth2 (1.0.0)
|
39
|
+
faraday (>= 0.8, < 0.10)
|
40
|
+
jwt (~> 1.0)
|
41
|
+
multi_json (~> 1.3)
|
42
|
+
multi_xml (~> 0.5)
|
43
|
+
rack (~> 1.2)
|
44
|
+
rack (1.6.0)
|
45
|
+
rake (10.4.2)
|
46
|
+
rdoc (4.2.0)
|
47
|
+
json (~> 1.4)
|
48
|
+
thread_safe (0.3.5)
|
49
|
+
|
50
|
+
PLATFORMS
|
51
|
+
ruby
|
52
|
+
|
53
|
+
DEPENDENCIES
|
54
|
+
bundler (~> 1.0)
|
55
|
+
jeweler (~> 2.0.1)
|
56
|
+
rdoc (~> 4.2.0)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2015 Rune Schjellerup Philosof
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
= Capistrano::Secure Permissions
|
2
|
+
|
3
|
+
You should create a user to run the app as. For Phusion Passenger, set the user with PassengerUser and PassengerGroup.
|
4
|
+
That user should not own the files or have any other access to them.
|
5
|
+
The deploy user should own the files.
|
6
|
+
|
7
|
+
````
|
8
|
+
set :app_user, 'www-client-app'
|
9
|
+
set :web_user, 'www-data' # Defaults to 'www-data'
|
10
|
+
````
|
11
|
+
|
12
|
+
The `web_user` is the one serving the static files (what apache, nginx, ... is running as).
|
13
|
+
|
14
|
+
|
15
|
+
== Installation
|
16
|
+
|
17
|
+
Add this line to your application's Gemfile
|
18
|
+
|
19
|
+
````
|
20
|
+
gem 'capistrano-secure-permissions', :git => 'centic@puppet.centic.dk:repos/centic/capistrano-secure-permissions.git'
|
21
|
+
````
|
22
|
+
|
23
|
+
|
24
|
+
== Usage
|
25
|
+
|
26
|
+
Add this line to your application's Capfile
|
27
|
+
|
28
|
+
````
|
29
|
+
require 'capistrano/secure-permissions'
|
30
|
+
````
|
31
|
+
|
32
|
+
|
33
|
+
== Contributing to capistrano-secure-permissions
|
34
|
+
|
35
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
36
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
37
|
+
* Fork the project.
|
38
|
+
* Start a feature/bugfix branch.
|
39
|
+
* Commit and push until you are happy with your contribution.
|
40
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
41
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
42
|
+
|
43
|
+
|
44
|
+
== Copyright
|
45
|
+
|
46
|
+
Copyright (c) 2015 Rune Schjellerup Philosof. See LICENSE.txt for
|
47
|
+
further details.
|
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
17
|
+
gem.name = "capistrano-secure-permissions"
|
18
|
+
gem.homepage = "http://github.com/runephilosof/capistrano-secure-permissions"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Sets ACL permissions after capistrano deployment}
|
21
|
+
gem.description = %Q{This gem makes it easy to run your app with a user that only has write permissions to the public folder}
|
22
|
+
gem.email = "rune.capistrano-secure-permissions@philosof.dk"
|
23
|
+
gem.authors = ["Rune Schjellerup Philosof"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rdoc/task'
|
29
|
+
Rake::RDocTask.new do |rdoc|
|
30
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
31
|
+
|
32
|
+
rdoc.rdoc_dir = 'rdoc'
|
33
|
+
rdoc.title = "capistrano-secure-permissions #{version}"
|
34
|
+
rdoc.rdoc_files.include('README*')
|
35
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
36
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: capistrano-secure-permissions 0.1.0 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "capistrano-secure-permissions"
|
9
|
+
s.version = "0.1.0"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
13
|
+
s.authors = ["Rune Schjellerup Philosof"]
|
14
|
+
s.date = "2015-03-19"
|
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
|
+
s.email = "rune.capistrano-secure-permissions@philosof.dk"
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.rdoc"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
"Gemfile",
|
24
|
+
"Gemfile.lock",
|
25
|
+
"LICENSE.txt",
|
26
|
+
"README.rdoc",
|
27
|
+
"Rakefile",
|
28
|
+
"VERSION",
|
29
|
+
"capistrano-secure-permissions.gemspec",
|
30
|
+
"lib/capistrano/secure-permissions.rb",
|
31
|
+
"lib/capistrano/tasks/secure-permissions.rake",
|
32
|
+
"lib/secure-permissions.rb"
|
33
|
+
]
|
34
|
+
s.homepage = "http://github.com/runephilosof/capistrano-secure-permissions"
|
35
|
+
s.licenses = ["MIT"]
|
36
|
+
s.rubygems_version = "2.2.2"
|
37
|
+
s.summary = "Sets ACL permissions after capistrano deployment"
|
38
|
+
|
39
|
+
if s.respond_to? :specification_version then
|
40
|
+
s.specification_version = 4
|
41
|
+
|
42
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
43
|
+
s.add_development_dependency(%q<rdoc>, ["~> 4.2.0"])
|
44
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
45
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
|
46
|
+
else
|
47
|
+
s.add_dependency(%q<rdoc>, ["~> 4.2.0"])
|
48
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
49
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
50
|
+
end
|
51
|
+
else
|
52
|
+
s.add_dependency(%q<rdoc>, ["~> 4.2.0"])
|
53
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
54
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/secure-permissions.rake', __FILE__)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
namespace :deploy do
|
2
|
+
desc 'Secure app with file permissions'
|
3
|
+
task :secure_permissions do
|
4
|
+
on roles(:all) do
|
5
|
+
execute :setfacl, "-m", "u:www-data:x", "#{release_path}", "#{shared_path}", "#{shared_path}/public"
|
6
|
+
execute :setfacl, '--logical', '--recursive', '-m', "u:#{web_user}:rX,d:u:#{web_user}:rX,u:#{app_user}:rwX,d:u:#{app_user}:rwX", "#{release_path}/public"
|
7
|
+
execute :setfacl, '--logical', '--recursive', '-m', "d:u:#{app_user}:rX,u:#{app_user}:rX", "#{release_path}", "#{shared_path}"
|
8
|
+
execute :setfacl, '--logical', '--recursive', '-m', "d:u:#{app_user}:rwX,u:#{app_user}:rwX", "#{release_path}/log", "#{release_path}/tmp"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
after 'deploy:updated', 'deploy:secure_permissions'
|
13
|
+
end
|
14
|
+
|
15
|
+
namespace :secure_permissions do
|
16
|
+
task :validate do
|
17
|
+
on roles(:all) do
|
18
|
+
if fetch(:app_user).nil?
|
19
|
+
error "secure_permissions: app_user is not set"
|
20
|
+
exit 1
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
Capistrano::DSL.stages.each do |stage|
|
27
|
+
after stage, 'secure_permissions:validate'
|
28
|
+
end
|
29
|
+
|
30
|
+
namespace :load do
|
31
|
+
task :defaults do
|
32
|
+
set :web_user, 'www-data'
|
33
|
+
end
|
34
|
+
end
|
File without changes
|
metadata
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-secure-permissions
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rune Schjellerup Philosof
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rdoc
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.0
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: jeweler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.0.1
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.0.1
|
55
|
+
description: This gem makes it easy to run your app with a user that only has write
|
56
|
+
permissions to the public folder
|
57
|
+
email: rune.capistrano-secure-permissions@philosof.dk
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files:
|
61
|
+
- LICENSE.txt
|
62
|
+
- README.rdoc
|
63
|
+
files:
|
64
|
+
- ".document"
|
65
|
+
- Gemfile
|
66
|
+
- Gemfile.lock
|
67
|
+
- LICENSE.txt
|
68
|
+
- README.rdoc
|
69
|
+
- Rakefile
|
70
|
+
- VERSION
|
71
|
+
- capistrano-secure-permissions.gemspec
|
72
|
+
- lib/capistrano/secure-permissions.rb
|
73
|
+
- lib/capistrano/tasks/secure-permissions.rake
|
74
|
+
- lib/secure-permissions.rb
|
75
|
+
homepage: http://github.com/runephilosof/capistrano-secure-permissions
|
76
|
+
licenses:
|
77
|
+
- MIT
|
78
|
+
metadata: {}
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 2.2.2
|
96
|
+
signing_key:
|
97
|
+
specification_version: 4
|
98
|
+
summary: Sets ACL permissions after capistrano deployment
|
99
|
+
test_files: []
|