Giter Site home page Giter Site logo

pss's Introduction

WARNING

There is a new beta version of Pi-hole which may interfere with the capabilites of this script. I will check into this and see if PSS will work! Until then, keep posted!

Special Thanks To

Barry Quiel for fixing the Python version. This may be the future of PSS!

SafeSearch for Pi-hole

Pi-hole Logo

Supported Search Engines

Google Logo

DuckDuckGo Logo

Bing Logo

Installation

To install Pi-hole SafeSearch (PSS), simply run the following commands in your pi-hole terminal (log into pi with ssh; pi hole should be set up and running).

  1. Download the Pi-hole SafeSearch script:

    wget https://raw.githubusercontent.com/jaykepeters/PSS/master/Pi-hole_SafeSearch.sh

  2. Move the script.

    sudo mv ./Pi-hole_SafeSearch.sh /usr/local/bin/

  3. Make the script executable.

    sudo chmod a+x /usr/local/bin/Pi-hole_SafeSearch.sh

  4. Enable Pi-hole SafeSearch:

    sudo Pi-hole_SafeSearch.sh -e

How to enable SafeSearch via the Pi-hole Admin Interface (v5.0+)

  1. Click on the "Custom DNS Tab"
  2. For every provider you want, type in their domain name and SAFE IP addresses.
  • Google is tricky because they have some 300 top-level domains, so users could bypass SafeSearch by going to google.ca in the us, etc.
  • Bing, DuckDuckGo, and other providers should be fine. You want to make sure to add the www, as well as non-www variants for those search providers. Duck.com also redirects to duckduckgo.com right now as well...

Uninstallation

If you wish to not enforce SafeSearch on your network anymore, please follow the steps below to completely uninstall PSS

  1. Pi-hole_SafeSearch.sh --disable
  2. PSS creates the following files:
  • /var/log/pss.log
  • /etc/pss.ack
  • /tmp/safesearch.txt
  • /etc/dnsmasq.d/05-restrict.conf (Version < 2.0)
  • /etc/dnsmasq.d/SafeSearch.conf
  1. Version 2.1 will have the --uninstall option
  • User has to type y/n to confirm
  • All files will be deleted, including the script

API Draft

  • GET
    • /getStatus
    • /getStatus/{provider}
    • /getStatistics
    • /getStatistics/{provider}
  • POST
    • /enable/{provider}&auth={KEY}
    • /disable/{provider}&auth={KEY}

pss's People

Contributors

jaykepeters avatar quantixed avatar quielb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pss's Issues

Ask.com, altavista.com?

Thanks again for your work. I did not run your scripts as I'm now on 5.0 but I took the info and added the content directly via the web GUI.\

Should you consider adding altavista.com and ask(jeeves).com? These are NOT popular search engines anymore, but may be of use to some enterprising kid trying to get around blacklists.

I am not sure if they have any safe search options- so for now I just put them on the blacklist.

Check out http://www.thesearchenginelist.com/. There's a bunch of internet history on there.

Create YouTube Option/Remove hard-coded variables

Reference

Firstly thanks jaykepters for your efforts in getting Safe Search working with Pi-hole.

I can confirm with samad that you need to append the cname code above to the /etc/dnsmasq.d/05-restrict.conf file for YouTube restriced mode to work.

Looking at jay’s script it appears the conditional code below is not evaluating to “True” so the YouTube domains are not being echoed to the 05-restrict.conf file. I haven’t tested it but removing the “if” statement will allow the for loop to execute and propagate the conf file. Not sure if that helps?

# YouTube SafeSearch 
if [ "$YOUTUBE" == "True" ]; then
    for line in "${ytSS[@]}"
        do echo "$line"  >> "${file}"
    done
fi

Also jay I saw you post requesting a list of search engines so we can block any non Safe Search engines. I think I may have something that might be of use?

Per-Group Filtering

I'm not sure how viable this is from the PSS perspective, and wonder if it might need to be a PiHole thing, but is per-group Safe Mode filtering viable?

