Functionally this shouldn't change anything, but when building additional handlers, it's practical to show priorities of the ones that are registered.
To use the list action, simply call:
./blocklists.py list
Goes over the previous change by calling the reboot only once
instead of three times:
Here we are told there are upgrades pending and the upgrade hooks
were returning successfully. Apply the kernel immediately if
necessary to save a reboot. Contrary to popular belief the kernel
can still apply during a reboot if something went wrong, but this
way we save a reboot. After that don't question that a reboot is
necessary to avoid ever falling into the error case for no reason.
findNodeById() is not needed as findNodeByPath() does the same.
It's also not used anywhere else so just merge both.
On the system end make a getItem() which makes the code a little
cleaner and reduces callers of findNodeByPath() to one. ;)
One of the main issues with our previous bectl output was the variance of the (uuid) key, which we generated using the current name.
By using the create timestamp (acquired via zfs), we can keep our key stable on renames and offer access to simple json files on disk which contain additional notes.
Notes are stored in /conf/snapshots/ as json files, keyed by their generated uuid's.
* bootgrid: batch delete-selected by default
* ApiMutableModelControllerBase - simplify checkAndThrowSafeDelete in delBase a bit for https://github.com/opnsense/core/pull/9779
* use a descriptive name if available
---------
Co-authored-by: Ad Schellevis <ad@opnsense.org>
fw_log.volt:
Uses a url hash inside fw_log.volt to set a filter when opening it through a link from filter_rule.volt
The url hash can set any type of a single filter, so it can be reused in other pages as well.
Combine entry point of addCombinedFilter and addFilter, decide via array in field what type it is.
Change init entrypoint to always go through the filterChange() pipeline, but have a fast path in there that initializes without a filter. This adds the filter immediately when loading with the page with the URL hash
Make sure we want for tableBuilt to prevent replaceData errors
filter_rule.volt
Only show the log search button when row.log is 1 or true
Change fa icon in the lookup rule reference button in dnat as well for consistency
Use URLSearchParams()
---------
Co-authored-by: Stephan de Wit <stephan.de.wit@deciso.com>
Since ea75da8a this is no longer necessary although the introduction
in 039ae3c19 states that this was happening and allegedly helping.
Pre-upgrade runs this as well as the cleanup audit if it's needed
manually.
Catch empty lines. A single "," will generate
an empty string instead of NULL so we are good
here. It's safe to assume we have at least one
property in the line, otherwise the data is
useless to us anyway.
From the fgetcsv() manual:
A blank line in a CSV file will be returned as an array
comprising a single null field, and will not be treated
as an error.
See: https://www.php.net/manual/en/function.fgetcsv.php
The footer commands weren't taking into account the required properties, rendering unlinked buttons where they shouldn't be (e.g. in dnsmasq DHCP ranges etc.).
Take this opportunity to clean up and improve some front-end code, including batching of enable/disable-selected API calls. The arbitrary default limit of "40" has been set based on (40 * 36-character UUID + ~150-character URI out of a 2k URI character limit).
In the controller, change how rows are collected (use getNodeByReference only for rootnode) to save some cycles, throw an error if someone tries to swap multiple records at once as that is less likely intentional anyway (explicit on/off are acceptable values) and keep simplified result output.
Reference: https://forum.opnsense.org/index.php?topic=50806.0
---------
Co-authored-by: Ad Schellevis <ad@opnsense.org>
The static option list caching mechanism is now invoked over a
nonexistant config.xm; caching no interfaces for the "*" static
options key. In order to fix that add a reset for the list.
Would be nicer to move reset to BaseListField since a number
of fields use the static option list for caching but they all
define their own.
The tests aren't complete but they do cover parseReplaceSimple()
in its latest form so that's good enough.
Just as a note the tests are designed to be render-agnostic so
that we always start with our rule input and produce pf.conf
compatible rulesets with the tests. There are two purposes here:
1. Catch regressions when parsers are changed and that also includes
switching the parser implementation completely in the future.
2. Make sure that the files are actually compilable by pf.conf and
this should be covered later (the conf files are there on the
disk for that purpose).
This is the right type of testing for the purpose since the pf.conf
syntax is virtually static and will require little maintenance.
Just needs a lot more coverage for the missing features/rule types.
When uploading a file results in validation messages, add a download button to dump the results into a csv file as well.
Since our javascript code doesn't translate very well, only add an icon and skip the title text for simplicity.
The test already revealed an issue with the refactor:
replacing "any" with "" and then "" with "in" is not in
the interest of the inventor. Fix follows.