| #!/usr/bin/env sh |
| # |
| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| |
| # This file is meant to be executed inside the Vagrant development VM |
| |
| # Prevent dpkg-reconfigure interactive sessions |
| export DEBIAN_FRONTEND=noninteractive |
| |
| |
| ### BEGIN SAMPLE PCAP DATA ### |
| apt-get update |
| apt-get install -y libpcap-dev tshark |
| curl -s 'http://www.snaketrap.co.uk/pcaps/hbot.pcap' -o /vagrant/seed/hbot.pcap |
| ### END SAMPLE PCAP DATA ### |
| |
| |
| ### BEGIN OPENLDAP ### |
| # slapd doesn't seem to work right unless you configure it via debconf |
| # The password for all users is metron |
| debconf-set-selections /vagrant/seed/slapd.seed |
| apt-get update |
| apt-get -y install slapd ldap-utils |
| |
| cd /vagrant/seed/ldap |
| ldapmodify -Y EXTERNAL -H ldapi:/// -f logging.ldif |
| ldapmodify -Y EXTERNAL -H ldapi:/// -f config.ldif |
| ldapadd -D cn=admin,cn=config -w "metron" -H ldapi:/// -f memberof_add.ldif |
| ldapadd -D cn=admin,cn=config -w "metron" -H ldapi:/// -f memberof_config.ldif |
| cd - |
| ### END OPENLDAP ### |
| |
| |
| ### BEGIN REDIS ### |
| apt-get -y install redis-server |
| ### END REDIS ### |
| |
| |
| ### BEGIN ELASTICSEARCH ### |
| apt-get -y install openjdk-7-jre-headless |
| wget --quiet https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb |
| dpkg -i elasticsearch-1.1.1.deb |
| rm -rf elasticsearch-1.1.1.deb |
| cd /usr/share/elasticsearch |
| bin/plugin -install mobz/elasticsearch-head |
| cd - |
| update-rc.d elasticsearch defaults 95 10 |
| service elasticsearch restart |
| ### END ELASTICSEARCH ### |
| |
| |
| ### NODE SETUP ### |
| apt-get update |
| apt-get install -y nodejs npm |
| |
| ln -s /usr/bin/nodejs /usr/bin/node |
| npm install -g nodemon |
| |
| cd /vagrant |
| rm -rf node_modules |
| su vagrant -c "npm install" |
| su vagrant -c "echo 'export NODE_ENV=vagrant' >> /home/vagrant/.bashrc" |
| su vagrant -c "ln -s /vagrant/.nodemonignore ~/.nodemonignore" |
| cd - |
| ### END NODE SETUP ### |