Firewall: Rules - fix query performance issue caused by https://github.com/opnsense/core/commit/18533b4c60c27253f8c2ebbdfd9bc11d6450da1d
Always showing automatic rules has quite some performance impact, since we need to initialize the plugin system, we can't really speedup that part of the process.
This commit changes the view to show the currently active rules instead of calculating how it would look like after apply, in order to reach that state, we flush the non-mvc rules to /tmp/rules_internal.json which the list_non_mvc_rules.php can use to render the automatic (and legacy) rules quickly.
System: Routes: Configuration - add StaticRoute::installedRoutes to collect relevant routes for https://github.com/opnsense/core/issues/10569
Extracted "normalized" routes from our current routing table, ignoring link routes
(work in progress)
Firewall: Aliases - squeeze some extra performance out of the dynamic captive portal aliases, the getConfigNode() works but still costs a bit more than I'm willing to spend.
The downside from direct config access is that we need to keep track locations in multiple spots, but since it's highly unlikely these locations will change, it's probably better to save some cpu cycles.
Firewall: Aliases - fix performance regression introduced in https://github.com/opnsense/core/pull/8368
The captive portal model is quite expensive to construct and for our aliases we only require the data underneath.
This commit organizes a couple of things, first implement an easier handle to load a random model from disk to test:
```
Config::getInstance()->forceReload('/path/to/test/config.xml');
$before = memory_get_usage();
$start = hrtime(true);
$mdl = new \OPNsense\Firewall\Alias(true);
printf(
"Alias: %.2f ms, retained PHP memory: %.2f MiB\n",
(hrtime(true) - $start) / 1e6,
(memory_get_usage() - $before) / 1048576
);
```
[4 lines not shown]
Firewall: Aliases - fix performance regression introduced in https://github.com/opnsense/core/pull/8368
The captive portal model is quite expensive to construct and for our aliases we only require the data underneath.
This commit organizes a couple of things, first implement an easier handle to load a random model from disk to test:
```
Config::getInstance()->forceReload('/path/to/test/config.xml');
$before = memory_get_usage();
$start = hrtime(true);
$mdl = new \OPNsense\Firewall\Alias(true);
printf(
"Alias: %.2f ms, retained PHP memory: %.2f MiB\n",
(hrtime(true) - $start) / 1e6,
(memory_get_usage() - $before) / 1048576
);
```
[4 lines not shown]
sysutils/sftp-backup - set identity ownership to wwwonly:wheel to allow the frontend to send these backups. closes https://github.com/opnsense/plugins/issues/5809
Eventually we need to replace diag_backup.php, but for now we should make sure ownership matches reality. From a security perspective this doesn't make much of a difference as the config file is readable from the UI anyway.
Existing setups should remove the identity file (rm /conf/backup/sftp/identity) in order to get it recreated with proper ownership
unbound: CSV import for overrides and aliases. Closes https://github.com/opnsense/core/issues/8354
Since we added the "quick" alias add/delete options from the overrides,
the data layout has been made flat enough to do this in bulk.
health: use logarithmic mbuf reporting, separate formatting responsibilities
Let the y-axis use compact metric formatting such as 10K or 1M.
Since a tooltip should be able to contain more detailed information, allow
separation through a tooltip_formats structure.