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.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/Berksfile +2 -1
  3. data/Berksfile.lock +20 -1
  4. data/cookbooks/bluepill/CHANGELOG.md +93 -0
  5. data/cookbooks/bluepill/README.md +91 -0
  6. data/cookbooks/bluepill/attributes/default.rb +44 -0
  7. data/cookbooks/bluepill/metadata.json +1 -0
  8. data/cookbooks/bluepill/providers/service.rb +172 -0
  9. data/cookbooks/bluepill/recipes/default.rb +48 -0
  10. data/cookbooks/bluepill/recipes/rsyslog.rb +28 -0
  11. data/cookbooks/bluepill/resources/service.rb +27 -0
  12. data/cookbooks/bluepill/templates/default/bluepill_init.fedora.erb +34 -0
  13. data/cookbooks/bluepill/templates/default/bluepill_init.freebsd.erb +32 -0
  14. data/cookbooks/bluepill/templates/default/bluepill_init.lsb.erb +37 -0
  15. data/cookbooks/bluepill/templates/default/bluepill_init.rhel.erb +34 -0
  16. data/cookbooks/bluepill/templates/default/bluepill_rsyslog.conf.erb +1 -0
  17. data/cookbooks/nginx/CHANGELOG.md +435 -0
  18. data/cookbooks/nginx/README.md +521 -0
  19. data/cookbooks/nginx/attributes/auth_request.rb +23 -0
  20. data/cookbooks/nginx/attributes/default.rb +131 -0
  21. data/cookbooks/nginx/attributes/devel.rb +24 -0
  22. data/cookbooks/nginx/attributes/echo.rb +24 -0
  23. data/cookbooks/nginx/attributes/geoip.rb +31 -0
  24. data/cookbooks/nginx/attributes/headers_more.rb +24 -0
  25. data/cookbooks/nginx/attributes/lua.rb +28 -0
  26. data/cookbooks/nginx/attributes/naxsi.rb +24 -0
  27. data/cookbooks/nginx/attributes/openssl_source.rb +23 -0
  28. data/cookbooks/nginx/attributes/pagespeed.rb +9 -0
  29. data/cookbooks/nginx/attributes/passenger.rb +58 -0
  30. data/cookbooks/nginx/attributes/rate_limiting.rb +23 -0
  31. data/cookbooks/nginx/attributes/repo.rb +35 -0
  32. data/cookbooks/nginx/attributes/set_misc.rb +8 -0
  33. data/cookbooks/nginx/attributes/socketproxy.rb +13 -0
  34. data/cookbooks/nginx/attributes/source.rb +42 -0
  35. data/cookbooks/nginx/attributes/status.rb +22 -0
  36. data/cookbooks/nginx/attributes/syslog.rb +24 -0
  37. data/cookbooks/nginx/attributes/upload_progress.rb +26 -0
  38. data/cookbooks/nginx/definitions/nginx_site.rb +50 -0
  39. data/cookbooks/nginx/files/default/mime.types +78 -0
  40. data/cookbooks/nginx/files/default/naxsi_core.rules +82 -0
  41. data/cookbooks/nginx/libraries/matchers.rb +20 -0
  42. data/cookbooks/nginx/metadata.json +351 -0
  43. data/cookbooks/nginx/recipes/authorized_ips.rb +32 -0
  44. data/cookbooks/nginx/recipes/commons.rb +24 -0
  45. data/cookbooks/nginx/recipes/commons_conf.rb +42 -0
  46. data/cookbooks/nginx/recipes/commons_dir.rb +57 -0
  47. data/cookbooks/nginx/recipes/commons_script.rb +29 -0
  48. data/cookbooks/nginx/recipes/default.rb +31 -0
  49. data/cookbooks/nginx/recipes/headers_more_module.rb +50 -0
  50. data/cookbooks/nginx/recipes/http_auth_request_module.rb +52 -0
  51. data/cookbooks/nginx/recipes/http_echo_module.rb +46 -0
  52. data/cookbooks/nginx/recipes/http_geoip_module.rb +113 -0
  53. data/cookbooks/nginx/recipes/http_gzip_static_module.rb +30 -0
  54. data/cookbooks/nginx/recipes/http_mp4_module.rb +2 -0
  55. data/cookbooks/nginx/recipes/http_perl_module.rb +23 -0
  56. data/cookbooks/nginx/recipes/http_realip_module.rb +38 -0
  57. data/cookbooks/nginx/recipes/http_spdy_module.rb +23 -0
  58. data/cookbooks/nginx/recipes/http_ssl_module.rb +23 -0
  59. data/cookbooks/nginx/recipes/http_stub_status_module.rb +36 -0
  60. data/cookbooks/nginx/recipes/ipv6.rb +23 -0
  61. data/cookbooks/nginx/recipes/lua.rb +47 -0
  62. data/cookbooks/nginx/recipes/naxsi_module.rb +52 -0
  63. data/cookbooks/nginx/recipes/ngx_devel_module.rb +44 -0
  64. data/cookbooks/nginx/recipes/ngx_lua_module.rb +47 -0
  65. data/cookbooks/nginx/recipes/ohai_plugin.rb +35 -0
  66. data/cookbooks/nginx/recipes/openssl_source.rb +45 -0
  67. data/cookbooks/nginx/recipes/package.rb +52 -0
  68. data/cookbooks/nginx/recipes/pagespeed_module.rb +62 -0
  69. data/cookbooks/nginx/recipes/passenger.rb +56 -0
  70. data/cookbooks/nginx/recipes/repo.rb +41 -0
  71. data/cookbooks/nginx/recipes/repo_passenger.rb +39 -0
  72. data/cookbooks/nginx/recipes/set_misc.rb +30 -0
  73. data/cookbooks/nginx/recipes/socketproxy.rb +26 -0
  74. data/cookbooks/nginx/recipes/source.rb +205 -0
  75. data/cookbooks/nginx/recipes/syslog_module.rb +69 -0
  76. data/cookbooks/nginx/recipes/upload_progress_module.rb +53 -0
  77. data/cookbooks/nginx/templates/debian/nginx.init.erb +97 -0
  78. data/cookbooks/nginx/templates/default/default-site.erb +11 -0
  79. data/cookbooks/nginx/templates/default/modules/authorized_ip.erb +6 -0
  80. data/cookbooks/nginx/templates/default/modules/http_geoip.conf.erb +4 -0
  81. data/cookbooks/nginx/templates/default/modules/http_gzip_static.conf.erb +1 -0
  82. data/cookbooks/nginx/templates/default/modules/http_realip.conf.erb +7 -0
  83. data/cookbooks/nginx/templates/default/modules/nginx_status.erb +14 -0
  84. data/cookbooks/nginx/templates/default/modules/passenger.conf.erb +13 -0
  85. data/cookbooks/nginx/templates/default/modules/socketproxy.conf.erb +89 -0
  86. data/cookbooks/nginx/templates/default/modules/upload_progress.erb +4 -0
  87. data/cookbooks/nginx/templates/default/nginx-upstart.conf.erb +39 -0
  88. data/cookbooks/nginx/templates/default/nginx.conf.erb +103 -0
  89. data/cookbooks/nginx/templates/default/nginx.init.erb +111 -0
  90. data/cookbooks/nginx/templates/default/nginx.pill.erb +15 -0
  91. data/cookbooks/nginx/templates/default/nginx.sysconfig.erb +1 -0
  92. data/cookbooks/nginx/templates/default/nxdissite.erb +29 -0
  93. data/cookbooks/nginx/templates/default/nxensite.erb +38 -0
  94. data/cookbooks/nginx/templates/default/plugins/nginx.rb.erb +66 -0
  95. data/cookbooks/nginx/templates/default/sv-nginx-log-run.erb +2 -0
  96. data/cookbooks/nginx/templates/default/sv-nginx-run.erb +4 -0
  97. data/cookbooks/nginx/templates/gentoo/nginx.init.erb +87 -0
  98. data/cookbooks/nginx/templates/suse/nginx.init.erb +115 -0
  99. data/cookbooks/nginx/templates/ubuntu/nginx.init.erb +97 -0
  100. data/cookbooks/ohai/CHANGELOG.md +69 -0
  101. data/cookbooks/ohai/README.md +89 -0
  102. data/cookbooks/ohai/attributes/default.rb +31 -0
  103. data/cookbooks/ohai/files/default/plugins/README +1 -0
  104. data/cookbooks/ohai/libraries/matchers.rb +14 -0
  105. data/cookbooks/ohai/metadata.json +1 -0
  106. data/cookbooks/ohai/providers/hint.rb +38 -0
  107. data/cookbooks/ohai/recipes/default.rb +52 -0
  108. data/cookbooks/ohai/resources/hint.rb +5 -0
  109. data/cookbooks/packagecloud/CHANGELOG.md +12 -0
  110. data/cookbooks/packagecloud/README.md +80 -0
  111. data/cookbooks/packagecloud/attributes/default.rb +8 -0
  112. data/cookbooks/packagecloud/libraries/helper.rb +43 -0
  113. data/cookbooks/packagecloud/libraries/matcher.rb +7 -0
  114. data/cookbooks/packagecloud/metadata.json +1 -0
  115. data/cookbooks/packagecloud/providers/repo.rb +212 -0
  116. data/cookbooks/packagecloud/resources/repo.rb +10 -0
  117. data/cookbooks/packagecloud/templates/.kitchen/logs/kitchen.log +29 -0
  118. data/cookbooks/packagecloud/templates/default/apt.erb +2 -0
  119. data/cookbooks/packagecloud/templates/default/yum.erb +15 -0
  120. data/cookbooks/rsyslog/CHANGELOG.md +193 -0
  121. data/cookbooks/rsyslog/README.md +276 -0
  122. data/cookbooks/rsyslog/attributes/default.rb +131 -0
  123. data/cookbooks/rsyslog/libraries/helpers.rb +25 -0
  124. data/cookbooks/rsyslog/metadata.json +1 -0
  125. data/cookbooks/rsyslog/providers/file_input.rb +44 -0
  126. data/cookbooks/rsyslog/recipes/client.rb +87 -0
  127. data/cookbooks/rsyslog/recipes/default.rb +89 -0
  128. data/cookbooks/rsyslog/recipes/server.rb +44 -0
  129. data/cookbooks/rsyslog/resources/file_input.rb +28 -0
  130. data/cookbooks/rsyslog/templates/default/35-server-per-host.conf.erb +62 -0
  131. data/cookbooks/rsyslog/templates/default/49-relp.conf.erb +10 -0
  132. data/cookbooks/rsyslog/templates/default/49-remote.conf.erb +30 -0
  133. data/cookbooks/rsyslog/templates/default/50-default.conf.erb +6 -0
  134. data/cookbooks/rsyslog/templates/default/file-input.conf.erb +15 -0
  135. data/cookbooks/rsyslog/templates/default/omnios-manifest.xml.erb +30 -0
  136. data/cookbooks/rsyslog/templates/default/rsyslog.conf.erb +117 -0
  137. data/cookbooks/rsyslog/templates/smartos/50-default.conf.erb +18 -0
  138. data/cookbooks/runit/.kitchen.cloud.yml +103 -0
  139. data/cookbooks/runit/.kitchen.yml +38 -0
  140. data/cookbooks/runit/.rspec +3 -0
  141. data/cookbooks/runit/.rubocop.yml +45 -0
  142. data/cookbooks/runit/Berksfile.disabled +11 -0
  143. data/cookbooks/runit/CHANGELOG.md +226 -0
  144. data/cookbooks/runit/CONTRIBUTING.md +266 -0
  145. data/cookbooks/runit/Cheffile +11 -0
  146. data/cookbooks/runit/Gemfile +17 -0
  147. data/cookbooks/runit/LICENSE +201 -0
  148. data/cookbooks/runit/README.md +435 -0
  149. data/cookbooks/runit/Rakefile +23 -0
  150. data/cookbooks/runit/TESTING.md +26 -0
  151. data/cookbooks/runit/attributes/default.rb +62 -0
  152. data/cookbooks/runit/files/default/runit.seed +1 -0
  153. data/cookbooks/runit/files/default/runsvdir +0 -0
  154. data/cookbooks/runit/files/ubuntu-6.10/runsvdir +6 -0
  155. data/cookbooks/runit/files/ubuntu-7.04/runsvdir +7 -0
  156. data/cookbooks/runit/files/ubuntu-7.10/runsvdir +7 -0
  157. data/cookbooks/runit/files/ubuntu-8.04/runsvdir +7 -0
  158. data/cookbooks/runit/libraries/default.rb +0 -0
  159. data/cookbooks/runit/libraries/helpers.rb +190 -0
  160. data/cookbooks/runit/libraries/matchers.rb +69 -0
  161. data/cookbooks/runit/libraries/provider_runit_service.rb +326 -0
  162. data/cookbooks/runit/libraries/resource_runit_service.rb +267 -0
  163. data/cookbooks/runit/metadata.json +50 -0
  164. data/cookbooks/runit/recipes/default.rb +91 -0
  165. data/cookbooks/runit/templates/debian/init.d.erb +66 -0
  166. data/cookbooks/runit/templates/default/log-config.erb +24 -0
  167. data/cookbooks/runit/templates/gentoo/runit-start.sh.erb +32 -0
  168. data/cookbooks/scratchify/Berksfile +2 -1
  169. data/cookbooks/scratchify/Berksfile.lock +20 -1
  170. data/cookbooks/scratchify/lib/from-scratch.rb +1 -4
  171. data/cookbooks/scratchify/lib/from-scratch/version.rb +1 -1
  172. data/cookbooks/scratchify/metadata.json +5 -2
  173. data/cookbooks/scratchify/recipes/default.rb +15 -1
  174. data/cookbooks/scratchify/recipes/nginx_site.rb +4 -0
  175. data/cookbooks/scratchify/recipes/pre_rvm.rb +5 -0
  176. data/cookbooks/scratchify/templates/nginx.erb +31 -0
  177. data/cookbooks/scratchify/templates/node.json.erb +21 -6
  178. data/cookbooks/yum-epel/CHANGELOG.md +84 -0
  179. data/cookbooks/yum-epel/README.md +172 -0
  180. data/cookbooks/yum-epel/attributes/default.rb +1 -0
  181. data/cookbooks/yum-epel/attributes/epel-debuginfo.rb +28 -0
  182. data/cookbooks/yum-epel/attributes/epel-source.rb +28 -0
  183. data/cookbooks/yum-epel/attributes/epel-testing-debuginfo.rb +28 -0
  184. data/cookbooks/yum-epel/attributes/epel-testing-source.rb +28 -0
  185. data/cookbooks/yum-epel/attributes/epel-testing.rb +28 -0
  186. data/cookbooks/yum-epel/attributes/epel.rb +28 -0
  187. data/cookbooks/yum-epel/metadata.json +1 -0
  188. data/cookbooks/yum-epel/recipes/default.rb +61 -0
  189. data/cookbooks/yum/CHANGELOG.md +294 -0
  190. data/cookbooks/yum/README.md +285 -0
  191. data/cookbooks/yum/attributes/main.rb +100 -0
  192. data/cookbooks/yum/libraries/matchers.rb +27 -0
  193. data/cookbooks/yum/metadata.json +1 -0
  194. data/cookbooks/yum/providers/globalconfig.rb +41 -0
  195. data/cookbooks/yum/providers/repository.rb +106 -0
  196. data/cookbooks/yum/recipes/default.rb +26 -0
  197. data/cookbooks/yum/resources/globalconfig.rb +109 -0
  198. data/cookbooks/yum/resources/repository.rb +69 -0
  199. data/cookbooks/yum/templates/default/main.erb +276 -0
  200. data/cookbooks/yum/templates/default/repo.erb +125 -0
  201. data/lib/from-scratch.rb +1 -0
  202. data/lib/from-scratch/version.rb +1 -1
  203. data/metadata.rb +5 -1
  204. data/recipes/default.rb +15 -1
  205. data/recipes/nginx_site.rb +4 -0
  206. data/recipes/pre_rvm.rb +5 -0
  207. data/templates/nginx.erb +31 -0
  208. data/templates/node.json.erb +21 -6
  209. metadata +194 -1
@@ -0,0 +1,30 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipe:: http_gzip_static_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
+ template "#{node['nginx']['dir']}/conf.d/http_gzip_static.conf" do
23
+ source 'modules/http_gzip_static.conf.erb'
24
+ owner 'root'
25
+ group node['root_group']
26
+ mode '0644'
27
+ end
28
+
29
+ node.run_state['nginx_configure_flags'] =
30
+ node.run_state['nginx_configure_flags'] | ['--with-http_gzip_static_module']
@@ -0,0 +1,2 @@
1
+ node.run_state['nginx_configure_flags'] =
2
+ node.run_state['nginx_configure_flags'] | ['--with-http_mp4_module']
@@ -0,0 +1,23 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipe:: http_perl_module
4
+ #
5
+ # Author:: Akzhan Abdulin (<akzhan.abdulin@gmail.com>)
6
+ #
7
+ # Copyright 2012-2013, REG.RU
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.run_state['nginx_configure_flags'] =
23
+ node.run_state['nginx_configure_flags'] | ['--with-http_perl_module']
@@ -0,0 +1,38 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipe:: http_realip_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
+ # Documentation: http://wiki.nginx.org/HttpRealIpModule
23
+
24
+ # Currently only accepts X-Forwarded-For or X-Real-IP
25
+ node.default['nginx']['realip']['header'] = 'X-Forwarded-For'
26
+ node.default['nginx']['realip']['addresses'] = ['127.0.0.1']
27
+ node.default['nginx']['realip']['real_ip_recursive'] = 'off'
28
+
29
+ template "#{node['nginx']['dir']}/conf.d/http_realip.conf" do
30
+ source 'modules/http_realip.conf.erb'
31
+ owner 'root'
32
+ group node['root_group']
33
+ mode '0644'
34
+ notifies :reload, 'service[nginx]', :delayed
35
+ end
36
+
37
+ node.run_state['nginx_configure_flags'] =
38
+ node.run_state['nginx_configure_flags'] | ['--with-http_realip_module']
@@ -0,0 +1,23 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipe:: http_spdy_module
4
+ #
5
+ # Author:: Christoph Buente (<christoph@meinekleinefarm.org>)
6
+ #
7
+ # Copyright 2013, MeinekleineFarm.org
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.run_state['nginx_configure_flags'] =
23
+ node.run_state['nginx_configure_flags'] | ['--with-http_spdy_module']
@@ -0,0 +1,23 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipe:: http_ssl_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
+ node.run_state['nginx_configure_flags'] =
23
+ node.run_state['nginx_configure_flags'] | ['--with-http_ssl_module']
@@ -0,0 +1,36 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipe:: http_stub_status_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
+ include_recipe 'nginx::authorized_ips'
23
+
24
+ template 'nginx_status' do
25
+ path "#{node['nginx']['dir']}/sites-available/nginx_status"
26
+ source 'modules/nginx_status.erb'
27
+ owner 'root'
28
+ group node['root_group']
29
+ mode '0644'
30
+ notifies :reload, 'service[nginx]', :delayed
31
+ end
32
+
33
+ nginx_site 'nginx_status'
34
+
35
+ node.run_state['nginx_configure_flags'] =
36
+ node.run_state['nginx_configure_flags'] | ['--with-http_stub_status_module']
@@ -0,0 +1,23 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipe:: ipv6
4
+ #
5
+ # Author:: Alan Harper (alan@sct.com.au)
6
+ #
7
+ # Copyright 2013 Alan Harper
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.run_state['nginx_configure_flags'] =
23
+ node.run_state['nginx_configure_flags'] | ['--with-ipv6']
@@ -0,0 +1,47 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipe:: default
4
+ #
5
+ # Copyright 2013, Chef Software, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ luajit_src_filename = ::File.basename(node['nginx']['luajit']['url'])
21
+ luajit_src_filepath = "#{Chef::Config['file_cache_path']}/#{luajit_src_filename}"
22
+ luajit_extract_path = "#{Chef::Config['file_cache_path']}/luajit-#{node['nginx']['luajit']['version']}"
23
+
24
+ remote_file luajit_src_filepath do
25
+ source node['nginx']['luajit']['url']
26
+ checksum node['nginx']['luajit']['checksum']
27
+ owner 'root'
28
+ group node['root_group']
29
+ mode '0644'
30
+ end
31
+
32
+ bash 'extract_luajit' do
33
+ cwd ::File.dirname(luajit_src_filepath)
34
+ code <<-EOH
35
+ mkdir -p #{luajit_extract_path}
36
+ tar xzf #{luajit_src_filename} -C #{luajit_extract_path}
37
+ cd luajit-#{node['nginx']['luajit']['version']}/LuaJIT-#{node['nginx']['luajit']['version']}
38
+ make && make install
39
+ export LUAJIT_INC="/usr/local/include/luajit-2.0"
40
+ export LUAJIT_LIB="usr/local/lib"
41
+ EOH
42
+ not_if { ::File.exist?(luajit_extract_path) }
43
+ end
44
+
45
+ package 'lua-devel' do
46
+ action :install
47
+ end
@@ -0,0 +1,52 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipe:: naxsi_module
4
+ #
5
+ # Author:: Artiom Lunev (<artiom.lunev@gmail.com>)
6
+ #
7
+ # Copyright 2012-2013, Artiom Lunev
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
+ cookbook_file "#{node['nginx']['dir']}/naxsi_core.rules" do
23
+ source 'naxsi_core.rules'
24
+ owner 'root'
25
+ group node['root_group']
26
+ mode '0644'
27
+ notifies :reload, 'service[nginx]', :delayed
28
+ end
29
+
30
+ naxsi_src_filename = ::File.basename(node['nginx']['naxsi']['url'])
31
+ naxsi_src_filepath = "#{Chef::Config['file_cache_path']}/#{naxsi_src_filename}"
32
+ naxsi_extract_path = "#{Chef::Config['file_cache_path']}/nginx-naxsi-#{node['nginx']['naxsi']['version']}"
33
+
34
+ remote_file naxsi_src_filepath do
35
+ source node['nginx']['naxsi']['url']
36
+ checksum node['nginx']['naxsi']['checksum']
37
+ owner 'root'
38
+ group node['root_group']
39
+ mode '0644'
40
+ end
41
+
42
+ bash 'extract_naxsi_module' do
43
+ cwd ::File.dirname(naxsi_src_filepath)
44
+ code <<-EOH
45
+ mkdir -p #{naxsi_extract_path}
46
+ tar xzf #{naxsi_src_filename} -C #{naxsi_extract_path}
47
+ EOH
48
+ not_if { ::File.exist?(naxsi_extract_path) }
49
+ end
50
+
51
+ node.run_state['nginx_configure_flags'] =
52
+ node.run_state['nginx_configure_flags'] | ["--add-module=#{naxsi_extract_path}/naxsi-#{node['nginx']['naxsi']['version']}/naxsi_src"]
@@ -0,0 +1,44 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipes:: devel
4
+ #
5
+ # Author:: Arthur Freyman (<afreyman@riotgames.com>)
6
+ #
7
+ # Copyright 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
+ devel_src_filename = ::File.basename(node['nginx']['devel']['url'])
23
+ devel_src_filepath = "#{Chef::Config['file_cache_path']}/#{devel_src_filename}"
24
+ devel_extract_path = "#{Chef::Config['file_cache_path']}/nginx-devel-#{node['nginx']['devel']['version']}"
25
+
26
+ remote_file devel_src_filepath do
27
+ source node['nginx']['devel']['url']
28
+ checksum node['nginx']['devel']['checksum']
29
+ owner 'root'
30
+ group node['root_group']
31
+ mode '0644'
32
+ end
33
+
34
+ bash 'extract_devel_module' do
35
+ cwd ::File.dirname(devel_src_filepath)
36
+ code <<-EOH
37
+ mkdir -p #{devel_extract_path}
38
+ tar xzf #{devel_src_filename} -C #{devel_extract_path}
39
+ EOH
40
+ not_if { ::File.exist?(devel_extract_path) }
41
+ end
42
+
43
+ node.run_state['nginx_configure_flags'] =
44
+ node.run_state['nginx_configure_flags'] | ["--add-module=#{devel_extract_path}/ngx_devel_kit-#{node['nginx']['devel']['version']}"]
@@ -0,0 +1,47 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipes:: lua
4
+ #
5
+ # Author:: Arthur Freyman (<afreyman@riotgames.com>)
6
+ #
7
+ # Copyright 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
+ lua_src_filename = ::File.basename(node['nginx']['lua']['url'])
23
+ lua_src_filepath = "#{Chef::Config['file_cache_path']}/#{lua_src_filename}"
24
+ lua_extract_path = "#{Chef::Config['file_cache_path']}/nginx-lua-#{node['nginx']['lua']['version']}"
25
+
26
+ remote_file lua_src_filepath do
27
+ source node['nginx']['lua']['url']
28
+ checksum node['nginx']['lua']['checksum']
29
+ owner 'root'
30
+ group node['root_group']
31
+ mode '0644'
32
+ end
33
+
34
+ bash 'extract_lua_module' do
35
+ cwd ::File.dirname(lua_src_filepath)
36
+ code <<-EOH
37
+ mkdir -p #{lua_extract_path}
38
+ tar xzf #{lua_src_filename} -C #{lua_extract_path}
39
+ EOH
40
+ not_if { ::File.exist?(lua_extract_path) }
41
+ end
42
+
43
+ node.run_state['nginx_configure_flags'] =
44
+ node.run_state['nginx_configure_flags'] | ["--add-module=#{lua_extract_path}/lua-nginx-module-#{node['nginx']['lua']['version']}"]
45
+
46
+ include_recipe 'nginx::lua'
47
+ include_recipe 'nginx::ngx_devel_module'
@@ -0,0 +1,35 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipe:: ohai_plugin
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
+ ohai 'reload_nginx' do
23
+ plugin 'nginx'
24
+ action :nothing
25
+ end
26
+
27
+ template "#{node['ohai']['plugin_path']}/nginx.rb" do
28
+ source 'plugins/nginx.rb.erb'
29
+ owner 'root'
30
+ group node['root_group']
31
+ mode '0755'
32
+ notifies :reload, 'ohai[reload_nginx]', :immediately
33
+ end
34
+
35
+ include_recipe 'ohai::default'
@@ -0,0 +1,45 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Recipe:: openssl_source
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
+ src_filename = ::File.basename(node['nginx']['openssl_source']['url'])
23
+ src_filepath = "#{Chef::Config['file_cache_path']}/#{src_filename}"
24
+ extract_path = "#{Chef::Config['file_cache_path']}/openssl-#{node['nginx']['openssl_source']['version']}"
25
+
26
+ remote_file src_filepath do
27
+ source node['nginx']['openssl_source']['url']
28
+ owner 'root'
29
+ group node['root_group']
30
+ mode '0644'
31
+ not_if { ::File.exist?(src_filepath) }
32
+ end
33
+
34
+ bash 'extract_openssl' do
35
+ cwd ::File.dirname(src_filepath)
36
+ code <<-EOH
37
+ mkdir -p #{extract_path}
38
+ tar xzf #{src_filename} -C #{extract_path}
39
+ mv #{extract_path}/*/* #{extract_path}/
40
+ EOH
41
+ not_if { ::File.exist?(extract_path) }
42
+ end
43
+
44
+ node.run_state['nginx_configure_flags'] =
45
+ node.run_state['nginx_configure_flags'] | ["--with-openssl=#{extract_path}"]