recipiez 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Recipiez
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
data/recipes/apache.rb CHANGED
@@ -16,19 +16,13 @@ Capistrano::Configuration.instance(true).load do
16
16
 
17
17
  desc "PHP Vhost Setup"
18
18
  task :php_vhost do
19
-
20
- unless exists? :apache_port
21
- set :apache_port, '80'
22
- end
23
19
 
24
- unless exists? :allowed_ips
25
- set :allowed_ips, []
26
- end
20
+ _cset :apache_port, '80'
21
+ _cset :allowed_ips, []
22
+ _cset :server_aliases, []
23
+ _cset :ssl, 'off'
24
+ _cset :ssl_chain, 'none'
27
25
 
28
- unless exists? :server_aliases
29
- set :server_aliases, []
30
- end
31
-
32
26
  logger.info "generating .conf file"
33
27
  logger.info "placing #{application}.conf on remote server"
34
28
  apache_conf = "/etc/apache2/sites-available/#{application}"
data/recipes/ssl.rb CHANGED
@@ -2,27 +2,30 @@ Capistrano::Configuration.instance(true).load do
2
2
 
3
3
  namespace :ssl do
4
4
 
5
- desc "Uploads certificates to the server, default to /etc/certs"
5
+ desc "Uploads certificates to the server, default to /etc/certs, supports ssl_cert_path, ssl_key_path, ssl_chain_path"
6
6
  task :upload_certificate_pairs do
7
7
 
8
8
  _cset :base_cert_path, "/etc/certs"
9
9
  _cset :ssl_cert_path, ""
10
10
  _cset :ssl_key_path, ""
11
-
12
-
13
- put File.read(ssl_cert_path), File.basename(ssl_cert_path)
14
- put File.read(ssl_key_path), File.basename(ssl_key_path)
15
-
11
+
16
12
  begin
17
13
  sudo "mkdir #{base_cert_path}"
18
14
  rescue
19
15
  # ignore
20
16
  end
21
17
 
18
+ put File.read(ssl_cert_path), File.basename(ssl_cert_path)
19
+ put File.read(ssl_key_path), File.basename(ssl_key_path)
20
+
21
+ if exists? :ssl_chain_path
22
+ File.read(ssl_chain_path), File.basename(ssl_chain_path)
23
+ sudo "mv #{File.basename(ssl_chain_path)} #{base_cert_path}/#{File.basename(ssl_chain_path)}"
24
+ end
25
+
22
26
  sudo "mv #{File.basename(ssl_cert_path)} #{base_cert_path}/#{File.basename(ssl_cert_path)}"
23
27
  sudo "mv #{File.basename(ssl_key_path)} #{base_cert_path}/#{File.basename(ssl_key_path)}"
24
28
 
25
-
26
29
  end
27
30
 
28
31
  end
@@ -17,4 +17,39 @@ DocumentRoot <%= deploy_to %>/current/public
17
17
  Options -Indexes
18
18
  </Directory>
19
19
 
20
- </VirtualHost>
20
+ </VirtualHost>
21
+
22
+
23
+ <% if ssl == 'on' %>
24
+
25
+ <VirtualHost *:443>
26
+ ServerName <%= app_domain %>
27
+
28
+ CustomLog /var/log/apache2/<%= app_domain %>-access.log combined
29
+ ErrorLog /var/log/apache2/<%= app_domain %>-error.log
30
+ DocumentRoot <%= deploy_to %>/current/public
31
+
32
+ SSLEngine on
33
+ SSLCertificateFile <%= ssl_cert %>
34
+ SSLCertificateKeyFile <%= ssl_key %>
35
+
36
+ <% if ssl_chain != 'none' %>
37
+ SSLCertificateChainFile <%= ssl_chain %>
38
+ <% end %>
39
+
40
+ SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
41
+
42
+ </VirtualHost>
43
+
44
+ <% end %>
45
+
46
+
47
+ DocumentRoot /var/www-apps/activecollab/public
48
+
49
+ SSLEngine on
50
+ SSLCertificateFile /etc/apache2/ssl/project.blissio.com.crt
51
+ SSLCertificateKeyFile /etc/apache2/ssl/project.blissio.com.key
52
+ SSLCertificateChainFile /etc/apache2/ssl/globalsign.roots.crt
53
+ SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
54
+
55
+ RewriteEngine On
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recipiez
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alastair Brunton
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-14 00:00:00 +01:00
18
+ date: 2011-12-15 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency