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

ref #4392 - fix squid black list not showing categories #4440

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@
<Mask>/^([\t\n\v\f\r 0-9a-zA-Z.,_\x{00A0}-\x{FFFF}]){1,255}$/u</Mask>
</password>
<filter type="JsonKeyValueStoreField">
<ConfigdPopulateAct>blacklist categories list</ConfigdPopulateAct>
Copy link
Member

Choose a reason for hiding this comment

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

I don't think a configd action named blacklist exists.... easy to try using configctl blacklist categories list on a console. These %s.index files are created as a result from the download, triggered by fetchACLs.py:

[fetchacls]
command:
/usr/local/bin/flock -n -E 0 -o /tmp/fetchACLs.lock /usr/local/opnsense/scripts/proxy/fetchACLs.py && (
/usr/local/sbin/pluginctl -c webproxy reload;
/usr/local/etc/rc.d/squid reload
)
parameters:
type:script
message:download and reload proxy ACLs from remote locations
description:Download and reload external proxy ACLs
[downloadacls]
command:/usr/local/bin/flock -n -E 0 -o /tmp/fetchACLs.lock /usr/local/opnsense/scripts/proxy/fetchACLs.py
parameters:
type:script
message:download proxy ACLs from remote locations
description:Download external proxy ACLs

with open('%s.index' % target_filename, 'w', buffering=10240) as idx_out:

Copy link
Author

Choose a reason for hiding this comment

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

Ok but if "ConfigdPopulateAct" is not set, the list is not populated.

In file /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/JsonKeyValueStoreField.php line 126 :
if (!empty($this->internalConfigdPopulateAct)) { code populate list only if variable internalConfigdPopulateAct is not empty.

So set this variable in XML makes the code working.

A better solution would perhaps be to correct the file /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/JsonKeyValueStoreField.php.

Copy link
Member

Choose a reason for hiding this comment

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

@abonanni it looks like a regression in opnsense/core@525481c, previously a callout was not required. If you open a ticket in core, I'll take a look.

<SourceField>filename</SourceField>
<SourceFile>/usr/local/etc/squid/acl/%s.index</SourceFile>
<SelectAll>Y</SelectAll>
Expand Down