URL Filter: Drop Safe Search feature
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Apr 2019 16:06:08 +0000 (17:06 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 May 2019 03:16:39 +0000 (04:16 +0100)
This is not working for quite some time now because all search
engines have moved over to HTTPS. Therefore we no longer can
manipulate the URL query string.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
doc/language_issues.de
doc/language_issues.en
doc/language_issues.es
doc/language_issues.fr
doc/language_issues.it
doc/language_issues.nl
doc/language_issues.pl
doc/language_issues.ru
doc/language_issues.tr
html/cgi-bin/urlfilter.cgi

index 0a8b93a..6bc94f7 100644 (file)
@@ -707,6 +707,7 @@ WARNING: translation string unused: uptime and users
 WARNING: translation string unused: urlfilter background image
 WARNING: translation string unused: urlfilter background text
 WARNING: translation string unused: urlfilter enable jpeg
+WARNING: translation string unused: urlfilter safesearch
 WARNING: translation string unused: urlfilter update information
 WARNING: translation string unused: urlfilter update notification
 WARNING: translation string unused: urlfilter update results
index bc41cfe..8cc1043 100644 (file)
@@ -1989,7 +1989,6 @@ WARNING: untranslated string: urlfilter restore results = Restore results
 WARNING: untranslated string: urlfilter restore settings = Restore URL filter settings
 WARNING: untranslated string: urlfilter restore success = URL filter configuration has been restored. The URL filter must be restarted to activate the new settings.
 WARNING: untranslated string: urlfilter restore text = To restore a previously saved configuration upload the .tar.gz backup file below
-WARNING: untranslated string: urlfilter safesearch = Enable SafeSearch
 WARNING: untranslated string: urlfilter sat = S
 WARNING: untranslated string: urlfilter saturday = Sat
 WARNING: untranslated string: urlfilter save and restart = Save and Restart
index 676e550..5e3467e 100644 (file)
@@ -631,6 +631,7 @@ WARNING: translation string unused: uptime and users
 WARNING: translation string unused: urlfilter background image
 WARNING: translation string unused: urlfilter background text
 WARNING: translation string unused: urlfilter enable jpeg
+WARNING: translation string unused: urlfilter safesearch
 WARNING: translation string unused: urlfilter update information
 WARNING: translation string unused: urlfilter update notification
 WARNING: translation string unused: urlfilter update results
index 8226846..4af8190 100644 (file)
@@ -747,6 +747,7 @@ WARNING: translation string unused: uptime and users
 WARNING: translation string unused: urlfilter background image
 WARNING: translation string unused: urlfilter background text
 WARNING: translation string unused: urlfilter enable jpeg
+WARNING: translation string unused: urlfilter safesearch
 WARNING: translation string unused: urlfilter update information
 WARNING: translation string unused: urlfilter update notification
 WARNING: translation string unused: urlfilter update results
index 4156ed5..dce4889 100644 (file)
@@ -720,6 +720,7 @@ WARNING: translation string unused: uptime and users
 WARNING: translation string unused: urlfilter background image
 WARNING: translation string unused: urlfilter background text
 WARNING: translation string unused: urlfilter enable jpeg
+WARNING: translation string unused: urlfilter safesearch
 WARNING: translation string unused: urlfilter update information
 WARNING: translation string unused: urlfilter update notification
 WARNING: translation string unused: urlfilter update results
index 8f41d20..9dfe2f9 100644 (file)
@@ -715,6 +715,7 @@ WARNING: translation string unused: uptime and users
 WARNING: translation string unused: urlfilter background image
 WARNING: translation string unused: urlfilter background text
 WARNING: translation string unused: urlfilter enable jpeg
+WARNING: translation string unused: urlfilter safesearch
 WARNING: translation string unused: urlfilter update information
 WARNING: translation string unused: urlfilter update notification
 WARNING: translation string unused: urlfilter update results
index 676e550..5e3467e 100644 (file)
@@ -631,6 +631,7 @@ WARNING: translation string unused: uptime and users
 WARNING: translation string unused: urlfilter background image
 WARNING: translation string unused: urlfilter background text
 WARNING: translation string unused: urlfilter enable jpeg
+WARNING: translation string unused: urlfilter safesearch
 WARNING: translation string unused: urlfilter update information
 WARNING: translation string unused: urlfilter update notification
 WARNING: translation string unused: urlfilter update results
index 11a4244..2748723 100644 (file)
@@ -634,6 +634,7 @@ WARNING: translation string unused: uptime and users
 WARNING: translation string unused: urlfilter background image
 WARNING: translation string unused: urlfilter background text
 WARNING: translation string unused: urlfilter enable jpeg
+WARNING: translation string unused: urlfilter safesearch
 WARNING: translation string unused: urlfilter update information
 WARNING: translation string unused: urlfilter update notification
 WARNING: translation string unused: urlfilter update results
index 297901f..7891e53 100644 (file)
@@ -748,6 +748,7 @@ WARNING: translation string unused: uptime and users
 WARNING: translation string unused: urlfilter background image
 WARNING: translation string unused: urlfilter background text
 WARNING: translation string unused: urlfilter enable jpeg
+WARNING: translation string unused: urlfilter safesearch
 WARNING: translation string unused: urlfilter update information
 WARNING: translation string unused: urlfilter update notification
 WARNING: translation string unused: urlfilter update results
index c3c327e..28ffc81 100644 (file)
@@ -138,7 +138,6 @@ $filtersettings{'BLOCK_IP_ADDR'} = 'off';
 $filtersettings{'BLOCK_ALL'} = 'off';
 $filtersettings{'ENABLE_EMPTY_ADS'} = 'off';
 $filtersettings{'ENABLE_GLOBAL_WHITELIST'} = 'off';
-$filtersettings{'ENABLE_SAFESEARCH'} = 'off';
 $filtersettings{'ENABLE_LOG'} = 'off';
 $filtersettings{'ENABLE_USERNAME_LOG'} = 'off';
 $filtersettings{'ENABLE_CATEGORY_LOG'} = 'off';
@@ -1057,9 +1056,6 @@ $checked{'ENABLE_EMPTY_ADS'}{$filtersettings{'ENABLE_EMPTY_ADS'}} = "checked='ch
 $checked{'ENABLE_GLOBAL_WHITELIST'}{'off'} = '';
 $checked{'ENABLE_GLOBAL_WHITELIST'}{'on'} = '';
 $checked{'ENABLE_GLOBAL_WHITELIST'}{$filtersettings{'ENABLE_GLOBAL_WHITELIST'}} = "checked='checked'";
-$checked{'ENABLE_SAFESEARCH'}{'off'} = '';
-$checked{'ENABLE_SAFESEARCH'}{'on'} = '';
-$checked{'ENABLE_SAFESEARCH'}{$filtersettings{'ENABLE_SAFESEARCH'}} = "checked='checked'";
 $checked{'ENABLE_LOG'}{'off'} = '';
 $checked{'ENABLE_LOG'}{'on'} = '';
 $checked{'ENABLE_LOG'}{$filtersettings{'ENABLE_LOG'}} = "checked='checked'";
@@ -1473,21 +1469,17 @@ print <<END
        <td width='25%' class='base'>$Lang::tr{'urlfilter enable log'}:</td>
        <td><input type='checkbox' name='ENABLE_LOG' $checked{'ENABLE_LOG'}{'on'} /></td>
 </tr>
-<tr>
-       <td class='base'>$Lang::tr{'urlfilter safesearch'}:</td>
-       <td><input type='checkbox' name='ENABLE_SAFESEARCH' $checked{'ENABLE_SAFESEARCH'}{'on'} /></td>
-       <td class='base'>$Lang::tr{'urlfilter username log'}:</td>
-       <td><input type='checkbox' name='ENABLE_USERNAME_LOG' $checked{'ENABLE_USERNAME_LOG'}{'on'} /></td>
-</tr>
 <tr>
        <td class='base'>$Lang::tr{'urlfilter empty ads'}:</td>
        <td><input type='checkbox' name='ENABLE_EMPTY_ADS' $checked{'ENABLE_EMPTY_ADS'}{'on'} /></td>
-       <td class='base'>$Lang::tr{'urlfilter category log'}:</td>
-       <td><input type='checkbox' name='ENABLE_CATEGORY_LOG' $checked{'ENABLE_CATEGORY_LOG'}{'on'} /></td>
+       <td class='base'>$Lang::tr{'urlfilter username log'}:</td>
+       <td><input type='checkbox' name='ENABLE_USERNAME_LOG' $checked{'ENABLE_USERNAME_LOG'}{'on'} /></td>
 </tr>
 <tr>
        <td class='base'>$Lang::tr{'urlfilter block ip'}:</td>
        <td><input type='checkbox' name='BLOCK_IP_ADDR' $checked{'BLOCK_IP_ADDR'}{'on'} /></td>
+       <td class='base'>$Lang::tr{'urlfilter category log'}:</td>
+       <td><input type='checkbox' name='ENABLE_CATEGORY_LOG' $checked{'ENABLE_CATEGORY_LOG'}{'on'} /></td>
 </tr>
 <tr>
        <td class='base'>$Lang::tr{'urlfilter block all'}:</td>
@@ -2834,47 +2826,15 @@ sub writeconfigfile
                }
        }
 
