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

whitelisting not working via CLi #1577

Closed
RobMcRob24 opened this issue Oct 26, 2023 · 11 comments
Closed

whitelisting not working via CLi #1577

RobMcRob24 opened this issue Oct 26, 2023 · 11 comments

Comments

@RobMcRob24
Copy link

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

  • Platform: Docker on Synology ds922+

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
Copy link
Member

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
Copy link
Author

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
Copy link
Member

This is an easy fix I can prepare tomorrow.

@yubiuser
Copy link
Member

@RobMcRob24

This PR should make pihole -q work on the v6 container: #1465

@yubiuser
Copy link
Member

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

@RobMcRob24
Copy link
Author

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
Copy link
Member

yubiuser commented Nov 1, 2023

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

Copy link

github-actions bot commented Dec 1, 2023

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
Copy link

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
Copy link
Member

PromoFaux commented May 8, 2024

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
Copy link
Member

Will be fixed by #1576

Tested functionality is working

@PromoFaux PromoFaux transferred this issue from pi-hole/pi-hole May 8, 2024
@yubiuser yubiuser closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants