2017-04-01 00:15:04 +02:00
|
|
|
#
|
2017-04-20 22:50:02 +02:00
|
|
|
# Cookbook:: metasploitable
|
2017-04-01 00:15:04 +02:00
|
|
|
# Recipe:: sinatra
|
|
|
|
#
|
|
|
|
# Copyright:: 2017, Rapid7, All Rights Reserved.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
include_recipe 'metasploitable::sinatra'
|
2017-04-19 23:25:46 +02:00
|
|
|
include_recipe 'metasploitable::ruby23'
|
2017-04-01 00:15:04 +02:00
|
|
|
|
2017-09-01 23:23:59 +02:00
|
|
|
server_path = node['ec2'] ? 'aws' : 'virtualbox'
|
|
|
|
|
2017-04-01 00:15:04 +02:00
|
|
|
directory '/opt/sinatra' do
|
|
|
|
mode '0777'
|
|
|
|
end
|
|
|
|
|
2017-07-12 23:51:08 +02:00
|
|
|
directory '/var/opt/sinatra' do
|
|
|
|
mode '0777'
|
|
|
|
end
|
|
|
|
|
2017-07-20 21:08:03 +02:00
|
|
|
cookbook_file '/opt/sinatra/Gemfile' do
|
|
|
|
source 'sinatra/Gemfile'
|
|
|
|
mode '0777'
|
|
|
|
end
|
|
|
|
|
|
|
|
cookbook_file '/opt/sinatra/server' do
|
2017-09-05 21:18:18 +02:00
|
|
|
source "sinatra/#{server_path}/loader"
|
2017-07-20 21:08:03 +02:00
|
|
|
mode '0777'
|
2017-04-01 00:15:04 +02:00
|
|
|
end
|
|
|
|
|
2017-04-05 22:54:14 +02:00
|
|
|
cookbook_file '/etc/init/sinatra.conf' do
|
|
|
|
source 'sinatra/sinatra.conf'
|
2017-04-01 00:15:04 +02:00
|
|
|
mode '0777'
|
|
|
|
end
|
|
|
|
|
|
|
|
service 'sinatra' do
|
2017-04-05 22:54:14 +02:00
|
|
|
supports restart: false, start: true, reload: false, status: false
|
2017-04-01 00:15:04 +02:00
|
|
|
action [:enable, :start]
|
|
|
|
end
|