-       if ((($filtersettings{'ENABLE_REWRITE'} eq 'on') && (@repositoryfiles)) || ($filtersettings{'ENABLE_SAFESEARCH'} eq 'on'))
-       {
+       if (($filtersettings{'ENABLE_REWRITE'} eq 'on') && (@repositoryfiles)) {
                print FILE "rewrite rew-rule-1 {\n";
 
-               if (($filtersettings{'ENABLE_REWRITE'} eq 'on') && (@repositoryfiles))
-               {
-                       print FILE "    # rewrite localfiles\n";
-                       foreach (@repositoryfiles)
-                       {
-                               print FILE "    s@.*/$_\$\@http://$netsettings{'GREEN_ADDRESS'}:$http_port/repository/$_\@i\n";
-                       }
-               }
-
-               if ($filtersettings{'ENABLE_SAFESEARCH'} eq 'on')
+               print FILE "    # rewrite localfiles\n";
+               foreach (@repositoryfiles)
                {
-                       print FILE "    # rewrite safesearch\n";
-                       print FILE "    s@(.*\\Wgoogle\\.\\w+/(webhp|search|imghp|images|grphp|groups|nwshp|frghp|froogle)\\?)(.*)(\\bsafe=\\w+)(.*)\@\\1\\3safe=strict\\5\@i\n";
-                       print FILE "    s@(.*\\Wgoogle\\.\\w+/(webhp|search|imghp|images|grphp|groups|nwshp|frghp|froogle)\\?)(.*)\@\\1safe=strict\\\&\\3\@i\n";
-                       print FILE "    s@(.*\\Wsearch\\.yahoo\\.\\w+/search\\W)(.*)(\\bvm=\\w+)(.*)\@\\1\\2vm=r\\4\@i\n";
-                       print FILE "    s@(.*\\Wsearch\\.yahoo\\.\\w+/search\\W.*)\@\\1\\\&vm=r\@i\n";
-                       print FILE "    s@(.*\\Walltheweb\\.com/customize\\?)(.*)(\\bcopt_offensive=\\w+)(.*)\@\\1\\2copt_offensive=on\\4\@i\n";
-                       print FILE "    s@(.*\\Wbing\\.\\w+/)(.*)(\\badlt=\\w+)(.*)\@\\1\\2adlt=strict\\4\@i\n";
-                       print FILE "    s@(.*\\Wbing\\.\\w+/.*)\@\\1\\\&adlt=strict\@i\n";
+                       print FILE "    s@.*/$_\$\@http://$netsettings{'GREEN_ADDRESS'}:$http_port/repository/$_\@i\n";
                }
-
                print FILE "}\n\n";
-
-               if ((!($filtersettings{'UNFILTERED_CLIENTS'} eq '')) && ($filtersettings{'ENABLE_SAFESEARCH'} eq 'on')) {
-                       print FILE "rewrite rew-rule-2 {\n";
-                       if (($filtersettings{'ENABLE_REWRITE'} eq 'on') && (@repositoryfiles))
-                       {
-                               print FILE "    # rewrite localfiles\n";
-                               foreach (@repositoryfiles)
-                               {
-                                       print FILE "    s@.*/$_\$\@http://$netsettings{'GREEN_ADDRESS'}:$http_port/repository/$_\@i\n";
-                               }
-                       } else {
-                               print FILE "    # rewrite nothing\n";
-                       }
-                       print FILE "}\n\n";
-               }
        }
 
        if (!($filtersettings{'UNFILTERED_CLIENTS'} eq '')) {
@@ -3083,10 +3043,6 @@ sub writeconfigfile
        if (!($filtersettings{'UNFILTERED_CLIENTS'} eq '')) {
                print FILE "    unfiltered {\n";
                print FILE "        pass all\n";
-               if ($filtersettings{'ENABLE_SAFESEARCH'} eq 'on')
-               {
-                       print FILE "        rewrite rew-rule-2\n";
-               }
                print FILE "    }\n\n";
        }
        if (!($filtersettings{'BANNED_CLIENTS'} eq '')) {
@@ -3215,7 +3171,7 @@ sub writeconfigfile
                        print FILE "        logfile".$ident." urlfilter.log\n";
                }
        }
-       if ((($filtersettings{'ENABLE_REWRITE'} eq 'on') && (@repositoryfiles)) || ($filtersettings{'ENABLE_SAFESEARCH'} eq 'on'))
+       if (($filtersettings{'ENABLE_REWRITE'} eq 'on') && (@repositoryfiles))
        {
                print FILE "        rewrite rew-rule-1\n";
        }