mmmultiworks 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,47 @@
1
+ Capistrano.configuration(:must_exist).load do
2
+
3
+ desc "Setup svn repository"
4
+ task :setup_svn, :roles => :scm do
5
+ dir = "#{deploy_to}/repos"
6
+ run "mkdir -p #{dir}"
7
+ run "chmod 770 #{dir}"
8
+ run "svnadmin create #{dir}"
9
+ run "chmod -R g+w #{dir}/db/transactions"
10
+ run "chmod g+w #{dir}/db/write-lock"
11
+ run "chmod -R g+w #{dir}/db/revs"
12
+ run "chmod -R g+w #{dir}/db/revprops"
13
+ run "chmod g+w #{dir}/db"
14
+
15
+ end
16
+
17
+ desc "Import code into svn repository."
18
+ task :import_svn do
19
+ new_path = "../#{application}_mmm"
20
+ tags = repository.sub("trunk", "tags")
21
+ branches = repository.sub("trunk", "branches")
22
+ puts "Adding branches and tags"
23
+ system "svn mkdir -m 'Adding tags and branches directories' #{tags} #{branches}"
24
+ puts "Importing application."
25
+ system "svn import #{repository} -m 'Import'"
26
+ puts "Checking out to new directory."
27
+ system "svn co #{repository} #{new_path}"
28
+ cwd = Dir.getwd
29
+ Dir.chdir new_path
30
+ puts "removing log directory contents from svn"
31
+ system "svn remove log/*"
32
+ puts "ignoring log directory"
33
+ system "svn propset svn:ignore '*.log' log/"
34
+ system "svn update log/"
35
+ puts "removing tmp directory from svn"
36
+ system "svn remove tmp/"
37
+ puts "ignoring tmp directory"
38
+ system "svn propset svn:ignore '*' tmp/"
39
+ system "svn update tmp/"
40
+ puts "committing changes"
41
+ system "svn commit -m 'Removed and ignored log files and tmp'"
42
+ Dir.chdir cwd
43
+ puts "Your repository is: #{repository}"
44
+ puts "Please change to your new working directory: #{new_path}"
45
+ end
46
+
47
+ end
@@ -0,0 +1,74 @@
1
+ <VirtualHost <%= apache_ssl_ip %>:443>
2
+
3
+ ServerName <%= apache_server_name %>
4
+ <% apache_server_aliases_array.each do |a| %>
5
+ ServerAlias <%= "#{a}" %>
6
+ <% end %>
7
+ DocumentRoot <%= "#{current_path}/public" %>
8
+
9
+ <Directory <%= "#{current_path}/public" %>>
10
+ Options FollowSymLinks
11
+ AllowOverride None
12
+ Order allow,deny
13
+ Allow from all
14
+ </Directory>
15
+
16
+ # Configure mongrel_cluster
17
+ <Proxy balancer://<%= "#{application}_cluster" %>>
18
+ <% start_port = apache_proxy_port %>
19
+ <% end_port = apache_proxy_port + apache_proxy_servers - 1 %>
20
+ <% start_port.upto(end_port) do |port| %>
21
+ BalancerMember http://<%= "#{apache_proxy_address}:#{port.to_s}" %>
22
+ <% end %>
23
+ </Proxy>
24
+
25
+ RewriteEngine On
26
+
27
+ # Prevent access to .svn directories
28
+ RewriteRule ^(.*/)?\.svn/ - [F,L]
29
+ ErrorDocument 403 "Access Forbidden"
30
+
31
+ # Check for maintenance file and redirect all requests
32
+ RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
33
+ RewriteCond %{SCRIPT_FILENAME} !maintenance.html
34
+ RewriteRule ^.*$ /system/maintenance.html [L]
35
+
36
+ # Rewrite index to check for static
37
+ RewriteRule ^/$ /index.html [QSA]
38
+
39
+ # Rewrite to check for Rails cached page
40
+ RewriteRule ^([^.]+)$ $1.html [QSA]
41
+
42
+ # Redirect all non-static requests to cluster
43
+ RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
44
+ # Add header for Mongrel to set HTTPS environment for Rails
45
+ RequestHeader set X-Forwarded-Proto "https"
46
+ RewriteRule ^/(.*)$ balancer://<%= "#{application}_cluster" %>%{REQUEST_URI} [P,QSA,L]
47
+
48
+ # Deflate
49
+ AddOutputFilterByType DEFLATE text/html text/plain text/xml
50
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
51
+ BrowserMatch ^Mozilla/4\.0[678] no-gzip
52
+ BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
53
+
54
+ # SSL Engine Switch
55
+ SSLEngine on
56
+
57
+ # SSL Cipher Suite:
58
+ SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
59
+
60
+ # Server Certificate
61
+ SSLCertificateFile /etc/httpd/conf/ssl.crt/<%= domain %>.crt
62
+
63
+ # Server Private Key
64
+ SSLCertificateKeyFile /etc/httpd/conf/ssl.key/<%= domain %>.key
65
+
66
+ BrowserMatch ".*MSIE.*" \
67
+ nokeepalive ssl-unclean-shutdown \
68
+ downgrade-1.0 force-response-1.0
69
+
70
+ ErrorLog logs/<%= domain %>-error_log
71
+ CustomLog logs/<%= domain %>-access_log combined
72
+ CustomLog logs/<%= domain %>-ssl_log \
73
+ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
74
+ </VirtualHost>
@@ -0,0 +1,63 @@
1
+
2
+
3
+ <VirtualHost <%= apache_ssl_enabled ? apache_ssl_ip : "*" %>:80>
4
+ ServerName <%= apache_server_name %>
5
+ <% apache_server_aliases_array.each do |a| %>
6
+ ServerAlias <%= "#{a}" %>
7
+ <% end %>
8
+ DocumentRoot <%= "#{current_path}/public" %>
9
+
10
+ <Directory <%= "#{current_path}/public" %>>
11
+ Options FollowSymLinks
12
+ AllowOverride None
13
+ Order allow,deny
14
+ Allow from all
15
+ </Directory>
16
+
17
+ # Configure mongrel_cluster
18
+ <Proxy balancer://<%= "#{application}_cluster" %>>
19
+ <% start_port = apache_proxy_port %>
20
+ <% end_port = apache_proxy_port + apache_proxy_servers - 1 %>
21
+ <% start_port.upto(end_port) do |port| %>
22
+ BalancerMember http://<%= "#{apache_proxy_address}:#{port.to_s}" %>
23
+ <% end %>
24
+ </Proxy>
25
+
26
+ RewriteEngine On
27
+
28
+ <% if apache_ssl_enabled && apache_ssl_forward_all %>
29
+ RewriteRule ^(.*)$ https://<%= domain %>$1
30
+ <% end %>
31
+
32
+ # Prevent access to .svn directories
33
+ RewriteRule ^(.*/)?\.svn/ - [F,L]
34
+ ErrorDocument 403 "Access Forbidden"
35
+
36
+ # Check for maintenance file and redirect all requests
37
+ RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
38
+ RewriteCond %{SCRIPT_FILENAME} !maintenance.html
39
+ RewriteRule ^.*$ /system/maintenance.html [L]
40
+
41
+ # Rewrite index to check for static
42
+ RewriteRule ^/$ /index.html [QSA]
43
+
44
+ # Rewrite to check for Rails cached page
45
+ RewriteRule ^([^.]+)$ $1.html [QSA]
46
+
47
+ # Redirect all non-static requests to cluster
48
+ RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
49
+ RewriteRule ^/(.*)$ balancer://<%= "#{application}_cluster" %>%{REQUEST_URI} [P,QSA,L]
50
+
51
+ # Deflate
52
+ AddOutputFilterByType DEFLATE text/html text/plain text/xml
53
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
54
+ BrowserMatch ^Mozilla/4\.0[678] no-gzip
55
+ BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
56
+
57
+ ErrorLog logs/<%= domain %>-error_log
58
+ CustomLog logs/<%= domain %>-access_log combined
59
+ </VirtualHost>
60
+
61
+ <% if apache_ssl_enabled %>
62
+ Include "<%= apache_ssl_config %>"
63
+ <% end %>
@@ -0,0 +1,3 @@
1
+ ---
2
+ :debug: false
3
+
@@ -0,0 +1,18 @@
1
+ User "nobody"
2
+ Group "nobody"
3
+
4
+ ListenHTTP
5
+ Address <%= ip_address %>
6
+ Port 80
7
+
8
+ Service
9
+ Backend
10
+ Address 127.0.0.1
11
+ Port 8000
12
+ End
13
+ Backend
14
+ Address 127.0.0.1
15
+ Port 8001
16
+ End
17
+ End
18
+ End
data/tools/rakehelp.rb ADDED
@@ -0,0 +1,105 @@
1
+
2
+ def make(makedir)
3
+ Dir.chdir(makedir) do
4
+ sh(PLATFORM =~ /win32/ ? 'nmake' : 'make')
5
+ end
6
+ end
7
+
8
+
9
+ def extconf(dir)
10
+ Dir.chdir(dir) do ruby "extconf.rb" end
11
+ end
12
+
13
+
14
+ def setup_tests
15
+ Rake::TestTask.new do |t|
16
+ t.libs << "test"
17
+ t.test_files = FileList['test/test*.rb']
18
+ t.verbose = true
19
+ end
20
+ end
21
+
22
+
23
+ def setup_clean otherfiles
24
+ files = ['build/*', '**/*.o', '**/*.so', '**/*.a', 'lib/*-*', '**/*.log'] + otherfiles
25
+ CLEAN.include(files)
26
+ end
27
+
28
+
29
+ def setup_rdoc files
30
+ Rake::RDocTask.new do |rdoc|
31
+ rdoc.rdoc_dir = 'doc/rdoc'
32
+ rdoc.options << '--line-numbers'
33
+ rdoc.rdoc_files.add(files)
34
+ end
35
+ end
36
+
37
+
38
+ def setup_extension(dir, extension)
39
+ ext = "ext/#{dir}"
40
+ ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
41
+ ext_files = FileList[
42
+ "#{ext}/*.c",
43
+ "#{ext}/*.h",
44
+ "#{ext}/extconf.rb",
45
+ "#{ext}/Makefile",
46
+ "lib"
47
+ ]
48
+
49
+ task "lib" do
50
+ directory "lib"
51
+ end
52
+
53
+ desc "Builds just the #{extension} extension"
54
+ task extension.to_sym => ["#{ext}/Makefile", ext_so ]
55
+
56
+ file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
57
+ extconf "#{ext}"
58
+ end
59
+
60
+ file ext_so => ext_files do
61
+ make "#{ext}"
62
+ cp ext_so, "lib"
63
+ end
64
+ end
65
+
66
+
67
+ def base_gem_spec(pkg_name, pkg_version)
68
+ pkg_version = pkg_version
69
+ pkg_name = pkg_name
70
+ pkg_file_name = "#{pkg_name}-#{pkg_version}"
71
+ Gem::Specification.new do |s|
72
+ s.name = pkg_name
73
+ s.version = pkg_version
74
+ s.platform = Gem::Platform::RUBY
75
+ s.has_rdoc = true
76
+ s.extra_rdoc_files = [ "README" ]
77
+
78
+ s.files = %w(COPYING LICENSE README Rakefile) +
79
+ Dir.glob("{bin,doc/rdoc,test,lib}/**/*") +
80
+ Dir.glob("ext/**/*.{h,c,rb}") +
81
+ Dir.glob("examples/**/*.rb") +
82
+ Dir.glob("tools/*.rb")
83
+
84
+ s.require_path = "lib"
85
+ s.extensions = FileList["ext/**/extconf.rb"].to_a
86
+ s.bindir = "bin"
87
+ end
88
+ end
89
+
90
+ def setup_gem(pkg_name, pkg_version)
91
+ spec = base_gem_spec(pkg_name, pkg_version)
92
+ yield spec if block_given?
93
+
94
+ Rake::GemPackageTask.new(spec) do |p|
95
+ p.gem_spec = spec
96
+ p.need_tar = true
97
+ end
98
+ end
99
+
100
+ def setup_win32_gem(pkg_name, pkg_version)
101
+ spec = base_gem_spec(pkg_name, pkg_version)
102
+ yield spec if block_given?
103
+
104
+ Gem::Builder.new(spec).build
105
+ end
metadata ADDED
@@ -0,0 +1,114 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.2
3
+ specification_version: 1
4
+ name: mmmultiworks
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.1.0
7
+ date: 2007-03-04 00:00:00 -06:00
8
+ summary: The Mosquito Mole Multiworks task library
9
+ require_paths:
10
+ - lib
11
+ email:
12
+ homepage:
13
+ rubyforge_project:
14
+ description: The Mosquito Mole Multiworks task library
15
+ autorequire:
16
+ default_executable: mmmultiworks
17
+ bindir: bin
18
+ has_rdoc: false
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
29
+ authors:
30
+ - Matt Bauer
31
+ files:
32
+ - COPYING
33
+ - LICENSE
34
+ - README
35
+ - Rakefile
36
+ - bin/mmmultiworks
37
+ - lib/mmmultiworks
38
+ - lib/mmmultiworks/generators
39
+ - lib/mmmultiworks/recipes
40
+ - lib/mmmultiworks/recipes.rb
41
+ - lib/mmmultiworks/generators/loader.rb
42
+ - lib/mmmultiworks/generators/mmmultiworks
43
+ - lib/mmmultiworks/generators/mmmultiworks/mmmultiworks_generator.rb
44
+ - lib/mmmultiworks/generators/mmmultiworks/templates
45
+ - lib/mmmultiworks/generators/mmmultiworks/USAGE
46
+ - lib/mmmultiworks/generators/mmmultiworks/templates/deploy.rb
47
+ - lib/mmmultiworks/recipes/apache.rb
48
+ - lib/mmmultiworks/recipes/mongrel.rb
49
+ - lib/mmmultiworks/recipes/mysql.rb
50
+ - lib/mmmultiworks/recipes/svn.rb
51
+ - lib/mmmultiworks/recipes/templates
52
+ - lib/mmmultiworks/recipes/templates/httpd-ssl.conf
53
+ - lib/mmmultiworks/recipes/templates/httpd.conf
54
+ - tools/rakehelp.rb
55
+ - resources/defaults.yaml
56
+ - resources/pound.conf
57
+ test_files: []
58
+
59
+ rdoc_options: []
60
+
61
+ extra_rdoc_files:
62
+ - README
63
+ executables:
64
+ - mmmultiworks
65
+ extensions: []
66
+
67
+ requirements: []
68
+
69
+ dependencies:
70
+ - !ruby/object:Gem::Dependency
71
+ name: daemons
72
+ version_requirement:
73
+ version_requirements: !ruby/object:Gem::Version::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: 0.3.13.0
78
+ version:
79
+ - !ruby/object:Gem::Dependency
80
+ name: termios
81
+ version_requirement:
82
+ version_requirements: !ruby/object:Gem::Version::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 0.3.13.0
87
+ version:
88
+ - !ruby/object:Gem::Dependency
89
+ name: capistrano
90
+ version_requirement:
91
+ version_requirements: !ruby/object:Gem::Version::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: 1.1.0
96
+ version:
97
+ - !ruby/object:Gem::Dependency
98
+ name: mongrel
99
+ version_requirement:
100
+ version_requirements: !ruby/object:Gem::Version::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: 0.3.13.0
105
+ version:
106
+ - !ruby/object:Gem::Dependency
107
+ name: mongrel_cluster
108
+ version_requirement:
109
+ version_requirements: !ruby/object:Gem::Version::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: "0.2"
114
+ version: