Reflect changes to the pihole command, plus move whitelist/blacklist -> allowlist/denylist

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner
2024-10-02 20:31:56 +00:00
parent 87804ec824
commit 282cf1a951
4 changed files with 54 additions and 79 deletions

View File

@@ -0,0 +1,47 @@
### What Domains To Allow or Deny
[This extension for Google Chrome](https://chrome.google.com/webstore/detail/adamone-assistant/fdmpekabnlekabjlimjkfmdjajnddgpc) can help you in finding out which domains you need to allow.
### How to Allow or Deny Domains
There are scripts to aid users in adding or removing domains to the allowlist or denylist from the CLI
Each script accepts the following parameters:
| Parameter | Description |
|------------|--------------------------------------------------------------------------------------------------|
| `[domain]` | Fully qualified domain name you wish to add or remove. You can pass any number of domains. |
| `remove` | Removal mode. Domains will be removed from the list, rather than added |
| `-q` | Quiet mode. Console output is minimal. Useful for calling from another script (see `gravity.sh`) |
Domains passed are parsed by the script to ensure they are valid domains. If a domain is invalid it will be ignored.
By default, Allowed/Denied domains are associated with the Default Group only. If the domain should be associated with other groups, these will need to be selected in **Group Management > Domains** within the Pi-Hole web frontend.
#### Example `pihole allow` usages
* Attempt to add one or more domains to the allowlist and reload pihole-FTL:
```bash
pihole allow domain1 [domain2...]
```
To remove domains from the allowlist add `remove` as an additional argument, e.g:
```bash
pihole allow remove domain1 [domain2...]
```
#### Example `pihole deny` usages
* Attempt to add one or more domains to the denylist and reload pihole-FTL:
```bash
pihole deny domain1 [domain2...]
```
To remove domains from the denylist add `remove` as an additional argument, e.g:
```bash
pihole deny remove domain1 [domain2...]
```

View File

@@ -1,73 +0,0 @@
### What to Whitelist or Blacklist
[This extension for Google Chrome](https://chrome.google.com/webstore/detail/adamone-assistant/fdmpekabnlekabjlimjkfmdjajnddgpc) can help you in finding out which domains you need to whitelist.
### How to Whitelist or Blacklist
There are scripts to aid users in adding or removing domains to the whitelist or blacklist from the CLI
Each script accepts the following parameters:
| Parameter | Description |
|------------|--------------------------------------------------------------------------------------------------|
| `[domain]` | Fully qualified domain name you wish to add or remove. You can pass any number of domains. |
| `-d` | Removal mode. Domains will be removed from the list, rather than added |
| `-nr` | Update blacklist without refreshing pihole-FTL |
| `-f` | Force delete cached blocklist content |
| `-q` | Quiet mode. Console output is minimal. Useful for calling from another script (see `gravity.sh`) |
Domains passed are parsed by the script to ensure they are valid domains. If a domain is invalid it will be ignored.
By default, Whitelisted/Blacklisted domains are associated with the Default Group only. If the domain should be associated with other groups, these will need to be selected in **Group Management > Domains** within the Pi-Hole web frontend.
#### Example `pihole -w` usages
* Attempt to add one or more domains to the whitelist and reload pihole-FTL:
```bash
pihole -w domain1 [domain2...]
```
* Attempt to add one or more domains to the whitelist, but do not reload pihole-FTL:
```bash
pihole -w -nr domain1 [domain2...]
```
* Attempt to add one or more domains to the whitelist and force pihole-FTL to reload:
```bash
pihole -w -f domain1 [domain2...]
```
To remove domains from the whitelist add `-d` as an additional argument, e.g:
```bash
pihole -w -d domain1 [domain2...]
```
#### Example `pihole -b` usages
* Attempt to add one or more domains to the blacklist and reload pihole-FTL:
```bash
pihole -b domain1 [domain2...]
```
* Attempt to add one or more domains to the blacklist, but do not reload pihole-FTL:
```bash
pihole -b -nr domain1 [domain2...]
```
* Attempt to add one or more domains to the blacklist and force pihole-FTL to reload:
```bash
pihole -b -f domain1 [domain2...]
```
To remove domains from the blacklist add `-d` as an additional argument, e.g:
```bash
pihole -b -d domain1 [domain2...]
```

View File

@@ -11,7 +11,7 @@ Pi-hole makes use of many commands, and here we will break down those required t
| Feature | Invocation |
| -------------- | -------------- |
| [Core](#core-script) | `pihole` |
| [Whitelisting, Blacklisting and Regex](#whitelisting-blacklisting-and-regex) | `pihole -w`, `pihole -b`, `pihole --regex`, `pihole --wild` |
| [Allowlisting, Denylisting and Regex](#allowlisting-denylisting-and-regex) | `pihole allow`, `pihole deny`, `pihole --regex`, `pihole --wild` |
| [Debugger](#debugger) | `pihole debug` |
| [Log Flush](#log-flush) | `pihole flush` |
| [Reconfigure](#reconfigure) | `pihole reconfigure` |
@@ -37,11 +37,11 @@ Pi-hole makes use of many commands, and here we will break down those required t
The core script of Pi-hole provides the ability to tie many DNS related functions into a simple and user-friendly management system, so that one may easily block unwanted content such as advertisements. For both the Command-line Interface (CLI) and Web Interface, we achieve this through the `pihole` command (this helps minimize code duplication, and allows users to read exactly what's happening using `bash` scripting). This "wrapper" elevates the current user (whether it be your own user account, or `www-data`) using `sudo`, but restricts the elevation to solely what can be called through the wrapper.
### Whitelisting, Blacklisting and Regex
### Allowlisting, Denylisting and Regex
| | |
| -------------- | -------------- |
| Help Command | `pihole -w --help`, `pihole -b --help`, `pihole --regex --help`, `pihole --wild --help` |
| Help Command | `pihole allow --help`, `pihole deny --help`, `pihole --regex --help`, `pihole --wild --help` |
| Script Location | [`/opt/pihole/list.sh`](https://github.com/pi-hole/pi-hole/blob/master/advanced/Scripts/list.sh) |
| Example Usage | [`pihole --regex '^example.com$' '.*\.example2.net'`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#white-black-list) |
@@ -130,7 +130,7 @@ Gravity is one of the most important scripts of Pi-hole. Its main purpose is to
| Script Location | [`/usr/local/bin/pihole`](https://github.com/pi-hole/pi-hole/blob/master/pihole) |
| Example Usage | [`pihole logging off`](https://discourse.pi-hole.net/t/the-pihole-command-with-examples/738#logging) |
This command specifies whether the Pi-hole log should be used, by commenting out `log-queries` within `/etc/dnsmasq.d/01-pihole.conf` and flushing the log.
This command specifies whether the Pi-hole log should be used.
### Query

View File

@@ -207,7 +207,7 @@ nav:
- 'Using Tor': guides/misc/tor/using-tor.md
- 'Performance and other issues': guides/misc/tor/performance-issues.md
- 'Using DNSSEC': guides/misc/tor/dnssec.md
- 'Whitelist and Blacklist editing': guides/misc/whitelist-blacklist.md
- 'Allowlist and Denylist editing': guides/misc/allowlist-denylist.md
- 'Web server':
- 'NGINX': guides/webserver/nginx.md
- 'Caddy': guides/webserver/caddy.md
@@ -264,7 +264,7 @@ plugins:
'guides/tor/using-tor.md': guides/misc/tor/using-tor.md
'guides/tor/performance-issues.md': guides/misc/tor/performance-issues.md
'guides/tor/dnssec.md': guides/misc/tor/dnssec.md
'guides/whitelist-blacklist.md': guides/misc/whitelist-blacklist.md
'guides/whitelist-blacklist.md': guides/misc/allowlist-denylist.md
'guides/nginx-configuration.md': 'guides/webserver/nginx.md'
'guides/caddy-configuration.md': 'guides/webserver/caddy.md'
'guides/traefik-configuration-nodocker.md': 'guides/webserver/traefik-nodocker.md'
@@ -283,3 +283,4 @@ plugins:
'guides/vpn/openvpn/overview.md': guides/vpn/openvpn/index.md
'guides/misc/tor/overview.md': guides/misc/tor/index.md
'guides/github/contributing.md': guides/github/index.md
'guides/misc/whitelist-blacklist.md': guides/misc/allowlist-denylist.md