Univention Bugzilla – Bug 35908
squid/redirect not usable on UCS
Last modified: 2023-03-25 06:53:33 CET
Please check if a test case is possible. +++ This bug was initially created as a clone of Bug #32429 +++ Support for squid/redirect was merged from UCS@school in UCS 3.0-1. However, the template cannot be used in UCS out of the box. In UCS setting the variable will fail out of the box, since univention-squid doesn't depend on squidguard (in contrast to ucs@school): if configRegistry.get("squid/redirect") == "squidguard": print 'url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf' The template should rather use print 'url_rewrite_program configRegistry['squid/redirect' so that other redirectors can be used as well.
A new script is created with the name "43_proxy/01_squid_redirector_configuration" to test if the written configuration matches the current set ucr variable. configRegistry.get("squid/redirect") == "squidguard" → 'url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf' configRegistry.get("squid/redirect") == "x" → 'url_rewrite_program x' configRegistry.get("squid/redirect") == None → '' (no url_rewrite_program line) Tested for UCS-3.2 & UCS-4.0
The test case failed in Jenkins: Traceback (most recent call last): File "01_squid_redirector_configuration", line 38, in <module> main() File "01_squid_redirector_configuration", line 21, in main config_lines = get_lines_containing(SQUID_CONFIG, 'url_rewrite_program') File "01_squid_redirector_configuration", line 11, in get_lines_containing with open(filename) as input_file: IOError: [Errno 2] No such file or directory: '/etc/squid3/squid.conf' I think it should be checked if univention-squid is installed.
(In reply to Stefan Gohmann from comment #2) > The test case failed in Jenkins: > > Traceback (most recent call last): > File "01_squid_redirector_configuration", line 38, in <module> > main() > File "01_squid_redirector_configuration", line 21, in main > config_lines = get_lines_containing(SQUID_CONFIG, 'url_rewrite_program') > File "01_squid_redirector_configuration", line 11, in get_lines_containing > with open(filename) as input_file: > IOError: [Errno 2] No such file or directory: '/etc/squid3/squid.conf' > > I think it should be checked if univention-squid is installed. Done.
I can not see where squid/redirect is set. We should check if squid/redirect=X results in "url_rewrite_program X" in /etc/squid3/squid.conf with the special case squid/redirect=squidguard (with "url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf" in squid.conf) > "squid/redirect" is now simply the option for "url_rewrite_program" with the > special case "squid/redirect=squidguard", then 'url_rewrite_program /usr/bin > /squidGuard -c /etc/squid/squidGuard.conf' is still used (so we don't break > ucs@school).
(In reply to Felix Botner from comment #4) > I can not see where squid/redirect is set. > > We should check if squid/redirect=X results in "url_rewrite_program X" in > /etc/squid3/squid.conf with the special case squid/redirect=squidguard (with > "url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf" in > squid.conf) > > > "squid/redirect" is now simply the option for "url_rewrite_program" with the > > special case "squid/redirect=squidguard", then 'url_rewrite_program /usr/bin > > /squidGuard -c /etc/squid/squidGuard.conf' is still used (so we don't break > > ucs@school). Script modified to include the mentioned cases. Changelog entry added, package rebuilt.
OK