metasploitable3/chef/cookbooks/metasploitable/recipes/sinatra.rb

39 lines
687 B
Ruby
Raw Normal View History

#
# Cookbook:: sinatra
# Recipe:: sinatra
#
# Copyright:: 2017, Rapid7, All Rights Reserved.
#
#
include_recipe 'metasploitable::sinatra'
apt_repository 'rvm' do
2017-04-05 22:54:14 +02:00
uri 'ppa:brightbox/ruby-ng'
end
2017-04-05 22:54:14 +02:00
package 'ruby2.3'
2017-04-05 22:54:14 +02:00
package 'bundler'
directory '/opt/sinatra' do
mode '0777'
end
2017-04-05 22:54:14 +02:00
['Gemfile', 'README.txt', 'check.rb', 'poc.rb', 'start.sh', 'server.rb'].each do |fname|
cookbook_file "/opt/sinatra/#{fname}" do
source "sinatra/#{fname}"
mode '0777'
end
end
2017-04-05 22:54:14 +02:00
cookbook_file '/etc/init/sinatra.conf' do
source 'sinatra/sinatra.conf'
mode '0777'
end
service 'sinatra' do
2017-04-05 22:54:14 +02:00
supports restart: false, start: true, reload: false, status: false
action [:enable, :start]
end