diff --git a/chef/cookbooks/metasploitable/recipes/chatbot.rb b/chef/cookbooks/metasploitable/recipes/chatbot.rb index 6043653..2893202 100644 --- a/chef/cookbooks/metasploitable/recipes/chatbot.rb +++ b/chef/cookbooks/metasploitable/recipes/chatbot.rb @@ -1,18 +1,22 @@ # -# Cookbook:: chatbot +# Cookbook:: metasploitable # Recipe:: chatbot # # Copyright:: 2017, Rapid7, All Rights Reserved. # # -include_recipe 'metasploitable::chatbot' +include_recipe 'metasploitable::ruby23' +include_recipe 'metasploitable::nodejs' package 'unzip' -package 'npm' - -package 'bundler' +bash "Install dependencies" do + code <<-EOH + npm install express + npm install cors + EOH +end cookbook_file '/tmp/chatbot.zip' do source 'chatbot/chatbot.zip' diff --git a/chef/cookbooks/metasploitable/recipes/nodejs.rb b/chef/cookbooks/metasploitable/recipes/nodejs.rb new file mode 100644 index 0000000..f937e3d --- /dev/null +++ b/chef/cookbooks/metasploitable/recipes/nodejs.rb @@ -0,0 +1,14 @@ +# +# Cookbook:: metasploitable +# Recipe:: nodejs +# +# Copyright:: 2017, Rapid7, All Rights Reserved. +# +# + +execute "apt-get update" do + command "apt-get update" +end + +package 'nodejs' +package 'npm' diff --git a/chef/cookbooks/metasploitable/recipes/readme_app.rb b/chef/cookbooks/metasploitable/recipes/readme_app.rb index ba2f400..5a76e2e 100644 --- a/chef/cookbooks/metasploitable/recipes/readme_app.rb +++ b/chef/cookbooks/metasploitable/recipes/readme_app.rb @@ -7,9 +7,9 @@ # include_recipe 'metasploitable::ruby23' +include_recipe 'metasploitable::nodejs' package 'git' -package 'nodejs' directory '/opt/readme_app' do mode '0777' diff --git a/chef/cookbooks/metasploitable/recipes/sinatra.rb b/chef/cookbooks/metasploitable/recipes/sinatra.rb index b3acf12..583bb87 100644 --- a/chef/cookbooks/metasploitable/recipes/sinatra.rb +++ b/chef/cookbooks/metasploitable/recipes/sinatra.rb @@ -1,5 +1,5 @@ # -# Cookbook:: sinatra +# Cookbook:: metasploitable # Recipe:: sinatra # # Copyright:: 2017, Rapid7, All Rights Reserved.