from-scratch 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Berksfile +2 -1
- data/Berksfile.lock +20 -1
- data/cookbooks/bluepill/CHANGELOG.md +93 -0
- data/cookbooks/bluepill/README.md +91 -0
- data/cookbooks/bluepill/attributes/default.rb +44 -0
- data/cookbooks/bluepill/metadata.json +1 -0
- data/cookbooks/bluepill/providers/service.rb +172 -0
- data/cookbooks/bluepill/recipes/default.rb +48 -0
- data/cookbooks/bluepill/recipes/rsyslog.rb +28 -0
- data/cookbooks/bluepill/resources/service.rb +27 -0
- data/cookbooks/bluepill/templates/default/bluepill_init.fedora.erb +34 -0
- data/cookbooks/bluepill/templates/default/bluepill_init.freebsd.erb +32 -0
- data/cookbooks/bluepill/templates/default/bluepill_init.lsb.erb +37 -0
- data/cookbooks/bluepill/templates/default/bluepill_init.rhel.erb +34 -0
- data/cookbooks/bluepill/templates/default/bluepill_rsyslog.conf.erb +1 -0
- data/cookbooks/nginx/CHANGELOG.md +435 -0
- data/cookbooks/nginx/README.md +521 -0
- data/cookbooks/nginx/attributes/auth_request.rb +23 -0
- data/cookbooks/nginx/attributes/default.rb +131 -0
- data/cookbooks/nginx/attributes/devel.rb +24 -0
- data/cookbooks/nginx/attributes/echo.rb +24 -0
- data/cookbooks/nginx/attributes/geoip.rb +31 -0
- data/cookbooks/nginx/attributes/headers_more.rb +24 -0
- data/cookbooks/nginx/attributes/lua.rb +28 -0
- data/cookbooks/nginx/attributes/naxsi.rb +24 -0
- data/cookbooks/nginx/attributes/openssl_source.rb +23 -0
- data/cookbooks/nginx/attributes/pagespeed.rb +9 -0
- data/cookbooks/nginx/attributes/passenger.rb +58 -0
- data/cookbooks/nginx/attributes/rate_limiting.rb +23 -0
- data/cookbooks/nginx/attributes/repo.rb +35 -0
- data/cookbooks/nginx/attributes/set_misc.rb +8 -0
- data/cookbooks/nginx/attributes/socketproxy.rb +13 -0
- data/cookbooks/nginx/attributes/source.rb +42 -0
- data/cookbooks/nginx/attributes/status.rb +22 -0
- data/cookbooks/nginx/attributes/syslog.rb +24 -0
- data/cookbooks/nginx/attributes/upload_progress.rb +26 -0
- data/cookbooks/nginx/definitions/nginx_site.rb +50 -0
- data/cookbooks/nginx/files/default/mime.types +78 -0
- data/cookbooks/nginx/files/default/naxsi_core.rules +82 -0
- data/cookbooks/nginx/libraries/matchers.rb +20 -0
- data/cookbooks/nginx/metadata.json +351 -0
- data/cookbooks/nginx/recipes/authorized_ips.rb +32 -0
- data/cookbooks/nginx/recipes/commons.rb +24 -0
- data/cookbooks/nginx/recipes/commons_conf.rb +42 -0
- data/cookbooks/nginx/recipes/commons_dir.rb +57 -0
- data/cookbooks/nginx/recipes/commons_script.rb +29 -0
- data/cookbooks/nginx/recipes/default.rb +31 -0
- data/cookbooks/nginx/recipes/headers_more_module.rb +50 -0
- data/cookbooks/nginx/recipes/http_auth_request_module.rb +52 -0
- data/cookbooks/nginx/recipes/http_echo_module.rb +46 -0
- data/cookbooks/nginx/recipes/http_geoip_module.rb +113 -0
- data/cookbooks/nginx/recipes/http_gzip_static_module.rb +30 -0
- data/cookbooks/nginx/recipes/http_mp4_module.rb +2 -0
- data/cookbooks/nginx/recipes/http_perl_module.rb +23 -0
- data/cookbooks/nginx/recipes/http_realip_module.rb +38 -0
- data/cookbooks/nginx/recipes/http_spdy_module.rb +23 -0
- data/cookbooks/nginx/recipes/http_ssl_module.rb +23 -0
- data/cookbooks/nginx/recipes/http_stub_status_module.rb +36 -0
- data/cookbooks/nginx/recipes/ipv6.rb +23 -0
- data/cookbooks/nginx/recipes/lua.rb +47 -0
- data/cookbooks/nginx/recipes/naxsi_module.rb +52 -0
- data/cookbooks/nginx/recipes/ngx_devel_module.rb +44 -0
- data/cookbooks/nginx/recipes/ngx_lua_module.rb +47 -0
- data/cookbooks/nginx/recipes/ohai_plugin.rb +35 -0
- data/cookbooks/nginx/recipes/openssl_source.rb +45 -0
- data/cookbooks/nginx/recipes/package.rb +52 -0
- data/cookbooks/nginx/recipes/pagespeed_module.rb +62 -0
- data/cookbooks/nginx/recipes/passenger.rb +56 -0
- data/cookbooks/nginx/recipes/repo.rb +41 -0
- data/cookbooks/nginx/recipes/repo_passenger.rb +39 -0
- data/cookbooks/nginx/recipes/set_misc.rb +30 -0
- data/cookbooks/nginx/recipes/socketproxy.rb +26 -0
- data/cookbooks/nginx/recipes/source.rb +205 -0
- data/cookbooks/nginx/recipes/syslog_module.rb +69 -0
- data/cookbooks/nginx/recipes/upload_progress_module.rb +53 -0
- data/cookbooks/nginx/templates/debian/nginx.init.erb +97 -0
- data/cookbooks/nginx/templates/default/default-site.erb +11 -0
- data/cookbooks/nginx/templates/default/modules/authorized_ip.erb +6 -0
- data/cookbooks/nginx/templates/default/modules/http_geoip.conf.erb +4 -0
- data/cookbooks/nginx/templates/default/modules/http_gzip_static.conf.erb +1 -0
- data/cookbooks/nginx/templates/default/modules/http_realip.conf.erb +7 -0
- data/cookbooks/nginx/templates/default/modules/nginx_status.erb +14 -0
- data/cookbooks/nginx/templates/default/modules/passenger.conf.erb +13 -0
- data/cookbooks/nginx/templates/default/modules/socketproxy.conf.erb +89 -0
- data/cookbooks/nginx/templates/default/modules/upload_progress.erb +4 -0
- data/cookbooks/nginx/templates/default/nginx-upstart.conf.erb +39 -0
- data/cookbooks/nginx/templates/default/nginx.conf.erb +103 -0
- data/cookbooks/nginx/templates/default/nginx.init.erb +111 -0
- data/cookbooks/nginx/templates/default/nginx.pill.erb +15 -0
- data/cookbooks/nginx/templates/default/nginx.sysconfig.erb +1 -0
- data/cookbooks/nginx/templates/default/nxdissite.erb +29 -0
- data/cookbooks/nginx/templates/default/nxensite.erb +38 -0
- data/cookbooks/nginx/templates/default/plugins/nginx.rb.erb +66 -0
- data/cookbooks/nginx/templates/default/sv-nginx-log-run.erb +2 -0
- data/cookbooks/nginx/templates/default/sv-nginx-run.erb +4 -0
- data/cookbooks/nginx/templates/gentoo/nginx.init.erb +87 -0
- data/cookbooks/nginx/templates/suse/nginx.init.erb +115 -0
- data/cookbooks/nginx/templates/ubuntu/nginx.init.erb +97 -0
- data/cookbooks/ohai/CHANGELOG.md +69 -0
- data/cookbooks/ohai/README.md +89 -0
- data/cookbooks/ohai/attributes/default.rb +31 -0
- data/cookbooks/ohai/files/default/plugins/README +1 -0
- data/cookbooks/ohai/libraries/matchers.rb +14 -0
- data/cookbooks/ohai/metadata.json +1 -0
- data/cookbooks/ohai/providers/hint.rb +38 -0
- data/cookbooks/ohai/recipes/default.rb +52 -0
- data/cookbooks/ohai/resources/hint.rb +5 -0
- data/cookbooks/packagecloud/CHANGELOG.md +12 -0
- data/cookbooks/packagecloud/README.md +80 -0
- data/cookbooks/packagecloud/attributes/default.rb +8 -0
- data/cookbooks/packagecloud/libraries/helper.rb +43 -0
- data/cookbooks/packagecloud/libraries/matcher.rb +7 -0
- data/cookbooks/packagecloud/metadata.json +1 -0
- data/cookbooks/packagecloud/providers/repo.rb +212 -0
- data/cookbooks/packagecloud/resources/repo.rb +10 -0
- data/cookbooks/packagecloud/templates/.kitchen/logs/kitchen.log +29 -0
- data/cookbooks/packagecloud/templates/default/apt.erb +2 -0
- data/cookbooks/packagecloud/templates/default/yum.erb +15 -0
- data/cookbooks/rsyslog/CHANGELOG.md +193 -0
- data/cookbooks/rsyslog/README.md +276 -0
- data/cookbooks/rsyslog/attributes/default.rb +131 -0
- data/cookbooks/rsyslog/libraries/helpers.rb +25 -0
- data/cookbooks/rsyslog/metadata.json +1 -0
- data/cookbooks/rsyslog/providers/file_input.rb +44 -0
- data/cookbooks/rsyslog/recipes/client.rb +87 -0
- data/cookbooks/rsyslog/recipes/default.rb +89 -0
- data/cookbooks/rsyslog/recipes/server.rb +44 -0
- data/cookbooks/rsyslog/resources/file_input.rb +28 -0
- data/cookbooks/rsyslog/templates/default/35-server-per-host.conf.erb +62 -0
- data/cookbooks/rsyslog/templates/default/49-relp.conf.erb +10 -0
- data/cookbooks/rsyslog/templates/default/49-remote.conf.erb +30 -0
- data/cookbooks/rsyslog/templates/default/50-default.conf.erb +6 -0
- data/cookbooks/rsyslog/templates/default/file-input.conf.erb +15 -0
- data/cookbooks/rsyslog/templates/default/omnios-manifest.xml.erb +30 -0
- data/cookbooks/rsyslog/templates/default/rsyslog.conf.erb +117 -0
- data/cookbooks/rsyslog/templates/smartos/50-default.conf.erb +18 -0
- data/cookbooks/runit/.kitchen.cloud.yml +103 -0
- data/cookbooks/runit/.kitchen.yml +38 -0
- data/cookbooks/runit/.rspec +3 -0
- data/cookbooks/runit/.rubocop.yml +45 -0
- data/cookbooks/runit/Berksfile.disabled +11 -0
- data/cookbooks/runit/CHANGELOG.md +226 -0
- data/cookbooks/runit/CONTRIBUTING.md +266 -0
- data/cookbooks/runit/Cheffile +11 -0
- data/cookbooks/runit/Gemfile +17 -0
- data/cookbooks/runit/LICENSE +201 -0
- data/cookbooks/runit/README.md +435 -0
- data/cookbooks/runit/Rakefile +23 -0
- data/cookbooks/runit/TESTING.md +26 -0
- data/cookbooks/runit/attributes/default.rb +62 -0
- data/cookbooks/runit/files/default/runit.seed +1 -0
- data/cookbooks/runit/files/default/runsvdir +0 -0
- data/cookbooks/runit/files/ubuntu-6.10/runsvdir +6 -0
- data/cookbooks/runit/files/ubuntu-7.04/runsvdir +7 -0
- data/cookbooks/runit/files/ubuntu-7.10/runsvdir +7 -0
- data/cookbooks/runit/files/ubuntu-8.04/runsvdir +7 -0
- data/cookbooks/runit/libraries/default.rb +0 -0
- data/cookbooks/runit/libraries/helpers.rb +190 -0
- data/cookbooks/runit/libraries/matchers.rb +69 -0
- data/cookbooks/runit/libraries/provider_runit_service.rb +326 -0
- data/cookbooks/runit/libraries/resource_runit_service.rb +267 -0
- data/cookbooks/runit/metadata.json +50 -0
- data/cookbooks/runit/recipes/default.rb +91 -0
- data/cookbooks/runit/templates/debian/init.d.erb +66 -0
- data/cookbooks/runit/templates/default/log-config.erb +24 -0
- data/cookbooks/runit/templates/gentoo/runit-start.sh.erb +32 -0
- data/cookbooks/scratchify/Berksfile +2 -1
- data/cookbooks/scratchify/Berksfile.lock +20 -1
- data/cookbooks/scratchify/lib/from-scratch.rb +1 -4
- data/cookbooks/scratchify/lib/from-scratch/version.rb +1 -1
- data/cookbooks/scratchify/metadata.json +5 -2
- data/cookbooks/scratchify/recipes/default.rb +15 -1
- data/cookbooks/scratchify/recipes/nginx_site.rb +4 -0
- data/cookbooks/scratchify/recipes/pre_rvm.rb +5 -0
- data/cookbooks/scratchify/templates/nginx.erb +31 -0
- data/cookbooks/scratchify/templates/node.json.erb +21 -6
- data/cookbooks/yum-epel/CHANGELOG.md +84 -0
- data/cookbooks/yum-epel/README.md +172 -0
- data/cookbooks/yum-epel/attributes/default.rb +1 -0
- data/cookbooks/yum-epel/attributes/epel-debuginfo.rb +28 -0
- data/cookbooks/yum-epel/attributes/epel-source.rb +28 -0
- data/cookbooks/yum-epel/attributes/epel-testing-debuginfo.rb +28 -0
- data/cookbooks/yum-epel/attributes/epel-testing-source.rb +28 -0
- data/cookbooks/yum-epel/attributes/epel-testing.rb +28 -0
- data/cookbooks/yum-epel/attributes/epel.rb +28 -0
- data/cookbooks/yum-epel/metadata.json +1 -0
- data/cookbooks/yum-epel/recipes/default.rb +61 -0
- data/cookbooks/yum/CHANGELOG.md +294 -0
- data/cookbooks/yum/README.md +285 -0
- data/cookbooks/yum/attributes/main.rb +100 -0
- data/cookbooks/yum/libraries/matchers.rb +27 -0
- data/cookbooks/yum/metadata.json +1 -0
- data/cookbooks/yum/providers/globalconfig.rb +41 -0
- data/cookbooks/yum/providers/repository.rb +106 -0
- data/cookbooks/yum/recipes/default.rb +26 -0
- data/cookbooks/yum/resources/globalconfig.rb +109 -0
- data/cookbooks/yum/resources/repository.rb +69 -0
- data/cookbooks/yum/templates/default/main.erb +276 -0
- data/cookbooks/yum/templates/default/repo.erb +125 -0
- data/lib/from-scratch.rb +1 -0
- data/lib/from-scratch/version.rb +1 -1
- data/metadata.rb +5 -1
- data/recipes/default.rb +15 -1
- data/recipes/nginx_site.rb +4 -0
- data/recipes/pre_rvm.rb +5 -0
- data/templates/nginx.erb +31 -0
- data/templates/node.json.erb +21 -6
- metadata +194 -1
@@ -0,0 +1,32 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: nginx
|
3
|
+
# Recipe:: authorized_ips
|
4
|
+
#
|
5
|
+
# Author:: Jamie Winsor (<jamie@vialstudios.com>)
|
6
|
+
#
|
7
|
+
# Copyright 2012-2013, Riot Games
|
8
|
+
#
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
# you may not use this file except in compliance with the License.
|
11
|
+
# You may obtain a copy of the License at
|
12
|
+
#
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
#
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
# See the License for the specific language governing permissions and
|
19
|
+
# limitations under the License.
|
20
|
+
#
|
21
|
+
|
22
|
+
node.default['nginx']['remote_ip_var'] = 'remote_addr'
|
23
|
+
node.default['nginx']['authorized_ips'] = ['127.0.0.1/32']
|
24
|
+
|
25
|
+
template 'authorized_ip' do
|
26
|
+
path "#{node['nginx']['dir']}/authorized_ip"
|
27
|
+
source 'modules/authorized_ip.erb'
|
28
|
+
owner 'root'
|
29
|
+
group node['root_group']
|
30
|
+
mode '0644'
|
31
|
+
notifies :reload, 'service[nginx]', :delayed
|
32
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: nginx
|
3
|
+
# Recipe:: commons
|
4
|
+
#
|
5
|
+
# Author:: AJ Christensen <aj@junglist.gen.nz>
|
6
|
+
#
|
7
|
+
# Copyright 2008-2013, Chef Software, Inc.
|
8
|
+
#
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
# you may not use this file except in compliance with the License.
|
11
|
+
# You may obtain a copy of the License at
|
12
|
+
#
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
#
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
# See the License for the specific language governing permissions and
|
19
|
+
# limitations under the License.
|
20
|
+
#
|
21
|
+
|
22
|
+
include_recipe 'nginx::commons_dir'
|
23
|
+
include_recipe 'nginx::commons_script'
|
24
|
+
include_recipe 'nginx::commons_conf'
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: nginx
|
3
|
+
# Recipe:: common/conf
|
4
|
+
#
|
5
|
+
# Author:: AJ Christensen <aj@junglist.gen.nz>
|
6
|
+
#
|
7
|
+
# Copyright 2008-2013, Chef Software, Inc.
|
8
|
+
#
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
# you may not use this file except in compliance with the License.
|
11
|
+
# You may obtain a copy of the License at
|
12
|
+
#
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
#
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
# See the License for the specific language governing permissions and
|
19
|
+
# limitations under the License.
|
20
|
+
#
|
21
|
+
|
22
|
+
template 'nginx.conf' do
|
23
|
+
path "#{node['nginx']['dir']}/nginx.conf"
|
24
|
+
source node['nginx']['conf_template']
|
25
|
+
cookbook node['nginx']['conf_cookbook']
|
26
|
+
owner 'root'
|
27
|
+
group node['root_group']
|
28
|
+
mode '0644'
|
29
|
+
notifies :reload, 'service[nginx]', :delayed
|
30
|
+
end
|
31
|
+
|
32
|
+
template "#{node['nginx']['dir']}/sites-available/default" do
|
33
|
+
source 'default-site.erb'
|
34
|
+
owner 'root'
|
35
|
+
group node['root_group']
|
36
|
+
mode '0644'
|
37
|
+
notifies :reload, 'service[nginx]', :delayed
|
38
|
+
end
|
39
|
+
|
40
|
+
nginx_site 'default' do
|
41
|
+
enable node['nginx']['default_site_enabled']
|
42
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: nginx
|
3
|
+
# Recipe:: common/dir
|
4
|
+
#
|
5
|
+
# Author:: AJ Christensen <aj@junglist.gen.nz>
|
6
|
+
#
|
7
|
+
# Copyright 2008-2013, Chef Software, Inc.
|
8
|
+
#
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
# you may not use this file except in compliance with the License.
|
11
|
+
# You may obtain a copy of the License at
|
12
|
+
#
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
#
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
# See the License for the specific language governing permissions and
|
19
|
+
# limitations under the License.
|
20
|
+
#
|
21
|
+
|
22
|
+
directory node['nginx']['dir'] do
|
23
|
+
owner 'root'
|
24
|
+
group node['root_group']
|
25
|
+
mode '0755'
|
26
|
+
recursive true
|
27
|
+
end
|
28
|
+
|
29
|
+
directory node['nginx']['log_dir'] do
|
30
|
+
mode node['nginx']['log_dir_perm']
|
31
|
+
owner node['nginx']['user']
|
32
|
+
action :create
|
33
|
+
recursive true
|
34
|
+
end
|
35
|
+
|
36
|
+
directory File.dirname(node['nginx']['pid']) do
|
37
|
+
owner 'root'
|
38
|
+
group node['root_group']
|
39
|
+
mode '0755'
|
40
|
+
recursive true
|
41
|
+
end
|
42
|
+
|
43
|
+
%w(sites-available sites-enabled conf.d).each do |leaf|
|
44
|
+
directory File.join(node['nginx']['dir'], leaf) do
|
45
|
+
owner 'root'
|
46
|
+
group node['root_group']
|
47
|
+
mode '0755'
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
if !node['nginx']['default_site_enabled'] && (node['platform_family'] == 'rhel' || node['platform_family'] == 'fedora')
|
52
|
+
%w(default.conf example_ssl.conf).each do |config|
|
53
|
+
file "/etc/nginx/conf.d/#{config}" do
|
54
|
+
action :delete
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: nginx
|
3
|
+
# Recipe:: common/script
|
4
|
+
#
|
5
|
+
# Author:: AJ Christensen <aj@junglist.gen.nz>
|
6
|
+
#
|
7
|
+
# Copyright 2008-2013, Chef Software, Inc.
|
8
|
+
#
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
# you may not use this file except in compliance with the License.
|
11
|
+
# You may obtain a copy of the License at
|
12
|
+
#
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
#
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
# See the License for the specific language governing permissions and
|
19
|
+
# limitations under the License.
|
20
|
+
#
|
21
|
+
|
22
|
+
%w(nxensite nxdissite).each do |nxscript|
|
23
|
+
template "#{node['nginx']['script_dir']}/#{nxscript}" do
|
24
|
+
source "#{nxscript}.erb"
|
25
|
+
mode '0755'
|
26
|
+
owner 'root'
|
27
|
+
group node['root_group']
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: nginx
|
3
|
+
# Recipe:: default
|
4
|
+
#
|
5
|
+
# Author:: AJ Christensen <aj@junglist.gen.nz>
|
6
|
+
#
|
7
|
+
# Copyright 2008-2013, Chef Software, Inc.
|
8
|
+
#
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
# you may not use this file except in compliance with the License.
|
11
|
+
# You may obtain a copy of the License at
|
12
|
+
#
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
#
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
# See the License for the specific language governing permissions and
|
19
|
+
# limitations under the License.
|
20
|
+
#
|
21
|
+
|
22
|
+
include_recipe "nginx::#{node['nginx']['install_method']}"
|
23
|
+
|
24
|
+
service 'nginx' do
|
25
|
+
supports :status => true, :restart => true, :reload => true
|
26
|
+
action :start
|
27
|
+
end
|
28
|
+
|
29
|
+
node['nginx']['default']['modules'].each do |ngx_module|
|
30
|
+
include_recipe "nginx::#{ngx_module}"
|
31
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: nginx
|
3
|
+
# Recipe:: headers_more_module
|
4
|
+
#
|
5
|
+
# Author:: Lucas Jandrew (<ljandrew@riotgames.com>)
|
6
|
+
#
|
7
|
+
# Copyright 2012-2013, Riot Games
|
8
|
+
#
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
# you may not use this file except in compliance with the License.
|
11
|
+
# You may obtain a copy of the License at
|
12
|
+
#
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
#
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
# See the License for the specific language governing permissions and
|
19
|
+
# limitations under the License.
|
20
|
+
|
21
|
+
tar_location = "#{Chef::Config['file_cache_path']}/headers_more.tar.gz"
|
22
|
+
module_location = "#{Chef::Config['file_cache_path']}/headers_more/#{node['nginx']['headers_more']['source_checksum']}"
|
23
|
+
|
24
|
+
remote_file tar_location do
|
25
|
+
source node['nginx']['headers_more']['source_url']
|
26
|
+
checksum node['nginx']['headers_more']['source_checksum']
|
27
|
+
owner 'root'
|
28
|
+
group node['root_group']
|
29
|
+
mode '0644'
|
30
|
+
end
|
31
|
+
|
32
|
+
directory module_location do
|
33
|
+
owner 'root'
|
34
|
+
group node['root_group']
|
35
|
+
mode '0755'
|
36
|
+
recursive true
|
37
|
+
action :create
|
38
|
+
end
|
39
|
+
|
40
|
+
bash 'extract_headers_more' do
|
41
|
+
cwd ::File.dirname(tar_location)
|
42
|
+
user 'root'
|
43
|
+
code <<-EOH
|
44
|
+
tar -zxf #{tar_location} -C #{module_location}
|
45
|
+
EOH
|
46
|
+
not_if { ::File.exist?("#{module_location}/headers-more-nginx-module-#{node['nginx']['headers_more']['version']}/config") }
|
47
|
+
end
|
48
|
+
|
49
|
+
node.run_state['nginx_configure_flags'] =
|
50
|
+
node.run_state['nginx_configure_flags'] | ["--add-module=#{module_location}/headers-more-nginx-module-#{node['nginx']['headers_more']['version']}/"]
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: nginx
|
3
|
+
# Recipe:: http_auth_request_module
|
4
|
+
#
|
5
|
+
# Author:: David Radcliffe (<radcliffe.david@gmail.com>)
|
6
|
+
#
|
7
|
+
# Copyright 2013, David Radcliffe
|
8
|
+
#
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
# you may not use this file except in compliance with the License.
|
11
|
+
# You may obtain a copy of the License at
|
12
|
+
#
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
#
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
# See the License for the specific language governing permissions and
|
19
|
+
# limitations under the License.
|
20
|
+
#
|
21
|
+
|
22
|
+
# Documentation:
|
23
|
+
# http://nginx.org/en/docs/http/ngx_http_auth_request_module.html
|
24
|
+
if node['nginx']['source']['version'] >= '1.5.4'
|
25
|
+
node.run_state['nginx_configure_flags'] =
|
26
|
+
node.run_state['nginx_configure_flags'] | ['--with-http_auth_request_module']
|
27
|
+
else
|
28
|
+
arm_src_filename = ::File.basename(node['nginx']['auth_request']['url'])
|
29
|
+
arm_src_filepath = "#{Chef::Config['file_cache_path']}/#{arm_src_filename}"
|
30
|
+
arm_extract_path = "#{Chef::Config['file_cache_path']}/nginx_auth_request/#{node['nginx']['auth_request']['checksum']}"
|
31
|
+
|
32
|
+
remote_file arm_src_filepath do
|
33
|
+
source node['nginx']['auth_request']['url']
|
34
|
+
checksum node['nginx']['auth_request']['checksum']
|
35
|
+
owner 'root'
|
36
|
+
group node['root_group']
|
37
|
+
mode '0644'
|
38
|
+
end
|
39
|
+
|
40
|
+
bash 'extract_auth_request_module' do
|
41
|
+
cwd ::File.dirname(arm_src_filepath)
|
42
|
+
code <<-EOH
|
43
|
+
mkdir -p #{arm_extract_path}
|
44
|
+
tar xzf #{arm_src_filename} -C #{arm_extract_path}
|
45
|
+
mv #{arm_extract_path}/*/* #{arm_extract_path}/
|
46
|
+
EOH
|
47
|
+
not_if { ::File.exist?(arm_extract_path) }
|
48
|
+
end
|
49
|
+
|
50
|
+
node.run_state['nginx_configure_flags'] =
|
51
|
+
node.run_state['nginx_configure_flags'] | ["--add-module=#{arm_extract_path}"]
|
52
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: nginx
|
3
|
+
# Recipe:: http_echo_module
|
4
|
+
#
|
5
|
+
# Author:: Danial Pearce (<danial@cushycms.com>)
|
6
|
+
#
|
7
|
+
# Copyright 2012-2013, CushyCMS
|
8
|
+
#
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
# you may not use this file except in compliance with the License.
|
11
|
+
# You may obtain a copy of the License at
|
12
|
+
#
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
#
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
# See the License for the specific language governing permissions and
|
19
|
+
# limitations under the License.
|
20
|
+
#
|
21
|
+
|
22
|
+
echo_src_filename = "echo-nginx-module-v#{node['nginx']['echo']['version']}.tar.gz"
|
23
|
+
echo_src_filepath = "#{Chef::Config['file_cache_path']}/#{echo_src_filename}"
|
24
|
+
echo_extract_path = "#{Chef::Config['file_cache_path']}/nginx_echo_module/#{node['nginx']['echo']['checksum']}"
|
25
|
+
|
26
|
+
remote_file echo_src_filepath do
|
27
|
+
source node['nginx']['echo']['url']
|
28
|
+
checksum node['nginx']['echo']['checksum']
|
29
|
+
owner 'root'
|
30
|
+
group node['root_group']
|
31
|
+
mode '0644'
|
32
|
+
end
|
33
|
+
|
34
|
+
bash 'extract_http_echo_module' do
|
35
|
+
cwd ::File.dirname(echo_src_filepath)
|
36
|
+
code <<-EOH
|
37
|
+
mkdir -p #{echo_extract_path}
|
38
|
+
tar xzf #{echo_src_filename} -C #{echo_extract_path}
|
39
|
+
mv #{echo_extract_path}/*/* #{echo_extract_path}/
|
40
|
+
EOH
|
41
|
+
|
42
|
+
not_if { ::File.exist?(echo_extract_path) }
|
43
|
+
end
|
44
|
+
|
45
|
+
node.run_state['nginx_configure_flags'] =
|
46
|
+
node.run_state['nginx_configure_flags'] | ["--add-module=#{echo_extract_path}"]
|
@@ -0,0 +1,113 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: nginx
|
3
|
+
# Recipe:: http_geoip_module
|
4
|
+
#
|
5
|
+
# Author:: Jamie Winsor (<jamie@vialstudios.com>)
|
6
|
+
#
|
7
|
+
# Copyright 2012-2013, Riot Games
|
8
|
+
#
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
# you may not use this file except in compliance with the License.
|
11
|
+
# You may obtain a copy of the License at
|
12
|
+
#
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
#
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
# See the License for the specific language governing permissions and
|
19
|
+
# limitations under the License.
|
20
|
+
#
|
21
|
+
|
22
|
+
country_dat = "#{node['nginx']['geoip']['path']}/GeoIP.dat"
|
23
|
+
country_src_filename = ::File.basename(node['nginx']['geoip']['country_dat_url'])
|
24
|
+
country_src_filepath = "#{Chef::Config['file_cache_path']}/#{country_src_filename}"
|
25
|
+
city_dat = nil
|
26
|
+
city_src_filename = ::File.basename(node['nginx']['geoip']['city_dat_url'])
|
27
|
+
city_src_filepath = "#{Chef::Config['file_cache_path']}/#{city_src_filename}"
|
28
|
+
geolib_filename = ::File.basename(node['nginx']['geoip']['lib_url'])
|
29
|
+
geolib_filepath = "#{Chef::Config['file_cache_path']}/#{geolib_filename}"
|
30
|
+
|
31
|
+
remote_file geolib_filepath do
|
32
|
+
source node['nginx']['geoip']['lib_url']
|
33
|
+
checksum node['nginx']['geoip']['lib_checksum']
|
34
|
+
owner 'root'
|
35
|
+
group node['root_group']
|
36
|
+
mode '0644'
|
37
|
+
end
|
38
|
+
|
39
|
+
bash 'extract_geolib' do
|
40
|
+
cwd ::File.dirname(geolib_filepath)
|
41
|
+
code <<-EOH
|
42
|
+
tar xzvf #{geolib_filepath} -C #{::File.dirname(geolib_filepath)}
|
43
|
+
cd GeoIP-#{node['nginx']['geoip']['lib_version']}
|
44
|
+
./configure
|
45
|
+
make && make install
|
46
|
+
EOH
|
47
|
+
environment('echo' => 'echo') if node['platform_family'] == 'rhel' && node['platform_version'].to_f < 6
|
48
|
+
creates "/usr/local/lib/libGeoIP.so.#{node['nginx']['geoip']['lib_version']}"
|
49
|
+
subscribes :run, "remote_file[#{geolib_filepath}]"
|
50
|
+
end
|
51
|
+
|
52
|
+
directory node['nginx']['geoip']['path'] do
|
53
|
+
owner 'root'
|
54
|
+
group node['root_group']
|
55
|
+
mode '0755'
|
56
|
+
recursive true
|
57
|
+
end
|
58
|
+
|
59
|
+
remote_file country_src_filepath do
|
60
|
+
not_if do
|
61
|
+
File.exist?(country_src_filepath) &&
|
62
|
+
File.mtime(country_src_filepath) > Time.now - 86_400
|
63
|
+
end
|
64
|
+
source node['nginx']['geoip']['country_dat_url']
|
65
|
+
checksum node['nginx']['geoip']['country_dat_checksum']
|
66
|
+
owner 'root'
|
67
|
+
group node['root_group']
|
68
|
+
mode '0644'
|
69
|
+
end
|
70
|
+
|
71
|
+
bash 'gunzip_geo_lite_country_dat' do
|
72
|
+
code <<-EOH
|
73
|
+
gunzip -c "#{country_src_filepath}" > #{country_dat}
|
74
|
+
EOH
|
75
|
+
creates country_dat
|
76
|
+
end
|
77
|
+
|
78
|
+
if node['nginx']['geoip']['enable_city']
|
79
|
+
city_dat = "#{node['nginx']['geoip']['path']}/GeoLiteCity.dat"
|
80
|
+
|
81
|
+
remote_file city_src_filepath do
|
82
|
+
not_if do
|
83
|
+
File.exist?(city_src_filepath) &&
|
84
|
+
File.mtime(city_src_filepath) > Time.now - 86_400
|
85
|
+
end
|
86
|
+
source node['nginx']['geoip']['city_dat_url']
|
87
|
+
checksum node['nginx']['geoip']['city_dat_checksum']
|
88
|
+
owner 'root'
|
89
|
+
group node['root_group']
|
90
|
+
mode '0644'
|
91
|
+
end
|
92
|
+
|
93
|
+
bash 'gunzip_geo_lite_city_dat' do
|
94
|
+
code <<-EOH
|
95
|
+
gunzip -c "#{city_src_filepath}" > #{city_dat}
|
96
|
+
EOH
|
97
|
+
creates city_dat
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
template "#{node['nginx']['dir']}/conf.d/http_geoip.conf" do
|
102
|
+
source 'modules/http_geoip.conf.erb'
|
103
|
+
owner 'root'
|
104
|
+
group node['root_group']
|
105
|
+
mode '0644'
|
106
|
+
variables(
|
107
|
+
:country_dat => country_dat,
|
108
|
+
:city_dat => city_dat
|
109
|
+
)
|
110
|
+
end
|
111
|
+
|
112
|
+
node.run_state['nginx_configure_flags'] =
|
113
|
+
node.run_state['nginx_configure_flags'] | ['--with-http_geoip_module', "--with-ld-opt='-Wl,-R,/usr/local/lib -L /usr/local/lib'"]
|