Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Dansguardian safesearch regex

    Scheduled Pinned Locked Moved pfSense Packages
    11 Posts 4 Posters 6.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      bilbo
      last edited by

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

      Many thanks.  :)

      1 Reply Last reply Reply Quote 0
      • marcellocM
        marcelloc
        last edited by

        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&"
        

        Treinamentos de Elite: http://sys-squad.com

        Help a community developer! ;D

        1 Reply Last reply Reply Quote 0
        • B
          bilbo
          last edited by

          Thankyou

          here's Bing

          BING Add &adlt=strict

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

          1 Reply Last reply Reply Quote 0
          • R
            rjcrowder
            last edited by

            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?

            1 Reply Last reply Reply Quote 0
            • marcellocM
              marcelloc
              last edited by

              What you get on browser url rewrite test?

              Treinamentos de Elite: http://sys-squad.com

              Help a community developer! ;D

              1 Reply Last reply Reply Quote 0
              • R
                rjcrowder
                last edited by

                @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?

                1 Reply Last reply Reply Quote 0
                • B
                  bilbo
                  last edited by

                  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.

                  1 Reply Last reply Reply Quote 0
                  • R
                    rjcrowder
                    last edited by

                    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?

                    1 Reply Last reply Reply Quote 0
                    • B
                      bilbo
                      last edited by

                      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".

                      1 Reply Last reply Reply Quote 0
                      • R
                        rjcrowder
                        last edited by

                        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.

                        1 Reply Last reply Reply Quote 0
                        • Y
                          yadavkishor
                          last edited by

                          Please have a look
                          http://kishorkumaryadav.blogspot.in/2016/08/how-to-enable-google-safesearch-on.html

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.