diff --git a/src/etc/inc/plugins.inc b/src/etc/inc/plugins.inc index 7d1d93f7f..4aa5aed9e 100644 --- a/src/etc/inc/plugins.inc +++ b/src/etc/inc/plugins.inc @@ -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']); } } diff --git a/src/etc/inc/plugins.inc.d/core.inc b/src/etc/inc/plugins.inc.d/core.inc index 971483633..f99628cde 100644 --- a/src/etc/inc/plugins.inc.d/core.inc +++ b/src/etc/inc/plugins.inc.d/core.inc @@ -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; } diff --git a/src/etc/inc/plugins.inc.d/dnsmasq.inc b/src/etc/inc/plugins.inc.d/dnsmasq.inc index 5082ce352..69c90ee08 100644 --- a/src/etc/inc/plugins.inc.d/dnsmasq.inc +++ b/src/etc/inc/plugins.inc.d/dnsmasq.inc @@ -81,6 +81,7 @@ function dnsmasq_xmlrpc_sync() 'description' => gettext('Dnsmasq DNS'), 'section' => 'dnsmasq', 'id' => 'dnsforwarder', + 'services' => ["dnsmasq"], ); return $result; diff --git a/src/etc/inc/plugins.inc.d/ipfw.inc b/src/etc/inc/plugins.inc.d/ipfw.inc index e406501e2..faa8dae6d 100644 --- a/src/etc/inc/plugins.inc.d/ipfw.inc +++ b/src/etc/inc/plugins.inc.d/ipfw.inc @@ -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; diff --git a/src/etc/inc/plugins.inc.d/ipsec.inc b/src/etc/inc/plugins.inc.d/ipsec.inc index 828365b0d..f45c2d29e 100644 --- a/src/etc/inc/plugins.inc.d/ipsec.inc +++ b/src/etc/inc/plugins.inc.d/ipsec.inc @@ -333,6 +333,7 @@ function ipsec_xmlrpc_sync() 'description' => gettext('IPsec'), 'section' => 'ipsec', 'id' => 'ipsec', + 'services' => ["strongswan"], ); return $result; diff --git a/src/etc/inc/plugins.inc.d/monit.inc b/src/etc/inc/plugins.inc.d/monit.inc index 508cacb48..7ee6f8787 100644 --- a/src/etc/inc/plugins.inc.d/monit.inc +++ b/src/etc/inc/plugins.inc.d/monit.inc @@ -65,6 +65,7 @@ function monit_xmlrpc_sync() 'description' => gettext('Monit System Monitoring'), 'section' => 'OPNsense.monit', 'id' => 'monit', + 'services' => ["monit"], ); return $result; diff --git a/src/etc/inc/plugins.inc.d/netflow.inc b/src/etc/inc/plugins.inc.d/netflow.inc index a3ff3f534..d323f0a9b 100644 --- a/src/etc/inc/plugins.inc.d/netflow.inc +++ b/src/etc/inc/plugins.inc.d/netflow.inc @@ -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; +} diff --git a/src/etc/inc/plugins.inc.d/openssh.inc b/src/etc/inc/plugins.inc.d/openssh.inc index 6a602ba5c..a6a52ee87 100644 --- a/src/etc/inc/plugins.inc.d/openssh.inc +++ b/src/etc/inc/plugins.inc.d/openssh.inc @@ -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 */ diff --git a/src/etc/inc/plugins.inc.d/openvpn.inc b/src/etc/inc/plugins.inc.d/openvpn.inc index 107f0e696..ca1ed0e2f 100644 --- a/src/etc/inc/plugins.inc.d/openvpn.inc +++ b/src/etc/inc/plugins.inc.d/openvpn.inc @@ -110,6 +110,7 @@ function openvpn_xmlrpc_sync() 'description' => gettext('OpenVPN'), 'section' => 'openvpn', 'id' => 'openvpn', + 'services' => ["openvpn"], ); return $result; diff --git a/src/etc/inc/plugins.inc.d/pf.inc b/src/etc/inc/plugins.inc.d/pf.inc index 47b24ebb3..193f07cb3 100644 --- a/src/etc/inc/plugins.inc.d/pf.inc +++ b/src/etc/inc/plugins.inc.d/pf.inc @@ -178,6 +178,7 @@ function pf_xmlrpc_sync() 'description' => gettext('Firewall Groups'), 'section' => 'ifgroups.ifgroupentry', 'id' => 'ifgroups', + 'services' => ["pf"], ); return $result; diff --git a/src/etc/inc/plugins.inc.d/squid.inc b/src/etc/inc/plugins.inc.d/squid.inc index fdb4fe1c5..cb6574362 100644 --- a/src/etc/inc/plugins.inc.d/squid.inc +++ b/src/etc/inc/plugins.inc.d/squid.inc @@ -59,6 +59,7 @@ function squid_xmlrpc_sync() 'description' => gettext('Web Proxy'), 'section' => 'OPNsense.proxy', 'id' => 'squid', + 'services' => ["squid"], ); return $result; diff --git a/src/etc/inc/plugins.inc.d/suricata.inc b/src/etc/inc/plugins.inc.d/suricata.inc index ec3a676d7..714198c67 100644 --- a/src/etc/inc/plugins.inc.d/suricata.inc +++ b/src/etc/inc/plugins.inc.d/suricata.inc @@ -67,6 +67,7 @@ function suricata_xmlrpc_sync() 'description' => gettext('Intrusion Detection'), 'section' => 'OPNsense.IDS', 'id' => 'suricata', + 'services' => ["suricata"], ); return $result; diff --git a/src/etc/inc/plugins.inc.d/unbound.inc b/src/etc/inc/plugins.inc.d/unbound.inc index 4bd558692..6407d5ebf 100644 --- a/src/etc/inc/plugins.inc.d/unbound.inc +++ b/src/etc/inc/plugins.inc.d/unbound.inc @@ -75,6 +75,7 @@ function unbound_xmlrpc_sync() 'description' => gettext('Unbound DNS'), 'section' => 'unbound,OPNsense.unboundplus', 'id' => 'dnsresolver', + 'services' => ["unbound"], ); return $result;