mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
Merge remote-tracking branch 'remotes/origin/ent-5108-ws-cookie-parser' into develop
This commit is contained in:
commit
b71752ea03
@ -8,8 +8,19 @@ fi
|
|||||||
echo "Creating DEB packages in $RPMHOME/DEB"
|
echo "Creating DEB packages in $RPMHOME/DEB"
|
||||||
|
|
||||||
# Console
|
# Console
|
||||||
|
# Extra files to be added to rpm.
|
||||||
|
if [ "$X86_64" == "" ]; then
|
||||||
|
# Fake gotty.
|
||||||
|
echo 'Only x86_64 is supported' > $CODEHOME/pandora_console/gotty
|
||||||
|
chmod +x pandora_console/gotty
|
||||||
|
else
|
||||||
|
cp /root/bin/winexe/x64/gotty $CODEHOME/pandora_console/
|
||||||
|
fi
|
||||||
cd $CODEHOME/pandora_console/DEBIAN && bash ./make_deb_package.sh && mv ../*.deb $RPMHOME/DEB || exit 1
|
cd $CODEHOME/pandora_console/DEBIAN && bash ./make_deb_package.sh && mv ../*.deb $RPMHOME/DEB || exit 1
|
||||||
|
|
||||||
|
# Cleanup.
|
||||||
|
rm -f pandora_console/gotty
|
||||||
|
|
||||||
# Server
|
# Server
|
||||||
cd $CODEHOME/pandora_server/DEBIAN && bash ./make_deb_package.sh && mv ../*.deb $RPMHOME/DEB || exit 1
|
cd $CODEHOME/pandora_server/DEBIAN && bash ./make_deb_package.sh && mv ../*.deb $RPMHOME/DEB || exit 1
|
||||||
|
|
||||||
|
@ -8,8 +8,20 @@ fi
|
|||||||
echo "Creating RPM packages in $RPMHOME/RPMS"
|
echo "Creating RPM packages in $RPMHOME/RPMS"
|
||||||
|
|
||||||
# Console
|
# Console
|
||||||
|
# Extra files to be added to rpm.
|
||||||
|
if [ "$X86_64" == "" ]; then
|
||||||
|
# Fake gotty.
|
||||||
|
echo 'Only x86_64 is supported' > $CODEHOME/pandora_console/gotty
|
||||||
|
chmod +x pandora_console/gotty
|
||||||
|
else
|
||||||
|
cp /root/bin/winexe/x64/gotty $CODEHOME/pandora_console/
|
||||||
|
fi
|
||||||
|
|
||||||
rpmbuild -ba $CODEHOME/pandora_console/pandora_console.spec || exit 1
|
rpmbuild -ba $CODEHOME/pandora_console/pandora_console.spec || exit 1
|
||||||
|
|
||||||
|
# Cleanup.
|
||||||
|
rm -f pandora_console/gotty
|
||||||
|
|
||||||
# Server
|
# Server
|
||||||
rpmbuild -ba $CODEHOME/pandora_server/pandora_server.spec || exit 1
|
rpmbuild -ba $CODEHOME/pandora_server/pandora_server.spec || exit 1
|
||||||
|
|
||||||
|
@ -8,8 +8,20 @@ fi
|
|||||||
echo "Creating RPM packages in $RPMHOME/RPMS"
|
echo "Creating RPM packages in $RPMHOME/RPMS"
|
||||||
|
|
||||||
# Console
|
# Console
|
||||||
|
# Extra files to be added to rpm.
|
||||||
|
if [ "$X86_64" == "" ]; then
|
||||||
|
# Fake gotty.
|
||||||
|
echo 'Only x86_64 is supported' > $CODEHOME/pandora_console/gotty
|
||||||
|
chmod +x pandora_console/gotty
|
||||||
|
else
|
||||||
|
cp /root/bin/winexe/x64/gotty $CODEHOME/pandora_console/
|
||||||
|
fi
|
||||||
|
|
||||||
rpmbuild -ba $CODEHOME/pandora_console/pandora_console.redhat.spec || exit 1
|
rpmbuild -ba $CODEHOME/pandora_console/pandora_console.redhat.spec || exit 1
|
||||||
|
|
||||||
|
# Cleanup.
|
||||||
|
rm -f pandora_console/gotty
|
||||||
|
|
||||||
# Server
|
# Server
|
||||||
rpmbuild -ba $CODEHOME/pandora_server/pandora_server.redhat.spec || exit 1
|
rpmbuild -ba $CODEHOME/pandora_server/pandora_server.redhat.spec || exit 1
|
||||||
|
|
||||||
|
@ -8,13 +8,25 @@ fi
|
|||||||
echo "Creating RPM packages in $RPMHOME/RPMS"
|
echo "Creating RPM packages in $RPMHOME/RPMS"
|
||||||
|
|
||||||
# Console
|
# Console
|
||||||
|
# Extra files to be added to rpm.
|
||||||
|
if [ "$X86_64" == "" ]; then
|
||||||
|
# Fake gotty.
|
||||||
|
echo 'Only x86_64 is supported' > $CODEHOME/pandora_console/gotty
|
||||||
|
chmod +x pandora_console/gotty
|
||||||
|
else
|
||||||
|
cp /root/bin/winexe/x64/gotty $CODEHOME/pandora_console/
|
||||||
|
fi
|
||||||
|
|
||||||
rpmbuild -ba $CODEHOME/pandora_console/pandora_console.rhel7.spec || exit 1
|
rpmbuild -ba $CODEHOME/pandora_console/pandora_console.rhel7.spec || exit 1
|
||||||
|
|
||||||
|
# Cleanup.
|
||||||
|
rm -f pandora_console/gotty
|
||||||
|
|
||||||
# Server
|
# Server
|
||||||
#rpmbuild -ba $CODEHOME/pandora_server/pandora_server.rhel7.spec || exit 1
|
rpmbuild -ba $CODEHOME/pandora_server/pandora_server.redhat.spec || exit 1
|
||||||
|
|
||||||
# Unix agent
|
# Unix agent
|
||||||
#rpmbuild -ba $CODEHOME/pandora_agents/unix/pandora_agent.rhel7.spec || exit 1
|
rpmbuild -ba $CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec || exit 1
|
||||||
|
|
||||||
# Enterprise console
|
# Enterprise console
|
||||||
rpmbuild -ba $PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.rhel7.spec || exit 1
|
rpmbuild -ba $PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.rhel7.spec || exit 1
|
||||||
|
@ -10,6 +10,9 @@ if [ -f /etc/init.d/apache2 ]; then
|
|||||||
echo Restart the apache.
|
echo Restart the apache.
|
||||||
/etc/init.d/apache2 restart
|
/etc/init.d/apache2 restart
|
||||||
fi
|
fi
|
||||||
|
# Install GoTTY binary file.
|
||||||
|
cp -pf %{prefix}/pandora_console/gotty /usr/bin/
|
||||||
|
chmod +x /usr/bin/gotty
|
||||||
|
|
||||||
# Install pandora_websocket_engine service.
|
# Install pandora_websocket_engine service.
|
||||||
cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/
|
cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/
|
||||||
|
@ -65,17 +65,13 @@ function quickShell()
|
|||||||
ui_require_css_file('discovery');
|
ui_require_css_file('discovery');
|
||||||
|
|
||||||
// Settings.
|
// Settings.
|
||||||
// WebSocket host, where to connect.
|
// WebSocket host, where client should connect.
|
||||||
if (isset($config['ws_host']) === false) {
|
|
||||||
config_update_value('ws_host', $_SERVER['SERVER_ADDR']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($config['ws_port']) === false) {
|
if (isset($config['ws_port']) === false) {
|
||||||
config_update_value('ws_port', 8080);
|
config_update_value('ws_port', 8080);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($config['ws_proxy_url']) === true) {
|
if (empty($config['ws_proxy_url']) === true) {
|
||||||
$ws_url = 'http://'.$config['ws_host'].':'.$config['ws_port'];
|
$ws_url = 'http://'.$_SERVER['SERVER_ADDR'].':'.$config['ws_port'];
|
||||||
} else {
|
} else {
|
||||||
preg_match('/\/\/(.*)/', $config['ws_proxy_url'], $matches);
|
preg_match('/\/\/(.*)/', $config['ws_proxy_url'], $matches);
|
||||||
if (isset($_SERVER['HTTPS']) === true) {
|
if (isset($_SERVER['HTTPS']) === true) {
|
||||||
@ -313,7 +309,7 @@ function quickShellSettings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Parser.
|
// Parser.
|
||||||
if (get_parameter('qs_update', false) !== false) {
|
if (get_parameter('update_config', false) !== false) {
|
||||||
// Gotty settings. Internal communication (WS).
|
// Gotty settings. Internal communication (WS).
|
||||||
$gotty = get_parameter(
|
$gotty = get_parameter(
|
||||||
'gotty',
|
'gotty',
|
||||||
@ -381,14 +377,6 @@ function quickShellSettings()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interface.
|
|
||||||
ui_print_page_header(
|
|
||||||
__('QuickShell settings'),
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
'quickshell_settings'
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($changes > 0) {
|
if ($changes > 0) {
|
||||||
$msg = __('%d Updated', $changes);
|
$msg = __('%d Updated', $changes);
|
||||||
if ($critical > 0) {
|
if ($critical > 0) {
|
||||||
@ -401,100 +389,104 @@ function quickShellSettings()
|
|||||||
ui_print_success_message($msg);
|
ui_print_success_message($msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Form.
|
// Form. Using old style.
|
||||||
$wiz = new Wizard();
|
echo '<fieldset>';
|
||||||
|
echo '<legend>'.__('Quickshell').'</legend>';
|
||||||
|
|
||||||
$wiz->printForm(
|
$t = new StdClass();
|
||||||
[
|
$t->data = [];
|
||||||
'form' => [
|
$t->width = '100%';
|
||||||
'action' => '#',
|
$t->class = 'databox filters';
|
||||||
'class' => 'wizard',
|
$t->data = [];
|
||||||
'method' => 'post',
|
$t->style[0] = 'font-weight: bold';
|
||||||
],
|
|
||||||
'inputs' => [
|
$t->data[0][0] = __('Gotty path');
|
||||||
[
|
$t->data[0][1] = html_print_input_text(
|
||||||
'label' => __('Gotty path').ui_print_help_tip(
|
'gotty',
|
||||||
__('Leave blank if using an external Gotty service'),
|
$config['gotty'],
|
||||||
true
|
'',
|
||||||
),
|
30,
|
||||||
'arguments' => [
|
100,
|
||||||
'type' => 'text',
|
|
||||||
'name' => 'gotty',
|
|
||||||
'value' => $config['gotty'],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'label' => __('Gotty host'),
|
|
||||||
'arguments' => [
|
|
||||||
'type' => 'text',
|
|
||||||
'name' => 'gotty_host',
|
|
||||||
'value' => $config['gotty_host'],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'label' => __('Gotty ssh port'),
|
|
||||||
'arguments' => [
|
|
||||||
'type' => 'text',
|
|
||||||
'name' => 'gotty_ssh_port',
|
|
||||||
'value' => $config['gotty_ssh_port'],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'label' => __('Gotty telnet port'),
|
|
||||||
'arguments' => [
|
|
||||||
'type' => 'text',
|
|
||||||
'name' => 'gotty_telnet_port',
|
|
||||||
'value' => $config['gotty_telnet_port'],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'toggle' => true,
|
|
||||||
'toggle_name' => 'Advanced',
|
|
||||||
'block_content' => [
|
|
||||||
[
|
|
||||||
'label' => __('Gotty user').ui_print_help_tip(
|
|
||||||
__('Optional, set a user to access gotty service'),
|
|
||||||
true
|
|
||||||
),
|
|
||||||
'arguments' => [
|
|
||||||
'type' => 'text',
|
|
||||||
'name' => 'gotty_user',
|
|
||||||
'value' => $config['gotty_user'],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'label' => __('Gotty password').ui_print_help_tip(
|
|
||||||
__('Optional, set a password to access gotty service'),
|
|
||||||
true
|
|
||||||
),
|
|
||||||
'arguments' => [
|
|
||||||
'type' => 'password',
|
|
||||||
'name' => 'gotty_pass',
|
|
||||||
'value' => io_output_password($config['gotty_pass']),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'arguments' => [
|
|
||||||
'type' => 'hidden',
|
|
||||||
'name' => 'qs_update',
|
|
||||||
'value' => 1,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'arguments' => [
|
|
||||||
'type' => 'submit',
|
|
||||||
'label' => __('Update'),
|
|
||||||
'attributes' => 'class="sub next"',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
false,
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$t->data[1][0] = __('Gotty host');
|
||||||
|
$t->data[1][1] = html_print_input_text(
|
||||||
|
'gotty_host',
|
||||||
|
$config['gotty_host'],
|
||||||
|
'',
|
||||||
|
30,
|
||||||
|
100,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$t->data[2][0] = __('Gotty ssh port');
|
||||||
|
$t->data[2][1] = html_print_input_text(
|
||||||
|
'gotty_ssh_port',
|
||||||
|
$config['gotty_ssh_port'],
|
||||||
|
'',
|
||||||
|
30,
|
||||||
|
100,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$t->data[3][0] = __('Gotty telnet port');
|
||||||
|
$t->data[3][1] = html_print_input_text(
|
||||||
|
'gotty_telnet_port',
|
||||||
|
$config['gotty_telnet_port'],
|
||||||
|
'',
|
||||||
|
30,
|
||||||
|
100,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$hidden = new StdClass();
|
||||||
|
$hidden->data = [];
|
||||||
|
$hidden->width = '100%';
|
||||||
|
$hidden->class = 'databox filters';
|
||||||
|
$hidden->data = [];
|
||||||
|
$hidden->style[0] = 'font-weight: bold';
|
||||||
|
|
||||||
|
$hidden->data[0][0] = __('Gotty user').ui_print_help_tip(
|
||||||
|
__('Optional, set a user to access gotty service'),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
$hidden->data[0][1] = html_print_input_text(
|
||||||
|
'gotty_user',
|
||||||
|
$config['gotty_user'],
|
||||||
|
'',
|
||||||
|
30,
|
||||||
|
100,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$hidden->data[1][0] = __('Gotty password').ui_print_help_tip(
|
||||||
|
__('Optional, set a password to access gotty service'),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
$hidden->data[1][1] = html_print_input_password(
|
||||||
|
'gotty_pass',
|
||||||
|
io_output_password($config['gotty_pass']),
|
||||||
|
'',
|
||||||
|
30,
|
||||||
|
100,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
html_print_table($t);
|
||||||
|
|
||||||
|
ui_print_toggle(
|
||||||
|
[
|
||||||
|
'content' => html_print_table($hidden, true),
|
||||||
|
'name' => __('Advanced options'),
|
||||||
|
'clean' => false,
|
||||||
|
'main_class' => 'no-border-imp',
|
||||||
|
'container_class' => 'no-border-imp',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
echo '</fieldset>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -523,19 +515,4 @@ if (empty($agent_id) === false
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extensions_add_godmode_menu_option(
|
|
||||||
// Name.
|
|
||||||
__('QuickShell settings'),
|
|
||||||
// Acl.
|
|
||||||
'PM',
|
|
||||||
// FatherId.
|
|
||||||
'gextensions',
|
|
||||||
// Icon.
|
|
||||||
'images/ehorus/terminal.png',
|
|
||||||
// Version.
|
|
||||||
'N/A',
|
|
||||||
// SubfatherId.
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
extensions_add_godmode_function('quickShellSettings');
|
extensions_add_godmode_function('quickShellSettings');
|
||||||
|
@ -129,6 +129,7 @@ if ($disabled != '') {
|
|||||||
|
|
||||||
$extensions = extensions_get_extension_info();
|
$extensions = extensions_get_extension_info();
|
||||||
|
|
||||||
|
$table = new StdClass;
|
||||||
$table->width = '98%';
|
$table->width = '98%';
|
||||||
|
|
||||||
$table->head = [];
|
$table->head = [];
|
||||||
|
@ -316,6 +316,13 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
|||||||
$sub2['godmode/setup/setup&section=notifications']['text'] = __('Notifications');
|
$sub2['godmode/setup/setup&section=notifications']['text'] = __('Notifications');
|
||||||
$sub2['godmode/setup/setup&section=notifications']['refr'] = 0;
|
$sub2['godmode/setup/setup&section=notifications']['refr'] = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Enable only if quickshell is enabled.
|
||||||
|
if (function_exists('quickShellSettings') === true) {
|
||||||
|
$sub2['godmode/setup/setup&section=quickshell']['text'] = __('QuickShell');
|
||||||
|
$sub2['godmode/setup/setup&section=quickshell']['refr'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ($config['activate_gis']) {
|
if ($config['activate_gis']) {
|
||||||
$sub2['godmode/setup/gis']['text'] = __('Map conections GIS');
|
$sub2['godmode/setup/gis']['text'] = __('Map conections GIS');
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,11 @@ $buttons['notifications'] = [
|
|||||||
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=notifications').'">'.html_print_image('images/alerts_template.png', true, ['title' => __('Notifications')]).'</a>',
|
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=notifications').'">'.html_print_image('images/alerts_template.png', true, ['title' => __('Notifications')]).'</a>',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$buttons['websocket_engine'] = [
|
||||||
|
'active' => false,
|
||||||
|
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=websocket_engine').'">'.html_print_image('images/websocket_small.png', true, ['title' => __('Websocket engine')]).'</a>',
|
||||||
|
];
|
||||||
|
|
||||||
$help_header = '';
|
$help_header = '';
|
||||||
if (enterprise_installed()) {
|
if (enterprise_installed()) {
|
||||||
$subpage = setup_enterprise_add_subsection_main($section, $buttons, $help_header);
|
$subpage = setup_enterprise_add_subsection_main($section, $buttons, $help_header);
|
||||||
@ -183,6 +188,12 @@ switch ($section) {
|
|||||||
$subpage = ' » '.__('Notifications');
|
$subpage = ' » '.__('Notifications');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'websocket_engine':
|
||||||
|
$buttons['websocket_engine']['active'] = true;
|
||||||
|
$subpage = ' » '.__('Pandora Websocket Engine');
|
||||||
|
$help_header = 'quickshell_settings';
|
||||||
|
break;
|
||||||
|
|
||||||
case 'enterprise':
|
case 'enterprise':
|
||||||
$buttons['enterprise']['active'] = true;
|
$buttons['enterprise']['active'] = true;
|
||||||
$subpage = ' » '.__('Enterprise');
|
$subpage = ' » '.__('Enterprise');
|
||||||
@ -247,6 +258,10 @@ switch ($section) {
|
|||||||
include_once $config['homedir'].'/godmode/setup/setup_notifications.php';
|
include_once $config['homedir'].'/godmode/setup/setup_notifications.php';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'websocket_engine':
|
||||||
|
include_once $config['homedir'].'/godmode/setup/setup_websocket_engine.php';
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
enterprise_hook('setup_enterprise_select_tab', [$section]);
|
enterprise_hook('setup_enterprise_select_tab', [$section]);
|
||||||
break;
|
break;
|
||||||
|
@ -403,50 +403,6 @@ html_print_table($table_mail_conf);
|
|||||||
echo '</fieldset>';
|
echo '</fieldset>';
|
||||||
|
|
||||||
echo '<fieldset>';
|
echo '<fieldset>';
|
||||||
echo '<legend>'.__('WebSocket settings').'</legend>';
|
|
||||||
|
|
||||||
$t = new StdClass();
|
|
||||||
$t->data = [];
|
|
||||||
$t->width = '100%';
|
|
||||||
$t->class = 'databox filters';
|
|
||||||
$t->data = [];
|
|
||||||
$t->style[0] = 'font-weight: bold';
|
|
||||||
|
|
||||||
$t->data[0][0] = __('Bind address');
|
|
||||||
$t->data[0][1] = html_print_input_text(
|
|
||||||
'ws_bind_address',
|
|
||||||
$config['ws_bind_address'],
|
|
||||||
'',
|
|
||||||
30,
|
|
||||||
100,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
$t->data[1][0] = __('Bind port');
|
|
||||||
$t->data[1][2] = html_print_input_text(
|
|
||||||
'ws_port',
|
|
||||||
$config['ws_port'],
|
|
||||||
'',
|
|
||||||
30,
|
|
||||||
100,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
$t->data[2][0] = __('WebSocket proxy url').ui_print_help_tip(__('If you had configured a wsproxy set here target URL (for instance ws://your.public.fqdn/ws).'), true);
|
|
||||||
$t->data[2][2] = html_print_input_text(
|
|
||||||
'ws_proxy_url',
|
|
||||||
$config['ws_proxy_url'],
|
|
||||||
'',
|
|
||||||
30,
|
|
||||||
100,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
html_print_input_hidden('update_config', 1);
|
|
||||||
html_print_table($t);
|
|
||||||
|
|
||||||
|
|
||||||
echo '</fieldset>';
|
|
||||||
|
|
||||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||||
html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"');
|
html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"');
|
||||||
|
98
pandora_console/godmode/setup/setup_websocket_engine.php
Normal file
98
pandora_console/godmode/setup/setup_websocket_engine.php
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Settings for Pandora Websocket engine.
|
||||||
|
*
|
||||||
|
* @category UI file
|
||||||
|
* @package Pandora FMS
|
||||||
|
* @subpackage Community
|
||||||
|
* @version 1.0.0
|
||||||
|
* @license See below
|
||||||
|
*
|
||||||
|
* ______ ___ _______ _______ ________
|
||||||
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||||
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||||
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||||
|
*
|
||||||
|
* ============================================================================
|
||||||
|
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||||
|
* Please see http://pandorafms.org for full contribution list
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation for version 2.
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
* ============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
$url = ui_get_full_url(
|
||||||
|
'index.php?sec=gsetup&sec2=godmode/setup/setup&section=websocket_engine&pure='.$config['pure']
|
||||||
|
);
|
||||||
|
|
||||||
|
echo '<form id="form_setup" method="post" action="'.$url.'">';
|
||||||
|
|
||||||
|
echo '<fieldset>';
|
||||||
|
echo '<legend>'.__('WebSocket settings').'</legend>';
|
||||||
|
|
||||||
|
$t = new StdClass();
|
||||||
|
$t->data = [];
|
||||||
|
$t->width = '100%';
|
||||||
|
$t->class = 'databox filters';
|
||||||
|
$t->data = [];
|
||||||
|
$t->style[0] = 'font-weight: bold';
|
||||||
|
|
||||||
|
$t->data[0][0] = __('Bind address');
|
||||||
|
$t->data[0][1] = html_print_input_text(
|
||||||
|
'ws_bind_address',
|
||||||
|
$config['ws_bind_address'],
|
||||||
|
'',
|
||||||
|
30,
|
||||||
|
100,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$t->data[1][0] = __('Bind port');
|
||||||
|
$t->data[1][2] = html_print_input_text(
|
||||||
|
'ws_port',
|
||||||
|
$config['ws_port'],
|
||||||
|
'',
|
||||||
|
30,
|
||||||
|
100,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$t->data[2][0] = __('WebSocket proxy url').ui_print_help_tip(
|
||||||
|
__('If you had configured a wsproxy set here target URL (for instance ws://your.public.fqdn/ws).'),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
$t->data[2][2] = html_print_input_text(
|
||||||
|
'ws_proxy_url',
|
||||||
|
$config['ws_proxy_url'],
|
||||||
|
'',
|
||||||
|
30,
|
||||||
|
100,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
html_print_input_hidden('update_config', 1);
|
||||||
|
html_print_table($t);
|
||||||
|
|
||||||
|
|
||||||
|
echo '</fieldset>';
|
||||||
|
|
||||||
|
if (function_exists('quickShellSettings') === true) {
|
||||||
|
quickShellSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<div class="action-buttons" style="width: 100%;">';
|
||||||
|
html_print_submit_button(
|
||||||
|
__('Update'),
|
||||||
|
'update_button',
|
||||||
|
false,
|
||||||
|
'class="sub upd"'
|
||||||
|
);
|
||||||
|
echo '</div>';
|
||||||
|
echo '</form>';
|
BIN
pandora_console/images/websocket_big.png
Normal file
BIN
pandora_console/images/websocket_big.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
BIN
pandora_console/images/websocket_small.png
Normal file
BIN
pandora_console/images/websocket_small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
@ -152,7 +152,7 @@ class WSManager extends WebSocketServer
|
|||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
$listen_addr,
|
$listen_addr,
|
||||||
$listen_port,
|
int $listen_port,
|
||||||
$connected=[],
|
$connected=[],
|
||||||
$process=[],
|
$process=[],
|
||||||
$processRaw=[],
|
$processRaw=[],
|
||||||
@ -271,12 +271,20 @@ class WSManager extends WebSocketServer
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$php_session_id = \str_replace(
|
$match;
|
||||||
'PHPSESSID=',
|
$php_session_id = '';
|
||||||
'',
|
\preg_match(
|
||||||
$user->headers['cookie']
|
'/PHPSESSID=(.*)/',
|
||||||
|
$user->headers['cookie'],
|
||||||
|
$match
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (is_array($match) === true) {
|
||||||
|
$php_session_id = $match[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
$php_session_id = \preg_replace('/;.*$/', '', $php_session_id);
|
||||||
|
|
||||||
// If being redirected from proxy.
|
// If being redirected from proxy.
|
||||||
if (isset($user->headers['x-forwarded-for']) === true) {
|
if (isset($user->headers['x-forwarded-for']) === true) {
|
||||||
$user->address = $user->headers['x-forwarded-for'];
|
$user->address = $user->headers['x-forwarded-for'];
|
||||||
|
@ -590,6 +590,10 @@ select:-internal-list-box {
|
|||||||
.no-border {
|
.no-border {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
.no-border-imp,
|
||||||
|
.no-border-imp > div {
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
.no-padding {
|
.no-padding {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,10 @@ install -m 0644 pandora_console_logrotate_centos $RPM_BUILD_ROOT%{_sysconfdir}/l
|
|||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
# Install GoTTY binary file.
|
||||||
|
cp -pf %{prefix}/pandora_console/gotty /usr/bin/
|
||||||
|
chmod +x /usr/bin/gotty
|
||||||
|
|
||||||
# Install pandora_websocket_engine service.
|
# Install pandora_websocket_engine service.
|
||||||
cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/
|
cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/
|
||||||
chmod +x /etc/init.d/pandora_websocket_engine
|
chmod +x /etc/init.d/pandora_websocket_engine
|
||||||
|
@ -57,6 +57,10 @@ install -m 0644 pandora_console_logrotate_centos $RPM_BUILD_ROOT%{_sysconfdir}/l
|
|||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
# Install GoTTY binary file.
|
||||||
|
cp -pf %{prefix}/pandora_console/gotty /usr/bin/
|
||||||
|
chmod +x /usr/bin/gotty
|
||||||
|
|
||||||
# Install pandora_websocket_engine service.
|
# Install pandora_websocket_engine service.
|
||||||
cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/
|
cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/
|
||||||
chmod +x /etc/init.d/pandora_websocket_engine
|
chmod +x /etc/init.d/pandora_websocket_engine
|
||||||
|
@ -58,6 +58,10 @@ fi
|
|||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
# Install GoTTY binary file.
|
||||||
|
cp -pf %{prefix}/pandora_console/gotty /usr/bin/
|
||||||
|
chmod +x /usr/bin/gotty
|
||||||
|
|
||||||
# Install pandora_websocket_engine service.
|
# Install pandora_websocket_engine service.
|
||||||
cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/
|
cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/
|
||||||
chmod +x /etc/init.d/pandora_websocket_engine
|
chmod +x /etc/init.d/pandora_websocket_engine
|
||||||
|
@ -139,7 +139,7 @@ $ws = new WSManager(
|
|||||||
// Bind address.
|
// Bind address.
|
||||||
$config['ws_bind_address'],
|
$config['ws_bind_address'],
|
||||||
// Bind port.
|
// Bind port.
|
||||||
$config['ws_port'],
|
(int) $config['ws_port'],
|
||||||
// Connected handlers.
|
// Connected handlers.
|
||||||
['gotty' => 'proxyConnected'],
|
['gotty' => 'proxyConnected'],
|
||||||
// Process handlers.
|
// Process handlers.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user