From e8d86d6d078f04832320daa3c18889d7fa55d2c9 Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Fri, 19 Nov 2010 18:14:14 -0800 Subject: [PATCH] pulled out the certlocations to a config file --- Gemfile.lock | 3 +++ chef/cookbooks/common/files/default/thins.yml | 2 ++ chef/cookbooks/common/recipes/nginx.rb | 2 +- chef/cookbooks/common/templates/default/nginx.conf.erb | 4 ++-- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6125d083a..13fc8ecb9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -142,6 +142,8 @@ GEM childprocess (0.1.4) ffi (~> 0.6.3) closure-compiler (0.3.3) + cloudfiles (1.4.9) + mime-types (>= 1.16) columnize (0.3.2) configuration (1.1.0) crack (0.1.8) @@ -363,6 +365,7 @@ DEPENDENCIES capybara (~> 0.3.9) carrierwave! chef + cloudfiles cucumber-rails (= 0.3.2) database_cleaner (= 0.5.2) devise (= 1.1.3) diff --git a/chef/cookbooks/common/files/default/thins.yml b/chef/cookbooks/common/files/default/thins.yml index 12980b6b6..1b981d300 100644 --- a/chef/cookbooks/common/files/default/thins.yml +++ b/chef/cookbooks/common/files/default/thins.yml @@ -3,3 +3,5 @@ thins: - port: '3002' - port: '3003' url: 'alpha.joindiaspora.com' +cert_location: '/usr/local/nginx/conf/diaspora.crt' +key_location: '/usr/local/nginx/conf/diaspora.key' diff --git a/chef/cookbooks/common/recipes/nginx.rb b/chef/cookbooks/common/recipes/nginx.rb index 033cbef60..aa07b168e 100644 --- a/chef/cookbooks/common/recipes/nginx.rb +++ b/chef/cookbooks/common/recipes/nginx.rb @@ -29,5 +29,5 @@ end config = YAML.load_file("/usr/local/app/diaspora/chef/cookbooks/common/files/default/thins.yml") template "/usr/local/nginx/conf/nginx.conf" do source "nginx.conf.erb" - variables :ports => config['thins'].map{|thin| "#{thin["port"]}"}, :url => config['url'] + variables :ports => config['thins'].map{|thin| "#{thin["port"]}"}, :url => config['url'], :cert_location => config['cert_location'], :key_location => config['key_location'] end diff --git a/chef/cookbooks/common/templates/default/nginx.conf.erb b/chef/cookbooks/common/templates/default/nginx.conf.erb index 6ecb25d64..633c082f7 100644 --- a/chef/cookbooks/common/templates/default/nginx.conf.erb +++ b/chef/cookbooks/common/templates/default/nginx.conf.erb @@ -65,8 +65,8 @@ http { root /usr/local/app/diaspora/public; ssl on; - ssl_certificate /usr/local/nginx/conf/diaspora.crt; - ssl_certificate_key /usr/local/nginx/conf/diaspora.key; + ssl_certificate <%= @cert_location %>; + ssl_certificate_key <%= @key_location %>; location / { proxy_set_header X-Real-IP $remote_addr;