Skip to content

Commit

Permalink
Reflect changes to the pihole command, plus move whitelist/blacklis…
Browse files Browse the repository at this point in the history
…t -> allowlist/denylist

Signed-off-by: Adam Warner <[email protected]>
  • Loading branch information
PromoFaux committed Oct 2, 2024
1 parent 87804ec commit 282cf1a
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 79 deletions.
47 changes: 47 additions & 0 deletions docs/guides/misc/allowlist-denylist.md
Original file line number Diff line number Diff line change
@@ -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...]
```
73 changes: 0 additions & 73 deletions docs/guides/misc/whitelist-blacklist.md

This file was deleted.

8 changes: 4 additions & 4 deletions docs/main/pihole-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand All @@ -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) |

Expand Down Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand All @@ -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

0 comments on commit 282cf1a

Please sign in to comment.