mirror of
https://github.com/rapid7/metasploitable3.git
synced 2024-07-05 03:05:51 +02:00
3fdaf996ae
There were quite a few bugs in the chef recipes when building using other platforms. These were mostly due to assuming the vagrant user would exist. Things are now more generic and should be more reliable overall.
46 lines
802 B
Ruby
46 lines
802 B
Ruby
#
|
|
# Cookbook:: metasploitable
|
|
# Recipe:: chatbot
|
|
#
|
|
# Copyright:: 2017, Rapid7, All Rights Reserved.
|
|
#
|
|
#
|
|
|
|
include_recipe 'metasploitable::ruby23'
|
|
include_recipe 'metasploitable::nodejs'
|
|
|
|
package 'unzip'
|
|
|
|
bash "Install dependencies" do
|
|
code <<-EOH
|
|
npm install express
|
|
npm install cors
|
|
EOH
|
|
end
|
|
|
|
cookbook_file '/tmp/chatbot.zip' do
|
|
source 'chatbot/chatbot.zip'
|
|
mode '0777'
|
|
end
|
|
|
|
execute 'unzip chatbot' do
|
|
command 'unzip /tmp/chatbot.zip -d /opt'
|
|
end
|
|
|
|
execute 'chown chatbot' do
|
|
command "chown -R root:root /opt/chatbot"
|
|
end
|
|
|
|
execute 'chmod chatbot' do
|
|
command 'chmod -R 777 /opt/chatbot'
|
|
end
|
|
|
|
execute 'install chatbot' do
|
|
command '/opt/chatbot/install.sh'
|
|
end
|
|
|
|
service 'chatbot' do
|
|
supports restart: false, start: true, reload: false, status: false
|
|
action [:enable, :start]
|
|
end
|