Services: Captive Portal: Move template actions out of the ServiceController into its own TemplateController, so it can use the ApiMutableModelControllerBase methods
Services: Captive Portal: Move template actions out of the ServiceController into its own TemplateController, so it can use the ApiMutableModelControllerBase methods
backend: allow non-intrusive config_read_array(); closes #9786
When config keys are not found or are not arrays that should
be (especially for iterating with foreach) we do a trick here
by returning a detached empty array to avoid upper layer
errors, forcing empty arrays into $config yet reading and
removal still work fine. The default stays the "insert" mode,
which can be triggered explicitly just for symmetry. Bools
are not in the keys so this is perfectly fine.
The function itself was added in 4c179c23 in 2017 and hasn't
been modified since which is quite the achievement IMO. It's
had a clear purpose but now we make it just a little bit
better. :)
Look for more references at least in the legacy pages:
# git grep 'foreach.($config\[' src/www
interfaces: multi-dhcp6c support and custom PD association #7647
This splits off rtsold and dhcp6c into separate processes
which frees us from the restrictions of faked iterative IDs
for PD associations. For NA we simply default to 0 now.
I'm not entirely sure why we settled for a single deamon of
dhcp6c back in the day, but there are certianly downsides to
it and I don't see something that wasn't fixed in the meantime
that makes this not work.
Firewall: Rules [new]: Reduce complexity in url hash handling and when using firewall_rule_lookup (#9773)
* Reduce complexity of firewall_rule_lookup, we have an all rules entrypoint now, so potentially we could just search for the UUID of the rule without concerning us with interfaces anymore
* Clean up URL hash logic, we only allow #search and #interface now and need no special handling
* Only get the hash once, use it everywhere, re-add missing null fallback and initialized interface variable
* The hash was consumed too early now, fix it by shifting to the new spot where the variable is used last
mvc: collect uuid field so it can be searched, but only if the searchPhrase contains a valid UUID (#9780)
Add UUID to the fields that can be searched, but only if the searchPhrase contains a valid UUID. That way it won't match on partial strings.
* Create new Type class in core library and add isUUID static, replace individual callers with the new static.
* Add a new static function containsUUID() to the new Type class.
* Move searchPhrase tokenization to ApiMutableControllerBase searchBase()
Determine if search_tokens contain a valid UUID, if yes collect the uuid field so it can be searched. Doing this prevents finding partial strings in UUIDs, but allows to find exact UUIDs.
Inside UIModelGrid fetchBindRequest(), use the search_tokens directly. A compatability case makes this backwards compatible for callers that do not know about search_tokens.
Pass the search_tokens directky into UIModelGrid fetch() instead of the raw searchPhrase.
Security: Q-Feeds Connect - add new options as available in integrated blocklists, closes https://github.com/opnsense/plugins/issues/5197
This adds allowlists (regex patterns), source_nets Q-Feeds applies on, address to return and optional NXDOMAIN responses.
Please note this version is only compatible with current community versions, business edition installs will have to wait for 26.4.
Services: Unbound DNS: Blocklists - split logic in update_blocklist() so we can reuse it easily in list_configuration().
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
backend: allow non-intrusive config_read_array() for #9786
When config keys are not found or are not arrays that should
be especially for iterating with foreach we do a trick here
by returning a detached empty array to avoid upper layer
errors, forcing empty arrays into $config yet reading and
removal still work fine. The default stays the "insert" mode,
which can be triggered explicitly just for symmetry. Bools
are not in the keys so this is perfectly fine.
The function was added in 4c179c23 in 2017 and hasn't been
modified since which is quite the achievement IMO. It's
had a clear purpose but now we make it just a little bit
better. :)
Look for more references at least in the legacy pages:
# git grep 'foreach.($config\[' src/www
Move searchPhrase tokenization to ApiMutableControllerBase searchBase()
Determine if search_tokens contain a valid UUID, if yes collect the uuid field so it can be searched. Doing this prevents finding partial strings in UUIDs, but allows to find exact UUIDs.
Inside UIModelGrid fetchBindRequest(), use the search_tokens directly. A compatability case makes this backwards compatible for callers that do not know about search_tokens.
Pass the search_tokens directky into UIModelGrid fetch() instead of the raw searchPhrase.
firmware: restructure upgrade code
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.