veewee 0.4.4 → 0.4.5.pre1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzM2NTRjOTM1ODExZDQ4OWI1NjU1ZTk5ZWVhMzViNGIwNDA4ZGE0Mw==
4
+ MzYyNmUyZTIyNGM0NDUxZTFjZjhjYzUyZjg5NjRjNzY5ZmJlODlhNw==
5
5
  data.tar.gz: !binary |-
6
- YzM0MDk2Y2IxYzFiNjU3NGRiNGU3NmM0YzcxZTA2M2FhNzU4YTc4Zg==
6
+ ZDYwZjVhODY3OGFiYWIyMTlhMWVhZmEwMzhiYjNkODg5ZjJhYjE2Yw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGQ4M2I3ZDY3MWQyMWIyNmQ2MThkMTllMjk2YWI1ZDcyMjE5OTczZjJjY2Q5
10
- MzAyN2Q1ZTBkN2Q1MDgzMzBhODVlNmZiNDdlYzQyYTkzMjcxMDRhMTJhODhh
11
- MjU3MjJlZGYwZGE0OTFlOWRmZTMxZmFlOGI4N2Y3MDhlN2VhZTQ=
9
+ ODZkZmY2NmNmNThmZDMyYmUxN2UxNTY1MzFkMzJkZGU3ZDI0YjE1Y2U4MmE2
10
+ ZGQyMDZmMDBiMzM3ODNjMGI4ZmNhODgxZWQ2MTdlNTZiMjYwYTE1MTFlNDA0
11
+ MTUxMWU0NmI0NGZhN2IzNmJmNTY3Y2Q5MGRjODEzOGU2Nzg1ZDY=
12
12
  data.tar.gz: !binary |-
13
- NzMxYjkxY2YyMjA2NzBiZmZjYjJmNzczYWRjMzJjYThiZjUyYTIyMWQyNWRh
14
- NzZkMjQ4ZTdkNzE3YjZlMWQ3NTdmYzI4NGQzNWVmZjQzODc1NDViYmFmYWI0
15
- N2JhNDVmYzE2NmU2OGI0OGJjMjczMjEzZmIzMzdkOTBlZDMzYmU=
13
+ M2U3MzQwMGU5ZTIzZGFjZWYwZmIwZmI2YjY2ZTFhMGJjYjBlYTI1M2Q4YWVj
14
+ MWI3NGE0MzQxNGQ5NDc0NjU2MTgzMDBmYjRkMzYzNjgzMjM2MGJlYTY1N2U4
15
+ NzNlNWVmNDYyYWQ1YTYxMGRhYmQ3YjE5MmI1NjkzMjZhMzFhYTk=
@@ -42,24 +42,25 @@ module Veewee
42
42
 
43
43
  module Web
44
44
  def wait_for_http_request(filename, urlname, options) # original blocking
45
- s = server_for_http_request(filename, urlname, options)
46
- s.start
45
+ server_for_http_request(filename, urlname, options) do |server|
46
+ server.start
47
+ end
47
48
  end
48
49
 
49
50
  def allow_for_http_request(filename, urlname, options) # start in new thread
50
- s = server_for_http_request(filename, urlname, options.merge({:threaded => false}))
51
- t = Thread.new { s.start }
52
- t.abort_on_exception = true
51
+ server_for_http_request(filename, urlname, options.merge({:threaded => false})) do |server|
52
+ t = Thread.new { server.start }
53
+ t.abort_on_exception = true
54
+ end
53
55
  end
54
56
 
55
- def server_for_http_request(filename, urlname, options)
57
+ def server_for_http_request(filename, urlname, options, &block)
56
58
  # Calculate the OS equivalent of /dev/null , on windows this is NUL:
57
59
  # http://www.ruby-forum.com/topic/115472
58
60
  fn = test(?e, '/dev/null') ? '/dev/null' : 'NUL:'
59
61
  webrick_logger = WEBrick::Log.new(fn, WEBrick::Log::INFO)
60
62
 
61
63
  timeout = options[:timeout] || 60
62
- server = nil
63
64
  Timeout.timeout(timeout) do
64
65
  server =
65
66
  ::WEBrick::HTTPServer.new(
@@ -74,6 +75,7 @@ module Veewee
74
75
  ui.info "Stopping webserver"
75
76
  exit
76
77
  }
78
+ yield server
77
79
  end
78
80
  rescue Timeout::Error
79
81
  server.shutdown unless server.nil?
@@ -4,5 +4,5 @@ end
4
4
 
5
5
  # Only set the version constant if it wasn't set before
6
6
  unless defined?(Veewee::VERSION)
7
- ::Veewee::VERSION="0.4.4"
7
+ ::Veewee::VERSION="0.4.5.pre1"
8
8
  end
