Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HW install curl script removes pi-hole admin portal #495

Closed
Sean-Brooks opened this issue Nov 8, 2023 · 13 comments
Closed

HW install curl script removes pi-hole admin portal #495

Sean-Brooks opened this issue Nov 8, 2023 · 13 comments
Labels
bug 🐛 Something isn't working Contributors 🙏 Open for contributors to step in & help as I don't have time & expertise for everything myself. next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed.

Comments

@Sean-Brooks
Copy link

Sean-Brooks commented Nov 8, 2023

HW install curl script removed pi-hole's admin portal --> /var/www/html/admin

I had to pull another one to resolve
https://discourse.pi-hole.net/t/unable-to-update-pi-hole-error-web-admin-repo-is-missing-from-system/41599/8

This issue is likely due to lighttpd and nginx not wanting to play nice with each other or stealing ports away from the other.

I haven't tried running the container alongside pi-hole on the same device, however the container on another device appears to work well enough on the same LAN.

@lorki97
Copy link

lorki97 commented Nov 8, 2023

Please note that in the HW install instructions it tells one that installing this way is "... an Experimental feature 🧪 and it relies on community support.". The preferred installation method is still using a Docker container.

Removal of the /var/www/html/admin directory happens because the whole /var/www/html directory is removed in the start script: https://github.com/jokob-sk/Pi.Alert/blob/main/dockerfiles/start.sh#L40

@jokob-sk I think the way NGINX and the /var/www/html directory is currently setup/configured on startup won't allow another website to be served.

@jokob-sk jokob-sk added bug 🐛 Something isn't working Contributors 🙏 Open for contributors to step in & help as I don't have time & expertise for everything myself. labels Nov 8, 2023
@jokob-sk
Copy link
Owner

jokob-sk commented Nov 8, 2023

@Sean-Brooks sorry to hear about the issue. Hope it didn't impact your data.
@lorki97 Thank you for pinpointing the issue. Do you have an idea how to solve it? I will try to have a look over the weekend as well 🤔

@Sean-Brooks Sean-Brooks changed the title HW install curl script DESTROYED my pi-hole BEWARE! HW install curl script removes pi-hole admin portal Nov 8, 2023
@Sean-Brooks
Copy link
Author

@Sean-Brooks sorry to hear about the issue. Hope it didn't impact your data.
@lorki97 Thank you for pinpointing the issue. Do you have an idea how to solve it? I will try to have a look over the weekend as well 🤔

@jokob-sk The issue was all my complete doing, nothing you contributed to. Thank you for the work you've put into this project. I updated the issue verbiage.

@lorki97 Thank you for the feedback. I appreciated the time/effort you put into your reply.

@lorki97
Copy link

lorki97 commented Nov 9, 2023

I have PiHole installed myself (altough in a Docker container) and this is the /var/www/html directory in that container:

user@hostname:/# ls -lah /var/www/html/
total 12K
drwxrwxr-x 1 www-data www-data  3 Oct 10 19:06 .
drwxr-xr-x 1 root     root      3 May 28 04:03 ..
drwxr-xr-x 7 root     root     47 May 30 20:51 admin
-rw-r--r-- 1 www-data www-data 13 Oct 10 19:08 custom_disable_timer

The lighttpd config included in PiHole listens on port 80 and serves the whole /var/html/www directory by default. There is also a redirect in pihole-admin.conf which redirects to the admin console http://pi.hole/admin/ if only the PiHole host URL gets entered (http://pi.hole). This differs from the Docker container config but should be no problem.

PiAlert is by default served on a different port (20211) than PiHole (80) so this already avoids a conflict there. Maybe putting the PiAlert web files into e.g. /var/www/html/pialert/ and serve with NGINX web root set to that directory would be enough to fix this problem. Then the setup file can still delete the new directory to make sure no old files are in there without interfering with other web files.

Now on to NGINX. Currently the server config is symlinked to sites-available named default. I found out that this seems to be a Debian thing and not a NGINX default (https://serverfault.com/a/870709). So maybe it is best to change this to a named config file inside the /etc/nginx/conf.d directory, such as /etc/nginx/conf.d/pialert.conf. This way we would no longer interfere with other possible default configs and be more distribution agnostic.

Let me know what you think @jokob-sk

@jokob-sk
Copy link
Owner

jokob-sk commented Nov 9, 2023

@lorki97 I don't have an issue with that 👍are you able to help out with a PR? We just need to make sure the On-HW and docker build don't have issues.

@lorki97
Copy link

lorki97 commented Nov 9, 2023

Yes, I'll setup a test environment on my machine and check it against a "bare-metal" PiHole installation.

@jokob-sk
Copy link
Owner

jokob-sk commented Nov 9, 2023

@lorki97 Thank you in advance 🙏

@lorki97
Copy link

lorki97 commented Nov 15, 2023

@jokob-sk Please take a look at https://github.com/jokob-sk/Pi.Alert/pull/505, especially the issue with buildtimestamp.txt. You create this in the Dockerfile and thus is missing in a HW install. But inserting this into the install.sh would overwrite your execution in the Dockerfile and create it at each startup thus "disabling" (circumventing) the version check system. Any ideas on how to solve this?

@jokob-sk
Copy link
Owner

hummm, how about adding a check if the file exists and only create it if it is missing?

@lorki97
Copy link

lorki97 commented Nov 15, 2023

That's the easy way 😄 If there is not a lot of requests for a HW install leaving it at this quick simple - works with PiHole (on Debian) - fix should be enough.

@jokob-sk
Copy link
Owner

let's keep it simple for now - really appreciate the help here @lorki97 🙏bash scripts are not my strong suit. Feel free to also add a disclaimer in the docs to make sure the limitations are clear for the HW-only install.

@jokob-sk jokob-sk added the next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed. label Nov 17, 2023
@lorki97
Copy link

lorki97 commented Nov 17, 2023

@Sean-Brooks the PR supposed to fix this has been merged. You might want to try installing it. Just in case backup your PiHole install first.

@jokob-sk
Copy link
Owner

closing as released 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working Contributors 🙏 Open for contributors to step in & help as I don't have time & expertise for everything myself. next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed.
Projects
None yet
Development

No branches or pull requests

3 participants