Closed swvalenti194 closed 5 years ago
If you use lighttpd
as your web server, which you most likely do, the script is completely automated.
Execute the following command exactly as it appears below:
cd ~/ && wget -O setup.php https://apps.roen.us/pipass/setup && sudo php setup.php
Ok cool, but now what?
[ / ] DR check... Please enter your web document root. (e.g. /var/www/html)
To determine your web document root, can you run cat /etc/lighttpd/lighttpd.conf
? It's likely /var/www/
y
[ + ] DR check succeeded, now installing PiPass...
[ / ] Getting current php user...
[ + ] Current php user is pi.
[ / ] Building /etc/sudoers line to add...
[ / ] Checking if /etc/sudoers is already set up...
[ / ] /etc/sudoers is already set up... not performing action.
[ / ] Now making sure that your document root folder is clear...
[ + ] In document root... downloading files.
fatal: remote origin already exists.
fatal: Not a git repository (or any of the parent directories): .git
PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /home/pi/setup.php:98
Stack trace:
#0 /home/pi/setup.php(108): get_data('https://apps.ro...')
#1 /home/pi/setup.php(48): install()
#2 /home/pi/setup.php(24): preInstall()
#3 {main}
thrown in /home/pi/setup.php on line 98
``
php7.0-curl
is a prerequisite. To install it, use sudo apt update && sudo apt install php7.0-curl
Ok cool almost there now what?
[ + ] Installation complete. Please set your webserver to redirect all 404 pages to the homepage (web root). This function is not automated yet. [ + ] NOTE: Make sure you fill out config.php or you will get stuck in a redirect loop!
Can you run cat /etc/lighttpd/lighttpd.conf
? Also, determine the local/private IP address of your Raspberry Pi, e.g. 192.168.x.x
``# Pi-hole: A black hole for Internet advertisements
#
#
###############################################################################
###############################################################################
server.modules = ( "mod_access", "mod_accesslog", "mod_auth", "mod_expire", "mod_compress", "mod_redirect", "mod_setenv", "mod_rewrite" )
server.document-root = "/var/www/html" server.error-handler-404 = "index.php" server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/var/run/lighttpd.pid" server.username = "www-data" server.groupname = "www-data" server.port = 80 accesslog.filename = "/var/log/lighttpd/access.log" accesslog.format = "%{%s}t|%V|%r|%s|%b"
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" ) url.access-deny = ( "~", ".inc", ".md", ".yml", ".ini" ) static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
compress.cache-dir = "/var/cache/lighttpd/compress/" compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "find /etc/lighttpd/conf-enabled -name '*.conf' -a ! -name 'letsencrypt.conf' -printf 'include \"%p\"\n' 2>/dev/null"
$HTTP["url"] =~ "^/admin/" {
setenv.add-response-header = (
"X-Pi-hole" => "The Pi-hole Web interface is working!",
"X-Frame-Options" => "DENY"
)
$HTTP["url"] =~ ".ttf$" {
# Allow Block Page access to local fonts
setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
}
}
$HTTP["url"] =~ "^/admin/.(.*)" { url.access-deny = ("") }
include_shell "cat external.conf 2>/dev/null" ``
and pihole is 192.168.0.22
Can you rerun the setup script, but put /var/www/html
in there instead? Also, cd /var/www/ && sudo rm -r index.php config.php blockpage README.md .git setup
to clean up the old files.
After you do that, use your favorite text editor to edit /var/www/html/config.php
and change the blockpage_url
line. Put 192.168.0.22/blockpage
between the quotes on that line.
``<?php /* For your PiPass system to function properly, it's reccomended that you modify all of these variables to appropriate values. An explanation of each variable is listed as a comment below the variable.
NOTE: All PiPass files are dependent upon this one configuration file. Your changes will be widespread! */
$conf['show_tech_info'] = true; // Should usually be set to true, unless you have specific reason to disable // it. Determines whether the program should show technical info.
$conf['blockpage_url'] = "192.168.0.22/blockpage"; // The URL (not directory) of your blockpage. Setting this incorrectly can // lead to SSL certificate SAN errors, which prompt the user that the // connection is "not secure." It's highly reccomended that you change this. // Example: "https://example.com/blockpage/" ``
Added this yet when I got to an ad page I get this...
Feel like I'm there minus a stupid step...
I can see blockpage if go to http://192.168.0.22/blockpage/ but now when on a blocked site
@swvalenti194 It looks like you have the wrong blocking mode set for the Pi-hole. It should be set to IP or IP-NODATA-AAAA.
To set the right mode add
BLOCKINGMODE=IP-NODATA-AAAA
to /etc/pihole/pihole-FTL.conf
Then restart Pi-hole FTLDNS:
sudo killall -SIGHUP pihole-FTL
Now try going to a blocked page and PiPass blockpage should show up.
I did that but still no luck when...can you suggest a link to use to test to see if I get the blockpage?
@swvalenti194 Any page on the blacklist should work (or not if it has HSTS header)...
You can try with adding the bettermotherfuckingwebsite.com
(since it doesn't have HSTS) to the Pi-hole blacklist and then try visiting it.
I added it to pihole but it still doesn't block the site...
I got it all....thanks for time and patience!
I have pihole installed and would like to implement your project however I am not advanced as you are. I noticed that you said the install script is mostly automated. Can you help me on how to install this mostly automated script as the wiki doesn't seem to explain that for me. Do I just run a simple git script and it guides me through the setup and if so what is script? What things do I need to do that doesn't mostly automate if so?
From Reddit:
Thanks, Scott