Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/chef
diff options
context:
space:
mode:
authorzhitomirskiyi <ilya@joindiaspora.com>2011-01-18 00:38:02 +0300
committerzhitomirskiyi <ilya@joindiaspora.com>2011-01-18 02:56:06 +0300
commit390e19ecdd6a1a0c1b6ba2660ddb0a47d72a11f1 (patch)
tree416d9b0edd3531b9e82f46599d47561774ace8a5 /chef
parent47671ac3324b73cea1e7e156b1eb17b41abd4fcb (diff)
some sod modz
Diffstat (limited to 'chef')
-rw-r--r--chef/cookbooks/common/files/default/thins.yml4
-rw-r--r--chef/cookbooks/common/recipes/nginx.rb3
-rw-r--r--chef/cookbooks/common/templates/default/nginx.conf.erb4
3 files changed, 8 insertions, 3 deletions
diff --git a/chef/cookbooks/common/files/default/thins.yml b/chef/cookbooks/common/files/default/thins.yml
index 1b981d300..37ec634b3 100644
--- a/chef/cookbooks/common/files/default/thins.yml
+++ b/chef/cookbooks/common/files/default/thins.yml
@@ -2,6 +2,8 @@ thins:
- port: '3001'
- port: '3002'
- port: '3003'
-url: 'alpha.joindiaspora.com'
+url: 'joindiaspora.com'
cert_location: '/usr/local/nginx/conf/diaspora.crt'
key_location: '/usr/local/nginx/conf/diaspora.key'
+s3_bucket: "https://joindiaspora.s3.amazonaws.com"
+s3_path: "/uploads/images/'
diff --git a/chef/cookbooks/common/recipes/nginx.rb b/chef/cookbooks/common/recipes/nginx.rb
index aa07b168e..df2b41aa2 100644
--- a/chef/cookbooks/common/recipes/nginx.rb
+++ b/chef/cookbooks/common/recipes/nginx.rb
@@ -29,5 +29,6 @@ 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'], :cert_location => config['cert_location'], :key_location => config['key_location']
+ variables :ports => config['thins'].map{|thin| "#{thin["port"]}"}, :url => config['url'], :cert_location => config['cert_location'], :key_location => config['key_location'],
+ :s3_bucket => config['s3_bucket'] , :s3_path => config['s3_path']
end
diff --git a/chef/cookbooks/common/templates/default/nginx.conf.erb b/chef/cookbooks/common/templates/default/nginx.conf.erb
index a8aa121ec..c038d82c9 100644
--- a/chef/cookbooks/common/templates/default/nginx.conf.erb
+++ b/chef/cookbooks/common/templates/default/nginx.conf.erb
@@ -109,7 +109,9 @@ http {
break;
}
- rewrite ^/uploads/images/(.*)$ https://joindiaspora.s3.amazonaws.com/uploads/images/$1 permanent;
+ <% unless @s3_bucket.blank? || @s3_path.blank? %>
+ <%= "rewrite ^/uploads/images/(.*)$ #{@s3_bucket}#{@s3_path}$1 permanent; %>
+ <% end %>
}
error_page 500 502 503 504 /50x.html;