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

Make group management more prominent #740

Merged
merged 2 commits into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions docs/database/gravity/groups.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
## Group management

Any blocklist or domain on the white-/black-/regex-lists can be managed through groups. This allows not only grouping them to highlight their relationship, but also enabling/disabling them together if one, for instance, wants to visit a specific service only temporarily.

Groups are defined in the `group` table and can have an optional description in addition to the mandatory name of the group.

Label | Type | Uniqueness enforced | Content
Expand All @@ -25,14 +23,3 @@ Label | Type | Content
`group_id` | integer | `id` of associated group in the `group` table

Group `Default` (`group_id` `0`) is special as it is automatically assigned to domains and clients not being a member of other groups. Each newly added client or domain gets assigned to group zero when being added.

## Effect of group management

The great flexibility to manage domains in zero, one, or multiple groups may result in unexpected behavior when, e.g., the domains are enabled in some but disabled in other groups. For the sake of convenience, we describe the possible configurations and whether *FTL*DNS uses these domains (✔) or not (✘) in such cases.

- Domain disabled: ✘<br>Note that the domain is never imported by *FTL*DNS, even if it is contained in an enabled group.

- Domain enabled: It depends...
- Not managed by a group: ✔
- Contained in one or more groups (at least one enabled): ✔
- Contained in one or more groups (all disabled): ✘
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ after your database modifications to have FTL flush its internal domain-blocking

The `Default` group has a special meaning and cannot be deleted. All domains, clients, and adlists without a specific group assignment are automatically managed through this group. Disabling this group will disable Pi-hole blocking for all unmanaged devices.

![Adding three groups](example-groups.png)
![Adding three groups](../images/group_management/example-groups.png)

??? "Raw database instructions"
```sql
Expand All @@ -29,7 +29,7 @@ after your database modifications to have FTL flush its internal domain-blocking

Add three clients at your will, their IP addresses might differ from the ones in this example.

![Adding three clients](example-clients-1.png)
![Adding three clients](../images/group_management/example-clients-1.png)

??? "Raw database instructions"
```sql
Expand All @@ -40,7 +40,7 @@ after your database modifications to have FTL flush its internal domain-blocking

3. **Link the clients to the created groups.**

![Link groups and clients](example-clients-2.png)
![Link groups and clients](../images/group_management/example-clients-2.png)

??? "Raw database instructions"
```sql
Expand All @@ -53,7 +53,7 @@ after your database modifications to have FTL flush its internal domain-blocking

**Task:** Exclude client 1 from Pi-hole's blocking by removing client 1 from the `Default` group.

![Change client groups assignment - Overview](example-clients-3.png)
![Change client groups assignment - Overview](../images/group_management/example-clients-3.png)

??? "Raw database instructions"
```sql
Expand All @@ -76,7 +76,7 @@ All three clients got automatically assigned to the default (`Default`) group wh

**Task:** Assign adlist with ID 1 to group 1 (in addition to the default assignment to group 0). This results in client `192.168.0.101` using *only this* adlist (we removed the default association in the last step).

![Change blocklist group assignment - Overview](example-adlists-1.png)
![Change blocklist group assignment - Overview](../images/group_management/example-adlists-1.png)

??? "Raw database instructions"
```sql
Expand All @@ -103,9 +103,9 @@ Client | Group membership | Domain | Blocked

Add the domain to be blocked

![Add new exact blacklist domain](example-new-black.png)
![Add new exact blacklist domain](../images/group_management/example-new-black.png)

![Resulting row in the list of domains](example-domain-1.png)
![Resulting row in the list of domains](../images/group_management/example-domain-1.png)

??? "Raw database instructions"
```sql
Expand All @@ -128,7 +128,7 @@ Note that Pi-hole is *not* blocking this domain for client `192.168.0.101` as we

Assign this domain to group 1

![Assign group to a new domain](example-domain-2.png)
![Assign group to a new domain](../images/group_management/example-domain-2.png)

??? "Raw database instructions"
```sql
Expand All @@ -151,7 +151,7 @@ All clients see this domain as being blocked: Client 1 due to a direct assignmen

Remove default assignment to all clients not belonging to a group

![Remove Default group from new domain](example-domain-3.png)
![Remove Default group from new domain](../images/group_management/example-domain-3.png)

??? "Raw database instructions"
```sql
Expand All @@ -178,9 +178,9 @@ While client 1 keeps its explicit assignment through group 1, the remaining clie

Add the domain to be whitelisted

![Add a new exact whitelist domain](example-new-white.png)
![Add a new exact whitelist domain](../images/group_management/example-new-white.png)

![Resulting row in the list of domains](example-domain-4.png)
![Resulting row in the list of domains](../images/group_management/example-domain-4.png)

??? "Raw database instructions"
```sql
Expand All @@ -202,7 +202,7 @@ Client `192.168.0.101` is not whitelisting this domain as we removed the default

Remove default group assignment

![Remove default group assignment](example-domain-5.png)
![Remove default group assignment](../images/group_management/example-domain-5.png)

??? "Raw database instructions"
```sql
Expand All @@ -224,7 +224,7 @@ Requests from all clients are blocked as the new whitelist entry is not associat

Assign this domain to group 2

![Assign group to a new domain](example-domain-6.png)
![Assign group to a new domain](../images/group_management/example-domain-6.png)

??? "Raw database instructions"
```sql
Expand Down
9 changes: 9 additions & 0 deletions docs/group_management/groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Group management

Any blocklist or domain on the white-/black-/regex-lists can be managed through groups. This allows not only grouping them to highlight their relationship, but also enabling/disabling them together if one, for instance, wants to visit a specific service only temporarily.

Group `Default` (`group_id` `0`) is special as it is automatically assigned to domains and clients not being a member of other groups. Each newly added client or domain gets assigned to group zero when being added.

## Effect of group management

The great flexibility to manage domains in zero, one, or multiple groups may result in unexpected behavior when, e.g., the domains are enabled in some but disabled in other groups.
6 changes: 5 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ nav:
- 'Domain database':
- 'Overview': database/gravity/index.md
- 'Group management': database/gravity/groups.md
- 'Examples': database/gravity/example.md
- 'Database recovery': database/gravity/recovery.md
- 'FTLDNS':
- 'Overview': ftldns/index.md
Expand All @@ -120,6 +119,9 @@ nav:
- 'gdb': ftldns/debugging.md
- 'valgrind': ftldns/valgrind.md
- 'In-depth manual': ftldns/in-depth.md
- 'Group management':
- 'Overview': group_management/groups.md
- 'Examples': group_management/example.md
- 'RegEx blocking':
- "Overview": regex/overview.md
- "Testing": regex/testmode.md
Expand Down Expand Up @@ -228,3 +230,5 @@ plugins:
'ftldns/regex/index.md': regex/overview.md
'ftldns/regex/overview.md': regex/overview.md
'ftldns/regex/tutorial.md': regex/tutorial.md
'database/gravity/example.md': group_management/example.md