Dansguardian safesearch regex



  • Would someone please be so kind as to provide their current working url modifying safesearch regular expressions for Dansguardian please?

    Many thanks.  :)



  • I have these ones but I've tested only google without ssl

    "(^http://[0-9a-z]+\.google\.[a-z]+[-/%.0-9a-z]*/\?)(.*)(&?)(safe=[^&]*)"->"\1\2\3"
    # ... and add 'safe=vss'
    "(^http://[0-9a-z]+\.google\.[a-z]+[-/%.0-9a-z]*/\?)"->"\1safe=vss&"
    
    "([a-z]*\.google\..*)(&q=.*)"->"\1&safe=vss\2"
    "([a-z]*\.google\..*)(\?)(q=.*)"->"\1?safe=vss&\3"
    
    # Singingfish - remove 'ff=...' and add 'ff=1'
    "(^http://search\.singingfish\.com/[-/%.0-9a-z]*\?)(.*)(&?)(ff=[^&]*)"->"\1\2\3"
    
    "(^http://search\.singingfish\.com/[-/%.0-9a-z]*\?)"->"\1ff=1&"
    
    # Ilse - remove 'family=...' and add 'family=yes'
    "(^http://www\.ilse\.nl/searchresults\.dbl\?)(.*)(&?)(family=[^&]*)"->"\1\2\3"
    "(^http://www\.ilse\.nl/searchresults\.dbl\?)"->"\1family=yes&"
    
    # KEL - remove 'Realm%3AErotiek=...'
    "(^http://www\.kel\.nl/search/search.cgi\?)(.*)(&?)(Realm%3AErotiek=[^&]*)"->"\1\2\3"
    
    # Lycos.com - family filter only available in advanced mode.
    # Remove 'adv=...' and 'adf=...' and add 'adv=1&adf=on'
    "(^http://[^/]*search[^/]*\.lycos\.com/[-/%.0-9a-z]*\?)(.*)(&?)(adv=[^&]*)"->"\1\2\3"
    "(^http://[^/]*search[^/]*\.lycos\.com/[-/%.0-9a-z]*\?)(.*)(&?)(xadult\.)(.*)(xadult\.)"->"\1\2\3\5"
    "(^http://[^/]*search[^/]*\.lycos\.com/[-/%.0-9a-z]*\?)"->"\1adv=1&adf=on&"
    
    # Lycos.nl - remove 'family=...' and add 'family=on'
    "(^http://zoek\.lycos\.nl/[-/%.0-9a-z]*\?)(.*)(&?)(family=[^&]*)"->"\1\2\3"
    "(^http://zoek\.lycos\.nl/[-/%.0-9a-z]*\?)"->"\1family=on&"
    
    # Alltheweb - change the customize url so that 'offensive' cannot be turned off
    "(^http://www\.alltheweb\.com/customize\?)(.*)(&?)(copt_offensive=[^&]*)"->"\1\2\3copt_offensive=on"
    
    # Yahoo - remove 'vm=...' and add 'vm=r'
    "(^http://[.0-9a-z]+\.yahoo\.[a-z]+[-/%.0-9a-z]*/search)(.*)(&?)(vm=[^&]*)"->"\1\2\3"
    "(^http://[.0-9a-z]+\.yahoo\.[a-z]+[-/%.0-9a-z]*/search+.*\?)"->"\1vm=r&"
    
    # Hotbot - remove 'adf=...' and add 'adf=on'
    "(^http://[0-9a-z]+\.hotbot\.[a-z]+/default\.asp\?)(.*)(&?)(adf=[^&]*)"->"\1\2\3"
    "(^http://[0-9a-z]+\.hotbot\.[a-z]+/default\.asp\?)"->"\1adf=on&"
    
    # Wisenut - change the customize url so that 'wisepatrol' cannot be turned off
    "(^http://www\.wisenut\.com/preferences/savePreferences\.[^?]*\?)(.*)(&?)(wisepatrol=[^&]*)"->"\1\2\3wisepatrol=1"
    
    # Metacrawler - remove 'familyfilter=...' and add 'familyfilter=1'
    "(^http://www\.metacrawler\.com/info\.metac/search/[-/%.0-9a-z]*\?)(.*)(&?)(familyfilter=[^&]*)"->"\1\2\3"
    "(^http://www\.metacrawler\.com/info\.metac/search/[-/%.0-9a-z]*\?)"->"\1familyfilter=1&"
    


  • Thankyou

    here's Bing

    BING Add &adlt=strict

    "(^http://.+.bing.[a-z]+[-/%.0-9a-z]/.$)"->"\1&adlt=strict"



  • This is probably going to sound stupid… but I just figured out I'm not getting any log entries for URLMOD... which likely means that none of my URL rewrite rules are actually working.

    Shouldn't they be showing up in the dansguardian access.log?



  • What you get on browser url rewrite test?



  • @marcelloc:

    What you get on browser url rewrite test?

    Well… For Google I don't see the "safe=off" being added to the URL. Is that the best way to test it? just view the URL query string and see if it is being modified?



  • I just do a search for a bad word and google will come back with 0 results and say it is due to safesearch being activated.



  • What if safesearch is "off" in your google settings (in options/search settings)? Does it still force safe search? If so, do you see a "CONTENTMOD" entry in your dansguardian access log?



  • Yes, with safesearch off in google settings it is still forced with dg  in conjunction with the google no ssl trick, the kids cannot bring up horrible images anymore.

    No, cant see "CONTENTMOD".



  • In case anyone's interested, I figured out why my URL modifications were not working… I was using a custom compiled version of dansguardian (see this thread https://forum.pfsense.org/index.php/topic,61811.msg339655.html#msg339655) that apparently does not have PCRE support. I went back to the 2.12.03. version and all seems to be working.




Log in to reply