Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding level 4

  • Loading branch information...
commit 54bbad0d2419edfdd6c0f32888192077ed8a7cef 1 parent 30a1c88
@e28eta authored
View
18 Vagrantfile
@@ -17,19 +17,9 @@ Vagrant::Config.run do |config|
config.vm.box = "stripe-ctf-base"
config.vm.box_url = "https://www.dropbox.com/s/kpk5gett03vu8au/stripe-ctf-base-v3.box"
- config.vm.define :level2 do |box_config|
- configure(box_config, "2")
- end
- config.vm.define :level5 do |box_config|
- configure(box_config, "5")
- end
- config.vm.define :level6 do |box_config|
- configure(box_config, "6")
- end
- config.vm.define :level7 do |box_config|
- configure(box_config, "7")
- end
- config.vm.define :level8 do |box_config|
- configure(box_config, "8")
+ [2, *4..8].each do |number|
+ config.vm.define "level#{number}".to_sym do |box_config|
+ configure(box_config, number)
+ end
end
end
View
58 puppet/modules/stripectf2/manifests/level04.pp
@@ -0,0 +1,58 @@
+class stripectf2::level04 (
+ $destination,
+ $source,
+) {
+ file {$destination:
+ ensure => 'directory',
+ recurse => true,
+ mode => '0755',
+ owner => 'vagrant',
+ group => 'vagrant',
+ source => $source,
+ ignore => 'password.txt', # Don't copy the dummy password.txt file
+ }
+
+ stripectf2::random_password {"${destination}/password.txt":
+ require => File[$destination],
+ }
+
+ service {'srv.rb':
+ ensure => 'running',
+ start => "cd ${destination} && bundle install && bundle exec ./srv.rb &",
+ provider => 'base',
+ require => Stripectf2::Random_password["${destination}/password.txt"],
+ }
+
+ cron {'casperjs':
+ command => "cd ${destination} && /usr/local/bin/casperjs browser.coffee http://localhost:4567",
+ minute => '*',
+ environment => "PATH=/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/vagrant_ruby/bin",
+ user => 'vagrant',
+ }
+
+ service {'apache2':
+ ensure => 'running',
+ enable => true,
+ hasrestart => true,
+ }
+
+ # Disable the default apache2 site
+ stripectf2::apache2_site {'000-default':
+ ensure => 'absent',
+ }
+
+ stripectf2::apache2_module {['proxy', 'proxy_http']:
+ ensure => 'present',
+ }
+
+ $proxy_url = "http://127.0.0.1:4567/"
+ file {'/etc/apache2/sites-available/level04':
+ content => template('stripectf2/apache2_site_config.erb'),
+ notify => Service['apache2'],
+ }
+
+ stripectf2::apache2_site {'level04':
+ ensure => 'present',
+ require => File['/etc/apache2/sites-available/level04'],
+ }
+}
View
7 puppet/nodes/level04.pp
@@ -0,0 +1,7 @@
+node 'level04-1.stripe-ctf.com' {
+ class {'stripectf2::level04':
+ destination => '/levels/04',
+ source => '/vagrant/levels/4',
+ require => File['/levels'],
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.