eb_capistrano_extensions 0.0.1
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.
- data/MIT-LICENSE +20 -0
- data/README.md +0 -0
- data/lib/eb_capistrano_extensions.rb +34 -0
- metadata +71 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 [Expected Behavior, LLC]
|
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.md
ADDED
File without changes
|
@@ -0,0 +1,34 @@
|
|
1
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
set :rails_root, "#{File.dirname(__FILE__)}/.."
|
3
|
+
|
4
|
+
desc "Verify that the firewall configuration of the production boxes is correct"
|
5
|
+
task :verify_firewall do
|
6
|
+
hosts_to_verify = find_servers.map {|server| IPSocket.getaddress(server.host) }
|
7
|
+
hosts_to_verify.each do |from_ip|
|
8
|
+
hosts_to_verify.each do |to_ip|
|
9
|
+
system "ssh root@#{from_ip} 'ufw allow from #{to_ip} to any'"
|
10
|
+
end
|
11
|
+
system "ssh root@#{from_ip} 'ufw reload'"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Make sure that MySQL access is granted to everything it should"
|
16
|
+
task :verify_mysql_access, :roles => :db do
|
17
|
+
require 'escape'
|
18
|
+
database_servers = find_servers_for_task(current_task)
|
19
|
+
password = Capistrano::CLI.password_prompt("what is the database root password?")
|
20
|
+
password = Escape.shell_command([password])
|
21
|
+
production_ips = find_servers.map {|server| [server.host, IPSocket.getaddress(server.host)] }
|
22
|
+
database_config = YAML::load(File.open("#{rails_root}/config/database.yml"))[rails_env]
|
23
|
+
|
24
|
+
database_servers.each do |db_server_ip|
|
25
|
+
production_ips.each do |hostname, ip|
|
26
|
+
grant_statement = %{grant all on #{database_config['database']}.* to `#{database_config['username']}`@`#{ip}` identified by '#{database_config['password']}';}
|
27
|
+
grant_statement = Escape.shell_command(["echo", grant_statement])
|
28
|
+
command = Escape.shell_command(["ssh", "root@#{db_server_ip}", grant_statement, "|", "mysql", "-u root -p#{password}"])
|
29
|
+
system command
|
30
|
+
puts "granted access to #{hostname} for db server #{db_server_ip}"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: eb_capistrano_extensions
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Matt Gordon
|
14
|
+
- Joel Meador
|
15
|
+
- Chris Moore
|
16
|
+
autorequire:
|
17
|
+
bindir: bin
|
18
|
+
cert_chain: []
|
19
|
+
|
20
|
+
date: 2011-12-14 00:00:00 -05:00
|
21
|
+
default_executable:
|
22
|
+
dependencies: []
|
23
|
+
|
24
|
+
description: Provides useful capistrano extensions for use in multiple projects
|
25
|
+
email: matt@expectedbehavior.com
|
26
|
+
executables: []
|
27
|
+
|
28
|
+
extensions: []
|
29
|
+
|
30
|
+
extra_rdoc_files: []
|
31
|
+
|
32
|
+
files:
|
33
|
+
- README.md
|
34
|
+
- MIT-LICENSE
|
35
|
+
- lib/eb_capistrano_extensions.rb
|
36
|
+
has_rdoc: true
|
37
|
+
homepage: http://expectedbehavior.com
|
38
|
+
licenses: []
|
39
|
+
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
none: false
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
hash: 3
|
51
|
+
segments:
|
52
|
+
- 0
|
53
|
+
version: "0"
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 3
|
60
|
+
segments:
|
61
|
+
- 0
|
62
|
+
version: "0"
|
63
|
+
requirements: []
|
64
|
+
|
65
|
+
rubyforge_project:
|
66
|
+
rubygems_version: 1.6.0
|
67
|
+
signing_key:
|
68
|
+
specification_version: 3
|
69
|
+
summary: Provides useful capistrano extensions for use in multiple projects
|
70
|
+
test_files: []
|
71
|
+
|