mirror of https://github.com/MISP/MISP
commit
83945e4885
|
@ -15,7 +15,13 @@ jobs:
|
||||||
# This workflow contains a single job called "build"
|
# This workflow contains a single job called "build"
|
||||||
build:
|
build:
|
||||||
# The type of runner that the job will run on
|
# The type of runner that the job will run on
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
php: ['7.2', '7.3', '7.4']
|
||||||
|
|
||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
steps:
|
steps:
|
||||||
|
@ -45,21 +51,19 @@ jobs:
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '7.4'
|
php-version: ${{ matrix.php }}
|
||||||
tools: pecl, composer
|
extensions: mysql, mbstring, json, xml, opcache, readline, redis, gd
|
||||||
extensions: mysql, mbstring, json, xml, opcache, readline, redis, gnupg, gd
|
|
||||||
|
|
||||||
|
|
||||||
# Runs a set of commands using the runners shell
|
# Runs a set of commands using the runners shell
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
|
env:
|
||||||
|
php_version: ${{ matrix.php }}
|
||||||
run: |
|
run: |
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
date
|
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
sudo apt-get -y install python3 python3-venv virtualenv python3-pip python3-dev python3-nose python3-redis python3-lxml python3-dateutil python3-msgpack libxml2-dev libzmq3-dev zlib1g-dev apache2 curl php7.4-dev php7.4-cli libapache2-mod-php libfuzzy-dev libonig4
|
sudo apt-get -y install python3 python3-venv virtualenv python3-pip python3-nose python3-redis python3-lxml apache2 curl libapache2-mod-php libfuzzy-dev
|
||||||
sudo pip3 install --upgrade pip setuptools requests pyzmq
|
sudo pip3 install --upgrade pip setuptools requests pyzmq poetry
|
||||||
sudo pip3 install --upgrade -r requirements.txt
|
sudo pip3 install --upgrade -r requirements.txt
|
||||||
sudo pip3 install poetry
|
|
||||||
USER=`id -u -n`
|
USER=`id -u -n`
|
||||||
sudo chown $USER:www-data $HOME/.composer
|
sudo chown $USER:www-data $HOME/.composer
|
||||||
pushd app
|
pushd app
|
||||||
|
@ -123,6 +127,7 @@ jobs:
|
||||||
- name: Configure MISP
|
- name: Configure MISP
|
||||||
run: |
|
run: |
|
||||||
USER=`id -u -n`
|
USER=`id -u -n`
|
||||||
|
sudo -E su $USER -c 'app/Console/cake Admin setSetting "MISP.osuser" $USER'
|
||||||
sudo -E su $USER -c 'app/Console/cake Admin runUpdates'
|
sudo -E su $USER -c 'app/Console/cake Admin runUpdates'
|
||||||
sudo -E su $USER -c 'app/Console/cake userInit -q | sudo tee ./key.txt'
|
sudo -E su $USER -c 'app/Console/cake userInit -q | sudo tee ./key.txt'
|
||||||
sudo -E su $USER -c 'app/Console/cake Admin setSetting "Session.autoRegenerate" 0'
|
sudo -E su $USER -c 'app/Console/cake Admin setSetting "Session.autoRegenerate" 0'
|
||||||
|
@ -164,8 +169,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
USER=`id -u -n`
|
USER=`id -u -n`
|
||||||
sudo chmod +x app/Console/worker/start.sh
|
sudo chmod +x app/Console/worker/start.sh
|
||||||
sudo -E su $USER -c 'app/Console/worker/start.sh &'
|
sudo -E su $USER -c 'app/Console/worker/start.sh'
|
||||||
sleep 10
|
|
||||||
|
|
||||||
- name: Python setup
|
- name: Python setup
|
||||||
run: |
|
run: |
|
||||||
|
@ -213,7 +217,6 @@ jobs:
|
||||||
./curl_tests_GH.sh $AUTH $HOST
|
./curl_tests_GH.sh $AUTH $HOST
|
||||||
popd
|
popd
|
||||||
pushd PyMISP
|
pushd PyMISP
|
||||||
git pull origin main --tags -f
|
|
||||||
poetry install -E fileobjects -E openioc -E virustotal -E docs -E pdfexport
|
poetry install -E fileobjects -E openioc -E virustotal -E docs -E pdfexport
|
||||||
poetry run python tests/testlive_comprehensive.py
|
poetry run python tests/testlive_comprehensive.py
|
||||||
poetry run python tests/test_mispevent.py
|
poetry run python tests/test_mispevent.py
|
||||||
|
|
|
@ -443,7 +443,6 @@ class ACLComponent extends Component
|
||||||
'fetchServersForSG' => array('perm_sharing_group'),
|
'fetchServersForSG' => array('perm_sharing_group'),
|
||||||
'filterEventIndex' => array(),
|
'filterEventIndex' => array(),
|
||||||
'getApiInfo' => array('*'),
|
'getApiInfo' => array('*'),
|
||||||
'getGit' => array(),
|
|
||||||
'getInstanceUUID' => array('perm_sync'),
|
'getInstanceUUID' => array('perm_sync'),
|
||||||
'getPyMISPVersion' => array('*'),
|
'getPyMISPVersion' => array('*'),
|
||||||
'getRemoteUser' => array(),
|
'getRemoteUser' => array(),
|
||||||
|
|
|
@ -1824,11 +1824,6 @@ class ServersController extends AppController
|
||||||
$this->set('_serialize', 'response');
|
$this->set('_serialize', 'response');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getGit()
|
|
||||||
{
|
|
||||||
$status = $this->Server->getCurrentGitStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function checkout()
|
public function checkout()
|
||||||
{
|
{
|
||||||
$result = $this->Server->checkoutMain();
|
$result = $this->Server->checkoutMain();
|
||||||
|
@ -1839,7 +1834,13 @@ class ServersController extends AppController
|
||||||
if ($this->request->is('post')) {
|
if ($this->request->is('post')) {
|
||||||
$status = $this->Server->getCurrentGitStatus();
|
$status = $this->Server->getCurrentGitStatus();
|
||||||
$raw = array();
|
$raw = array();
|
||||||
|
if (empty($status['branch'])) { // do not try to update if you are not on branch
|
||||||
|
$msg = 'Update failed, you are not on branch';
|
||||||
|
$raw[] = $msg;
|
||||||
|
$update = $msg;
|
||||||
|
} else {
|
||||||
$update = $this->Server->update($status, $raw);
|
$update = $this->Server->update($status, $raw);
|
||||||
|
}
|
||||||
if ($this->_isRest()) {
|
if ($this->_isRest()) {
|
||||||
return $this->RestResponse->viewData(array('results' => $raw), $this->response->type());
|
return $this->RestResponse->viewData(array('results' => $raw), $this->response->type());
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -258,7 +258,7 @@ class PubSubTool
|
||||||
// Because setting file contains secrets, it should be readable just by owner. But because in Travis test,
|
// Because setting file contains secrets, it should be readable just by owner. But because in Travis test,
|
||||||
// config file is created under one user and then changed under other user, file must be readable and writable
|
// config file is created under one user and then changed under other user, file must be readable and writable
|
||||||
// also by group.
|
// also by group.
|
||||||
chmod($settingsFile->pwd(), 0660);
|
@chmod($settingsFile->pwd(), 0660); // hide error if current user is not file owner
|
||||||
if (!$settingsFile->write(json_encode($settings))) {
|
if (!$settingsFile->write(json_encode($settings))) {
|
||||||
throw new Exception("Could not write zmq config file '$settingFilePath'.");
|
throw new Exception("Could not write zmq config file '$settingFilePath'.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
?>
|
?>
|
||||||
<legend>Update MISP</legend>
|
<legend>Update MISP</legend>
|
||||||
<div style="padding-left:5px;padding-right:5px;padding-bottom:5px;">
|
<div style="padding-left:5px;padding-right:5px;padding-bottom:5px;">
|
||||||
<p><?php echo __('Do you want to pull the latest commit from the <?php echo h($branch); ?> branch? If you have made local changes to MISP the merge will fail.');?></p>
|
<p><?php echo __('Do you want to pull the latest commit from the %s branch? If you have made local changes to MISP the merge will fail.', h($branch));?></p>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="vertical-align:top">
|
<td style="vertical-align:top">
|
||||||
|
|
Loading…
Reference in New Issue