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,8 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Attributes:: set_misc
4
+ #
5
+
6
+ default['nginx']['set_misc']['version'] = '0.24'
7
+ default['nginx']['set_misc']['url'] = "https://github.com/agentzh/set-misc-nginx-module/archive/v#{node['nginx']['set_misc']['version']}.tar.gz"
8
+ default['nginx']['set_misc']['checksum'] = 'da404a7dac5fa4a0a86f42b4ec7648b607f4cd66'
@@ -0,0 +1,13 @@
1
+ default['nginx']['socketproxy']['root'] = '/usr/share/nginx/apps'
2
+ default['nginx']['socketproxy']['app_owner'] = 'root'
3
+ default['nginx']['socketproxy']['logname'] = 'socketproxy'
4
+ default['nginx']['socketproxy']['log_level'] = 'error'
5
+ # default['nginx']['socketproxy']['default_app'] = 'default'
6
+ # default['nginx']['socketproxy']['apps'] = {
7
+ # 'default' => {
8
+ # 'prepend_slash' => false,
9
+ # 'context_name' => '',
10
+ # 'subdir' => 'current',
11
+ # 'socket_path' => 'shared/sockets/unicorn.sock'
12
+ # }
13
+ # }
@@ -0,0 +1,42 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Attributes:: source
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_attribute 'nginx::default'
23
+
24
+ default['nginx']['source']['version'] = node['nginx']['version']
25
+ default['nginx']['source']['prefix'] = "/opt/nginx-#{node['nginx']['source']['version']}"
26
+ default['nginx']['source']['conf_path'] = "#{node['nginx']['dir']}/nginx.conf"
27
+ default['nginx']['source']['sbin_path'] = "#{node['nginx']['source']['prefix']}/sbin/nginx"
28
+ default['nginx']['source']['default_configure_flags'] = %W(
29
+ --prefix=#{node['nginx']['source']['prefix']}
30
+ --conf-path=#{node['nginx']['dir']}/nginx.conf
31
+ --sbin-path=#{node['nginx']['source']['sbin_path']}
32
+ )
33
+
34
+ default['nginx']['configure_flags'] = []
35
+ default['nginx']['source']['version'] = node['nginx']['version']
36
+ default['nginx']['source']['url'] = "http://nginx.org/download/nginx-#{node['nginx']['source']['version']}.tar.gz"
37
+ default['nginx']['source']['checksum'] = 'b5608c2959d3e7ad09b20fc8f9e5bd4bc87b3bc8ba5936a513c04ed8f1391a18'
38
+ default['nginx']['source']['modules'] = %w(
39
+ nginx::http_ssl_module
40
+ nginx::http_gzip_static_module
41
+ )
42
+ default['nginx']['source']['use_existing_user'] = false
@@ -0,0 +1,22 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Attributes:: status
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
+ default['nginx']['status']['port'] = '8090'
@@ -0,0 +1,24 @@
1
+
2
+ #
3
+ # Cookbook Name:: nginx
4
+ # Attributes:: syslog
5
+ #
6
+ # Author:: Bob Ziuchkovski (<bob@bz-technology.com>)
7
+ #
8
+ # Copyright 2014, UserTesting
9
+ #
10
+ # Licensed under the Apache License, Version 2.0 (the "License");
11
+ # you may not use this file except in compliance with the License.
12
+ # You may obtain a copy of the License at
13
+ #
14
+ # http://www.apache.org/licenses/LICENSE-2.0
15
+ #
16
+ # Unless required by applicable law or agreed to in writing, software
17
+ # distributed under the License is distributed on an "AS IS" BASIS,
18
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ # See the License for the specific language governing permissions and
20
+ # limitations under the License.
21
+ #
22
+
23
+ default['nginx']['syslog']['git_repo'] = 'https://github.com/yaoweibin/nginx_syslog_patch.git'
24
+ default['nginx']['syslog']['git_revision'] = 'master'
@@ -0,0 +1,26 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Attributes:: upload_progress
4
+ #
5
+ # Author:: Jamie Winsor (<jamie@vialstudios.com>)
6
+ #
7
+ # Copyright 2012, 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
+ default['nginx']['upload_progress']['url'] = 'https://github.com/masterzen/nginx-upload-progress-module/tarball/v0.9.0'
23
+ default['nginx']['upload_progress']['checksum'] = '3fb903dab595cf6656fa0fc5743a48daffbba2f6b5c554836be630800eaad4e2'
24
+ default['nginx']['upload_progress']['javascript_output'] = true
25
+ default['nginx']['upload_progress']['zone_name'] = 'proxied'
26
+ default['nginx']['upload_progress']['zone_size'] = '1m'
@@ -0,0 +1,50 @@
1
+ #
2
+ # Cookbook Name:: nginx
3
+ # Definition:: nginx_site
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
+ define :nginx_site, :enable => true, :timing => :delayed do
23
+ if params[:enable]
24
+
25
+ if params[:template]
26
+ template "#{node['nginx']['dir']}/sites-available/#{params[:name]}" do
27
+ source params[:template]
28
+ variables(params[:variables])
29
+ end
30
+ end
31
+
32
+ execute "nxensite #{params[:name]}" do
33
+ command "#{node['nginx']['script_dir']}/nxensite #{params[:name]}"
34
+ notifies :reload, 'service[nginx]', params[:timing]
35
+ not_if do
36
+ ::File.symlink?("#{node['nginx']['dir']}/sites-enabled/#{params[:name]}") ||
37
+ ::File.symlink?("#{node['nginx']['dir']}/sites-enabled/000-#{params[:name]}")
38
+ end
39
+ end
40
+ else
41
+ execute "nxdissite #{params[:name]}" do
42
+ command "#{node['nginx']['script_dir']}/nxdissite #{params[:name]}"
43
+ notifies :reload, 'service[nginx]', params[:timing]
44
+ only_if do
45
+ ::File.symlink?("#{node['nginx']['dir']}/sites-enabled/#{params[:name]}") ||
46
+ ::File.symlink?("#{node['nginx']['dir']}/sites-enabled/000-#{params[:name]}")
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,78 @@
1
+ types {
2
+ text/html html htm shtml;
3
+ text/css css;
4
+ text/xml xml;
5
+ image/gif gif;
6
+ image/jpeg jpeg jpg;
7
+ application/javascript js;
8
+ application/json json;
9
+ application/atom+xml atom;
10
+ application/rss+xml rss;
11
+ text/cache.manifest manifest;
12
+ text/mathml mml;
13
+ text/plain txt;
14
+ text/vnd.sun.j2me.app-descriptor jad;
15
+ text/vnd.wap.wml wml;
16
+ text/x-component htc;
17
+ image/png png;
18
+ image/tiff tif tiff;
19
+ image/vnd.wap.wbmp wbmp;
20
+ image/x-icon ico;
21
+ image/x-jng jng;
22
+ image/x-ms-bmp bmp;
23
+ image/svg+xml svg svgz;
24
+ image/webp webp;
25
+ application/java-archive jar war ear;
26
+ application/mac-binhex40 hqx;
27
+ application/msword doc;
28
+ application/pdf pdf;
29
+ application/postscript ps eps ai;
30
+ application/rtf rtf;
31
+ application/vnd.ms-excel xls;
32
+ application/vnd.ms-powerpoint ppt;
33
+ application/vnd.wap.wmlc wmlc;
34
+ application/vnd.google-earth.kml+xml kml;
35
+ application/vnd.google-earth.kmz kmz;
36
+ application/x-7z-compressed 7z;
37
+ application/x-cocoa cco;
38
+ application/x-java-archive-diff jardiff;
39
+ application/x-java-jnlp-file jnlp;
40
+ application/x-makeself run;
41
+ application/x-perl pl pm;
42
+ application/x-pilot prc pdb;
43
+ application/x-rar-compressed rar;
44
+ application/x-redhat-package-manager rpm;
45
+ application/x-sea sea;
46
+ application/x-shockwave-flash swf;
47
+ application/x-stuffit sit;
48
+ application/x-tcl tcl tk;
49
+ application/x-x509-ca-cert der pem crt;
50
+ application/x-xpinstall xpi;
51
+ application/xhtml+xml xhtml;
52
+ application/zip zip;
53
+ application/octet-stream bin exe dll;
54
+ application/octet-stream deb;
55
+ application/octet-stream dmg;
56
+ application/octet-stream iso img;
57
+ application/octet-stream msi msp msm;
58
+ font/ttf ttf;
59
+ font/opentype otf;
60
+ application/x-font-woff woff;
61
+ application/vnd.ms-fontobject eot;
62
+ audio/midi mid midi kar;
63
+ audio/mpeg mp3;
64
+ audio/ogg ogg;
65
+ audio/x-m4a m4a;
66
+ audio/x-realaudio ra;
67
+ video/3gpp 3gpp 3gp;
68
+ video/mp4 mp4;
69
+ video/mpeg mpeg mpg;
70
+ video/quicktime mov;
71
+ video/webm webm;
72
+ video/x-flv flv;
73
+ video/x-m4v m4v;
74
+ video/x-mng mng;
75
+ video/x-ms-asf asx asf;
76
+ video/x-ms-wmv wmv;
77
+ video/x-msvideo avi;
78
+ }
@@ -0,0 +1,82 @@
1
+ ##################################
2
+ ## INTERNAL RULES IDS:1-10 ##
3
+ ##################################
4
+ #weird_request : 1
5
+ #big_body : 2
6
+ #no_content_type : 3
7
+
8
+ #@MainRule "msg:weird/incorrect request" id:1;
9
+ #@MainRule "msg:big request, unparsed" id:2;
10
+ #@MainRule "msg:uncommon hex encoding (%00 etc.)" id:10;
11
+ #@MainRule "msg:uncommon/empty content-type in POST" id:11;
12
+ #@MainRule "msg:uncommon/malformed URL" id:12;
13
+
14
+ #MainRule "str:123FREETEXT" "msg:exemple learning test pattern" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:BLOCK" id:0;
15
+
16
+ ##################################
17
+ ## SQL Injections IDs:1000-1099 ##
18
+ ##################################
19
+ MainRule "rx:select|union|update|delete|insert|table|from|ascii|hex|unhex|drop" "msg:sql keywords" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$SQL:4" id:1000;
20
+ MainRule "str:\"" "msg:double quote" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$SQL:8,$XSS:8" id:1001;
21
+ MainRule "str:0x" "msg:0x, possible hex encoding" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$SQL:2" id:1002;
22
+ ## Hardcore rules
23
+ MainRule "str:/*" "msg:mysql comment (/*)" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$SQL:8" id:1003;
24
+ MainRule "str:*/" "msg:mysql comment (*/)" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$SQL:8" id:1004;
25
+ MainRule "str:|" "msg:mysql keyword (|)" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$SQL:8" id:1005;
26
+ MainRule "str:&&" "msg:mysql keyword (&&)" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$SQL:8" id:1006;
27
+ ## end of hardcore rules
28
+ MainRule "str:--" "msg:mysql comment (--)" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$SQL:4" id:1007;
29
+ MainRule "str:;" "msg:; in stuff" "mz:BODY|URL|ARGS" "s:$SQL:4,$XSS:8" id:1008;
30
+ MainRule "str:=" "msg:equal in var, probable sql/xss" "mz:ARGS|BODY" "s:$SQL:2" id:1009;
31
+ MainRule "str:(" "msg:parenthesis, probable sql/xss" "mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie" "s:$SQL:4,$XSS:8" id:1010;
32
+ MainRule "str:)" "msg:parenthesis, probable sql/xss" "mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie" "s:$SQL:4,$XSS:8" id:1011;
33
+ MainRule "str:'" "msg:simple quote" "mz:ARGS|BODY|URL|$HEADERS_VAR:Cookie" "s:$SQL:4,$XSS:8" id:1013;
34
+ MainRule "str:," "msg:, in stuff" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$SQL:4" id:1015;
35
+ MainRule "str:#" "msg:mysql comment (#)" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$SQL:4" id:1016;
36
+
37
+ ###############################
38
+ ## OBVIOUS RFI IDs:1100-1199 ##
39
+ ###############################
40
+ MainRule "str:http://" "msg:http:// scheme" "mz:ARGS|BODY|$HEADERS_VAR:Cookie" "s:$RFI:8" id:1100;
41
+ MainRule "str:https://" "msg:https:// scheme" "mz:ARGS|BODY|$HEADERS_VAR:Cookie" "s:$RFI:8" id:1101;
42
+ MainRule "str:ftp://" "msg:ftp:// scheme" "mz:ARGS|BODY|$HEADERS_VAR:Cookie" "s:$RFI:8" id:1102;
43
+ MainRule "str:php://" "msg:php:// scheme" "mz:ARGS|BODY|$HEADERS_VAR:Cookie" "s:$RFI:8" id:1103;
44
+ MainRule "str:sftp://" "msg:sftp:// scheme" "mz:ARGS|BODY|$HEADERS_VAR:Cookie" "s:$RFI:8" id:1104;
45
+ MainRule "str:zlib://" "msg:zlib:// scheme" "mz:ARGS|BODY|$HEADERS_VAR:Cookie" "s:$RFI:8" id:1105;
46
+ MainRule "str:data://" "msg:data:// scheme" "mz:ARGS|BODY|$HEADERS_VAR:Cookie" "s:$RFI:8" id:1106;
47
+ MainRule "str:glob://" "msg:glob:// scheme" "mz:ARGS|BODY|$HEADERS_VAR:Cookie" "s:$RFI:8" id:1107;
48
+ MainRule "str:phar://" "msg:phar:// scheme" "mz:ARGS|BODY|$HEADERS_VAR:Cookie" "s:$RFI:8" id:1108;
49
+ MainRule "str:file://" "msg:file:// scheme" "mz:ARGS|BODY|$HEADERS_VAR:Cookie" "s:$RFI:8" id:1109;
50
+
51
+ #######################################
52
+ ## Directory traversal IDs:1200-1299 ##
53
+ #######################################
54
+ MainRule "str:.." "msg:double dot" "mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie" "s:$TRAVERSAL:4" id:1200;
55
+ MainRule "str:/etc/passwd" "msg:obvious probe" "mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie" "s:$TRAVERSAL:4" id:1202;
56
+ MainRule "str:c:\\" "msg:obvious windows path" "mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie" "s:$TRAVERSAL:4" id:1203;
57
+ MainRule "str:cmd.exe" "msg:obvious probe" "mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie" "s:$TRAVERSAL:4" id:1204;
58
+ MainRule "str:\\" "msg:backslash" "mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie" "s:$TRAVERSAL:4" id:1205;
59
+ #MainRule "str:/" "msg:slash in args" "mz:ARGS|BODY|$HEADERS_VAR:Cookie" "s:$TRAVERSAL:2" id:1206;
60
+
61
+ ########################################
62
+ ## Cross Site Scripting IDs:1300-1399 ##
63
+ ########################################
64
+ MainRule "str:<" "msg:html open tag" "mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie" "s:$XSS:8" id:1302;
65
+ MainRule "str:>" "msg:html close tag" "mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie" "s:$XSS:8" id:1303;
66
+ MainRule "str:[" "msg:[, possible js" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$XSS:4" id:1310;
67
+ MainRule "str:]" "msg:], possible js" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$XSS:4" id:1311;
68
+ MainRule "str:~" "msg:~ character" "mz:BODY|URL|ARGS|$HEADERS_VAR:Cookie" "s:$XSS:4" id:1312;
69
+ MainRule "str:`" "msg:grave accent !" "mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie" "s:$XSS:8" id:1314;
70
+ MainRule "rx:%[2|3]." "msg:double encoding !" "mz:ARGS|URL|BODY|$HEADERS_VAR:Cookie" "s:$XSS:8" id:1315;
71
+
72
+ ####################################
73
+ ## Evading tricks IDs: 1400-1500 ##
74
+ ####################################
75
+ MainRule "str:&#" "msg: utf7/8 encoding" "mz:ARGS|BODY|URL|$HEADERS_VAR:Cookie" "s:$EVADE:4" id:1400;
76
+ MainRule "str:%U" "msg: M$ encoding" "mz:ARGS|BODY|URL|$HEADERS_VAR:Cookie" "s:$EVADE:4" id:1401;
77
+ MainRule negative "rx:multipart/form-data|application/x-www-form-urlencoded" "msg:Content is neither mulipart/x-www-form.." "mz:$HEADERS_VAR:Content-type" "s:$EVADE:4" id:1402;
78
+
79
+ #############################
80
+ ## File uploads: 1500-1600 ##
81
+ #############################
82
+ MainRule "rx:.ph|.asp|.ht" "msg:asp/php file upload!" "mz:FILE_EXT" "s:$UPLOAD:8" id:1500;
@@ -0,0 +1,20 @@
1
+ if defined?(ChefSpec)
2
+ # Custom ChefSpec matchers
3
+ module ChefSpec::Matchers
4
+ RSpec::Matchers.define :enable_nginx_site do |site|
5
+ match do |chef_run|
6
+ chef_run.resource_collection.all_resources.any? do |resource|
7
+ resource.resource_name == :execute && resource.name =~ /.*nxensite.*#{site}/
8
+ end
9
+ end
10
+ end
11
+
12
+ RSpec::Matchers.define :disable_nginx_site do |site|
13
+ match do |chef_run|
14
+ chef_run.resource_collection.all_resources.any? do |resource|
15
+ resource.resource_name == :execute && resource.name =~ /.*nxdissite.*#{site}/
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,351 @@
1
+ {
2
+ "name": "nginx",
3
+ "description": "Installs and configures nginx",
4
+ "long_description": "",
5
+ "maintainer": "Chef Software, Inc.",
6
+ "maintainer_email": "cookbooks@chef.io",
7
+ "license": "Apache 2.0",
8
+ "platforms": {
9
+ "amazon": ">= 0.0.0",
10
+ "centos": ">= 0.0.0",
11
+ "debian": ">= 0.0.0",
12
+ "fedora": ">= 0.0.0",
13
+ "oracle": ">= 0.0.0",
14
+ "redhat": ">= 0.0.0",
15
+ "scientific": ">= 0.0.0",
16
+ "ubuntu": ">= 0.0.0"
17
+ },
18
+ "dependencies": {
19
+ "apt": "~> 2.2",
20
+ "bluepill": "~> 2.3",
21
+ "build-essential": "~> 2.0",
22
+ "ohai": "~> 2.0",
23
+ "runit": "~> 1.2",
24
+ "yum-epel": "~> 0.3"
25
+ },
26
+ "recommendations": {
27
+
28
+ },
29
+ "suggestions": {
30
+
31
+ },
32
+ "conflicting": {
33
+
34
+ },
35
+ "providing": {
36
+
37
+ },
38
+ "replacing": {
39
+
40
+ },
41
+ "attributes": {
42
+ "nginx/dir": {
43
+ "display_name": "Nginx Directory",
44
+ "description": "Location of nginx configuration files",
45
+ "default": "/etc/nginx",
46
+ "choice": [
47
+
48
+ ],
49
+ "calculated": false,
50
+ "type": "string",
51
+ "required": "optional",
52
+ "recipes": [
53
+
54
+ ]
55
+ },
56
+ "nginx/log_dir": {
57
+ "display_name": "Nginx Log Directory",
58
+ "description": "Location for nginx logs",
59
+ "default": "/var/log/nginx",
60
+ "choice": [
61
+
62
+ ],
63
+ "calculated": false,
64
+ "type": "string",
65
+ "required": "optional",
66
+ "recipes": [
67
+
68
+ ]
69
+ },
70
+ "nginx/user": {
71
+ "display_name": "Nginx User",
72
+ "description": "User nginx will run as",
73
+ "default": "www-data",
74
+ "choice": [
75
+
76
+ ],
77
+ "calculated": false,
78
+ "type": "string",
79
+ "required": "optional",
80
+ "recipes": [
81
+
82
+ ]
83
+ },
84
+ "nginx/binary": {
85
+ "display_name": "Nginx Binary",
86
+ "description": "Location of the nginx server binary",
87
+ "default": "/usr/sbin/nginx",
88
+ "choice": [
89
+
90
+ ],
91
+ "calculated": false,
92
+ "type": "string",
93
+ "required": "optional",
94
+ "recipes": [
95
+
96
+ ]
97
+ },
98
+ "nginx/gzip": {
99
+ "display_name": "Nginx Gzip",
100
+ "description": "Whether gzip is enabled",
101
+ "default": "on",
102
+ "choice": [
103
+
104
+ ],
105
+ "calculated": false,
106
+ "type": "string",
107
+ "required": "optional",
108
+ "recipes": [
109
+
110
+ ]
111
+ },
112
+ "nginx/gzip_http_version": {
113
+ "display_name": "Nginx Gzip HTTP Version",
114
+ "description": "Version of HTTP Gzip",
115
+ "default": "1.0",
116
+ "choice": [
117
+
118
+ ],
119
+ "calculated": false,
120
+ "type": "string",
121
+ "required": "optional",
122
+ "recipes": [
123
+
124
+ ]
125
+ },
126
+ "nginx/gzip_comp_level": {
127
+ "display_name": "Nginx Gzip Compression Level",
128
+ "description": "Amount of compression to use",
129
+ "default": "2",
130
+ "choice": [
131
+
132
+ ],
133
+ "calculated": false,
134
+ "type": "string",
135
+ "required": "optional",
136
+ "recipes": [
137
+
138
+ ]
139
+ },
140
+ "nginx/gzip_proxied": {
141
+ "display_name": "Nginx Gzip Proxied",
142
+ "description": "Whether gzip is proxied",
143
+ "default": "any",
144
+ "choice": [
145
+
146
+ ],
147
+ "calculated": false,
148
+ "type": "string",
149
+ "required": "optional",
150
+ "recipes": [
151
+
152
+ ]
153
+ },
154
+ "nginx/gzip_types": {
155
+ "display_name": "Nginx Gzip Types",
156
+ "description": "Supported MIME-types for gzip",
157
+ "type": "array",
158
+ "default": [
159
+ "text/plain",
160
+ "text/css",
161
+ "application/x-javascript",
162
+ "text/xml",
163
+ "application/xml",
164
+ "application/xml+rss",
165
+ "text/javascript",
166
+ "application/javascript",
167
+ "application/json"
168
+ ],
169
+ "choice": [
170
+
171
+ ],
172
+ "calculated": false,
173
+ "required": "optional",
174
+ "recipes": [
175
+
176
+ ]
177
+ },
178
+ "nginx/keepalive": {
179
+ "display_name": "Nginx Keepalive",
180
+ "description": "Whether to enable keepalive",
181
+ "default": "on",
182
+ "choice": [
183
+
184
+ ],
185
+ "calculated": false,
186
+ "type": "string",
187
+ "required": "optional",
188
+ "recipes": [
189
+
190
+ ]
191
+ },
192
+ "nginx/keepalive_timeout": {
193
+ "display_name": "Nginx Keepalive Timeout",
194
+ "default": "65",
195
+ "choice": [
196
+
197
+ ],
198
+ "calculated": false,
199
+ "type": "string",
200
+ "required": "optional",
201
+ "recipes": [
202
+
203
+ ]
204
+ },
205
+ "nginx/worker_processes": {
206
+ "display_name": "Nginx Worker Processes",
207
+ "description": "Number of worker processes",
208
+ "default": "1",
209
+ "choice": [
210
+
211
+ ],
212
+ "calculated": false,
213
+ "type": "string",
214
+ "required": "optional",
215
+ "recipes": [
216
+
217
+ ]
218
+ },
219
+ "nginx/worker_connections": {
220
+ "display_name": "Nginx Worker Connections",
221
+ "description": "Number of connections per worker",
222
+ "default": "1024",
223
+ "choice": [
224
+
225
+ ],
226
+ "calculated": false,
227
+ "type": "string",
228
+ "required": "optional",
229
+ "recipes": [
230
+
231
+ ]
232
+ },
233
+ "nginx/server_names_hash_bucket_size": {
234
+ "display_name": "Nginx Server Names Hash Bucket Size",
235
+ "default": "64",
236
+ "choice": [
237
+
238
+ ],
239
+ "calculated": false,
240
+ "type": "string",
241
+ "required": "optional",
242
+ "recipes": [
243
+
244
+ ]
245
+ },
246
+ "nginx/types_hash_max_size": {
247
+ "display_name": "Nginx Types Hash Max Size",
248
+ "default": "2048",
249
+ "choice": [
250
+
251
+ ],
252
+ "calculated": false,
253
+ "type": "string",
254
+ "required": "optional",
255
+ "recipes": [
256
+
257
+ ]
258
+ },
259
+ "nginx/types_hash_bucket_size": {
260
+ "display_name": "Nginx Types Hash Bucket Size",
261
+ "default": "64",
262
+ "choice": [
263
+
264
+ ],
265
+ "calculated": false,
266
+ "type": "string",
267
+ "required": "optional",
268
+ "recipes": [
269
+
270
+ ]
271
+ },
272
+ "nginx/disable_access_log": {
273
+ "display_name": "Disable Access Log",
274
+ "default": "false",
275
+ "choice": [
276
+
277
+ ],
278
+ "calculated": false,
279
+ "type": "string",
280
+ "required": "optional",
281
+ "recipes": [
282
+
283
+ ]
284
+ },
285
+ "nginx/default_site_enabled": {
286
+ "display_name": "Default site enabled",
287
+ "default": "true",
288
+ "choice": [
289
+
290
+ ],
291
+ "calculated": false,
292
+ "type": "string",
293
+ "required": "optional",
294
+ "recipes": [
295
+
296
+ ]
297
+ },
298
+ "nginx/sendfile": {
299
+ "display_name": "Nginx sendfile",
300
+ "description": "Whether to enable sendfile",
301
+ "default": "on",
302
+ "choice": [
303
+
304
+ ],
305
+ "calculated": false,
306
+ "type": "string",
307
+ "required": "optional",
308
+ "recipes": [
309
+
310
+ ]
311
+ },
312
+ "nginx/tcp_nopush": {
313
+ "display_name": "Nginx tcp_nopush",
314
+ "description": "Whether to enable tcp_nopush",
315
+ "default": "on",
316
+ "choice": [
317
+
318
+ ],
319
+ "calculated": false,
320
+ "type": "string",
321
+ "required": "optional",
322
+ "recipes": [
323
+
324
+ ]
325
+ },
326
+ "nginx/tcp_nodelay": {
327
+ "display_name": "Nginx tcp_nodelay",
328
+ "description": "Whether to enable tcp_nodelay",
329
+ "default": "on",
330
+ "choice": [
331
+
332
+ ],
333
+ "calculated": false,
334
+ "type": "string",
335
+ "required": "optional",
336
+ "recipes": [
337
+
338
+ ]
339
+ }
340
+ },
341
+ "groupings": {
342
+
343
+ },
344
+ "recipes": {
345
+ "nginx": "Installs nginx package and sets up configuration with Debian apache style with sites-enabled/sites-available",
346
+ "nginx::source": "Installs nginx from source and sets up configuration with Debian apache style with sites-enabled/sites-available"
347
+ },
348
+ "version": "2.7.6",
349
+ "source_url": "",
350
+ "issues_url": ""
351
+ }