mirror of https://github.com/MISP/MISP
Update travis for 2.4
parent
52f429e3c7
commit
7b401141f2
|
@ -1,7 +1,7 @@
|
||||||
[submodule "app/Lib/cakephp"]
|
[submodule "app/Lib/cakephp"]
|
||||||
path = app/Lib/cakephp
|
path = app/Lib/cakephp
|
||||||
url = https://github.com/cakephp/cakephp.git
|
url = https://github.com/cakephp/cakephp.git
|
||||||
branch = 2.6
|
branch = 2.7
|
||||||
[submodule "PyMISP"]
|
[submodule "PyMISP"]
|
||||||
path = PyMISP
|
path = PyMISP
|
||||||
url = https://github.com/MISP/PyMISP.git
|
url = https://github.com/MISP/PyMISP.git
|
||||||
|
|
117
.travis.yml
117
.travis.yml
|
@ -3,12 +3,11 @@ php:
|
||||||
- 5.6
|
- 5.6
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- mysql
|
|
||||||
- redis
|
- redis
|
||||||
|
|
||||||
sudo: true
|
sudo: required
|
||||||
|
dist: trusty
|
||||||
cache: pip
|
group: edge
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- DB=mysql
|
- DB=mysql
|
||||||
|
@ -19,6 +18,7 @@ addons:
|
||||||
- localhost
|
- localhost
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
|
- mysql-server
|
||||||
- python-dev
|
- python-dev
|
||||||
- python-pip
|
- python-pip
|
||||||
- libxml2-dev
|
- libxml2-dev
|
||||||
|
@ -26,13 +26,13 @@ addons:
|
||||||
- php5-dev
|
- php5-dev
|
||||||
- apache2
|
- apache2
|
||||||
- libapache2-mod-php5
|
- libapache2-mod-php5
|
||||||
- libapache2-mod-fastcgi
|
|
||||||
- curl
|
- curl
|
||||||
- python-virtualenv
|
- python-virtualenv
|
||||||
- python-pip
|
- python-pip
|
||||||
- php5-mysql
|
- php5-mysql
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
- git pull --recurse-submodules && git submodule update
|
||||||
- pip install --user pyzmq
|
- pip install --user pyzmq
|
||||||
- pip install --user coveralls
|
- pip install --user coveralls
|
||||||
- pip install --user codecov
|
- pip install --user codecov
|
||||||
|
@ -43,54 +43,97 @@ install:
|
||||||
- pear install Net_GeoIP
|
- pear install Net_GeoIP
|
||||||
- phpenv rehash
|
- phpenv rehash
|
||||||
- pushd app
|
- pushd app
|
||||||
- composer require kamisama/cake-resque:4.1.2
|
- curl -s https://getcomposer.org/installer | php
|
||||||
- composer config vendor-dir Vendor
|
- php composer.phar require kamisama/cake-resque:4.1.2
|
||||||
- composer install
|
- php composer.phar config vendor-dir Vendor
|
||||||
|
- php composer.phar install
|
||||||
- popd
|
- popd
|
||||||
|
- sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty multiverse" && sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty-updates multiverse"
|
||||||
before_script:
|
- sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty universe" && sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty-updates universe"
|
||||||
# enable php-fpm
|
- sudo apt-get update -qq
|
||||||
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
|
- sudo apt-get install libapache2-mod-fastcgi php5-redis
|
||||||
- sudo a2enmod rewrite actions fastcgi alias
|
|
||||||
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
|
||||||
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
|
|
||||||
# configure apache virtual hosts
|
|
||||||
- sudo cp -f build/travis-ci-apache /etc/apache2/sites-available/misp
|
|
||||||
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/misp
|
|
||||||
- cat /etc/apache2/sites-available/misp
|
|
||||||
- sudo a2dissite default
|
|
||||||
- sudo a2ensite misp
|
|
||||||
- sudo service apache2 restart
|
|
||||||
- phpenv config-add travis/myphpconfig.ini
|
- phpenv config-add travis/myphpconfig.ini
|
||||||
- mkdir .gnupg
|
|
||||||
- cp -fa INSTALL/setup/config.php app/Plugin/CakeResque/Config/config.php
|
- cp -fa INSTALL/setup/config.php app/Plugin/CakeResque/Config/config.php
|
||||||
- cp travis/bootstrap.php app/Config/bootstrap.php
|
# Set perms
|
||||||
- cp travis/database.php app/Config/database.php
|
- sudo chown -R www-data:www-data `pwd`
|
||||||
- cp travis/core.php app/Config/core.php
|
- sudo chmod -R 755 `pwd`
|
||||||
- cp travis/config.php app/Config/config.php
|
- sudo chmod -R g+ws `pwd`/app/tmp
|
||||||
|
- sudo chmod -R g+ws `pwd`/app/tmp/cache
|
||||||
|
- sudo chmod -R g+ws `pwd`/app/tmp/cache/persistent
|
||||||
|
- sudo chmod -R g+ws `pwd`/app/tmp/cache/models
|
||||||
|
- sudo chmod -R g+ws `pwd`/app/tmp/logs
|
||||||
|
- sudo chmod -R g+ws `pwd`/app/files
|
||||||
|
- sudo chmod -R g+ws `pwd`/app/files/scripts/tmp
|
||||||
|
# Resque perms
|
||||||
|
- sudo chown -R www-data:www-data `pwd`/app/Plugin/CakeResque/tmp
|
||||||
|
- sudo chmod -R 755 `pwd`/app/Plugin/CakeResque/tmp
|
||||||
|
# install MySQL
|
||||||
|
- sudo chmod -R 777 `pwd`/INSTALL
|
||||||
- mysql -u root -e 'create database misp;'
|
- mysql -u root -e 'create database misp;'
|
||||||
- mysql -u root -e "grant usage on *.* to misp@localhost identified by 'blah'";
|
- mysql -u root -e "grant usage on *.* to misp@localhost identified by 'blah'";
|
||||||
- mysql -u root -e "grant all privileges on misp.* to misp@localhost;"
|
- mysql -u root -e "grant all privileges on misp.* to misp@localhost;"
|
||||||
- mysql -u misp -pblah misp < INSTALL/MYSQL.sql
|
- mysql -u misp -pblah misp < INSTALL/MYSQL.sql
|
||||||
- AUTH=`app/Console/cake userInit -q`
|
# configure apache virtual hosts
|
||||||
- sudo chown -R www-data:www-data app/
|
- sudo chmod -R 777 `pwd`/build
|
||||||
- curl http://misp.local >> /dev/null
|
- sudo cp -f build/travis-ci-apache /etc/apache2/sites-available/misp.local.conf
|
||||||
|
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/misp.local.conf
|
||||||
|
- sudo a2dissite 000-default
|
||||||
|
- sudo a2ensite misp.local.conf
|
||||||
|
- sudo a2enmod rewrite
|
||||||
|
- sudo service apache2 restart
|
||||||
|
# MISP configuration
|
||||||
|
- sudo chmod -R 777 `pwd`/travis
|
||||||
|
- sudo cp travis/bootstrap.php app/Config/bootstrap.php
|
||||||
|
- sudo cp travis/database.php app/Config/database.php
|
||||||
|
- sudo cp travis/core.php app/Config/core.php
|
||||||
|
- sudo cp travis/config.php app/Config/config.php
|
||||||
|
# Ensure the perms
|
||||||
|
- sudo chown -R www-data:www-data `pwd`/app/Config
|
||||||
|
- sudo chmod -R 750 `pwd`/app/Config
|
||||||
|
# GPG setup
|
||||||
|
- sudo mkdir `pwd`/.gnupg
|
||||||
|
# /!\ VERY INSECURE BUT FASTER ON THE BUILD ENV OF TRAVIS
|
||||||
|
- sudo cp -a /dev/urandom /dev/random
|
||||||
|
- sudo gpg --homedir `pwd`/.gnupg --gen-key --batch `pwd`/travis/gpg
|
||||||
|
- sudo chown www-data:www-data `pwd`/.gnupg
|
||||||
|
- sudo chmod 700 `pwd`/.gnupg
|
||||||
|
# Get authkey
|
||||||
|
- sudo usermod -a -G www-data $USER
|
||||||
|
- sudo -E su $USER -c 'app/Console/cake userInit -q | sudo tee ./key.txt'
|
||||||
|
- sudo chmod 777 ./key.txt
|
||||||
|
- sudo chown -R www-data:www-data `pwd`
|
||||||
|
- sudo chmod +x /home/travis/build
|
||||||
|
- sudo chmod +x /home/travis
|
||||||
|
- sudo chmod +x /home
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- curl http://misp.local
|
||||||
|
- AUTH=`cat key.txt`
|
||||||
|
- sudo chmod -R 777 PyMISP
|
||||||
- pushd PyMISP
|
- pushd PyMISP
|
||||||
- echo 'url = "http://misp.local"' >> tests/keys.py
|
- echo 'url = "http://misp.local"' >> tests/keys.py
|
||||||
- echo 'key = "'${AUTH}'"' >> tests/keys.py
|
- echo 'key = "'${AUTH}'"' >> tests/keys.py
|
||||||
- cat tests/keys.py
|
- cat tests/keys.py
|
||||||
- popd
|
- popd
|
||||||
- sudo chown -R www-data:www-data ./
|
|
||||||
- sudo chmod -R 755 ./
|
|
||||||
- sudo chmod 700 .gnupg
|
|
||||||
- sudo chmod -R 777 app/tmp
|
|
||||||
- sudo chmod -R 777 app/files
|
|
||||||
- sudo chmod -R 777 app/files/scripts/tmp
|
|
||||||
- sudo chmod -R 777 PyMISP
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- pushd PyMISP
|
- pushd PyMISP
|
||||||
- coverage run setup.py test
|
- coverage run setup.py test
|
||||||
|
- popd
|
||||||
|
|
||||||
|
after_failure:
|
||||||
|
- curl http://misp.local
|
||||||
|
- cat /etc/apache2/envvars
|
||||||
|
- cat /etc/apache2/sites-available/misp.local.conf
|
||||||
|
- sudo ls -l /var/log/apache2
|
||||||
|
- sudo cat `pwd`/app/tmp/logs/error.log
|
||||||
|
- sudo cat `pwd`/app/tmp/logs/debug.log
|
||||||
|
- sudo cat /var/log/apache2/error.log
|
||||||
|
- sudo cat /var/log/apache2/misp.local_error.log
|
||||||
|
- sudo cat /var/log/apache2/misp.local_access.log
|
||||||
|
- pwd
|
||||||
|
- sudo ls -lR /home
|
||||||
|
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- coveralls
|
- coveralls
|
||||||
|
|
2
PyMISP
2
PyMISP
|
@ -1 +1 @@
|
||||||
Subproject commit f968f43bd9cfafa239151cbc04fd207a5d3a11e8
|
Subproject commit 3a2414bc8c01687290245f186cfa72d29b99d09e
|
|
@ -1 +1 @@
|
||||||
Subproject commit 4faf31e60af89006eec54551cf11074887a19d18
|
Subproject commit 4de92123fa453f5e5eedd001a8918ad2976436af
|
|
@ -1,23 +1,15 @@
|
||||||
<VirtualHost *:80>
|
<VirtualHost misp.local>
|
||||||
ServerAdmin admin@misp.local
|
ServerAdmin me@me.local
|
||||||
ServerName misp.local
|
ServerName misp.local
|
||||||
DocumentRoot %TRAVIS_BUILD_DIR%/app/webroot
|
DocumentRoot %TRAVIS_BUILD_DIR%/app/webroot
|
||||||
|
<Directory %TRAVIS_BUILD_DIR%/app/webroot>
|
||||||
<Directory %TRAVIS_BUILD_DIR%/app/webroot>
|
Options -Indexes
|
||||||
Options FollowSymLinks MultiViews ExecCGI -Indexes
|
AllowOverride all
|
||||||
AllowOverride All
|
Require all granted
|
||||||
Order allow,deny
|
</Directory>
|
||||||
Allow from all
|
|
||||||
</Directory>
|
|
||||||
|
|
||||||
# Wire up Apache to use Travis CI's php-fpm.
|
|
||||||
<IfModule mod_fastcgi.c>
|
|
||||||
AddHandler php5-fcgi .php
|
|
||||||
Action php5-fcgi /php5-fcgi
|
|
||||||
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
|
|
||||||
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
LogLevel warn
|
|
||||||
|
|
||||||
|
LogLevel warn
|
||||||
|
ErrorLog /var/log/apache2/misp.local_error.log
|
||||||
|
CustomLog /var/log/apache2/misp.local_access.log combined
|
||||||
|
ServerSignature Off
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
$config = array (
|
$config = array (
|
||||||
'debug' => 0,
|
'debug' => 1,
|
||||||
'Security' =>
|
'Security' =>
|
||||||
array (
|
array (
|
||||||
'level' => 'medium',
|
'level' => 'medium',
|
||||||
|
@ -10,7 +10,7 @@ $config = array (
|
||||||
),
|
),
|
||||||
'MISP' =>
|
'MISP' =>
|
||||||
array (
|
array (
|
||||||
'baseurl' => 'http://localhost',
|
'baseurl' => 'http://misp.local',
|
||||||
'footerpart1' => 'Powered by MISP',
|
'footerpart1' => 'Powered by MISP',
|
||||||
'footerpart2' => '© Belgian Defense CERT & NCIRC',
|
'footerpart2' => '© Belgian Defense CERT & NCIRC',
|
||||||
'org' => 'ORGNAME',
|
'org' => 'ORGNAME',
|
||||||
|
|
|
@ -177,7 +177,7 @@
|
||||||
*/
|
*/
|
||||||
Configure::write('Session', array(
|
Configure::write('Session', array(
|
||||||
'timeout' => 60, // Session timeout, default is 1 hour
|
'timeout' => 60, // Session timeout, default is 1 hour
|
||||||
'defaults' => 'database'
|
'defaults' => 'php'
|
||||||
));
|
));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue