mirror of https://github.com/MISP/MISP
new: [sync] Added flag to avoid using the proxy
- in some cases you have internal sync between instances in which case going through the proxy is sillypull/3427/head
parent
8559af8c6a
commit
59b17b5af6
|
@ -377,7 +377,7 @@ class ServersController extends AppController {
|
||||||
}
|
}
|
||||||
if (!$fail) {
|
if (!$fail) {
|
||||||
// say what fields are to be updated
|
// say what fields are to be updated
|
||||||
$fieldList = array('id', 'url', 'push', 'pull', 'unpublish_event', 'publish_without_email', 'remote_org_id', 'name' ,'self_signed', 'cert_file', 'client_cert_file', 'push_rules', 'pull_rules', 'internal');
|
$fieldList = array('id', 'url', 'push', 'pull', 'unpublish_event', 'publish_without_email', 'remote_org_id', 'name' ,'self_signed', 'cert_file', 'client_cert_file', 'push_rules', 'pull_rules', 'internal', 'skip_proxy');
|
||||||
$this->request->data['Server']['id'] = $id;
|
$this->request->data['Server']['id'] = $id;
|
||||||
if (isset($this->request->data['Server']['authkey']) && "" != $this->request->data['Server']['authkey']) $fieldList[] = 'authkey';
|
if (isset($this->request->data['Server']['authkey']) && "" != $this->request->data['Server']['authkey']) $fieldList[] = 'authkey';
|
||||||
if(isset($this->request->data['Server']['organisation_type']) && isset($json)) {
|
if(isset($this->request->data['Server']['organisation_type']) && isset($json)) {
|
||||||
|
|
|
@ -16,9 +16,10 @@ class SyncTool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$HttpSocket = new HttpSocket($params);
|
$HttpSocket = new HttpSocket($params);
|
||||||
|
if (empty($server['Server']['skip_proxy'])) {
|
||||||
$proxy = Configure::read('Proxy');
|
$proxy = Configure::read('Proxy');
|
||||||
if (isset($proxy['host']) && !empty($proxy['host'])) $HttpSocket->configProxy($proxy['host'], $proxy['port'], $proxy['method'], $proxy['user'], $proxy['password']);
|
if (isset($proxy['host']) && !empty($proxy['host'])) $HttpSocket->configProxy($proxy['host'], $proxy['port'], $proxy['method'], $proxy['user'], $proxy['password']);
|
||||||
|
}
|
||||||
return $HttpSocket;
|
return $HttpSocket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,8 @@ class AppModel extends Model {
|
||||||
|
|
||||||
public $db_changes = array(
|
public $db_changes = array(
|
||||||
1 => false, 2 => false, 3 => false, 4 => true, 5 => false, 6 => false,
|
1 => false, 2 => false, 3 => false, 4 => true, 5 => false, 6 => false,
|
||||||
7 => false, 8 => false, 9 => false, 10 => false, 11 => false, 12 => false
|
7 => false, 8 => false, 9 => false, 10 => false, 11 => false, 12 => false,
|
||||||
|
13 => false
|
||||||
);
|
);
|
||||||
|
|
||||||
function afterSave($created, $options = array()) {
|
function afterSave($created, $options = array()) {
|
||||||
|
@ -957,6 +958,9 @@ class AppModel extends Model {
|
||||||
INDEX `timestamp` (`timestamp`)
|
INDEX `timestamp` (`timestamp`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
||||||
break;
|
break;
|
||||||
|
case 13:
|
||||||
|
$sqlArray[] = "ALTER TABLE `servers` ADD `skip_proxy` tinyint(1) NOT NULL DEFAULT 0;";
|
||||||
|
break;
|
||||||
case 'fixNonEmptySharingGroupID':
|
case 'fixNonEmptySharingGroupID':
|
||||||
$sqlArray[] = 'UPDATE `events` SET `sharing_group_id` = 0 WHERE `distribution` != 4;';
|
$sqlArray[] = 'UPDATE `events` SET `sharing_group_id` = 0 WHERE `distribution` != 4;';
|
||||||
$sqlArray[] = 'UPDATE `attributes` SET `sharing_group_id` = 0 WHERE `distribution` != 4;';
|
$sqlArray[] = 'UPDATE `attributes` SET `sharing_group_id` = 0 WHERE `distribution` != 4;';
|
||||||
|
|
|
@ -88,6 +88,10 @@
|
||||||
echo $this->Form->input('self_signed', array(
|
echo $this->Form->input('self_signed', array(
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
));
|
));
|
||||||
|
?>
|
||||||
|
<div class = "input clear"></div>
|
||||||
|
<?php
|
||||||
|
echo $this->Form->input('skip_proxy', array('type' => 'checkbox', 'label' => 'Skip proxy (if applicable)'));
|
||||||
|
|
||||||
echo $this->Form->input('Server.submitted_cert', array(
|
echo $this->Form->input('Server.submitted_cert', array(
|
||||||
'label' => '<b>' . __('Server certificate file') . '</b>',
|
'label' => '<b>' . __('Server certificate file') . '</b>',
|
||||||
|
|
|
@ -94,6 +94,10 @@
|
||||||
echo $this->Form->input('self_signed', array(
|
echo $this->Form->input('self_signed', array(
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
));
|
));
|
||||||
|
?>
|
||||||
|
<div class = "input clear"></div>
|
||||||
|
<?php
|
||||||
|
echo $this->Form->input('skip_proxy', array('type' => 'checkbox', 'label' => 'Skip proxy (if applicable)'));
|
||||||
?>
|
?>
|
||||||
<div class="clear">
|
<div class="clear">
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
<th><?php echo $this->Paginator->sort('cert_file');?></th>
|
<th><?php echo $this->Paginator->sort('cert_file');?></th>
|
||||||
<th><?php echo $this->Paginator->sort('client_cert_file');?></th>
|
<th><?php echo $this->Paginator->sort('client_cert_file');?></th>
|
||||||
<th><?php echo $this->Paginator->sort('self_signed');?></th>
|
<th><?php echo $this->Paginator->sort('self_signed');?></th>
|
||||||
|
<th><?php echo $this->Paginator->sort('skip_proxy');?></th>
|
||||||
<th><?php echo $this->Paginator->sort('org');?></th>
|
<th><?php echo $this->Paginator->sort('org');?></th>
|
||||||
<th class="actions"><?php echo __('Actions');?></th>
|
<th class="actions"><?php echo __('Actions');?></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -78,6 +79,7 @@ foreach ($servers as $server):
|
||||||
<td class="short"><?php echo h($server['Server']['cert_file']); ?> </td>
|
<td class="short"><?php echo h($server['Server']['cert_file']); ?> </td>
|
||||||
<td class="short"><?php echo h($server['Server']['client_cert_file']); ?> </td>
|
<td class="short"><?php echo h($server['Server']['client_cert_file']); ?> </td>
|
||||||
<td class="short"><span class="<?php echo ($server['Server']['self_signed'] ? 'icon-ok' : 'icon-remove'); ?>"></span></td>
|
<td class="short"><span class="<?php echo ($server['Server']['self_signed'] ? 'icon-ok' : 'icon-remove'); ?>"></span></td>
|
||||||
|
<td class="short"><span class="<?php echo ($server['Server']['skip_proxy'] ? 'icon-ok' : 'icon-remove'); ?>"></span></td>
|
||||||
<td class="short"><a href="/organisations/view/<?php echo h($server['Organisation']['id']); ?>"><?php echo h($server['Organisation']['name']); ?></a></td>
|
<td class="short"><a href="/organisations/view/<?php echo h($server['Organisation']['id']); ?>"><?php echo h($server['Organisation']['name']); ?></a></td>
|
||||||
<td class="short action-links">
|
<td class="short action-links">
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in New Issue