From 44eaf077b8b931a14870b3ee0078671833041148 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sat, 8 Feb 2025 10:42:55 +0100 Subject: [PATCH] dnsmasq: migrate to MVC/API, dnsmasq supports custom includes as well, let's make sure to signal the user when they exist. for https://github.com/opnsense/core/issues/7905 --- plist | 1 + .../System/Status/DnsmasqOverrideStatus.php | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 src/opnsense/mvc/app/library/OPNsense/System/Status/DnsmasqOverrideStatus.php diff --git a/plist b/plist index a347b3587..49a78e819 100644 --- a/plist +++ b/plist @@ -579,6 +579,7 @@ /usr/local/opnsense/mvc/app/library/OPNsense/System/AbstractStatus.php /usr/local/opnsense/mvc/app/library/OPNsense/System/Status/CrashReporterStatus.php /usr/local/opnsense/mvc/app/library/OPNsense/System/Status/DiskSpaceStatus.php +/usr/local/opnsense/mvc/app/library/OPNsense/System/Status/DnsmasqOverrideStatus.php /usr/local/opnsense/mvc/app/library/OPNsense/System/Status/FirewallStatus.php /usr/local/opnsense/mvc/app/library/OPNsense/System/Status/IPsecOverrideStatus.php /usr/local/opnsense/mvc/app/library/OPNsense/System/Status/LiveMediaStatus.php diff --git a/src/opnsense/mvc/app/library/OPNsense/System/Status/DnsmasqOverrideStatus.php b/src/opnsense/mvc/app/library/OPNsense/System/Status/DnsmasqOverrideStatus.php new file mode 100644 index 000000000..a047a234c --- /dev/null +++ b/src/opnsense/mvc/app/library/OPNsense/System/Status/DnsmasqOverrideStatus.php @@ -0,0 +1,55 @@ +internalPriority = 2; + $this->internalPersistent = true; + $this->internalTitle = gettext('Configuration override'); + $this->internalIsBanner = true; + $this->internalScope[] = '/ui/dnsmasq/*'; + $this->internalScope[] = '/ui/dnsmasq'; + } + + public function collectStatus() + { + if (count(glob('/usr/local/etc/dnsmasq.conf.d/*.conf'))) { + $this->internalMessage = gettext( + 'The configuration contains manual overwrites, these may interfere with the settings configured here.' + ); + $this->internalStatus = SystemStatusCode::NOTICE; + } + } +}