PiHole (DNS AdWare Filter) not on Yunohost

Après avoir installé Yunohost sans problème (testé sur la version 2.2 et 2.4)j’ai exécuté tout bêtement la commande :

la commande est toujours valide, **NE PAS EXECUTER SUR Yunohost**
parce que lighttpd interfère avec NGINX
the commant still work, but **DON'T USE THIS ON YOUR Yunohost**
lighttpd will broke your NGINX.

curl -L https://install.pi-hole.net | bash

tel que proposé par le site puis ajouté mon Yunohost comme étant un DNS interne.

C’est magique
après plus d’un mois d’utilisation; le seul problème que j’ai rencontré c’est avec des sites j.mp

After installation of pi-hole.net, I can not start nginx.

systemctl status -l nginx.service
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
   Active: failed (Result: exit-code) since Fri 2016-06-10 14:42:42 IST; 25s ago
  Process: 2710 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 2709 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

Jun 10 14:42:39 datamol nginx[2710]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 10 14:42:39 datamol nginx[2710]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Jun 10 14:42:40 datamol nginx[2710]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 10 14:42:40 datamol nginx[2710]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Jun 10 14:42:40 datamol nginx[2710]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 10 14:42:40 datamol nginx[2710]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Jun 10 14:42:41 datamol nginx[2710]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 10 14:42:41 datamol nginx[2710]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Jun 10 14:42:41 datamol nginx[2710]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 10 14:42:41 datamol nginx[2710]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Jun 10 14:42:42 datamol nginx[2710]: nginx: [emerg] still could not bind()
Jun 10 14:42:42 datamol systemd[1]: nginx.service: control process exited, code=exited status=1
Jun 10 14:42:42 datamol systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Jun 10 14:42:42 datamol systemd[1]: Unit nginx.service entered failed state.

And

journalctl -xn
-- Logs begin at Fri 2016-06-10 14:30:43 IST, end at Fri 2016-06-10 14:45:01 IST. --
Jun 10 14:42:41 datamol nginx[2710]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Jun 10 14:42:41 datamol nginx[2710]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 10 14:42:41 datamol nginx[2710]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Jun 10 14:42:42 datamol nginx[2710]: nginx: [emerg] still could not bind()
Jun 10 14:42:42 datamol systemd[1]: nginx.service: control process exited, code=exited status=1
Jun 10 14:42:42 datamol systemd[1]: Failed to start A high performance web server and a reverse proxy server.
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nginx.service has failed.
-- 
-- The result is failed.
Jun 10 14:42:42 datamol systemd[1]: Unit nginx.service entered failed state.
Jun 10 14:45:01 datamol CRON[2716]: pam_unix(cron:session): session opened for user root by (uid=0)
Jun 10 14:45:01 datamol CRON[2717]: (root) CMD (bash /etc/openvpn/yunohost.cron)
Jun 10 14:45:01 datamol CRON[2716]: pam_unix(cron:session): session closed for user root

sudo netstat -ltnp | grep :80 gives me this.

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      936/lighttpd    
tcp        0      0 127.0.0.1:8081          0.0.0.0:*               LISTEN      1967/python     
tcp6       0      0 :::80                   :::*                    LISTEN      936/lighttpd

Hi @kanhu;
Thanks for your feedback and i’m sorry to ear that
apparently lighthttpd remove your nginx or at least take over.

and actually I just try to reproduce the error and it did the same thing to me
so something might change in : https://github.com/pi-hole/pi-hole/blob/master/automated%20install/basic-install.sh

Hi @jodumont
Do you know how to remove PiHole from yunohost ? There is no un-install script.

I strongly advise against installing something like this on yunohost.

  1. “curl -L https://something | bash” is always a bad idea and teach bad security practises https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/
  2. It can’t be uninstalled easily
  3. It modify your network configuration, this can generate conflict with yunohost
  4. It conflict with nginx, as said before

@tostaki
Can you tell me how to uninstall it ?

@kanhu No, I don’t know how to uninstall it. You have to read the script to see what it does and undo it. I would start by uninstalling lighttpd and maybe reinstall the yunohost package to restore dependancies.
My point was to not install something like this in the first place unless you know exactly what it does (or on a development environnement). I’m sorry if you break your yunohost but please be careful about what you install.

I admit, in general it’s a bad idea to install something from the Internet
but CURL or WGET still the same, even I PPA or whatever none official source and Yunohost and Debian are clear on that.
After all I did’nt force people to execute the line.
Before executing something I’m doing snapshot and evaluating the source (this one is on GitHub).

the script to uninstall is there : https://github.com/pi-hole/pi-hole/blob/master/automated%20install/uninstall.sh
but I never use it.

So if you want to do the same principe you could look at https://github.com/pi-hole/pi-hole/blob/master/adlists.default
and inject those text file into your host file.
and with a cronjob update it.
But BEWARE, don’t forget to verify the 1.6M line you will put into your host file (sic) :wink:

Hi guys, I try to work on pi-hole.

I made a install without the automated script, so without ligthttpd.
For the moment, the web interface works fine, behind the sso. dnsmasq is quite ok (just a small conflict with the ynh dnsmasq config, nothing really bad). And the pihole service works fine too.

I have to try to use it as a dns to know if it really works.
For the moment, I have no big issue, but playing with the dns is such a hazardous game. So maybe it’s not going to work. We will see…

If all is ok, I plan to make a package for YunoHost

2 Likes

Hi @Maniack_Crudelis
Can you please tell how the pi-hole app works? I have installed it and changed the dns of my devices to the ip of the YunoHost server, but I don’t see any activity in pi-hole admin panel. :stuck_out_tongue: . Neither do I see adds being blocked. :smile:

Hi Kanhu,

this package is in progress, you should not use it now ! It’s not safe !

But…
We have try it yesterday and it seems to work.
First, to see any activities on the panel, you have to activate the query log. In settings, if you didn’t agree when you had install the package.
Second, to see who resolv your dns queries, you can try an dig or nslookup on a domain.
For the usage, I think you have to change your main dns ip, that’s all.

But I have allready installed it. :blush:
I have enabled the pi-hole query log, now I can see the logs both in command-line and web-interface. :sunny:
Is there any security issue as you mentioned its not safe?

No, not any security issues.
But as we play with the dns, it needs to be fully tested because we can have some problems.
Yesterday, we had find that if your /etc/hosts contains an entry with 127.0.0.1 on your main domain, obviously, you can’t reach your server anymore.
And an another error with the blacklist and ipv6.

Some fix are on the road, but not pushed yet.

So, be carreful, and if you have any problem, please report here.

1 Like

I get cron error everyday :
PATH="$PATH:/usr/local/bin/" pihole flush once quiet

error: error creating output file /var/log/pihole.log.1: Permission denied
error: error opening /var/log/pihole-FTL.log: Permission denied

Ok, it’s the standard configuration given by pi-hole.
But, I think it can be better to use a directory for pi-hole log.
Let me fix that :wink:

And thanks for this info

1 Like

So, I can’t use a directory, because the log path is hardcoded in pi-hole.
But, I fix this issue in logrotate’s config.

You can update your pi-hole.