Improved all about pi-hole

This commit is contained in:
Michele Cereda
2023-02-07 03:03:36 +01:00
parent 5dfe346fa0
commit 50f38880f5
5 changed files with 77 additions and 21 deletions

View File

@@ -35,6 +35,7 @@
"ocsp",
"pacman",
"pamac",
"pihole",
"pkexec",
"polkit",
"pvresize",

View File

@@ -1,2 +1,5 @@
# Update Graviton's DB once a week (at midnight on Sundays).
0 0 * * 0 docker ps -f 'name=pihole' -f 'status=running' -f 'health=healthy' -q | xargs -I{} docker exec {} pihole -g
# Update Graviton's DB once a week (at 3:00 on Sundays).
0 3 * * 0 docker ps -f 'name=pihole' -f 'status=running' -f 'health=healthy' -q | xargs -I{} docker exec {} pihole -g
# Create a complete backup once a week (at 3:30 on Sundays).
30 3 * * 0 docker ps -f 'name=pihole' -f 'status=running' -f 'health=healthy' -q | xargs -I{} docker exec {} pihole -a -t /etc/pihole/teleporter_backup.tar.gz

View File

@@ -1,36 +1,30 @@
version: "3.2"
secrets:
webpassword:
file: ./webpassword
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
image: pihole/pihole:2023.01.10
environment:
FTLCONF_LOCAL_IPV4: 127.0.0.1
REV_SERVER_CIDR: 192.168.1.0/24
REV_SERVER_DOMAIN: localdomain
REV_SERVER_TARGET: 192.168.1.1
REV_SERVER: "true"
SKIPGRAVITYONBOOT: 1
TZ: Europe/Amsterdam
WEBPASSWORD_FILE: /run/secrets/webpassword
# DNSMASQ_LISTENING: all # Only required if using Docker's default 'bridge' network setting
volumes:
- ./etc-pihole:/etc/pihole
- ./etc-dnsmasq.d:/etc/dnsmasq.d
- ./etc/pihole:/etc/pihole
- ./etc/dnsmasq.d:/etc/dnsmasq.d
dns:
- 127.0.0.1
- 1.1.1.1
restart: unless-stopped
secrets:
- webpassword
# If using the container's DHCP server it is recommended to replace the
# 'ports' definition with the 'network_mode' definition instead.
network_mode: "host"
# ports:
# - "53:53/tcp"
# - "53:53/udp"
# - "67:67/udp" # Only required if using the DHCP server component.
# - "80:80/tcp"
# Only required if using the DHCP server component.
# cap_add:
# - NET_ADMIN
ports:
- "53:53/tcp"
- "53:53/udp"
- "80:80/tcp"

View File

@@ -16,5 +16,14 @@ stat /etc/pihole/gravity.db
## Further readings
- Pi-hole's [repository]
- The [pihole] command
- [Run Pi-hole as a container with Podman on openSUSE]
<!-- project's references -->
[repository]: https://github.com/pi-hole/pi-hole
<!-- internal references -->
[pihole]: pihole.md
<!-- external references -->
[run pi-hole as a container with podman on opensuse]: https://www.suse.com/c/pihole-podman-opensuse/

49
knowledge base/pihole.md Normal file
View File

@@ -0,0 +1,49 @@
# Pihole
## TL;DR
```sh
# Check the status.
pihole status
# Temporarily disable blocking.
pihole disable '5m'
# Follow the logs in real-time.
pihole tail
# Set or change the Web Interface's password.
pihole -a -p
pihole -a -p 'new-password'
# Show Chronometer, the console dashboard of real-time stats.
pihole -c
# Show Chronometer and exit.
pihole -c -e
# Empty Pi-hole's logs.
pihole flush
# Update Graviton's DB.
pihole -g
# Backup all settings and the configuration.
# Without a path, the backup will be created in the current directory.
# The resulting archive can be imported using the Settings > Teleport webpage.
pihole -a -t
pihole -a -t 'path/to/backup/file.tar.gz'
```
## Further readings
- [Pi-hole]
- [The pihole command]
<!-- project's references -->
[the pihole command]: https://docs.pi-hole.net/core/pihole-command/
<!-- internal references -->
[pi-hole]: pi-hole.md
<!-- external references -->