@@ -0,0 +1,26 @@
1
+ # Update the box
2
+ apt-get -y update
3
+ apt-get -y upgrade
4
+ apt-get -y install linux-headers-$(uname -r) build-essential
5
+ apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev libyaml-0-2
6
+ apt-get -y install curl unzip vim
7
+
8
+ # Set up sudo
9
+ echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant
10
+
11
+ # Tweak sshd to prevent DNS resolution (speed up logins)
12
+ echo 'UseDNS no' >> /etc/ssh/sshd_config
13
+
14
+ # Remove 5s grub timeout to speed up booting
15
+ cat <<EOF > /etc/default/grub
16
+ # If you change this file, run 'update-grub' afterwards to update
17
+ # /boot/grub/grub.cfg.
18
+
19
+ GRUB_DEFAULT=0
20
+ GRUB_TIMEOUT=0
21
+ GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
22
+ GRUB_CMDLINE_LINUX_DEFAULT="quiet"
23
+ GRUB_CMDLINE_LINUX="debian-installer=en_US"
24
+ EOF
25
+
26
+ update-grub
@@ -0,0 +1,49 @@
1
+ if [ -f .veewee_params ]
2
+ then
3
+ . .veewee_params
4
+ fi
5
+
6
+ # Default to Gem install
7
+ if [ -z "$CHEF_INSTALLMETHOD" ]; then
8
+ export CHEF_INSTALLMETHOD="gems"
9
+ fi
10
+
11
+ # Installing chef
12
+ case $CHEF_INSTALLMETHOD in
13
+ "gems")
14
+ # Using gems
15
+ if [ -z "$CHEF_VERSION" ]; then
16
+ # Default to latest
17
+ gem install chef --no-ri --no-rdoc
18
+ else
19
+ gem install chef --no-ri --no-rdoc --version $CHEF_VERSION
20
+ fi
21
+ ;;
22
+
23
+ "omnibus")
24
+ # Using omnibus
25
+ if [ -z "$CHEF_VERSION" ]; then
26
+ # Default to latest
27
+ wget -O - http://opscode.com/chef/install.sh | sudo bash -s
28
+ else
29
+ wget -O - http://opscode.com/chef/install.sh | sudo bash -s -- -v $CHEF_VERSION
30
+ fi
31
+ ;;
32
+
33
+ "package")
34
+ # Using packages
35
+ apt-get install -y debconf-utils
36
+ echo "chef chef/chef_server_url string $CHEF_SERVER_URL" | debconf-set-selections
37
+ if [ -z "$CHEF_VERSION" ]; then
38
+ # Default to latest
39
+ apt-get install -y chef
40
+ else
41
+ apt-get install -y chef=$CHEF_VERSION
42
+ fi
43
+ ;;
44
+
45
+ *)
46
+ echo "Unsupported method for installing chef"
47
+ exit -1
48
+ ;;
49
+ esac
@@ -0,0 +1,20 @@
1
+ # Clean up
2
+ apt-get -y remove linux-headers-$(uname -r)
3
+ apt-get -y autoremove
4
+ apt-get -y clean
5
+
6
+ # Removing leftover leases and persistent rules
7
+ echo "cleaning up dhcp leases"
8
+ rm /var/lib/dhcp/*
9
+
10
+ # Make sure Udev doesn't block our network
11
+ echo "cleaning up udev rules"
12
+ rm /etc/udev/rules.d/70-persistent-net.rules
13
+ mkdir /etc/udev/rules.d/70-persistent-net.rules
14
+ rm -rf /dev/.udev/
15
+ rm /lib/udev/rules.d/75-persistent-net-generator.rules
16
+
17
+ echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
18
+ echo "pre-up sleep 2" >> /etc/network/interfaces
19
+
20
+ update-rc.d gdm3 disable
@@ -0,0 +1,51 @@
1
+ Veewee::Session.declare({
2
+ :cpu_count => '1',
3
+ :memory_size => '512',
4
+ :disk_size => '20480',
5
+ :disk_format => 'VDI',
6
+ :hostiocache => 'off',
7
+ :os_type_id => 'Debian_64',
8
+ :iso_file => "kali-linux-1.0.9a-amd64.iso",
9
+ :iso_src => "http://cdimage.kali.org/kali-1.0.9a/kali-linux-1.0.9a-amd64.iso",
10
+ :iso_md5 => "401e2b14921de5f808c7786b3b84dc57",
11
+ :iso_download_timeout => "2000",
12
+ :boot_wait => "10",
13
+ :boot_cmd_sequence => [
14
+ '<Esc>',
15
+ 'install ',
16
+ 'preseed/url=http://%IP%:%PORT%/preseed.cfg ',
17
+ 'debian-installer=en_US ',
18
+ 'auto ',
19
+ 'locale=en_US ',
20
+ 'kbd-chooser/method=us ',
21
+ 'netcfg/get_hostname=%NAME% ',
22
+ 'netcfg/get_domain=vagrantup.com ',
23
+ 'fb=false ',
24
+ 'debconf/frontend=noninteractive ',
25
+ 'console-setup/ask_detect=false ',
26
+ 'console-keymaps-at/keymap=us ',
27
+ 'keyboard-configuration/xkb-keymap=us ',
28
+ '<Enter>'
29
+ ],
30
+ :kickstart_port => "7122",
31
+ :kickstart_timeout => "10000",
32
+ :kickstart_file => "preseed.cfg",
33
+ :ssh_login_timeout => "10000",
34
+ :ssh_user => "vagrant",
35
+ :ssh_password => "vagrant",
36
+ :ssh_key => "",
37
+ :ssh_host_port => "7222",
38
+ :ssh_guest_port => "22",
39
+ :sudo_cmd => "echo '%p'|sudo -S bash '%f'",
40
+ :shutdown_cmd => "halt -h -p",
41
+ :postinstall_files => [
42
+ "base.sh",
43
+ "virtualbox.sh",
44
+ "vagrant.sh",
45
+ "chef.sh",
46
+ "puppet.sh",
47
+ "cleanup.sh",
48
+ "zerodisk.sh"
49
+ ],
50
+ :postinstall_timeout => "10000"
51
+ })
@@ -0,0 +1,73 @@
1
+ d-i debian-installer/locale string en_US
2
+ d-i console-keymaps-at/keymap select us
3
+ d-i mirror/country string enter information manually
4
+ d-i mirror/suite string kali
5
+ d-i mirror/codename string kali
6
+ d-i mirror/http/hostname string archive.kali.org
7
+ d-i mirror/http/directory string /kali
8
+ d-i mirror/http/proxy string
9
+ d-i clock-setup/utc boolean true
10
+ d-i clock-setup/ntp boolean true
11
+ d-i time/zone string UTC
12
+
13
+ d-i apt-setup/services-select multiselect
14
+
15
+ d-i apt-setup/non-free boolean true
16
+ d-i apt-setup/contrib boolean true
17
+
18
+ d-i partman-auto/method string regular
19
+ d-i partman-lvm/device_remove_lvm boolean true
20
+ d-i partman-md/device_remove_md boolean true
21
+ d-i partman-lvm/confirm boolean true
22
+ d-i partman-auto/choose_recipe select atomic
23
+ d-i partman/confirm_write_new_label boolean true
24
+ d-i partman/choose_partition select finish
25
+ d-i partman/confirm boolean true
26
+ d-i partman/confirm_nooverwrite boolean true
27
+
28
+ d-i apt-setup/local0/repository string http://archive.kali.org/kali-security kali/updates main
29
+ d-i apt-setup/local0/comment string Security updates
30
+ d-i apt-setup/local0/source boolean false
31
+ d-i apt-setup/use_mirror boolean true
32
+ tasksel tasksel/first multiselect standard
33
+ d-i pkgsel/include string sudo openssh-server ntpupdate ntp acpid bzip2 rsync htop mysql-server
34
+ d-i pkgsel/upgrade select full-upgrade
35
+
36
+ d-i netcfg/get_hostname string unassigned-hostname
37
+ d-i netcfg/get_domain string unassigned-domain
38
+ d-i netcfg/hostname string system
39
+ d-i passwd/make-user boolean true
40
+ d-i passwd/root-password password toor
41
+ d-i passwd/root-password-again password toor
42
+
43
+ d-i passwd/user-fullname string Vagrant User
44
+ d-i passwd/username string vagrant
45
+ d-i passwd/user-password password vagrant
46
+ d-i passwd/user-password-again password vagrant
47
+ d-i passwd/user-default-groups string audio cdrom video adm sudo
48
+ d-i user-setup/encrypt-home boolean false
49
+ d-i user-setup/allow-password-weak boolean true
50
+
51
+ popularity-contest popularity-contest/participate boolean false
52
+ d-i grub-installer/only_debian boolean true
53
+ d-i grub-installer/with_other_os boolean false
54
+ d-i finish-install/reboot_in_progress note
55
+
56
+ kismet kismet/install-setuid boolean false
57
+ kismet kismet/install-users string
58
+
59
+ mysql-server-5.5 mysql-server/root_password_again password
60
+ mysql-server-5.5 mysql-server/root_password password
61
+ mysql-server-5.5 mysql-server/error_setting_password error
62
+ mysql-server-5.5 mysql-server-5.5/postrm_remove_databases boolean false
63
+ mysql-server-5.5 mysql-server-5.5/start_on_boot boolean true
64
+ mysql-server-5.5 mysql-server-5.5/nis_warning note
65
+ mysql-server-5.5 mysql-server-5.5/really_downgrade boolean false
66
+ mysql-server-5.5 mysql-server/password_mismatch error
67
+ mysql-server-5.5 mysql-server/no_upgrade_when_using_ndb error
68
+
69
+ d-i preseed/late_command string in-target update-rc.d ssh enable
70
+
71
+ d-i preseed/early_command string sed -i \
72
+ '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \
73
+ /usr/lib/pre-pkgsel.d/20install-hwpackages
@@ -0,0 +1,7 @@
1
+ # Prepare puppetlabs repo
2
+ wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb
3
+ dpkg -i puppetlabs-release-wheezy.deb
4
+ apt-get update
5
+
6
+ # Install puppet/facter
7
+ apt-get install -y puppet facter
@@ -0,0 +1,16 @@
1
+ # Set up Vagrant.
2
+
3
+ date > /etc/vagrant_box_build_time
4
+
5
+ # Install vagrant keys
6
+ mkdir -pm 700 /home/vagrant/.ssh
7
+ curl -Lo /home/vagrant/.ssh/authorized_keys \
8
+ 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub'
9
+ chmod 0600 /home/vagrant/.ssh/authorized_keys
10
+ chown -R vagrant:vagrant /home/vagrant/.ssh
11
+
12
+ # Customize the message of the day
13
+ echo 'Welcome to your Vagrant-built virtual machine.' > /var/run/motd
14
+
15
+ # Install NFS client
16
+ apt-get -y install nfs-common
@@ -0,0 +1,37 @@
1
+ if test -f .vbox_version ; then
2
+ # The netboot installs the VirtualBox support (old) so we have to remove it
3
+ if test -f /etc/init.d/virtualbox-ose-guest-utils ; then
4
+ /etc/init.d/virtualbox-ose-guest-utils stop
5
+ fi
6
+
7
+ rmmod vboxguest
8
+ aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils
9
+
10
+ # Install dkms for dynamic compiles
11
+
12
+ apt-get install -y dkms
13
+
14
+ # If libdbus is not installed, virtualbox will not autostart
15
+ apt-get -y install --no-install-recommends libdbus-1-3
16
+
17
+ # Install the VirtualBox guest additions
18
+ VBOX_VERSION=$(cat .vbox_version)
19
+ VBOX_ISO=VBoxGuestAdditions_$VBOX_VERSION.iso
20
+ mount -o loop $VBOX_ISO /mnt
21
+ yes|sh /mnt/VBoxLinuxAdditions.run
22
+ umount /mnt
23
+
24
+ # Start the newly build driver
25
+ /etc/init.d/vboxadd start
26
+
27
+ # Make a temporary mount point
28
+ mkdir /tmp/veewee-validation
29
+
30
+ # Test mount the veewee-validation
31
+ mount -t vboxsf veewee-validation /tmp/veewee-validation
32
+
33
+ rm $VBOX_ISO
34
+
35
+ # Symlink vbox guest additions. Fix for https://github.com/mitchellh/vagrant/issues/3341
36
+ ln -s /opt/VBoxGuestAdditions-$VBOX_VERSION/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
37
+ fi
@@ -0,0 +1,3 @@
1
+ # Zero out the free space to save space in the final image:
2
+ dd if=/dev/zero of=/EMPTY bs=1M
3
+ rm -f /EMPTY
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: veewee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Debois
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-18 00:00:00.000000000 Z
11
+ date: 2014-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -1569,6 +1569,15 @@ files:
1569
1569
  - templates/gentoo-latest-i686/virtualbox.sh
1570
1570
  - templates/gentoo-latest-i686/wipe_sources.sh
1571
1571
  - templates/gentoo-latest-i686/zerodisk.sh
1572
+ - templates/kali-1.0.9a-amd64/base.sh
1573
+ - templates/kali-1.0.9a-amd64/chef.sh
1574
+ - templates/kali-1.0.9a-amd64/cleanup.sh
1575
+ - templates/kali-1.0.9a-amd64/definition.rb
1576
+ - templates/kali-1.0.9a-amd64/preseed.cfg
1577
+ - templates/kali-1.0.9a-amd64/puppet.sh
1578
+ - templates/kali-1.0.9a-amd64/vagrant.sh
1579
+ - templates/kali-1.0.9a-amd64/virtualbox.sh
1580
+ - templates/kali-1.0.9a-amd64/zerodisk.sh
1572
1581
  - templates/netbsd-613-amd64/README
1573
1582
  - templates/netbsd-613-amd64/base.sh
1574
1583
  - templates/netbsd-613-amd64/chef.sh