pi-hole / docker-pi-hole

Pi-hole in a docker container
https://pi-hole.net
Other
8.36k stars 1.12k forks source link

whitelisting not working via CLi #1577

Closed RobMcRob24 closed 4 months ago

RobMcRob24 commented 10 months ago

Versions

pihole:/# pihole -v Pi-hole version is development-v6 a44e51b (Latest: v5.17.2) web version is development-v6 82f1965 (Latest: v5.20.2) FTL version is development-v6 vDev-8664165 (Latest: v5.23)

Platform

Expected behavior

Domain should be added to whitelist

Actual behavior / bug

pihole:/# pihole -w site1.com grep: unrecognized option: P BusyBox v1.36.1 (2023-07-27 17:12:24 UTC) multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A|B|C N] { PATTERN | -e PATTERN... | -f FILE... } [FILE]...

Search for PATTERN in FILEs (or stdin)

    -H      Add 'filename:' prefix
    -h      Do not add 'filename:' prefix
    -n      Add 'line_no:' prefix
    -l      Show only names of files that match
    -L      Show only names of files that don't match
    -c      Show only count of matching lines
    -o      Show only the matching part of line
    -q      Quiet. Return 0 if PATTERN is found, 1 otherwise
    -v      Select non-matching lines
    -s      Suppress open and read errors
    -r      Recurse
    -R      Recurse and dereference symlinks
    -i      Ignore case
    -w      Match whole words only
    -x      Match whole lines only
    -F      PATTERN is a literal (not regexp)
    -E      PATTERN is an extended regexp
    -m N    Match up to N times per file
    -A N    Print N lines of trailing context
    -B N    Print N lines of leading context
    -C N    Same as '-A N -B N'
    -e PTRN Pattern to match
    -f FILE Read pattern from file

grep: unrecognized option: P BusyBox v1.36.1 (2023-07-27 17:12:24 UTC) multi-call binary.

Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A|B|C N] { PATTERN | -e PATTERN... | -f FILE... } [FILE]...

Search for PATTERN in FILEs (or stdin)

    -H      Add 'filename:' prefix
    -h      Do not add 'filename:' prefix
    -n      Add 'line_no:' prefix
    -l      Show only names of files that match
    -L      Show only names of files that don't match
    -c      Show only count of matching lines
    -o      Show only the matching part of line
    -q      Quiet. Return 0 if PATTERN is found, 1 otherwise
    -v      Select non-matching lines
    -s      Suppress open and read errors
    -r      Recurse
    -R      Recurse and dereference symlinks
    -i      Ignore case
    -w      Match whole words only
    -x      Match whole lines only
    -F      PATTERN is a literal (not regexp)
    -E      PATTERN is an extended regexp
    -m N    Match up to N times per file
    -A N    Print N lines of trailing context
    -B N    Print N lines of leading context
    -C N    Same as '-A N -B N'
    -e PTRN Pattern to match
    -f FILE Read pattern from file

[✗] site1.com is not a valid argument or domain name!

Steps to reproduce

Steps to reproduce the behavior:

Logon to docker CLI and try to add a domain to the whitelist. Seems, that grep -P in list.sh in line 111/112 is not a possible option on Synology docker container.

yubiuser commented 10 months ago

There are two issues here: one is the busybox binary on the alpine docker image and the other is that pihole -b/w need to be completely rewritten for V6. For more details see https://discourse.pi-hole.net/t/whitelist-blacklist-options-result-in-grep-errors/65521/2

RobMcRob24 commented 10 months ago

Thanks for the advice. Unfortunately query.sh is also not working on my docker container:

pihole -q flurry.com /opt/pihole/query.sh: line 113: idn2: not found Found domains exactly matching ''.

sh: out of range Found adlists exactly matching ''.

sh: out of range

yubiuser commented 10 months ago

This is an easy fix I can prepare tomorrow.

yubiuser commented 10 months ago

@RobMcRob24

This PR should make pihole -q work on the v6 container: https://github.com/pi-hole/docker-pi-hole/pull/1465

yubiuser commented 10 months ago

We took a different approach: IDNs are now handled by FTL itself (https://github.com/pi-hole/FTL/pull/1715), so idn2 is not needed anymore (https://github.com/pi-hole/pi-hole/pull/5468)

RobMcRob24 commented 10 months ago

Is this now included in the current development-v6 docker build. I got it a few minutes ago, but I still have the same error message from the query.sh

yubiuser commented 10 months ago

Only one of the two linked PRs has been merged yet, but we need both.

github-actions[bot] commented 9 months ago

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

pralor-bot commented 8 months ago

This issue has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pihole-w-domain-name-not-working/67245/2

PromoFaux commented 4 months ago

Just looking over this issue, it appears all of the linked PRs have been merged (@yubiuser - unless I'm missing something?)

@RobMcRob24 does this issue still exist in the latest builds?

Scratch that - having just tried it myself, yes it still exists. @yubiuser - what is the other PR that needs to be looked at?

PromoFaux commented 4 months ago

Will be fixed by https://github.com/pi-hole/docker-pi-hole/pull/1576

Tested functionality is working