Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces 'Whitelist' with 'Allowlist' #8305

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cwmoriarty
Copy link

Built and tested on

OPNsense 25.1.r_38-amd64
FreeBSD 14.2-RELEASE
OpenSSL 3.0.15

@cwmoriarty
Copy link
Author

@fichtner For your review, per 8298

@@ -60,7 +60,7 @@ public function updateBlocklistAction()

// strip off any trailing dot
$value = rtrim($domain, '.');
$wl = explode(',', (string)$mdl->dnsbl->whitelists);
$wl = explode(',', (string)$mdl->dnsbl->allowlists);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$wl could have been changed to $al too, I guess.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is the thing I was afraid of: changing model field names forces data loss for everyone using the feature

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch.

@fichtner fichtner self-assigned this Feb 11, 2025
<id>unbound.dnsbl.whitelists</id>
<label>Whitelist Domains</label>
<id>unbound.dnsbl.allowlists</id>
<label>Allowlist Domains</label>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start with the label only...

<type>select_multiple</type>
<style>tokenize</style>
<allownew>true</allownew>
<help>List of domains to whitelist. You can use regular expressions.</help>
<help>List of domains to allowlist. You can use regular expressions.</help>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and the help text.

@@ -37,7 +37,7 @@ class DefaultBlocklistHandler(BaseBlocklistHandler):
def __init__(self):
super().__init__('/usr/local/etc/unbound/unbound-blocklists.conf')
self.priority = 100
self._whitelist_pattern = self._get_excludes()
self._allowlist_pattern = self._get_excludes()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the changes in this script are likely ok

@@ -85,9 +85,9 @@ custom_{{loop.index}}={{uri}}
[exclude]
# exclude localhost entries
default_pattern_1=.*localhost$
{% if not helpers.empty('OPNsense.unboundplus.dnsbl.whitelists')%}
{% if not helpers.empty('OPNsense.unboundplus.dnsbl.allowlists')%}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model changes again here and below

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, will remove.

@@ -75,7 +75,7 @@ public function totalsAction($maximum)
}
}

$parsed['whitelisted_domains'] = array_keys($nodes['dnsbl']['whitelists']);
$parsed['allowlisted_domains'] = array_keys($nodes['dnsbl']['allowlists']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return key is ok access key is difficult, GUI changes are probably ok either way

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, I'll remove.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants