소스 검색

Merge pull request #6604 from JakubOnderka/github-test-changes

GitHub test changes
tags/v2.4.135
Jakub Onderka 5 달 전
committed by GitHub
부모
커밋
83945e4885
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
5개의 변경된 파일25개의 추가작업 그리고 22개의 파일을 삭제
  1. +15
    -12
      .github/workflows/main.yml
  2. +0
    -1
      app/Controller/Component/ACLComponent.php
  3. +8
    -7
      app/Controller/ServersController.php
  4. +1
    -1
      app/Lib/Tools/PubSubTool.php
  5. +1
    -1
      app/View/Servers/ajax/update.ctp

+ 15
- 12
.github/workflows/main.yml 파일 보기

@@ -15,7 +15,13 @@ jobs:
# This workflow contains a single job called "build"
build:
# 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:
@@ -45,21 +51,19 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: pecl, composer
extensions: mysql, mbstring, json, xml, opcache, readline, redis, gnupg, gd

php-version: ${{ matrix.php }}
extensions: mysql, mbstring, json, xml, opcache, readline, redis, gd

# Runs a set of commands using the runners shell
- name: Install deps
env:
php_version: ${{ matrix.php }}
run: |
git submodule update --init --recursive
date
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 pip3 install --upgrade pip setuptools requests pyzmq
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 poetry
sudo pip3 install --upgrade -r requirements.txt
sudo pip3 install poetry
USER=`id -u -n`
sudo chown $USER:www-data $HOME/.composer
pushd app
@@ -123,6 +127,7 @@ jobs:
- name: Configure MISP
run: |
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 userInit -q | sudo tee ./key.txt'
sudo -E su $USER -c 'app/Console/cake Admin setSetting "Session.autoRegenerate" 0'
@@ -164,8 +169,7 @@ jobs:
run: |
USER=`id -u -n`
sudo chmod +x app/Console/worker/start.sh
sudo -E su $USER -c 'app/Console/worker/start.sh &'
sleep 10
sudo -E su $USER -c 'app/Console/worker/start.sh'

- name: Python setup
run: |
@@ -213,7 +217,6 @@ jobs:
./curl_tests_GH.sh $AUTH $HOST
popd
pushd PyMISP
git pull origin main --tags -f
poetry install -E fileobjects -E openioc -E virustotal -E docs -E pdfexport
poetry run python tests/testlive_comprehensive.py
poetry run python tests/test_mispevent.py


+ 0
- 1
app/Controller/Component/ACLComponent.php 파일 보기

@@ -443,7 +443,6 @@ class ACLComponent extends Component
'fetchServersForSG' => array('perm_sharing_group'),
'filterEventIndex' => array(),
'getApiInfo' => array('*'),
'getGit' => array(),
'getInstanceUUID' => array('perm_sync'),
'getPyMISPVersion' => array('*'),
'getRemoteUser' => array(),


+ 8
- 7
app/Controller/ServersController.php 파일 보기

@@ -1824,11 +1824,6 @@ class ServersController extends AppController
$this->set('_serialize', 'response');
}

public function getGit()
{
$status = $this->Server->getCurrentGitStatus();
}

public function checkout()
{
$result = $this->Server->checkoutMain();
@@ -1839,11 +1834,17 @@ class ServersController extends AppController
if ($this->request->is('post')) {
$status = $this->Server->getCurrentGitStatus();
$raw = array();
$update = $this->Server->update($status, $raw);
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);
}
if ($this->_isRest()) {
return $this->RestResponse->viewData(array('results' => $raw), $this->response->type());
} else {
return new CakeResponse(array('body'=> $update, 'type' => 'txt'));
return new CakeResponse(array('body' => $update, 'type' => 'txt'));
}
} else {
$branch = $this->Server->getCurrentBranch();


+ 1
- 1
app/Lib/Tools/PubSubTool.php 파일 보기

@@ -258,7 +258,7 @@ class PubSubTool
// 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
// 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))) {
throw new Exception("Could not write zmq config file '$settingFilePath'.");
}


+ 1
- 1
app/View/Servers/ajax/update.ctp 파일 보기

@@ -4,7 +4,7 @@
?>
<legend>Update MISP</legend>
<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>
<tr>
<td style="vertical-align:top">


불러오는 중...
취소
저장