mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
XML-RPC (HA-Sync) - add missing configuration sections. closes https://github.com/opnsense/core/issues/4834
o while here add "services" attribute for future use, so we can track related services o add missing service controls: routing, tunables, cron, webgui (so we can remove service callouts in filter_configure_xmlrpc() at a later stage)
This commit is contained in:
parent
6923424818
commit
8af2147e9c
@ -336,6 +336,11 @@ function plugins_xmlrpc_sync()
|
||||
if (empty($helper['help'])) {
|
||||
$sync_settings[$helper['id']]['help'] = sprintf(gettext('Synchronize the %s configuration to the other HA host.'), $helper['description']);
|
||||
}
|
||||
if (empty($helper['services'])) {
|
||||
$sync_settings[$helper['id']]['services'] = [];
|
||||
} elseif (!is_array($helper['services'])) {
|
||||
$sync_settings[$helper['id']]['services'] = [$helper['services']];
|
||||
}
|
||||
unset($sync_settings[$helper['id']]['id']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,6 +79,32 @@ function core_services()
|
||||
'name' => 'login',
|
||||
);
|
||||
|
||||
$services[] = array(
|
||||
'description' => gettext('System routing'),
|
||||
'php' => array(
|
||||
"restart" => array('system_routing_configure')
|
||||
),
|
||||
'nocheck' => true,
|
||||
'name' => 'routing',
|
||||
);
|
||||
|
||||
$services[] = array(
|
||||
'description' => gettext('System tunables'),
|
||||
'php' => array(
|
||||
"restart" => array('system_sysctl_configure')
|
||||
),
|
||||
'nocheck' => true,
|
||||
'name' => 'sysctl',
|
||||
);
|
||||
|
||||
$services[] = array(
|
||||
'description' => gettext('Cron'),
|
||||
'php' => array(
|
||||
"restart" => array('system_cron_configure')
|
||||
),
|
||||
'name' => 'cron',
|
||||
);
|
||||
|
||||
if (empty($config['syslog']['disable_clog'])) {
|
||||
$services[] = array(
|
||||
'description' => gettext('Legacy Syslog Daemon'),
|
||||
@ -103,6 +129,16 @@ function core_services()
|
||||
'name' => 'syslog-ng',
|
||||
);
|
||||
|
||||
$services[] = array(
|
||||
'pidfile' => '/var/run/lighty-webConfigurator.pid',
|
||||
'description' => gettext('WebGui'),
|
||||
'configd' => array(
|
||||
'restart' => array('webgui restart')
|
||||
),
|
||||
'locked' => true,
|
||||
'name' => 'webgui',
|
||||
);
|
||||
|
||||
return $services;
|
||||
}
|
||||
|
||||
@ -261,12 +297,14 @@ function core_xmlrpc_sync()
|
||||
'help' => gettext('Synchronize the users and groups over to the other HA host.'),
|
||||
'section' => 'system.user,system.group',
|
||||
'id' => 'users',
|
||||
'services' => ["login"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('Auth Servers'),
|
||||
'help' => gettext('Synchronize the authentication servers (e.g. LDAP, RADIUS) over to the other HA host.'),
|
||||
'section' => 'system.authserver',
|
||||
'id' => 'authservers',
|
||||
'services' => ["login"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('Certificates'),
|
||||
@ -279,30 +317,59 @@ function core_xmlrpc_sync()
|
||||
'help' => gettext('Synchronize the firewall rules to the other HA host.'),
|
||||
'section' => 'filter',
|
||||
'id' => 'rules',
|
||||
'services' => ["pf"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('Firewall Schedules'),
|
||||
'help' => gettext('Synchronize the firewall schedules to the other HA host.'),
|
||||
'section' => 'schedules',
|
||||
'id' => 'schedules',
|
||||
'services' => ["pf"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('Firewall Categories'),
|
||||
'section' => 'OPNsense.Firewall.Category',
|
||||
'id' => 'categories'
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('Aliases'),
|
||||
'help' => gettext('Synchronize the aliases over to the other HA host.'),
|
||||
'section' => 'OPNsense.Firewall.Alias',
|
||||
'id' => 'aliases',
|
||||
'services' => ["pf"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('NAT'),
|
||||
'help' => gettext('Synchronize the NAT rules over to the other HA host.'),
|
||||
'section' => 'nat',
|
||||
'id' => 'nat',
|
||||
'services' => ["pf"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('DHCPD'),
|
||||
'help' => gettext('Synchronize the DHCP Server settings over to the other HA host. This only applies to DHCP for IPv4.'),
|
||||
'section' => 'dhcpd',
|
||||
'id' => 'dhcpd',
|
||||
'services' => ["dhcpd"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('DHCPv4: Relay'),
|
||||
'section' => 'dhcrelay',
|
||||
'id' => 'dhcrelay',
|
||||
'services' => ["dhcrelay"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('DHCPDv6'),
|
||||
'help' => gettext('Synchronize DHCPv6 including router advertisements.'),
|
||||
'section' => 'dhcpdv6',
|
||||
'id' => 'dhcpdv6',
|
||||
'services' => ["dhcpdv6", "radvd"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('DHCPv6: Relay'),
|
||||
'section' => 'dhcrelay6',
|
||||
'id' => 'dhcrelay6',
|
||||
'services' => ["dhcrelay6"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('Virtual IPs'),
|
||||
@ -315,12 +382,39 @@ function core_xmlrpc_sync()
|
||||
'help' => gettext('Synchronize the Static Route configuration and Gateways to the other HA host.'),
|
||||
'section' => 'staticroutes,gateways',
|
||||
'id' => 'staticroutes',
|
||||
'services' => ["routing"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('Network Time'),
|
||||
'section' => 'ntpd,system.timeservers',
|
||||
'id' => 'ntpd',
|
||||
'services' => ["ntpd"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('Syslog'),
|
||||
'section' => 'syslog,OPNsense.Syslog',
|
||||
'id' => 'syslog',
|
||||
'services' => ["syslogd"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('Cron'),
|
||||
'section' => 'OPNsense.cron',
|
||||
'id' => 'cron',
|
||||
'services' => ["cron"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('System Tunables'),
|
||||
'section' => 'sysctl',
|
||||
'id' => 'sysctl',
|
||||
'services' => ["sysctl"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('WebGui'),
|
||||
'section' => 'system.webgui',
|
||||
'id' => 'webgui',
|
||||
'services' => ["webgui"],
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -81,6 +81,7 @@ function dnsmasq_xmlrpc_sync()
|
||||
'description' => gettext('Dnsmasq DNS'),
|
||||
'section' => 'dnsmasq',
|
||||
'id' => 'dnsforwarder',
|
||||
'services' => ["dnsmasq"],
|
||||
);
|
||||
|
||||
return $result;
|
||||
|
||||
@ -56,11 +56,13 @@ function ipfw_xmlrpc_sync()
|
||||
'description' => gettext('Shaper'),
|
||||
'section' => 'OPNsense.TrafficShaper',
|
||||
'id' => 'shaper',
|
||||
'services' => ["ipfw"],
|
||||
);
|
||||
$result[] = array(
|
||||
'description' => gettext('Captive Portal'),
|
||||
'section' => 'OPNsense.captiveportal',
|
||||
'id' => 'captiveportal',
|
||||
'services' => ["ipfw"],
|
||||
);
|
||||
|
||||
return $result;
|
||||
|
||||
@ -333,6 +333,7 @@ function ipsec_xmlrpc_sync()
|
||||
'description' => gettext('IPsec'),
|
||||
'section' => 'ipsec',
|
||||
'id' => 'ipsec',
|
||||
'services' => ["strongswan"],
|
||||
);
|
||||
|
||||
return $result;
|
||||
|
||||
@ -65,6 +65,7 @@ function monit_xmlrpc_sync()
|
||||
'description' => gettext('Monit System Monitoring'),
|
||||
'section' => 'OPNsense.monit',
|
||||
'id' => 'monit',
|
||||
'services' => ["monit"],
|
||||
);
|
||||
|
||||
return $result;
|
||||
|
||||
@ -73,3 +73,20 @@ function netflow_services()
|
||||
|
||||
return $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* sync configuration via xmlrpc
|
||||
* @return array
|
||||
*/
|
||||
function netflow_xmlrpc_sync()
|
||||
{
|
||||
$result = [];
|
||||
$result[] = array(
|
||||
'description' => gettext('Netflow / Insight'),
|
||||
'section' => 'OPNsense.Netflow',
|
||||
'id' => 'syslog',
|
||||
'services' => ["samplicate", "flowd_aggregate"],
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -63,6 +63,24 @@ function openssh_services()
|
||||
return $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* sync configuration via xmlrpc
|
||||
* @return array
|
||||
*/
|
||||
function openssh_xmlrpc_sync()
|
||||
{
|
||||
$result = [];
|
||||
$result[] = array(
|
||||
'description' => gettext('OpenSSH'),
|
||||
'section' => 'system.ssh',
|
||||
'id' => 'ssh',
|
||||
'services' => ["openssh"],
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
function openssh_stop()
|
||||
{
|
||||
/* if run from a shell session, `-af' and the full path is needed */
|
||||
|
||||
@ -110,6 +110,7 @@ function openvpn_xmlrpc_sync()
|
||||
'description' => gettext('OpenVPN'),
|
||||
'section' => 'openvpn',
|
||||
'id' => 'openvpn',
|
||||
'services' => ["openvpn"],
|
||||
);
|
||||
|
||||
return $result;
|
||||
|
||||
@ -178,6 +178,7 @@ function pf_xmlrpc_sync()
|
||||
'description' => gettext('Firewall Groups'),
|
||||
'section' => 'ifgroups.ifgroupentry',
|
||||
'id' => 'ifgroups',
|
||||
'services' => ["pf"],
|
||||
);
|
||||
|
||||
return $result;
|
||||
|
||||
@ -59,6 +59,7 @@ function squid_xmlrpc_sync()
|
||||
'description' => gettext('Web Proxy'),
|
||||
'section' => 'OPNsense.proxy',
|
||||
'id' => 'squid',
|
||||
'services' => ["squid"],
|
||||
);
|
||||
|
||||
return $result;
|
||||
|
||||
@ -67,6 +67,7 @@ function suricata_xmlrpc_sync()
|
||||
'description' => gettext('Intrusion Detection'),
|
||||
'section' => 'OPNsense.IDS',
|
||||
'id' => 'suricata',
|
||||
'services' => ["suricata"],
|
||||
);
|
||||
|
||||
return $result;
|
||||
|
||||
@ -75,6 +75,7 @@ function unbound_xmlrpc_sync()
|
||||
'description' => gettext('Unbound DNS'),
|
||||
'section' => 'unbound,OPNsense.unboundplus',
|
||||
'id' => 'dnsresolver',
|
||||
'services' => ["unbound"],
|
||||
);
|
||||
|
||||
return $result;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user