Add startpage?

I just installed this on both my piholes, but it is not yet working. Is this because it is cached, and takes time to flush out the duckduckgo address?

Also, is it possible to add startpage to the list?

Thanks !

update for pihole v5

hi,

can we use your script in pihole v5 (beta) or do i need to wait for an update?

youtube.com still in unrestricted mode after installation

I am running pi-hole 5.1.2 and followed the instructions on installing and running the SafeSearch shell script.

Everything completed without errors, however when I browse to youtube.com I am still in unrestricted mode.

Am I missing the obvious? Do I need to start pi-hole to pick up the new 05 config file?

Google Drive getting blocked

Not sure exactly how, but when I apply this, drive.google.com gets blocked.

macbookpro:~ kupan787$ nslookup drive.google.com
;; Got SERVFAIL reply from 2601:204:ca00:f61:8787:7fd6:1b90:23d1, trying next server
;; Got SERVFAIL reply from 2601:204:ca00:f61:62aa:c8c2:e695:fb4b, trying next server
Server:		10.100.1.2
Address:	10.100.1.2#53

** server can't find drive.google.com: SERVFAIL

As soon as I remove what this script did, Google Drive starts working again.

line 48: syntax error near unexpected token

FYI, as of August 27, 2020, the current script 1.6.1 gives this error on a raspberry pi running raspbian buster. Pi-hole v5.1.2

pi@raspberrypi:~ $ sudo Pi-hole_SafeSearch.sh --enable [2020-08-27 14:30:01:998]: Retrieving List from Google [2020-08-27 14:30:03:287]: 191 TLDs [2020-08-27 14:30:03:297]: 382 Domains [2020-08-27 14:30:03:308]: ENABLING SAFESEARCH FOR PI-HOLE [2020-08-27 14:30:03:325]: BLOCKING OTHER BAD SITES /usr/local/bin/Pi-hole_SafeSearch.sh: line 48: syntax error near unexpected token^'
/usr/local/bin/Pi-hole_SafeSearch.sh: line 48: "(^|\.).+xxx$"'

In testing, it looks like line 192 is the one that is failing. If I comment it out, things work.
silently pihole --regex "${REGEX[@]}"

For clarity, here's what the REGEX code is:
REGEX=( "(^|\.).+xxx$" "(^|\.).+sexy$" "(^|\.).+webcam$" "(^|\.).+sex$" "(^|\.).+porn$" "(^|\.).+tube$" "(^|\.).+cam$" "(^|\.).+adult$" )

The log file has this in it:
`pi@raspberrypi:~ $ cat /var/log/Pi-hole_SafeSearch.sh.log
[2020-08-27 14:30:01:984]: STARTED
[2020-08-27 14:30:01:989]: ARGUMENTS: --enable
/usr/local/bin/Pi-hole_SafeSearch.sh: line 118: checkSudo: command not found
[2020-08-27 14:30:01:995]: Retrieving List from Google
[2020-08-27 14:30:03:282]: 191 TLDs
[2020-08-27 14:30:03:292]: 382 Domains
[2020-08-27 14:30:03:303]: ENABLING SAFESEARCH FOR PI-HOLE
[2020-08-27 14:30:03:320]: BLOCKING OTHER BAD SITES
[2020-08-27 14:30:04:083]: STOPPED

`

Sorry for the odd formatting, not sure why it isn't showing the code with the newline/CR.

safe.duckduckgo.com IP address has changed?

Searching with duckduckgo didn't seem to work anymore for me. I checked the NSLookup for safe.duckduckgo.com and the IP is different than the one in the script. I changed it in the script and re-ran the script. It is now working. Thanks for this awesome script!

CNAME support is coming up soon in the next releases of v.5 so it might be good to handle duck duck in the GUI then and only use the script for Google since their are so many domains for it.

https://discourse.pi-hole.net/t/custom-redirects/37272/18

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.