Compare commits

...

1427 Commits

Author SHA1 Message Date
6167c9455c Merge pull request 'Add trufflehog to testworkflow' (#17) from trufflehog into master
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Check for merge conflicts / main (push) Waiting to run
Sync Back to Development / Syncing branches (push) Waiting to run
Reviewed-on: #17
2026-03-18 14:12:12 +00:00
59ab4723cd Merge branch 'master' into trufflehog
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:12:02 +00:00
683dd33827 Merge pull request 'Set versions in /etc/pihole/versions to null if script fails' (#16) from fix/version_null into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #16
2026-03-18 14:11:40 +00:00
b3a8a719d8 Merge branch 'master' into fix/version_null
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:11:27 +00:00
2a987db4be Merge pull request 'development' (#15) from development into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #15
2026-03-18 14:11:08 +00:00
509c272ccb Merge branch 'master' into development
Some checks are pending
CodeQL / Analyze (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Check for merge conflicts / main (push) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:10:58 +00:00
3b92ec05cc Merge pull request 'tweak/update' (#13) from tweak/update into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #13
2026-03-18 14:10:19 +00:00
d34d3f558a Merge branch 'master' into tweak/update
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:10:10 +00:00
81496e044c Merge pull request 'docker_disable_flush' (#12) from docker_disable_flush into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #12
2026-03-18 14:09:43 +00:00
ca06930a50 Merge branch 'master' into docker_disable_flush
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:09:34 +00:00
a6f69a13f3 Merge pull request 'Replace sudo with doas on alpine' (#11) from doas_alpine into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #11
2026-03-18 14:09:03 +00:00
3eacdc8872 Merge branch 'master' into doas_alpine
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:08:55 +00:00
87cb43cc85 Merge pull request 'Give FTL 120 seconds to shutdown' (#10) from more_time into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #10
2026-03-18 14:08:37 +00:00
0a903feb12 Merge branch 'master' into more_time
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:08:30 +00:00
15874b002e Merge pull request 'fix/version_file' (#7) from fix/version_file into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #7
2026-03-18 14:06:44 +00:00
ca9de23ca5 Merge branch 'master' into fix/version_file
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:06:35 +00:00
d807c40ba5 Merge pull request 'Install ARMv7 binary even when we detect a 64bit (aarch64) CPU but the operating system is 32bit. See FTL#2494 for reference' (#5) from tweak/32bitARM into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #5
2026-03-18 14:05:21 +00:00
6ee7eca1e5 Merge branch 'master' into tweak/32bitARM
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:05:15 +00:00
396f85614d Merge pull request 'Fix permission for *.etag files after gravity run' (#4) from fix/etag into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #4
2026-03-18 14:04:29 +00:00
c95094a6d3 Merge branch 'master' into fix/etag
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:04:22 +00:00
0159461cc0 Merge pull request 'fix/gravity_permission_check' (#3) from fix/gravity_permission_check into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #3
2026-03-18 14:03:54 +00:00
8d24316758 Merge branch 'master' into fix/gravity_permission_check
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:03:46 +00:00
e972595170 Merge pull request 'unsupported/binary' (#2) from unsupported/binary into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #2
2026-03-18 14:03:20 +00:00
ba86a1c23f Merge branch 'master' into unsupported/binary
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:03:11 +00:00
1703f169ba Merge pull request 'Move unattended check to the top of the script - exit early if /etc/pihole/pihole.toml file is not found,' (#1) from tweak/6380 into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #1
2026-03-18 14:02:47 +00:00
fbb3798dc2 Merge branch 'master' into tweak/6380
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:02:37 +00:00
yubiuser
cf7139bad8 Bump psf/black from 26.3.0 to 26.3.1 in the github-actions-dependencies group (#6566)
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
2026-03-14 14:49:24 +01:00
yubiuser
c7eff386e5 Bump tox from 4.49.0 to 4.49.1 in /test in the python-dependencies group (#6567) 2026-03-14 14:46:50 +01:00
dependabot[bot]
47de7d5913 Bump tox from 4.49.0 to 4.49.1 in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [tox](https://github.com/tox-dev/tox).


Updates `tox` from 4.49.0 to 4.49.1
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.49.0...4.49.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.49.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-14 10:02:46 +00:00
dependabot[bot]
ed3f72958b Bump psf/black in the github-actions-dependencies group
Bumps the github-actions-dependencies group with 1 update: [psf/black](https://github.com/psf/black).


Updates `psf/black` from 26.3.0 to 26.3.1
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](35ea67920b...c6755bb741)

---
updated-dependencies:
- dependency-name: psf/black
  dependency-version: 26.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-14 10:02:24 +00:00
yubiuser
bdeb05b941 Bump tox from 4.46.3 to 4.49.0 in /test in the python-dependencies group (#6560) 2026-03-07 17:06:39 +01:00
yubiuser
2d99a95dfb Bump the github-actions-dependencies group with 2 updates (#6561) 2026-03-07 17:05:35 +01:00
dependabot[bot]
8834b49fd3 Bump the github-actions-dependencies group with 2 updates
Bumps the github-actions-dependencies group with 2 updates: [github/codeql-action](https://github.com/github/codeql-action) and [psf/black](https://github.com/psf/black).


Updates `github/codeql-action` from 4.32.4 to 4.32.6
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](89a39a4e59...0d579ffd05)

Updates `psf/black` from 26.1.0 to 26.3.0
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](6305bf1ae6...35ea67920b)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: psf/black
  dependency-version: 26.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-07 10:02:47 +00:00
dependabot[bot]
752273f400 Bump tox from 4.46.3 to 4.49.0 in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [tox](https://github.com/tox-dev/tox).


Updates `tox` from 4.46.3 to 4.49.0
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.46.3...4.49.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.49.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-07 10:02:46 +00:00
Dominik
3d3be66685 Remove readonly from piholeNetworkFlush.sh to avoid error message (#6554) 2026-03-02 18:25:28 +01:00
RD WebDesign
36601eef3a Remove readonly from piholeNetworkFlush.sh to avoid error message
This is a quick fix to avoid the error when api.sh tries to set the
variable again.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-03-01 17:29:19 -03:00
yubiuser
ec0ce92aaa Bump tox from 4.44.0 to 4.46.3 in /test in the python-dependencies group (#6552) 2026-02-28 16:32:30 +01:00
dependabot[bot]
6dc67a48e9 Bump tox from 4.44.0 to 4.46.3 in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [tox](https://github.com/tox-dev/tox).


Updates `tox` from 4.44.0 to 4.46.3
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.44.0...4.46.3)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.46.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-28 10:02:45 +00:00
yubiuser
cda392ac97 Remove additional ':' from debug log system time output (#6551) 2026-02-24 16:39:35 +01:00
yubiuser
08365b3795 Bump tox from 4.35.0 to 4.44.0 in /test in the python-dependencies group (#6546) 2026-02-24 09:19:51 +01:00
Christian König
f28233729c Remove additional ':' from debug log system time output
Signed-off-by: Christian König <github@yubiuser.dev>
2026-02-24 08:51:07 +01:00
Christian König
ec8df55f0d Set versions in /etc/pihole/versions to null if script fails
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Signed-off-by: Christian König <github@yubiuser.dev>
2026-02-23 11:33:06 +01:00
yubiuser
2acb7098d8 Bump the github-actions-dependencies group with 2 updates (#6547) 2026-02-22 01:44:36 +01:00
dependabot[bot]
f2af7c8970 Bump the github-actions-dependencies group with 2 updates
Bumps the github-actions-dependencies group with 2 updates: [github/codeql-action](https://github.com/github/codeql-action) and [actions/stale](https://github.com/actions/stale).


Updates `github/codeql-action` from 4.32.3 to 4.32.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](9e907b5e64...89a39a4e59)

Updates `actions/stale` from 10.1.1 to 10.2.0
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](997185467f...b5d41d4e1d)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: actions/stale
  dependency-version: 10.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-21 10:02:51 +00:00
dependabot[bot]
c8ff8b747f Bump tox from 4.35.0 to 4.44.0 in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [tox](https://github.com/tox-dev/tox).


Updates `tox` from 4.35.0 to 4.44.0
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.35.0...4.44.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.44.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-21 10:02:39 +00:00
Christian König
4125bcccdc Files should be created before calling addOrEditKeyValPair
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Signed-off-by: Christian König <github@yubiuser.dev>
2026-02-18 09:25:10 +01:00
Christian König
ac37014628 Truncate version file instead of removing and creating freshly
Signed-off-by: Christian König <github@yubiuser.dev>
2026-02-18 09:22:11 +01:00
Adam Warner
a393dd83f3 v6.4 (#6536) 2026-02-17 20:26:56 +00:00
Christian König
d765ce768f Wipe version file before creating a new one
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-02-16 20:11:17 +01:00
yubiuser
e929d799b8 Don't install unused /usr/local/share/man/man5 (#6526) 2026-02-14 20:36:17 +01:00
yubiuser
194d6e3565 Bump tox from 4.34.1 to 4.35.0 in /test in the python-dependencies group (#6533) 2026-02-14 13:13:51 +01:00
yubiuser
f90f456bcf Bump github/codeql-action from 4.32.2 to 4.32.3 in the github-actions-dependencies group (#6534) 2026-02-14 12:50:03 +01:00
dependabot[bot]
75af6dc968 Bump github/codeql-action in the github-actions-dependencies group
Bumps the github-actions-dependencies group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.32.2 to 4.32.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](45cbd0c69e...9e907b5e64)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-14 10:02:35 +00:00
dependabot[bot]
0b0cbdf7d0 Bump tox from 4.34.1 to 4.35.0 in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [tox](https://github.com/tox-dev/tox).


Updates `tox` from 4.34.1 to 4.35.0
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.34.1...4.35.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-14 10:02:34 +00:00
yubiuser
6f54ce8c72 Bump github/codeql-action from 4.32.0 to 4.32.2 in the github-actions-dependencies group (#6528) 2026-02-07 11:12:58 +01:00
dependabot[bot]
a90df8072c Bump github/codeql-action in the github-actions-dependencies group
Bumps the github-actions-dependencies group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.32.0 to 4.32.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b20883b0cd...45cbd0c69e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-07 10:02:40 +00:00
darkexplosiveqwx
3d5c832dbe Remove /usr/local/share/man/man5 from tests
Signed-off-by: darkexplosiveqwx <101737077+darkexplosiveqwx@users.noreply.github.com>
2026-02-06 16:49:31 +01:00
darkexplosiveqwx
8c4778025a Don't install unused /usr/local/share/man/man5
Last used before `pihole-FTL.conf.5` was removed with https://github.com/pi-hole/pi-hole/pull/4489

Signed-off-by: darkexplosiveqwx <101737077+darkexplosiveqwx@users.noreply.github.com>
2026-02-05 18:45:57 +01:00
yubiuser
8eb602bd2b Bump github/codeql-action from 4.31.11 to 4.32.0 in the github-actions-dependencies group (#6525) 2026-01-31 11:51:05 +01:00
dependabot[bot]
19f80a1aa7 Bump github/codeql-action in the github-actions-dependencies group
Bumps the github-actions-dependencies group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.31.11 to 4.32.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](19b2f06db2...b20883b0cd)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-31 10:02:46 +00:00
yubiuser
8abfc5ae1a Bump the github-actions-dependencies group with 4 updates (#6522) 2026-01-28 09:02:56 +01:00
Christian König
03ee5b514d Fix black formatting
Signed-off-by: Christian König <github@yubiuser.dev>
2026-01-28 08:56:25 +01:00
dependabot[bot]
f0bc920384 Bump the github-actions-dependencies group with 4 updates
Bumps the github-actions-dependencies group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action](https://github.com/github/codeql-action), [psf/black](https://github.com/psf/black) and [actions/setup-python](https://github.com/actions/setup-python).


Updates `actions/checkout` from 6.0.1 to 6.0.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8e8c483db8...de0fac2e45)

Updates `github/codeql-action` from 4.31.10 to 4.31.11
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cdefb33c0f...19b2f06db2)

Updates `psf/black` from 25.12.0 to 26.1.0
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](782e5605c8...6305bf1ae6)

Updates `actions/setup-python` from 6.1.0 to 6.2.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](83679a892e...a309ff8b42)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: github/codeql-action
  dependency-version: 4.31.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: psf/black
  dependency-version: 26.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: actions/setup-python
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-24 10:02:49 +00:00
yubiuser
441832a331 Bump github/codeql-action from 4.31.9 to 4.31.10 in the github-actions-dependencies group (#6519) 2026-01-17 11:26:18 +01:00
dependabot[bot]
887255f518 Bump github/codeql-action in the github-actions-dependencies group
Bumps the github-actions-dependencies group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.31.9 to 4.31.10
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](5d4e8d1aca...cdefb33c0f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-17 10:02:42 +00:00
yubiuser
0f4594c88e Bump tox from 4.33.0 to 4.34.1 in /test in the python-dependencies group (#6515) 2026-01-10 11:05:42 +01:00
dependabot[bot]
ec6d3e2f83 Bump tox from 4.33.0 to 4.34.1 in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [tox](https://github.com/tox-dev/tox).


Updates `tox` from 4.33.0 to 4.34.1
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.33.0...4.34.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.34.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-10 10:01:07 +00:00
Adam Warner
f6531d722b Add missing -g to the message in gravity recovery command (#6513) 2026-01-08 17:46:38 +00:00
RD WebDesign
d0433cdb48 Add missing -g to the message in gravity recovery command
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-01-07 00:28:09 -03:00
Adam Warner
42ee5648cf Use configured location for web repo when updating or repairing (#6470) 2026-01-04 13:08:33 +00:00
yubiuser
d9e10413c3 Bump tox from 4.32.0 to 4.33.0 in /test in the python-dependencies group (#6510) 2026-01-03 13:22:09 +01:00
dependabot[bot]
102bc6043d Bump tox from 4.32.0 to 4.33.0 in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [tox](https://github.com/tox-dev/tox).


Updates `tox` from 4.32.0 to 4.33.0
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.32.0...4.33.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.33.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-03 10:01:40 +00:00
yubiuser
25a9897c4e Bump github/codeql-action from 4.31.8 to 4.31.9 in the github-actions-dependencies group (#6502) 2025-12-20 11:40:02 +01:00
dependabot[bot]
dd1e60b505 Bump github/codeql-action in the github-actions-dependencies group
Bumps the github-actions-dependencies group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.31.8 to 4.31.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b168cd394...5d4e8d1aca)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-20 10:01:25 +00:00
yubiuser
88a23f8f14 Bump pytest from 9.0.1 to 9.0.2 in /test in the python-dependencies group (#6500) 2025-12-13 16:49:39 +01:00
yubiuser
a1520d2fa6 Bump the github-actions-dependencies group with 3 updates (#6499) 2025-12-13 16:35:19 +01:00
dependabot[bot]
3ddf4014af Bump pytest in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [pytest](https://github.com/pytest-dev/pytest).


Updates `pytest` from 9.0.1 to 9.0.2
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/9.0.1...9.0.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 9.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-13 10:02:04 +00:00
dependabot[bot]
9f07e74eb8 Bump the github-actions-dependencies group with 3 updates
Bumps the github-actions-dependencies group with 3 updates: [github/codeql-action](https://github.com/github/codeql-action), [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) and [psf/black](https://github.com/psf/black).


Updates `github/codeql-action` from 4.31.7 to 4.31.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cf1bb45a27...1b168cd394)

Updates `redhat-plumbers-in-action/differential-shellcheck` from 5.5.5 to 5.5.6
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](0d9e5b2962...d965e66ec0)

Updates `psf/black` from 25.11.0 to 25.12.0
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](05f0a8ce1f...782e5605c8)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-version: 5.5.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: psf/black
  dependency-version: 25.12.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-13 10:01:35 +00:00
Christian König
7a352e61bc Add trufflehog to testworkflow
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-12-07 17:55:39 +01:00
yubiuser
beda7a5e0a Bump the github-actions-dependencies group with 3 updates (#6490) 2025-12-06 11:43:35 +01:00
dependabot[bot]
a5c6c2c12c Bump the github-actions-dependencies group with 3 updates
Bumps the github-actions-dependencies group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action](https://github.com/github/codeql-action) and [actions/stale](https://github.com/actions/stale).


Updates `actions/checkout` from 6.0.0 to 6.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](1af3b93b68...8e8c483db8)

Updates `github/codeql-action` from 4.31.5 to 4.31.7
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](fdbfb4d275...cf1bb45a27)

Updates `actions/stale` from 10.1.0 to 10.1.1
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](5f858e3efb...997185467f)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: github/codeql-action
  dependency-version: 4.31.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: actions/stale
  dependency-version: 10.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-06 10:01:25 +00:00
Dan Schaper
7442623f2f Debug log - Add colors to gravity tables (#6485) 2025-12-04 12:52:07 -07:00
Dan Schaper
013abb2898 Add Alpine 3.23 to test suite (#6488) 2025-12-03 15:48:44 -07:00
Christian König
f5f74066fc Add Alpine 3.23 to test suite
Signed-off-by: Christian König <github@yubiuser.dev>
2025-12-03 23:37:04 +01:00
Dan Schaper
6ce1707b55 Remove custom FTL FirewallD zone checks from debug log (#6481) 2025-11-30 16:54:03 -07:00
Dan Schaper
e103fbe1c8 Bump the github-actions-dependencies group with 2 updates (#6483) 2025-11-30 16:53:25 -07:00
RD WebDesign
1f4ed9b518 Replace some strings with their colored equivalents
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-11-30 18:43:40 -03:00
RD WebDesign
95ae51bbdb Use more specific strings on the tables to match only desired text
- use `--no---` and `--yes---` to make sure the strings won't match user
comments or parts of domains
- also use `-ALLOW-` and `-BLOCK-`

Also reduce the domain column to 90 characters

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-11-30 18:42:02 -03:00
Dan Schaper
a1af212ec0 Remove wget from alpine dependencies (#6484) 2025-11-30 11:30:38 -07:00
darkexplosiveqwx
353105ec0f remove wget from alpine dependencies
Signed-off-by: darkexplosiveqwx <101737077+darkexplosiveqwx@users.noreply.github.com>
2025-11-30 19:00:34 +01:00
dependabot[bot]
d77179a412 Bump the github-actions-dependencies group with 2 updates
Bumps the github-actions-dependencies group with 2 updates: [github/codeql-action](https://github.com/github/codeql-action) and [actions/setup-python](https://github.com/actions/setup-python).


Updates `github/codeql-action` from 4.31.4 to 4.31.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](e12f017898...fdbfb4d275)

Updates `actions/setup-python` from 6.0.0 to 6.1.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](e797f83bcb...83679a892e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: actions/setup-python
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-29 10:01:27 +00:00
Adam Warner
3a4c399982 Sync master back into development (#6482) 2025-11-27 23:21:18 +00:00
Adam Warner
5a23c9c366 Pi-hole Core v6.3 (#6480) 2025-11-27 18:10:51 +00:00
RD WebDesign
247b0c506b Remove custom FTL FirewallD zone checks from debug log
Removed checks for custom FTL FirewallD zone in piholeDebug.sh.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-11-26 23:46:43 -03:00
Adam Warner
d4db2dca22 Improve gravity tables presentation on the debug log (#6460) 2025-11-25 18:59:04 +00:00
yubiuser
e93bcaf7a4 Bump the github-actions-dependencies group with 2 updates (#6478) 2025-11-22 21:49:24 +01:00
dependabot[bot]
4b824f931f Bump the github-actions-dependencies group with 2 updates
Bumps the github-actions-dependencies group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 5.0.0 to 6.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](08c6903cd8...1af3b93b68)

Updates `github/codeql-action` from 4.31.3 to 4.31.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](014f16e7ab...e12f017898)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: github/codeql-action
  dependency-version: 4.31.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-22 10:01:26 +00:00
RD WebDesign
8c6bb3f8da Use text colums instead of number codes on gravity tables
- Domains table ("type" column): replace 0, 1, 2 and 3 with
  "exact-allow", "exact-deny", "regex-allow" and "regex-deny"
- All tables: use yes/no for "enabled" columns

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-11-20 16:46:38 -03:00
RD WebDesign
987a59f7e5 Show "Block" and "Allow" instead of 0 and 1
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-11-19 16:35:39 -03:00
yubiuser
de444407a9 Use port from dns.port in piholeDebug.sh (#6475) 2025-11-17 21:43:51 +01:00
darkexplosiveqwx
1dc8bfc950 Use port from dns.port in piholeDebug.sh
Signed-off-by: darkexplosiveqwx <101737077+darkexplosiveqwx@users.noreply.github.com>
2025-11-16 16:35:05 +01:00
yubiuser
bbd35045cf Bump pytest from 8.4.2 to 9.0.1 in /test in the python-dependencies group (#6474) 2025-11-15 13:49:28 +01:00
yubiuser
da03d713a6 Bump the github-actions-dependencies group with 2 updates (#6473) 2025-11-15 13:41:22 +01:00
dependabot[bot]
17dd5b97f3 Bump pytest in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [pytest](https://github.com/pytest-dev/pytest).


Updates `pytest` from 8.4.2 to 9.0.1
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.4.2...9.0.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 9.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-15 10:02:08 +00:00
dependabot[bot]
5f977eb35f Bump the github-actions-dependencies group with 2 updates
Bumps the github-actions-dependencies group with 2 updates: [github/codeql-action](https://github.com/github/codeql-action) and [psf/black](https://github.com/psf/black).


Updates `github/codeql-action` from 4.31.2 to 4.31.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](0499de31b9...014f16e7ab)

Updates `psf/black` from 25.9.0 to 25.11.0
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](af0ba72a73...05f0a8ce1f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: psf/black
  dependency-version: 25.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-15 10:01:21 +00:00
yubiuser
1110f26329 debug - speed up processing and display of file contents and services (#6469) 2025-11-12 22:23:49 +01:00
Rob Gill
03fd486921 use configured value for web repo when updating or repairing
Instead of hardcoded web repo location, get the currently configured location.
Imports utils.sh to facilitate this

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-11-11 07:28:21 +10:00
Rob Gill
bf41c3dded debug - speed up processing and display of file contents and services
Use bash-internal globs and parameter expasion in preference to
assignment from output of ls or basename per file/directory.

When displaying file contents, call sed once and preprocesses the entire
file (eg pihole.toml), rather than spawning a new sed process for every
line of the file.

When checking services, call awk once to extract all data for each ip:port
pair, rather than three times.

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-11-10 14:33:07 +10:00
yubiuser
3d25d20e86 systemd service - don't use deprecated PermissionsStartOnly (#6465) 2025-11-09 10:44:21 +01:00
yubiuser
c9eb377fba Bump codespell-project/actions-codespell from 2.1 to 2.2 in the github-actions-dependencies group (#6466) 2025-11-08 11:42:32 +01:00
dependabot[bot]
83f7b4089a Bump codespell-project/actions-codespell
Bumps the github-actions-dependencies group with 1 update: [codespell-project/actions-codespell](https://github.com/codespell-project/actions-codespell).


Updates `codespell-project/actions-codespell` from 2.1 to 2.2
- [Release notes](https://github.com/codespell-project/actions-codespell/releases)
- [Commits](406322ec52...8f01853be1)

---
updated-dependencies:
- dependency-name: codespell-project/actions-codespell
  dependency-version: '2.2'
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-08 10:01:11 +00:00
Rob Gill
7452c95080 systemd service - don't use deprecated PermissionsStartOnly
- elevate Prestart and Poststop script permissions using "+" prefix instead,
as per https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Command%20lines

( PermissionsStartOnly was deprecated in systemd 241 and no longer appears in
documentation since 2018 https://github.com/systemd/systemd/pull/10802 )

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-11-08 15:35:10 +10:00
Christian König
7df117876f Replace sudo with doas on alpine
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-11-03 22:23:12 +01:00
RD WebDesign
40aa986af1 Add list "type" (block/allow) to the debug log table
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-11-03 17:39:36 -03:00
yubiuser
ff75860de3 Fix libcap capabilities not being granted on OpenRC distros (#6456) 2025-11-02 16:43:36 +01:00
Sparronator9999
4ff250edac Fix libcap capabilities not being granted on OpenRC distros
Created on behalf of @mgziminsky - see this issue comment: https://github.com/pi-hole/pi-hole/issues/6454#issuecomment-3476576177

Signed-off-by: Sparronator9999 <86388887+Sparronator9999@users.noreply.github.com>
2025-11-02 07:29:20 +11:00
yubiuser
2e24c2d805 Add Fedora 43 to test suite (#6453) 2025-11-01 12:26:46 +01:00
yubiuser
c7ebaece92 Bump github/codeql-action from 4.31.0 to 4.31.2 in the github-actions-dependencies group (#6455) 2025-11-01 11:33:37 +01:00
dependabot[bot]
766e61c52a Bump github/codeql-action in the github-actions-dependencies group
Bumps the github-actions-dependencies group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.31.0 to 4.31.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](4e94bd11f7...0499de31b9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-01 10:01:18 +00:00
Christian König
558f0c4bf7 Add Fedora 43 to test suite
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-10-31 18:54:42 +01:00
Adam Warner
23e48cf544 Sync master back into development (#6448) 2025-10-28 17:18:45 +00:00
Adam Warner
1837b754b9 v6.2.2 (#6447) 2025-10-28 17:07:28 +00:00
yubiuser
d0fd967734 Bump github/codeql-action from 4.30.9 to 4.31.0 in the github-actions-dependencies group across 1 directory (#6446) 2025-10-28 16:08:39 +01:00
dependabot[bot]
4247a6056b Bump github/codeql-action
Bumps the github-actions-dependencies group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.30.9 to 4.31.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](16140ae1a1...4e94bd11f7)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-28 13:43:44 +00:00
Adam Warner
dff04eb822 Start using commented tags for editorconfig-checker (#6443) 2025-10-28 13:42:25 +00:00
Adam Warner
c5a2078ce7 Add bind9-dnsutils as dependency for APT based systems (#6444) 2025-10-28 13:41:55 +00:00
Adam Warner
1d6b3cd894 Add log file path variables and ensure log files are created if missing (#6441) 2025-10-28 13:40:00 +00:00
Adam Warner
91727fe284 Create version file, if not existing (on first Container start) (#6440) 2025-10-27 20:57:50 +00:00
Christian König
fc4c10dbe2 Add bind9-dnsutils as dependency for APT based systems
Signed-off-by: Christian König <github@yubiuser.dev>
2025-10-26 21:06:22 +01:00
yubiuser
0e46b9c83f Bump tox from 4.31.0 to 4.32.0 in /test in the python-dependencies group (#6433) 2025-10-26 20:50:56 +01:00
Christian König
49099d017a Start using commented tags for editorconfig-checker
Signed-off-by: Christian König <github@yubiuser.dev>
2025-10-26 20:30:34 +01:00
Yannick7777
72e3699265 Add log file path variables and ensure log files are created if missing
Signed-off-by: Yannick7777 <admin@eyer.life>
2025-10-26 15:19:56 +01:00
casperklein
1818e7e59e Ensure 'versions' file exist on first start
Signed-off-by: casperklein <casperklein@users.noreply.github.com>
2025-10-26 12:05:13 +01:00
Adam Warner
770aa1f061 Sync master back into development (#6434) 2025-10-25 11:49:52 +01:00
Adam Warner
66a3c73d6c Fix formatting in chooseInterface function (#6435) 2025-10-25 11:38:21 +01:00
Adam Warner
1ca693866c Fix formatting in chooseInterface function to ensure proper variable expansion - with quotes, the dialog command throws the error:
Expected at least 20 tokens for --radi, have 5.
Use --help to list options.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-10-25 11:31:59 +01:00
Adam Warner
75d4082e57 Pi-hole Core v6.2 (#6411) 2025-10-25 11:11:45 +01:00
dependabot[bot]
77dd566a4f Bump tox from 4.31.0 to 4.32.0 in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [tox](https://github.com/tox-dev/tox).


Updates `tox` from 4.31.0 to 4.32.0
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.31.0...4.32.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-25 10:01:46 +00:00
yubiuser
527895a377 Fix indentation
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-10-24 21:07:12 +02:00
Christian König
11344c39f5 Prevent URLs like file:/./ to circumvent permission check
Signed-off-by: Christian König <github@yubiuser.dev>
2025-10-23 22:22:02 +02:00
Christian König
b2e56662c0 Loose requirements for local file access for gravity
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-10-23 22:21:36 +02:00
Christian König
12342682b4 Separate log flush from log rotate
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-10-21 20:47:53 +02:00
Christian König
a734733a87 Disable log flush on docker container
Signed-off-by: Christian König <github@yubiuser.dev>
2025-10-21 20:41:18 +02:00
yubiuser
c901aa1a2e Fix gravity indention (#6427) 2025-10-21 19:49:08 +02:00
yubiuser
bfc263ac96 Apply suggestion from @rdwebdesign
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-10-20 09:22:21 +02:00
yubiuser
1f3a1c0676 Bump the github-actions-dependencies group with 2 updates (#6426) 2025-10-18 13:25:54 +02:00
Christian König
31cf4ed06d Fix gravity indention
Signed-off-by: Christian König <github@yubiuser.dev>
2025-10-18 13:12:23 +02:00
dependabot[bot]
190b89483c Bump the github-actions-dependencies group with 2 updates
Bumps the github-actions-dependencies group with 2 updates: [github/codeql-action](https://github.com/github/codeql-action) and [editorconfig-checker/action-editorconfig-checker](https://github.com/editorconfig-checker/action-editorconfig-checker).


Updates `github/codeql-action` from 4.30.8 to 4.30.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f443b600d9...16140ae1a1)

Updates `editorconfig-checker/action-editorconfig-checker` from 1a41284d59c6fe7f1b21ddc4a2b36400a33dc1b4 to 5ecdd656fe347c26f76b1b435b90e1d74fb5e787
- [Release notes](https://github.com/editorconfig-checker/action-editorconfig-checker/releases)
- [Commits](1a41284d59...5ecdd656fe)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.30.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: editorconfig-checker/action-editorconfig-checker
  dependency-version: 5ecdd656fe347c26f76b1b435b90e1d74fb5e787
  dependency-type: direct:production
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-18 10:01:21 +00:00
yubiuser
d0ce95c385 Tiny change to make prev2 also a local variable (#6420) 2025-10-15 05:54:57 +02:00
casperklein
9e8e360591 add missing local variable
Signed-off-by: casperklein <casperklein@users.noreply.github.com>
2025-10-15 04:37:19 +02:00
yubiuser
5b53661a79 Bump tox from 4.30.3 to 4.31.0 in /test in the python-dependencies group (#6418) 2025-10-11 12:13:53 +02:00
yubiuser
a626e7de48 Bump the github-actions-dependencies group with 2 updates (#6417) 2025-10-11 12:12:52 +02:00
dependabot[bot]
71dbf2715a Bump tox from 4.30.3 to 4.31.0 in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [tox](https://github.com/tox-dev/tox).


Updates `tox` from 4.30.3 to 4.31.0
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.30.3...4.31.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-11 10:01:51 +00:00
dependabot[bot]
08ce6499fc Bump the github-actions-dependencies group with 2 updates
Bumps the github-actions-dependencies group with 2 updates: [github/codeql-action](https://github.com/github/codeql-action) and [editorconfig-checker/action-editorconfig-checker](https://github.com/editorconfig-checker/action-editorconfig-checker).


Updates `github/codeql-action` from 3.30.6 to 4.30.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](64d10c1313...f443b600d9)

Updates `editorconfig-checker/action-editorconfig-checker` from f40bac9e7d9e7d298fbe36b83e1eff8f0de13fb8 to 1a41284d59c6fe7f1b21ddc4a2b36400a33dc1b4
- [Release notes](https://github.com/editorconfig-checker/action-editorconfig-checker/releases)
- [Commits](f40bac9e7d...1a41284d59)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.30.8
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: editorconfig-checker/action-editorconfig-checker
  dependency-version: 1a41284d59c6fe7f1b21ddc4a2b36400a33dc1b4
  dependency-type: direct:production
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-11 10:01:39 +00:00
Dominik
106b999054 Rename views, upgrade gravity database and bump gravity databae version (#6386) 2025-10-05 20:33:30 +02:00
yubiuser
564d917022 Bump the python-dependencies group across 1 directory with 3 updates (#6407) 2025-10-04 21:32:30 +02:00
yubiuser
a53dc8fa41 Bump the github-actions-dependencies group across 1 directory with 4 updates (#6409) 2025-10-04 21:30:30 +02:00
dependabot[bot]
37fc86410f Bump the github-actions-dependencies group across 1 directory with 4 updates
Bumps the github-actions-dependencies group with 4 updates in the / directory: [github/codeql-action](https://github.com/github/codeql-action), [actions/stale](https://github.com/actions/stale), [psf/black](https://github.com/psf/black) and [actions/setup-python](https://github.com/actions/setup-python).


Updates `github/codeql-action` from 3.29.10 to 3.30.6
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](96f518a34f...64d10c1313)

Updates `actions/stale` from 9.1.0 to 10.1.0
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](5bef64f19d...5f858e3efb)

Updates `psf/black` from 25.1.0 to 25.9.0
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](8a737e727a...af0ba72a73)

Updates `actions/setup-python` from 5.6.0 to 6.0.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](a26af69be9...e797f83bcb)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.30.6
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
- dependency-name: actions/stale
  dependency-version: 10.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: psf/black
  dependency-version: 25.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions-dependencies
- dependency-name: actions/setup-python
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-04 19:26:34 +00:00
yubiuser
e0a9b06b8e Use SHA to pin github actions (#6392) 2025-10-04 21:25:09 +02:00
Christian König
f8d14c398e Use sha also fpr editor-config-checker without adding a specific tag commit
Signed-off-by: Christian König <github@yubiuser.dev>
2025-10-04 21:15:12 +02:00
dependabot[bot]
f5ce7b29e0 Bump the python-dependencies group across 1 directory with 3 updates
Bumps the python-dependencies group with 3 updates in the /test directory: [pyyaml](https://github.com/yaml/pyyaml), [pytest](https://github.com/pytest-dev/pytest) and [tox](https://github.com/tox-dev/tox).


Updates `pyyaml` from 6.0.2 to 6.0.3
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/6.0.3/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/6.0.2...6.0.3)

Updates `pytest` from 8.4.1 to 8.4.2
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.4.1...8.4.2)

Updates `tox` from 4.28.4 to 4.30.2
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.28.4...4.30.2)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-dependencies
- dependency-name: pytest
  dependency-version: 8.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-dependencies
- dependency-name: tox
  dependency-version: 4.30.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-04 10:02:17 +00:00
Dominik
c0a05297e6 Adjust .shellcheckrc to 0.11 and enable some optional checks (#6374) 2025-10-04 09:11:48 +02:00
Dominik
e5112a9fb8 Add Debian 13 Trixie to the test suite (#6382) 2025-10-04 09:10:30 +02:00
yubiuser
c31bfb8d82 Fix typo found during install (#6406) 2025-09-24 18:06:55 +02:00
Jon Herron
59ccfd6d13 Fix typo found during install
Signed-off-by: Jon Herron <jon.herron@yahoo.com>
2025-09-24 08:43:25 -04:00
Adam Warner
950107503d uninstall refactor and improvement (#6339) 2025-08-29 13:30:51 +01:00
Rob Gill
87f307f1d8 Uninstall refactor
Split removePiholeFiles into functions for each category.

Reorder execution so that:
  Pihole-FTL is stopped and removed before shutdown scripts are removed.
  User and group are removed before needed commands are removed.

Remove database and log files in user-specified non-default locations,
and use local directories from basic install.sh, falling back to defaults.

Remove use of sudo as the script already checks that it is called as root.

Advise user of location of crontab backup if is created

Make use of service control functions, command detection and default
directories from basic_install.sh

Align variable names with current basic-install.sh

Disable pihole-FTL service immediately, if systemctl is available

Call systemd daemon-reload after removing service files (on systemd systems)

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-08-29 08:47:00 +10:00
Adam Warner
0a837dd955 Alpine Linux Support and Tests (#6275) 2025-08-27 21:13:37 +01:00
Christian König
7140953500 Use SHA to pin github actions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-08-27 21:02:18 +02:00
Michael Ziminsky (Z)
f50a4c1c89 Don't use hard-coded path for pihole user nologin shell
Signed-off-by: Michael Ziminsky (Z) <mgziminsky@users.noreply.github.com>
2025-08-16 21:47:57 +00:00
Michael Ziminsky (Z)
3908be911c Alpine: Switch cron service from busybox to cronie during install
Signed-off-by: Michael Ziminsky (Z) <mgziminsky@users.noreply.github.com>
2025-08-16 21:47:56 +00:00
Michael Ziminsky (Z)
44f95a4f57 Alpine: Ensure community repo is enabled and handle dependency install errors
Signed-off-by: Michael Ziminsky (Z) <mgziminsky@users.noreply.github.com>
2025-08-16 21:47:56 +00:00
Michael Ziminsky (Z)
4bf67a3c79 Alpine: Add some additional dependencies and minor script fixes
Signed-off-by: Michael Ziminsky (Z) <mgziminsky@users.noreply.github.com>
2025-08-16 21:47:55 +00:00
Rob Gill
d75dae788d Alpine Linux tests
Add Dockerfile and corresponding tox file to add alpine linux 3.21 & 3.22 to the test suite
Add apk as another package manager in the automated install tests
Use short switches for su command as busybox's su does not accept long switches here
Add Alpine test to github workflow

Signed-off-by: Michael Ziminsky (Z) <mgziminsky@users.noreply.github.com>
2025-08-16 21:47:54 +00:00
Michael Ziminsky (Z)
0db48383ae Add support for alpine
Signed-off-by: Michael Ziminsky (Z) <mgziminsky@users.noreply.github.com>
2025-08-16 21:47:54 +00:00
Dominik
73521bb110 Add FTL bash autocomplete (#6376) 2025-08-16 21:02:42 +02:00
yubiuser
36c4193dc5 Bump actions/checkout from 4.2.2 to 5.0.0 in the github-actions-dependencies group (#6387) 2025-08-16 12:36:52 +02:00
dependabot[bot]
6e9e961d3c Bump actions/checkout in the github-actions-dependencies group
Bumps the github-actions-dependencies group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 4.2.2 to 5.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.2.2...v5.0.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-16 10:23:35 +00:00
DL6ER
9e258e7005 Rename views, upgrade gravity database and bump gravity databae version
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-08-15 19:39:21 +02:00
Christian König
ea274073b4 Add Debian 13 Trixie to the test suite
Signed-off-by: Christian König <github@yubiuser.dev>
2025-08-13 06:27:19 +02:00
Adam Warner
5ed52554d7 Move unattended check to the top of the script - exit early if /etc/pihole/pihole.toml file is not found,
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-08-11 14:55:39 +01:00
Christian König
94bbf5f429 Fix shellcheck warnings
Signed-off-by: Christian König <github@yubiuser.dev>
2025-08-07 19:44:26 +02:00
Christian König
4511daf560 Use pihole-FTL --complete to generate autocomplete suggestions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-08-06 21:01:37 +02:00
Christian König
5d1ef6279f Fix shellcheck warnings for pihole bash completion
Signed-off-by: Christian König <github@yubiuser.dev>
2025-08-06 13:05:48 +02:00
Christian König
340ffbe5e8 Add pihole-FTL bash completion
Signed-off-by: Christian König <github@yubiuser.dev>
2025-08-06 13:05:36 +02:00
Christian König
7baa9c5de0 Adjust .shellcheckrc to 0.11 and enable some optional checks
Signed-off-by: Christian König <github@yubiuser.dev>
2025-08-04 20:38:27 +02:00
yubiuser
75286a1626 Bump tox from 4.28.3 to 4.28.4 in /test in the python-dependencies group (#6371) 2025-08-02 12:56:30 +02:00
dependabot[bot]
9bc17a1f2b Bump tox from 4.28.3 to 4.28.4 in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [tox](https://github.com/tox-dev/tox).


Updates `tox` from 4.28.3 to 4.28.4
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.28.3...4.28.4)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.28.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-02 10:52:42 +00:00
yubiuser
86850e9020 Add "setpassword" to pihole Bash completion (#6369) 2025-07-31 19:06:45 +02:00
deHakkelaar
d4562a1deb Add "setpassword" to pihole Bash completion
Its missing.
After:

```
$ sudo pihole
allow          arpflush       disable        logging        reloadlists    tail           version
allow-regex    checkout       enable         query          repair         uninstall      wildcard
allow-wild     debug          flush          regex          setpassword    updateGravity
api            deny           help           reloaddns      status         updatePihole
```

Signed-off-by: deHakkelaar <deHakkelaar@users.noreply.github.com>
2025-07-31 18:03:43 +02:00
Adam Warner
62ccfc77de Explicitly check for the existence of FTL binary before attempting to stop it. Prevents warning message on fresh installs (#6364) 2025-07-28 15:56:42 +01:00
Dominik
0df3b41ca0 Do not call pihole-FTL --config interactively (#6368) 2025-07-27 20:25:31 +02:00
DL6ER
5cb601200c Use non-interactive shell in utils.sh:getFTLConfigValue to avoid colored output
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-07-26 21:54:25 +02:00
Adam Warner
342c8b693b Revert "pihole api - use keepalive for curl queries" (#6367) 2025-07-26 19:12:46 +01:00
Adam Warner
24d8754033 Revert "pihole api - use keepalive for curl queries" 2025-07-26 12:35:02 +01:00
yubiuser
966e466c9e Bump tox from 4.27.0 to 4.28.3 in /test in the python-dependencies group (#6366) 2025-07-26 12:43:27 +02:00
dependabot[bot]
37ec67e9a3 Bump tox from 4.27.0 to 4.28.3 in /test in the python-dependencies group
Bumps the python-dependencies group in /test with 1 update: [tox](https://github.com/tox-dev/tox).


Updates `tox` from 4.27.0 to 4.28.3
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.27.0...4.28.3)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.28.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-26 10:36:36 +00:00
Adam Warner
364ba99b1f Update automated install/basic-install.sh
Co-authored-by: yubiuser <github@yubiuser.dev>
Signed-off-by: Adam Warner <github@adamwarner.co.uk>
2025-07-26 10:56:21 +01:00
Adam Warner
9252e90bd6 Check for the existence of the FTL binary before stopping the service
This prevents errors on fresh installs where the FTL binary does not exist yet.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-07-26 10:31:58 +01:00
Adam Warner
ae0fef4626 pihole api - use keepalive for curl queries (#6365) 2025-07-26 10:22:16 +01:00
Rob Gill
5b4a7b8b74 pihole api - use keepalive for curl queries
Adds the keepalive header to all curl requests

This reduces session establishment time across the multiple

requests necessary to authenticate, obtain response and log out

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-07-26 18:48:32 +10:00
Dan Schaper
a9680db218 Use 'true'/'false' strings instead of 0/1 integers for boolean root user check in pihole command (#6351) 2025-07-23 09:16:15 -07:00
Christian König
7aa57e154e Group functions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-23 08:23:09 +02:00
Christian König
05f4ae7719 Invert need_root logic and check if set/unset
Signed-off-by: Christian König <github@yubiuser.dev>
Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net>
2025-07-23 08:09:26 +02:00
Dan Schaper
29b6252935 Fix gravity user permission checking and fix error on pihole-FTL --config failures (#6352) 2025-07-22 15:27:07 -07:00
Dan Schaper
f324d4cc7d Separate network flush and arp table flush functions (#6319)
This PR updates the function flushing the network tables and the ARP table. It separates the two, renaming the whole function to networkflush and makes flushing ARP optional by appending --arp. Deletion of the network table is now done via FTL's /action/flush/arp endpoint.

Documentation: https://github.com/pi-hole/docs/pull/1253
Related PR in the FTL repo: https://github.com/pi-hole/FTL/pull/2541
2025-07-22 15:20:50 -07:00
yubiuser
310f0711fa Group evaluations
Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net>
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-07-22 12:52:43 +02:00
Christian König
9580dc6560 Improve setFTLConfigValue function
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-22 12:50:42 +02:00
Christian König
70e317f373 Revert https://github.com/pi-hole/pi-hole/pull/6345
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-22 12:50:42 +02:00
Christian König
285b3c37f9 Tweak fluash ARP function
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-22 12:45:22 +02:00
Dan Schaper
41f6738e97 Update man page - remove "reconfigure" option (#6361) 2025-07-21 13:57:51 -07:00
RD WebDesign
22e6ff2cdf Update man page - remove "reconfigure" option
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-07-21 16:15:25 -03:00
Dan Schaper
be36432f24 Speed up pihole api (#6336) 2025-07-21 10:51:25 -07:00
Christian König
a9e3d3b728 Use --skipFTL flag also for pihole repair and checkout
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-21 12:07:33 +02:00
Christian König
a8db4def9a Use flag --skipFTL instead of env var PIHOLE_SKIP_FTL_CHECK
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-21 11:54:12 +02:00
Dan Schaper
4bea9a1d12 Use RTMIN value provided by FTL when possible (#6358)
In some cases `kill -RTMIN` can send incorrect signal value to the FTL causing it to terminate instead of performing lists reload.
https://github.com/pi-hole/FTL/issues/2573
2025-07-20 18:06:00 -07:00
Dan Schaper
35ce3580e5 Reduce pihole --query jq calls (#6334) 2025-07-20 18:02:45 -07:00
Dan Schaper
90eb5778ca Re-order authentication errors in verbose mode (#6338) 2025-07-20 17:46:07 -07:00
Dan Schaper
c0539a4fb0 Remove netcat from the list of dependencies (#6343) 2025-07-20 17:44:04 -07:00
Jack'lul
da85a7a2a7 Use RTMIN value provided by FTL when possible
Signed-off-by: Jack'lul <jacklulcat@gmail.com>
2025-07-18 23:13:19 +02:00
Christian König
95021fce58 Fix permission for *.etag files after gravity run
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-16 21:00:05 +02:00
Christian König
3c52ce98d4 Revert https://github.com/pi-hole/pi-hole/pull/6312
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-16 13:50:37 +02:00
Dan Schaper
ae048201a2 Remove readonly from list.sh to avoid errors (#6349) 2025-07-14 21:10:53 -07:00
RD WebDesign
dad27f8d06 Remove readonly from list.sh to avoid errors
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-07-14 21:20:39 -03:00
Dan Schaper
c0b512be60 Sync master back into development (#6348) 2025-07-14 14:45:31 -07:00
Adam Warner
cef7fd4b02 Pi-hole core 6.1.4 (#6347) 2025-07-14 22:15:50 +01:00
Adam Warner
c09da77e2b Fix pihole api command by not setting the some variabes as readonly (#6346) 2025-07-14 22:09:27 +01:00
Adam Warner
18e8396a44 Fix issue where web interface cannot run gravity (#6345) 2025-07-14 22:05:18 +01:00
Adam Warner
1bef0415db bare minimum first past fix for pihoe api command not working due to attempting to re-set readony variabes PI_HOE_SCRIPT_DIR and utisfie.
Can't compain about them being readony if they're.. not.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-07-14 22:02:02 +01:00
Adam Warner
d6a83baf4f Allow non-root access for updateGravity command
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-07-14 21:38:59 +01:00
Dan Schaper
605ff8183a Sync master back into development (#6341) 2025-07-14 11:45:03 -07:00
darkexplosiveqwx
e231107e81 Remove netcat from the list of dependencies
Signed-off-by: darkexplosiveqwx <101737077+darkexplosiveqwx@users.noreply.github.com>
2025-07-14 20:18:18 +02:00
Dan Schaper
9494dc6061 Pi-hole Core v6.1.3 (#6337) 2025-07-14 07:14:43 -07:00
Christian König
71501e15e5 Re-order authentication errors in verbose mode
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-13 22:16:40 +02:00
Rob Gill
0187087da0 Speed up pihole --api
Get session authentication information via single jq operation,
setting defaults if no data returned.

Simplify jq test for valid JSON data

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-07-14 05:44:46 +10:00
Dan Schaper
9605ccc178 basic-install.sh listing interfaces (#6269) 2025-07-13 11:57:32 -07:00
deHakkelaar
86bdae0076 Update basic-install.sh
Added comments
2025-07-13 11:05:58 +02:00
Rob Gill
05ad3d7155 Update advanced/Scripts/query.sh
Co-authored-by: yubiuser <github@yubiuser.dev>
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-07-12 22:25:22 +00:00
Rob Gill
ea8272d7d4 speed up pihole --query
Count list and gravity matches using jq in a single step.

Use jq's map to simplify list processing, eliminating intermediate
jsons.

Eliminate while loop for each lists's final output and formatting.

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-07-12 14:25:17 +10:00
Dan Schaper
1e88ce4975 piholeDebug - Get default route robustly (#6303) 2025-07-11 16:19:54 -07:00
Adam Warner
bb60e2e346 Sync master back into development (#6332) 2025-07-11 21:02:14 +01:00
Adam Warner
3977a312f0 Update release.yml
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-07-11 21:01:01 +01:00
Dan Schaper
b3d193b34c Update Firewalld tests to match v6 ports (#6307) 2025-07-10 14:15:41 -07:00
Christian König
463086ef23 Skip FTL update check if $PIHOLE_SKIP_FTL_CHECK is set to true
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-10 21:57:38 +02:00
Christian König
f3e04117f6 Let users know we skipped the FTL checks
Co-authored-by: davygravy <davygravy@users.noreply.github.com>
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-10 21:56:52 +02:00
Christian König
f67a8e5110 Only set PIHOLE_SKIP_FTL_CHECK if not already set by env variable
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-10 21:56:52 +02:00
Christian König
3f7f6f0294 Allow uses to skip binary check and installing FTL in case the use a self-compiled binary
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-10 21:56:52 +02:00
Dan Schaper
0a36e9d949 update: abort if FTL branch does not exist (#6329) 2025-07-10 12:55:12 -07:00
MichaIng
6db6c68a4e update: abort if FTL branch does not exist
Currently, if the FTL update check returns 404, hence the FTL branch does not seem to exist, an error message is printed, but the update continues, only the FTL update is skipped.

This can lead to setups with v5 FTL and v6 core/web, failing at config migration, where FTL is invoked with a v6-only command.

With this change, the update aborts immediately if the FTL branch is invalid, like it does in case of other FTL update check errors (other HTTP error codes than 404 or other curl errors). Hence it continues only if FTL is up-to-date already, or a new version from the given branch has been found.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-07-10 21:37:28 +02:00
Dan Schaper
5b5e02d492 Do not skip root check for pihole user (#6312) 2025-07-10 11:48:29 -07:00
Dan Schaper
a2dd0e2f50 Prevent gravity curl from using unset bash variable's empty string. (#6191) 2025-07-10 11:29:00 -07:00
Dan Schaper
3d75ea6df2 Only update the package cache on fresh installations (#6282) 2025-07-10 11:20:03 -07:00
Dan Schaper
080e1ccf8a installer: exit if FTL update check fails (#6316) 2025-07-10 10:59:05 -07:00
Dan Schaper
24f32d48af Fix pihole -q by setting PI_HOLE_SCRIPT_DIR in api.sh (#6284) 2025-07-10 10:51:20 -07:00
Dan Schaper
8486cfd95a Update python version used in test to 3.13 (#6321) 2025-07-10 10:47:49 -07:00
yubiuser
c81d5019a3 Bump pytest-xdist from 3.7.0 to 3.8.0 in /test (#6324) 2025-07-05 23:07:49 +02:00
dependabot[bot]
c5c5116e53 Bump pytest-xdist from 3.7.0 to 3.8.0 in /test
Bumps [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) from 3.7.0 to 3.8.0.
- [Release notes](https://github.com/pytest-dev/pytest-xdist/releases)
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-xdist/compare/v3.7.0...v3.8.0)

---
updated-dependencies:
- dependency-name: pytest-xdist
  dependency-version: 3.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-05 10:28:30 +00:00
Christian König
2f9fa80d7a Update python version used in test to 3.13
Signed-off-by: Christian König <github@yubiuser.dev>
2025-07-01 13:34:55 +02:00
Dominik
f2280eb330 taillog Prevent grep interpeting search term as an option (#6318) 2025-06-29 07:08:21 +02:00
Rob Gill
f24fc9573a taillog Prevent grep interpeting search term as an option
Adds '--' indicating end of options before the user provided
search pattern.

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-06-29 06:45:02 +10:00
MichaIng
3a35e589f2 installer: exit if FTL update check fails
The return code of `FTLdetect()` is used in the installer to know whether FTL has been installed or not.

The function however returns an error only, if the download of FTL fails, not if checking for a latest version/update of FTL fails. This way, installs and rapairs can continue without or with ourdated FTL until `pihole-FTL migrate v6`, which hangs endlessly, if it is a v5 FTL.

This commit handles the return code in `FTLdetect()`, and lets it return true only if FTL download succeeded, or if the update check succeeded and FTL is up-to-date. Else, it could neither be repaired, nor installed, and the error message should give a hint what went wrong, hence exit.

`FTLdetect()` is not called by any other script, hence this change has no surprising effect elsewhere.

Additionally, a syntax error in the `FTLcheckUpdate()` function itself is fixed, which masks the `check_download_exists()` return code, hence always leads to error code 4, if the FTL branch is not `master`.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-06-26 00:53:49 +02:00
Rob Gill
19d5943440 piholeDebug - Get default route robustly
Determine address and interface of default route by preceeding
    'via' and 'dev' fields in json output instead of plain text
    field position.

    Log if unable to determine default gateway

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-06-25 05:10:12 +10:00
Dominik
f90677a1ff Clean COL_TABLE and allow to send color codes when invoked by FTL (${FORCE_COLOR}) (#6314) 2025-06-24 19:24:40 +02:00
Christian König
daec6f8c02 Set color codes when FORCE_COLOR is true
Signed-off-by: Christian König <github@yubiuser.dev>
2025-06-24 19:03:24 +02:00
Christian König
a48665c7bb Remove deprecated and unused colors
Signed-off-by: Christian König <github@yubiuser.dev>
2025-06-24 18:51:01 +02:00
Adam Warner
8a97a1433a Fix dependabot (#6297) 2025-06-22 14:28:08 +02:00
Adam Warner
f94d9f2540 Add note about adding local user to pihole group to final dialog (#6152) 2025-06-22 14:13:46 +02:00
Christian König
830c4bc049 Do not skipp root check for pihole user
Signed-off-by: Christian König <github@yubiuser.dev>
2025-06-21 22:40:43 +02:00
yubiuser
1dbe425146 Bump pytest from 8.4.0 to 8.4.1 in /test (#6311) 2025-06-21 14:31:07 +02:00
yubiuser
fc2f7795e9 Bump tox from 4.26.0 to 4.27.0 in /test (#6310) 2025-06-21 14:30:38 +02:00
dependabot[bot]
0bc06ed204 Bump pytest from 8.4.0 to 8.4.1 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.4.0 to 8.4.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.4.0...8.4.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 8.4.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-21 10:10:47 +00:00
dependabot[bot]
700c892dff Bump tox from 4.26.0 to 4.27.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.26.0 to 4.27.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.26.0...4.27.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.27.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-21 10:10:43 +00:00
RD WebDesign
405053692a Add HTTPS and NTP services to firewalld test
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-06-17 21:32:49 -03:00
RD WebDesign
04d9d32444 Remove test for port 4711
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-06-17 20:19:13 -03:00
Christian König
c19e907c0c Fix dependabot
Signed-off-by: Christian König <github@yubiuser.dev>
2025-06-09 19:06:15 +02:00
Christian König
7a16024020 Run package update everytime before building the meta package when invoking from the install script
Signed-off-by: Christian König <github@yubiuser.dev>
2025-06-08 21:31:56 +02:00
Christian König
5777497f52 Separate package manager detection and cache update functions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-06-08 21:25:43 +02:00
Adam Warner
404dc7cb88 Add 'never-stale' to the exempt issue labels of the stale workflow (#6283) 2025-06-08 15:06:33 +01:00
Adam Warner
2f3dfef862 Dependabot: group updates (#6294) 2025-06-07 18:36:35 +01:00
XhmikosR
b39c9956e8 Dependabot: group updates
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-06-07 18:27:46 +03:00
yubiuser
70bcb0bb2b Bump pytest-xdist from 3.6.1 to 3.7.0 in /test (#6254) 2025-06-07 12:32:36 +02:00
dependabot[bot]
2c1032090d Bump pytest-xdist from 3.6.1 to 3.7.0 in /test
Bumps [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) from 3.6.1 to 3.7.0.
- [Release notes](https://github.com/pytest-dev/pytest-xdist/releases)
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-xdist/compare/v3.6.1...v3.7.0)

---
updated-dependencies:
- dependency-name: pytest-xdist
  dependency-version: 3.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-07 10:07:56 +00:00
yubiuser
b5adc981c2 Bump pytest from 8.3.5 to 8.4.0 in /test (#6293) 2025-06-07 12:06:51 +02:00
dependabot[bot]
3933cb0575 Bump pytest from 8.3.5 to 8.4.0 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.5 to 8.4.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.5...8.4.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 8.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-07 10:01:39 +00:00
Dan Schaper
6964cd124e Sync master back into development (#6291) 2025-06-06 16:22:37 -07:00
DL6ER
082d74eeb1 Install ARMv7 binary even when we detect a 64bit (aarch64) CPU but the operating system is 32bit. See FTL#2494 for reference
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-06-06 06:44:17 +02:00
Christian König
d16c049768 Set PI_HOLE_SCRIPT_DIR in api.sh
Signed-off-by: Christian König <github@yubiuser.dev>
2025-06-05 14:45:29 +02:00
Christian König
5ff4f000d5 Add 'never-stale' to the exempt issue labels of the stale workflow
Signed-off-by: Christian König <github@yubiuser.dev>
2025-06-05 14:16:27 +02:00
Christian König
93ecfb9504 We test a fresh installaton, so don't pretend this is not a fresh installation
Signed-off-by: Christian König <github@yubiuser.dev>
2025-06-05 13:09:03 +02:00
Christian König
ea61755881 Only update the package cache on fresh installations
Signed-off-by: Christian König <github@yubiuser.dev>
2025-06-05 12:50:10 +02:00
deHakkelaar
6130b800e3 basic-install.sh listing interfaces
Following up on below one:

https://github.com/pi-hole/pi-hole/pull/6236

And below poor attempt:

https://github.com/pi-hole/pi-hole/pull/6256

Signed-off-by: deHakkelaar <deHakkelaar@users.noreply.github.com>
2025-06-02 03:59:36 +02:00
Dan Schaper
ec892ec096 Pi-hole Core v6.1.1 (#6267) 2025-06-01 18:35:19 -07:00
Dan Schaper
4d4195ed4e Revert "Use PID1 to determine which command to use when toggeling services" (#6262) 2025-06-01 09:45:48 -07:00
Dan Schaper
260fa5ea40 Sync master back into development (#6253) 2025-06-01 09:15:10 -07:00
yubiuser
03b3b69617 Make LOGFILE readonly after assignment (#6261) 2025-06-01 15:47:11 +02:00
Dan Schaper
8c81335004 Don't revert the package metadata
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2025-05-31 11:39:13 -07:00
Dan Schaper
e1b05028a7 Revert "Use PID1 to determine which command to use when toggeling services" 2025-05-31 09:14:08 -07:00
Dan Schaper
89c4976da4 Make LOGFILE readonly after assignment
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2025-05-31 08:23:24 -07:00
Adam Warner
4fed49c5e5 Pi-hole Core v6.1 (#6221) 2025-05-30 22:56:55 +01:00
yubiuser
cad0d0bf1f Allow to get API URL from local.api.ftl even if DNS port has changed (#6252) 2025-05-30 21:57:23 +02:00
Dan Schaper
42aba32ceb Use PID1 to determine which command to use when toggeling services (#6245) 2025-05-30 12:24:09 -07:00
Christian König
6f429d82b4 Allow to get API URL from local.api.ftl even if DNS port has changed
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-30 21:05:08 +02:00
Christian König
fd40fa6f39 Test need adjustment to long arument syntax
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-30 20:52:37 +02:00
yubiuser
d177c4c776 Add useful comment
Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net>
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-05-30 19:03:12 +02:00
Christian König
888556278e Add gwak to Fedorea 42 test image as other tests also rely on awk
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-28 20:47:55 +02:00
Christian König
69473a7b54 Add awk to meta package dependencie (is missing on Fedora 42 by default) and order dependencies alphabetically
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-28 19:54:44 +02:00
Christian König
f3166d7a78 Adjust test to mock PID1 to be systemd
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-27 23:52:46 +02:00
Christian König
137338e6a8 Use service wrappers in all scripts
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-27 21:23:56 +02:00
Christian König
b707890f10 Use PID1 to determine which command to use when toggeling services
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-27 20:09:59 +02:00
Dominik
822e677c5c Use a more general method to determine whether systemd is the init system (#6043) 2025-05-27 19:33:57 +02:00
Christian König
1a3a23a867 Give FTL 120 seconds to shutdown
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-26 21:38:26 +02:00
yubiuser
5aadc5f475 Function gravity_CheckDNSResolutionAvailable() should return 0 if DNS resolution is available (#6240) 2025-05-21 07:44:04 +02:00
RD WebDesign
6ba6b0f015 Return 1 only if resolution fails
Function gravity_CheckDNSResolutionAvailable() should return 0 if DNS resolution is available

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-05-20 19:46:28 -03:00
yubiuser
5f60860a17 Bump tox from 4.25.0 to 4.26.0 in /test (#6237) 2025-05-17 13:13:30 +02:00
dependabot[bot]
86d9ac5f8f Bump tox from 4.25.0 to 4.26.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.25.0 to 4.26.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.25.0...4.26.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-version: 4.26.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-17 10:02:13 +00:00
Dan Schaper
a04ed13d0a Allow simple pihole api output, containing only the JSON payload (#6096) 2025-05-16 13:57:04 -07:00
Dan Schaper
04e52daaf3 Update get_available_interfaces() to correctly filter loopback device (lo) (#6236) 2025-05-15 08:43:12 -07:00
Piotr Tyrakowski
88934ec818 Update basic-install.sh
Signed-off-by: Piotr Tyrakowski <verscup@gmail.com>
2025-05-14 21:47:34 +02:00
Dan Schaper
9aa005ad4c Revert "fix(get_available_interfaces): only drop the loopback device (‘lo’), don’t filter every “lo” substring" (#6235) 2025-05-14 09:53:07 -07:00
Dan Schaper
f6d477f228 Revert "fix(get_available_interfaces): only drop the loopback device (‘lo’), don’t filter every “lo” substring" 2025-05-14 09:51:47 -07:00
Dan Schaper
3c1d8690fa fix(get_available_interfaces): only drop the loopback device (‘lo’), don’t filter every “lo” substring (#6224) 2025-05-14 09:05:21 -07:00
Dan Schaper
3314887e65 Change FTLcheckUpdate to use api.github.com and jq to retrieve tag_name (#6229) 2025-05-14 08:32:42 -07:00
Dan Schaper
c1a5b902fb Use shell parameter expansion to split http_code and payload for api.sh (#6230) 2025-05-14 08:31:13 -07:00
Christian König
a590b77431 Link to documentation on how to add local user to pihole group
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-14 09:36:52 +02:00
RD WebDesign
dee44cb3da Define "silent" as default option and include "verbose" to the man page
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-05-13 14:22:41 -03:00
Dan Schaper
de31858950 Use shell parameter expansion to split http_code and payload
Codespell

editorconfig

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2025-05-12 12:26:56 -07:00
Piotr Tyrakowski
13848f2da1 Update automated install/basic-install.sh
Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net>
Signed-off-by: Piotr Tyrakowski <verscup@gmail.com>
2025-05-12 21:13:01 +02:00
RD WebDesign
e01d49b3ee Change FTLcheckUpdate to use api.github.com and jq to retrieve tag_name
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-05-12 15:53:12 -03:00
RD WebDesign
190798e572 Allow simple pihole api output, containing only the JSON payload
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-05-12 14:23:15 -03:00
Dan Schaper
1bdbc26a07 Give FTL 60 seconds for graceful shutdown (#6187) 2025-05-12 10:13:29 -07:00
Christian König
842afc2475 Give FTL 60 seconds for graceful shutdown
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-12 19:02:29 +02:00
Dan Schaper
398405c303 All gravity related files and dirs should be owned by pihole:pihole (#6186) 2025-05-12 08:48:27 -07:00
yubiuser
189da82614 && chown
Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net>
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-05-12 08:54:58 +02:00
Dan Schaper
99d00e0ed0 Do not try to upgrade gravity if it does not exist (#6218) 2025-05-11 08:47:46 -07:00
Dan Schaper
3c6c3d3a15 Fix API logic in api.sh (#6193) 2025-05-11 08:43:12 -07:00
Dan Schaper
3c0ff57660 Allow alternative cron daemons on Debian (#6180) 2025-05-11 08:12:29 -07:00
Piotr Tyrakowski
9f3e71b0b6 Update basic-install.sh
I have updated line 708
to use grep -v "loo" 
instead of "lo" 
the reason is with "lo" it cannot find "wlo1" interface

Signed-off-by: Piotr Tyrakowski <verscup@gmail.com>
2025-05-09 17:03:57 +02:00
Christian König
d45003a8ca Do not try to upgrade gravity if it does not exist
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-05 17:27:53 +02:00
yubiuser
7aaaa49cf0 Set dns.interface during installation (#6216) 2025-05-05 08:39:23 +02:00
Christian König
fc103af050 Revert response code logic
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-04 21:45:44 +02:00
yubiuser
46fbd931b5 Use CODEOWNERS instead of deprecated dependbot/reviewers (#6213) 2025-05-04 20:56:09 +02:00
Christian König
96437dc913 Set dns.interface during installation
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-04 19:39:43 +02:00
yubiuser
cae558d5d4 Extend .gitignore (#6215) 2025-05-04 14:32:40 +02:00
darkexplosiveqwx
65fd0b099d Extend .gitignore
Signed-off-by: darkexplosiveqwx <101737077+darkexplosiveqwx@users.noreply.github.com>
2025-05-04 14:22:02 +02:00
Christian König
95d27ac985 Merge branch 'development' into tweak/gravity_options
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-04 14:17:41 +02:00
yubiuser
744ac6ad88 Add Fedora 42 to tests (#6177) 2025-05-04 13:28:03 +02:00
darkexplosiveqwx
b82487ee6a Add Fedora 42 to tests
Signed-off-by: darkexplosiveqwx <101737077+darkexplosiveqwx@users.noreply.github.com>
2025-05-04 12:02:15 +02:00
Dan Schaper
0a72e517b6 Remove reference to telnet and chronometer in README (#6188) 2025-05-03 13:38:29 -07:00
Dan Schaper
09368a77b4 Remove unused $target from gravity (#6192) 2025-05-03 13:37:45 -07:00
Dan Schaper
0e6439c6c0 Remove check for supported OS (#6206) 2025-05-03 13:17:56 -07:00
Christian König
0c533ec71b Use CODEOWNERS instead of deprecated dependbot/reviewers
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-03 20:06:24 +02:00
Christian König
5355e9e084 Remove os_check from debug script
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-28 21:10:36 +02:00
Christian König
54c8dd3d77 Remove os_check from tests
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-28 21:06:05 +02:00
Christian König
d9f4ee7aaa Remove os_check from update script
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-28 21:04:08 +02:00
Christian König
40da3a40ec Remove os_check from install script
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-28 21:03:08 +02:00
yubiuser
3cbaee7b76 Fix gravity waiting forever for DNS (#6196) 2025-04-26 16:48:24 +02:00
yubiuser
3bd6a41795 Improve wording
Co-authored-by: Adam Warner <me@adamwarner.co.uk>
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-04-26 15:36:22 +02:00
Christian König
4303a5868f Only append dot
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-26 15:03:42 +02:00
Christian König
215003899d (2+1)*40
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-26 15:03:01 +02:00
yubiuser
cf3b7d0d8e Bump actions/setup-python from 5.5.0 to 5.6.0 (#6199) 2025-04-26 12:56:31 +02:00
dependabot[bot]
454f96d0ea Bump actions/setup-python from 5.5.0 to 5.6.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.5.0 to 5.6.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.5.0...v5.6.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: 5.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-26 10:25:43 +00:00
Christian König
1bea6db50a Fix API logic in api.sh
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-25 21:16:52 +02:00
Christian König
72a52807d1 Fix gravity waiting forever for DNS
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-25 21:03:09 +02:00
Christian König
d7b6d6aa33 Remove unused $target from gravity
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-22 23:06:01 +02:00
Christian König
7a641f4c35 Use paramteter expansion to prevent adding literal '' if parameter is empty
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-22 22:52:33 +02:00
Rob Gill
ce0bdac1bd Remove reference to telnet and chronometer in README
Replace with curl example and commandline example

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-04-23 06:41:16 +10:00
Christian König
13d76abff7 Set customUpstreamResolver empty
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-22 22:38:07 +02:00
Christian König
76e41aeefa Add small note about modifiedOptions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-22 22:03:54 +02:00
Christian König
774037834b Rename cmd_ext
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-22 22:01:21 +02:00
Christian König
89c4248315 Use quotes for all substitutions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-22 21:57:47 +02:00
Michael Woolweaver
6fc5bf83f4 don't mute SC2086
Signed-off-by: Michael Woolweaver <michael@woolweaver.bid>
2025-04-22 21:56:21 +02:00
Christian König
4a1bcda6f1 All gravity related files and dirs should be owned by pihole:pihole
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-21 09:30:36 +02:00
yubiuser
60485fdc51 Remove duplicated code checking if adlist domain is blocked locally (#6183) 2025-04-21 09:17:39 +02:00
yubiuser
6fe77ebeed Treat FTL return data as strings - part II (#6184) 2025-04-21 09:16:58 +02:00
Christian König
8733b429dd Treat FTL return data as strings - part II
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-20 22:50:55 +02:00
Christian König
1432568d17 Remove duplicated code checking if adlist domain is blocked locally
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-20 20:14:41 +02:00
Ihor Urazov
cff7f40739 Allow alternative cron daemons on Debian
Add cron-daemon virtual package as an alternative dependency. This way
pihole-meta by default still depends on cron, but allows installation of
systemd-cron, which completely replaces cron daemon and package. With
systemd-cron functionality of crontab files and /etc/cron.* directories
works expected, as systemd-cron generates systemd timers from cron
files.

Signed-off-by: Ihor Urazov <iurazov@healthjoy.com>
2025-04-19 20:33:19 +03:00
yubiuser
248d25b8d0 Install on IPv6-only/DNS64/NAT64 system (#6144) 2025-04-15 17:33:09 +02:00
Dominik
95c1b1a542 Add ON DELETE CASCADE to FOREIGN KEY REFERENCES in gravity.db (#6113) 2025-04-15 06:24:52 +02:00
Rob Gill
9e62625f83 Install on IPv6-only/DNS64/NAT64 system
Alters the test for IPv4 route so the installer doesn't fail instantly on IPv6-only.

Gives user a dialog to proceed with IPv6 only installation

Switches DNS server options to only contain IPv6 addresses.

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-04-15 14:13:43 +10:00
Dan Schaper
faeba69090 revert a change to gravity.sh that attempted to fix an SC2086 warning… (#6162) 2025-04-09 10:07:10 -07:00
Adam Warner
48272f3393 revert a change to gravity.sh that attempted to fix an SC2086 warning from shellcheck.
Fixes #6159

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-09 18:02:40 +01:00
Adam Warner
195e65855d Fix more shellcheck warnings (#6155) 2025-04-08 17:27:07 +01:00
Christian König
0f511ad574 Remove token and use sarif-fmt for nicer CLI output
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-08 17:50:19 +02:00
Adam Warner
323dbbe5d9 Reduce code duplication in piholeLogFlush (#6148) 2025-04-08 12:44:30 +01:00
Christian König
bda81cb2f5 Remove debug SARIF upload
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-07 21:25:29 +02:00
Christian König
b271dbf606 Set shellcheck level to warning, can be lowered later
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-07 14:11:39 +02:00
Christian König
5002ce8ba7 Source files relative to the repos root
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-07 14:10:01 +02:00
Christian König
135b0cce14 Switch to Differential ShellCheck
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-07 11:54:35 +02:00
Christian König
23fc53c618 Set -x option for shellcheck GHA
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-07 11:32:14 +02:00
Adam Warner
3732ea7365 Remove shellcheck directives that no longer serve any purpose
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-07 10:24:53 +01:00
Christian König
ca1bab3c1b Fix more shellcheck warnings
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-07 10:52:57 +02:00
yubiuser
36e6c9921e Shellcheck Tweaks (#6147) 2025-04-07 10:08:25 +02:00
Dan Schaper
6c5bc1de39 versions file should readable by others (make pihole -v work for non-root users) (#6002) 2025-04-06 12:58:16 -07:00
Christian König
9f5e18b1cd Make it 644
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-06 21:13:47 +02:00
Christian König
d28e795266 Permissions on versions file should be 640
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-06 21:12:58 +02:00
Christian König
e579397f51 Allow all users to read the version file
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-06 20:52:57 +02:00
Adam Warner
2088601148 Add .shellcheckrc to configure shellcheck ignore SC1090-1 globally
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-06 18:46:47 +01:00
Adam Warner
48c59cb6cf In ./automated install/uninstall.sh line 14:
readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome")
         ^-----------------^ SC2155 (warning): Declare and assign separately to avoid masking return values.

In ./advanced/Scripts/update.sh line 39:
readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome")
         ^-----------------^ SC2155 (warning): Declare and assign separately to avoid masking return values.

In ./advanced/Scripts/updatecheck.sh line 45:
readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome")
         ^-----------------^ SC2155 (warning): Declare and assign separately to avoid masking return values.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-06 14:20:51 +01:00
Adam Warner
f01e8c70d9 Weirldly, GHA missed these minor warnings however have disabled them as they are due to variables either being used in or declared in basic-install,.sh
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-06 14:11:40 +01:00
Adam Warner
3a9b9c027e In ./pihole line 20:
source "${colfile}"
       ^----------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location.

In ./pihole line 23:
source "${utilsfile}"
       ^------------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location.

In ./pihole line 27:
source "${apifile}"
       ^----------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location.

In ./pihole line 34:
    source "${versionsfile}"
           ^---------------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location.

In ./pihole line 251:
  local timer="$(echo "${data}"| jq --raw-output '.timer' )"
        ^---^ SC2155 (warning): Declare and assign separately to avoid masking return values.

In ./pihole line 255:
  local str="Pi-hole $(echo "${data}" | jq --raw-output '.blocking')${extra}"
        ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values.

In ./pihole line 378:
  local logging_enabled=$(getFTLConfigValue dns.queryLogging)
        ^-------------^ SC2155 (warning): Declare and assign separately to avoid masking return values.

In ./pihole line 385:
  readonly LOGFILE=$(getFTLConfigValue files.log.dnsmasq)
           ^-----^ SC2155 (warning): Declare and assign separately to avoid masking return values.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-06 14:11:40 +01:00
Adam Warner
f5dc337d1b In ./advanced/Scripts/piholeLogFlush.sh line 12:
source ${colfile}
       ^--------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location.

In ./advanced/Scripts/piholeLogFlush.sh line 16:
source "${utilsfile}"
       ^------------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-06 14:11:40 +01:00
Adam Warner
63623c4353 In ./advanced/Scripts/piholeCheckout.sh line 112:
corebranches=($(get_available_branches "${PI_HOLE_FILES_DIR}"))
                      ^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting).

In ./advanced/Scripts/piholeCheckout.sh line 139:
        webbranches=($(get_available_branches "${webInterfaceDir}"))
                     ^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting).

In ./advanced/Scripts/piholeCheckout.sh line 170:
        ftlbranches=( $(git ls-remote https://github.com/pi-hole/ftl | grep "refs/heads" | cut -d'/' -f3- -) )
                      ^-- SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting).

In ./advanced/Scripts/piholeCheckout.sh line 218:
            elif [ $? -eq 2 ]; then
                   ^-- SC2319 (warning): This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-06 14:11:40 +01:00
Adam Warner
59d2177271 In ./advanced/Scripts/database_migration/gravity-db.sh line 18:
piholeDir="${2}"
    ^-------^ SC2034 (warning): piholeDir appears unused. Verify use (or export if used externally).

Turns out it is _actually_ unused, the full path of the gravity database is passed to the function, so we'll tidy this up rather than supressing.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-06 14:11:40 +01:00
Adam Warner
a624d3be8d In ./advanced/Scripts/utils.sh line 91:
if [[ $? -eq 5 ]]; then
     ^------------^ SC3010 (warning): In POSIX sh, [[ ]] is undefined.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-06 14:11:40 +01:00
Adam Warner
39f5115135 In ./automated install/basic-install.sh line 1753:
local status=$(curl --head --silent "https://ftl.pi-hole.net/${1}" | head -n 1)
          ^----^ SC2155 (warning): Declare and assign separately to avoid masking return values.

In ./automated install/basic-install.sh line 2076:
            elif [ $? -eq 2 ]; then
                   ^-- SC2319 (warning): This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-06 14:11:40 +01:00
Adam Warner
e018a37a8c First things first - bump severity of shellcheck action from error to warning
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-06 14:11:40 +01:00
Adam Warner
6e06a93c31 functionise log rotation and flushing code to avoid dupliation
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-06 13:57:07 +01:00
Adam Warner
7e5d9db6b7 Remove no-longer-needed pihole sudoers file (#6143) 2025-04-06 13:52:37 +01:00
Dominik
5afab5e96c Move list parsing entirely into FTL (#6105) 2025-04-05 20:15:16 +02:00
yubiuser
ab8b8da9c3 Bump pytest-testinfra from 10.1.1 to 10.2.2 in /test (#6151) 2025-04-05 12:11:16 +02:00
dependabot[bot]
07864032de Bump pytest-testinfra from 10.1.1 to 10.2.2 in /test
Bumps [pytest-testinfra](https://github.com/pytest-dev/pytest-testinfra) from 10.1.1 to 10.2.2.
- [Release notes](https://github.com/pytest-dev/pytest-testinfra/releases)
- [Changelog](https://github.com/pytest-dev/pytest-testinfra/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-testinfra/compare/10.1.1...10.2.2)

---
updated-dependencies:
- dependency-name: pytest-testinfra
  dependency-version: 10.2.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-05 10:05:08 +00:00
Adam Warner
bdcb6fc88c Update update.sh, updatecheck.sh and uninstall.sh to honour pihole.to… (#5981) 2025-04-05 01:18:49 +01:00
Adam Warner
f403468450 Add webserver log to piholeLogFlush.sh (#6049) 2025-04-05 00:33:18 +01:00
Adam Warner
097ac8336e Add recommended fields to the deb package (#6054) 2025-04-05 00:31:26 +01:00
Christian König
fe2b22c570 Add recommended fields to the deb package
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-05 00:29:13 +01:00
Adam Warner
2477d6b184 Revert #6137 (#6146) 2025-04-04 23:28:51 +01:00
Adam Warner
f98b9520e4 v5 sudoers file that allowed www-data to run pihole command is no longer needed. "Fixes" #6066
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-04-04 23:19:14 +01:00
yubiuser
65b42c1c8f Ensure gravity_Cleanup() checks the correct directory (#6131) 2025-04-04 22:50:19 +02:00
Michael Woolweaver
e548ed043f ensure gravity_Cleanup() checks the correct directory for list data
also glob with * to ensure .etag & .sha1 are removed as well
should fix #6075

Co-authored-by: yubiuser <github@yubiuser.dev>
Signed-off-by: Michael Woolweaver <michael@woolweaver.bid>
2025-04-04 15:15:51 -05:00
Adam Warner
4108c817dc Revert "source with source not dot (#6137)"
This reverts commit 8fd2ebd3d7, reversing
changes made to 557bc6f179.
2025-04-04 19:12:57 +01:00
Dan Schaper
8fd2ebd3d7 source with source not dot (#6137) 2025-04-02 12:36:48 -07:00
Michael Woolweaver
4efe4dfd4b source with source not dot
Signed-off-by: Michael Woolweaver <michael@woolweaver.bid>
2025-04-02 14:21:45 -05:00
Adam Warner
557bc6f179 Add CentOS 10 to test suite (#6126) 2025-04-02 18:24:36 +01:00
Adam Warner
8fce8f6149 build gravityDBfile_default like the other variables (#6133) 2025-04-02 17:12:21 +01:00
Michael Woolweaver
3cb6ea503a build gravityDBfile_default like the other variables
seems this one was forgotten

Signed-off-by: Michael Woolweaver <michael@woolweaver.bid>
2025-04-01 23:57:56 -05:00
Christian König
7886cfc80b Add CentOS 10 to test suite
Signed-off-by: Christian König <github@yubiuser.dev>
2025-03-31 12:13:34 +02:00
Adam Warner
8797a0df05 Sync master back into development (#6122) 2025-03-30 18:31:02 +01:00
Adam Warner
0f7803b775 Pi-hole Core v6.0.6 (#6118) 2025-03-30 17:54:55 +01:00
James George
0f482396ee Update update.sh, updatecheck.sh and uninstall.sh to honour pihole.toml settings for webserver.paths.webroot and webserver.paths.webhome
When uninstalling, remove web interface parent directory empty check and possible removal.

Signed-off-by: James George <james.george@vigilantvoid.com>
2025-03-30 13:11:21 +08:00
yubiuser
73074f1557 Bump tox from 4.24.2 to 4.25.0 in /test (#6116) 2025-03-29 21:46:47 +01:00
yubiuser
bc23303788 Bump actions/setup-python from 5.4.0 to 5.5.0 (#6117) 2025-03-29 21:43:58 +01:00
dependabot[bot]
49fbdc4c00 Bump actions/setup-python from 5.4.0 to 5.5.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.4.0 to 5.5.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.4.0...v5.5.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-29 10:25:36 +00:00
dependabot[bot]
315528d740 Bump tox from 4.24.2 to 4.25.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.24.2 to 4.25.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.24.2...4.25.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-29 10:25:08 +00:00
DL6ER
71ec0a0244 Add ON DELETE CASCADE to FOREIGN KEY REFERENCES in gravity.db
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-27 13:10:53 +01:00
Adam Warner
e5cb0efd61 revert #6030 in preparation for docker-pi-hole #1794 (#6086) 2025-03-25 17:06:01 +00:00
DL6ER
dec670a6d6 Move list parsing entirely into FTL
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-22 09:18:02 +01:00
Michael Woolweaver
3a592471c6 revert pi-hole/pi-hole/pull/6030
in preparation for pi-hole/docker-pi-hole/pull/1786

Signed-off-by: Michael Woolweaver <michael@woolweaver.bid>
2025-03-14 14:32:29 -05:00
yubiuser
3f5c00919b Remove WEB_CALL from COL_TABLE (#6062) 2025-03-10 06:14:47 +01:00
yubiuser
349544b24a Create webserver.log on FTL startup (#6051) 2025-03-10 06:14:22 +01:00
yubiuser
387ec3a3c2 Bump pytest from 8.3.4 to 8.3.5 in /test (#6068) 2025-03-08 11:50:40 +01:00
dependabot[bot]
6b873b2d7f Bump pytest from 8.3.4 to 8.3.5 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.4 to 8.3.5.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.4...8.3.5)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-08 10:46:01 +00:00
yubiuser
46e5b3b02e Bump tox from 4.24.1 to 4.24.2 in /test (#6067) 2025-03-08 11:44:54 +01:00
dependabot[bot]
27aeed76f0 Bump tox from 4.24.1 to 4.24.2 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.24.1 to 4.24.2.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.24.1...4.24.2)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-08 10:30:22 +00:00
yubiuser
80d63eca93 Add 2FA handling to api.sh (#6065) 2025-03-08 10:46:54 +01:00
yubiuser
72404c983d Add trailing / when changing ownership of /etc/pihole (#6057) 2025-03-07 23:08:04 +01:00
casperklein
9b4502a7a9 Add trailing / to directories
Signed-off-by: casperklein <casperklein@users.noreply.github.com>
2025-03-07 23:00:40 +01:00
Christian König
5de9b6ae69 Add 2FA handling to api.sh
Signed-off-by: Christian König <github@yubiuser.dev>
2025-03-07 13:43:41 +01:00
Christian König
f3dc202e36 Remove WEB_CALL from COL_TABLE
Signed-off-by: Christian König <github@yubiuser.dev>
2025-03-07 10:16:25 +01:00
yubiuser
9050e47049 version.sh: fix typo in comment (#6056) 2025-03-06 20:49:20 +01:00
XhmikosR
45cb722e50 version.sh: fix typo in comment
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-03-06 21:40:17 +02:00
yubiuser
98b17edfd7 README.md: switch to the SVG logo (#6052) 2025-03-06 14:27:58 +01:00
XhmikosR
d094b197e3 README.md: switch to the SVG logo
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-03-06 15:06:34 +02:00
Christian König
e437e3a805 Create webserver.log on FTL startup
Signed-off-by: Christian König <github@yubiuser.dev>
2025-03-06 09:48:06 +01:00
Jack'lul
4df5c0bb96 Add webserver log to piholeLogFlush.sh
Signed-off-by: Jack'lul <8418678+jacklul@users.noreply.github.com>
2025-03-05 22:25:33 +01:00
Adam Warner
411b9fcb6d Sync master back into development (#6046) 2025-03-04 19:46:03 +00:00
Adam Warner
9fe687bd62 Pi-hole Core v6.0.5 (#6042) 2025-03-04 17:21:05 +00:00
DL6ER
bef8227cbd Use a more general method to determine whether systemd is the init system
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-03 20:16:07 +01:00
Adam Warner
edf336067a Fix gravity.sh -- Alpine / Docker specific issue (#6030) 2025-03-03 17:44:45 +00:00
Adam Warner
196a84721f Fix find command syntax, remove log dir from search (#6035) 2025-03-03 17:40:12 +00:00
Adam Warner
978694f262 Improve update/fresh install detection (#6034) 2025-03-03 12:23:29 +00:00
Dominik
7eef780fbc Revert "Improve gravity on systems with low memory" (#6039) 2025-03-03 11:01:45 +01:00
Dominik
df814ece91 Revert "Improve gravity on systems with low memory" 2025-03-03 09:00:17 +01:00
Karol Kania
9c7e02f213 Update gravity.sh
remove the left-over commented debug code 

Signed-off-by: Karol Kania <44871508+karolkania@users.noreply.github.com>
2025-03-02 12:05:42 +01:00
Jack'lul
0130f7be74 Fix find command syntax, remove log dir from search
Signed-off-by: Jack'lul <8418678+jacklul@users.noreply.github.com>
2025-03-01 14:43:36 +01:00
Dan Schaper
f207385269 Removing kernel check based on discussion in Pi-Hole PR pi-hole#5957. (#6020) 2025-02-28 20:00:00 -08:00
Adam Warner
ce73691082 Juggle some code around:
- Move random password generation block inside final "fresh install" if block, ensure password is ONLY generated on fresh installs.
 - Add additional check for fresh install around setting of PIHOLE_DNS1/2, QUERY_LOGGING, and PRIVACY_LEVEL
 - Remove dedicated displayFinalMessage function.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-02-28 23:06:52 +00:00
Adam Warner
8874757958 Start by renaming useUpdateVars to fresh_install and flipping the logic, the old name is not relevant any more
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-02-28 21:29:33 +00:00
Adam Warner
821c953216 Remove 'reconfigure' option (#5887) 2025-02-28 21:14:18 +00:00
Dominik
53e241f057 Improve gravity on systems with low memory (#5977) 2025-02-28 17:02:56 +01:00
Karol Kania
a9650ae287 Update gravity.sh
fix the `if statement` that doesn't seem to work for neither of alpine's ash / bash - applying some workaround with the `stat` command

Signed-off-by: Karol Kania <44871508+karolkania@users.noreply.github.com>
2025-02-28 12:52:07 +01:00
Christian König
7282aada25 Don't show a warning before the repair is done
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-28 11:51:09 +01:00
Dominik
c5d66c2162 Do not overwrite TLS cert/key mode (#5998) 2025-02-27 19:45:32 +01:00
UltChowsk
869411a514 Fixing whitespaces after removing lines.
Signed-off-by: UltChowsk <ult@chowsk.net>
2025-02-27 06:24:13 -05:00
UltChowsk
d1b5f95aa7 Removing kernel check based on discussion in Pi-Hole PR pi-hole#5957.
Signed-off-by: UltChowsk <ult@chowsk.net>
2025-02-26 20:37:20 -05:00
MichaIng
ad6a48b219 Add comment about TLS-related file permissions
Co-authored-by: Dominik <DL6ER@users.noreply.github.com>
Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-26 20:59:32 +01:00
Christian König
43ee724718 Improve alignment and add link to blog post
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-26 13:30:46 +01:00
MichaIng
83a38bb71d Add comment about file permissions
Co-authored-by: Dominik <DL6ER@users.noreply.github.com>
Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-26 12:26:50 +01:00
MichaIng
232d581916 Re-add comment about execute bit on directory
Co-authored-by: Dominik <DL6ER@users.noreply.github.com>
Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-26 12:25:51 +01:00
Dan Schaper
002536ae09 Do not hide error messages when dealing with services (#5983) 2025-02-25 12:30:39 -08:00
yubiuser
8a788ad755 Update README.md - Fix Text+URL for allowlisting/denylisting (#5993) 2025-02-25 20:57:57 +01:00
Christian König
4609f90860 Show an warning dialoge before performing an update
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-25 14:33:30 +01:00
MichaIng
0b380d671d Follow symlinks with find
Incorporating https://github.com/pi-hole/pi-hole/pull/5997

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-24 17:37:01 +01:00
MichaIng
65bcb24d0e Fix test
Do not check whether the pihole user can read /etc/pihole/logrotate. It needs to be readable by root only, which is always true.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-24 17:29:59 +01:00
MichaIng
e70981d80f Do not overwrite TLS cert/key mode
FTL correctly creates the cert and especially private key with 0600 mode. But the prestart scripts changes it to 0660.

After removing the dedicated webserver from Pi-hole setups, the pihole group has no purpose anymore, and files should not be writable to any other user than pihole itself, and the private TLS key not reasable to anyone else either.

Additionally, this commit consolidates the chmod calls, applying 0755 to all directories and 0640 to all files, but the TLS key and cert.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-24 17:29:58 +01:00
yubiuser
9840b42847 Add missing trailing / when setting permissions of /etc/pihole (#5997) 2025-02-24 17:24:10 +01:00
Christian König
b59ab5852a Add missing trailing / when setting permissions of /etc/pihole
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-24 15:59:11 +01:00
Jeroen Habets
a0541dd7fb Update README.md
Fix Text+URL for allowlisting/denylisting. Keep former terms for when people search for them.

Signed-off-by: Jeroen Habets <jeroenhabets@users.noreply.github.com>
2025-02-24 10:45:17 +01:00
Dominik
48c4efd7b0 Improve dig error handlin in api.sh (#5965) 2025-02-23 20:15:31 +01:00
MichaIng
729a44f82a Do not hide error messages when dealing with services
If service start/stop/restart/enable/disable fails, it help to debug the issue, if STDERR is not hidden, hence the error message can be seen. systemctl furthermore has the `-q` option to suppress non-error output. It works as well for "is-enabled", but until a certain systemd version still throws an error, if the checked service does not exist at all. Once Debian Bullseye support is dropped by Pi-hole, also STDERR form systemctl is-enabled does not need to be suppressed anymore.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-23 15:48:32 +01:00
Dominik
9c995962a5 If there are no files to change, don't print an error (#5953) 2025-02-23 09:04:16 +01:00
DL6ER
5da5d0d4c1 Use temp_store = FILE to avoid memory exhaustion on build the tree for very large databases
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-02-23 08:50:08 +01:00
Adam Warner
a7e414aca4 Sync master back into development (#5976) 2025-02-22 23:17:53 +00:00
Adam Warner
567bb724b1 Pi-hole Core v6.0.4 (#5975) 2025-02-22 23:14:13 +00:00
Adam Warner
bc3c78f4fa Print a more helpful message on pihole checkout in docker containers (#5963) 2025-02-22 22:49:51 +00:00
yubiuser
ce18de3d6d Assure that Lighttpd conf-enabled symlink is removed (#5974) 2025-02-22 23:31:47 +01:00
MichaIng
8e706e4a16 Assure that Lighttpd conf-enabled symlink is removed
`/etc/lighttpd/conf-enabled` usually contains symlinks to the actual files in `/etc/lighttpd/conf-available`, at least `lighty-enable-mod` does exactly this. If `/etc/lighttpd/conf-available/15-pihole-admin.conf` is removed first, `/etc/lighttpd/conf-enabled/15-pihole-admin.conf` hence points to nowhere, which makes the `-f` check return false. The orphaned symlink is hence not removed, if `lighty-disable-mod` is not available.

This PR changes the order, to remove the symlink first, and to be failsafe also if it is orphaned already, and the actual config afterwards.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-22 23:27:05 +01:00
Adam Warner
667a25574a Fix dnsmasq v5 to v6 config migration (#5968) 2025-02-22 21:33:02 +00:00
MichaIng
8f5296536e Fix dnsmasq v5 to v6 config migration
The dnsmasq config files were removed in `remove_old_dnsmasq_ftl_configs()`, before they were tried to be migrated via `migrate_dnsmasq_configs()`, and hence most settings were lost during v5 to v6 update.

This commit renames and adjussts `remove_old_dnsmasq_ftl_configs()` to move dnsmasq config files into the migration directory instead, to be picked up by `migrate_dnsmasq_configs()` later.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-22 21:43:49 +01:00
Adam Warner
da4048ba5d Only run migration code if setupVars.conf exists. (#5969) 2025-02-22 20:30:46 +00:00
Adam Warner
1764f99333 decide migration based on existence of setupVars rather than pihole.toml
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-02-22 15:35:05 +00:00
Christian König
cadee26dba Improve dig error handlin in api.sh
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-22 13:48:55 +01:00
DL6ER
b64a54bba1 Print a more helpful message on pihole checkout in docker containers
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-02-22 11:53:16 +01:00
yubiuser
5d5bddc979 Don't set a random password on v5 -> v6 updates (#5960) 2025-02-22 11:21:17 +01:00
Christian König
bd3a0f4891 Don't set a random password on v5 -> v6 updates
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-22 07:16:28 +01:00
Christian König
cd269cbca1 If there are no files to change, don't print an error
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-21 22:02:03 +01:00
Adam Warner
8290e414ce Sync master back into development (#5944) 2025-02-20 23:23:31 +00:00
Adam Warner
0e6d9e74d9 Pi-hole Core v6.0.2 (#5939) 2025-02-20 23:07:13 +00:00
Adam Warner
f38332409f Fix empty password detection (#5935) 2025-02-20 22:43:52 +00:00
MichaIng
cd4efc3141 Fix empty password detection
The CLI skips double quotes in config output, hence the output is completely empty, if no password was applied yet, e.g. on a fresh install. This leads to an unprotected web interface. The check is corrected, to have a random password applied as intended.

Additionally, the logic to show an unchanged or unset password on the completion dialog is inverted to correctly show "unchanged" resp. "NOT SET" if the password has not been changed resp. is empty.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-20 19:12:59 +01:00
Adam Warner
99bd142dd5 Apply chosen upstream DNS on fresh install (#5938) 2025-02-20 17:59:37 +00:00
MichaIng
49bb6dc0da Apply chosen upstream DNS on fresh install
While the dialog is shown to choose or enter an upstream DNS for Pi-hole, it is never applied. Hence fresh Pi-hole installs have no upstream DNS and cannot resolve queries.

It is now checked for the two generated variables PIHOLE_DNS_1 and PIHOLE_DNS_2, a TOML array generated and applied via pihole-FTL CLI.

Signed-off-by: MichaIng <micha@dietpi.com>
2025-02-20 18:28:38 +01:00
Dominik
6f82ec5121 Sync master back into development (#5913) 2025-02-19 17:30:40 +01:00
Dominik
9de976cbbd Pi-hole Core 6.0.1 (#5912) 2025-02-19 17:17:57 +01:00
yubiuser
0890f67322 Fix i386 fallback download (#5903) 2025-02-19 10:12:29 +01:00
DL6ER
f7403e2ee6 Fix binary name in 32 bit x86 fallback case
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-02-19 08:42:32 +01:00
Dominik
51a9412c4b Sync master back into development (#5892) 2025-02-18 19:22:47 +01:00
Adam Warner
2d81552f9f Pi-hole core v6.0.0 (#5842) 2025-02-18 17:19:41 +00:00
yubiuser
2faad0b60a Fix database integrity check in debug log (#5889) 2025-02-14 07:41:07 +01:00
Christian König
c9e58adc48 DHCP discover timeout was reduced by FTL
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-10 20:41:18 +01:00
Christian König
d1639740d9 Fix database integrity check in debug log
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-10 20:29:05 +01:00
Dominik
abb94cafe4 Amend warning on gravity tree build failure (#5888) 2025-02-09 19:07:57 +01:00
DL6ER
1bebeff720 Add further info message that building the tree may have failed because of too little RAM baing available. We have see this a few times, either with way too many domains on devices like a Pi Zero or, e.g., only 256 MB RAM being allocated to VMs
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-02-09 10:06:24 +01:00
Christian König
dfc2b32248 Use better function name
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-06 21:57:17 +01:00
Christian König
49cf5bb221 Remove 'reconfigure' option
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-06 21:57:05 +01:00
yubiuser
9d53ad7668 installer: use a drop-in to disable systemd-resolved stub listener (#5885) 2025-02-06 18:47:49 +01:00
Nick Rosbrook
8fb3ccc147 installer: use a drop-in to disable systemd-resolved stub listener
systemd-resolved supports drop-in config snippets, e.g. by placing .conf
files in /etc/systemd/resolved.conf.d. During install, use a drop-in
config to set DNSStubListener=no, instead of modifying the main config.

This is generally better practice, and also prevents conflicts when
distribution packages are upgraded, which may include new versions of
/etc/systemd/resolved.conf.

Signed-off-by: Nick Rosbrook <enr0n@ubuntu.com>
2025-02-04 16:18:04 -05:00
Dominik
9212a4a514 Decide if the content was changed *before* passing over to FTL (#5872) 2025-02-04 18:57:01 +01:00
Adam Warner
2ae78e02bd Add call to os_check in the update script (#5845) 2025-02-04 17:35:15 +00:00
yubiuser
330698878a Remove outdated dns-servers.conf (#5883) 2025-02-04 06:19:07 +01:00
Dominik
8e298df1e8 Show only enabled domains/regex in the final gravity message (#5884) 2025-02-03 20:37:49 +01:00
Dominik
894a9e157f Move gravity list cache into dedicated directory (#5869) 2025-02-03 20:35:38 +01:00
DL6ER
88cfda7210 Show only enabled domains/regex in the final gravity message
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-02-03 19:16:24 +01:00
Christian König
0da97e762f Remove outdated dns-servers.conf
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-03 08:31:33 +01:00
Christian König
94e772378e Merge branch 'development' into new/listsCacheDir
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-03 08:09:37 +01:00
Dominik
7dbf408c26 Gravity: Use ETags (#5867) 2025-02-03 06:30:11 +01:00
Dominik
ec805f9543 Fix counting of domains in the gravity summary (#5881) 2025-02-02 21:07:52 +01:00
DL6ER
7162be18e2 Remove curl -V temp variable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-02-02 20:57:13 +01:00
yubiuser
9cd32bf2b7 Bump actions/setup-python from 5.3.0 to 5.4.0 (#5878) 2025-02-02 13:34:16 +01:00
DL6ER
9da1e9ab88 Fix counting of domains at the end of pihole -g. The existing schme used the SQL VIEWs for simplicitly, however, they have the unintended side-effect of - when being queried without a GROUP BY clause - returning entries multiple times if they are assigned to several groups
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-02-01 19:42:25 +01:00
DL6ER
37718c65e9 Simplify cURL etag feature detection following discussion in #5873
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-02-01 19:36:56 +01:00
dependabot[bot]
aadea31e52 Bump actions/setup-python from 5.3.0 to 5.4.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.3.0...v5.4.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-01 10:14:46 +00:00
DL6ER
9faef22061 Decide if the content was changed *before* passing over to FTL
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-31 16:46:12 +01:00
DL6ER
bf899fa57f Migrate list's files (lists themselves, their SHA1 sum and, later, their ETags) into a dedicated directory /etc/pihole/listsCache in an attempt to clean up /etc/pihole
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-30 06:12:49 +01:00
DL6ER
68b03e114c Merge branch 'development' into new/etags
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-29 19:24:31 +01:00
Dominik
e682f69a1d Use a different method to identify if a gravity restore succeeded (#5868) 2025-01-29 19:23:40 +01:00
DL6ER
f50c696253 Use temp variable for curl -V output
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-29 19:19:01 +01:00
DL6ER
6e0b16ed1a Rename heisenbergCompensator -> modifiedOptions
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-29 19:17:04 +01:00
DL6ER
4322299c39 Drive-by fixing of errors reported by shellcheck for gravity.sh
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-29 17:53:33 +01:00
DL6ER
cee021c358 Use HTTP ETags in addition to the If-Modified-Since header if supported by curl to avoid downloading from servers not using the latter method (raw.githubcontent.com)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-29 17:53:33 +01:00
DL6ER
c381109dcd Use a different method to identify if a gravity restore succeeded
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-29 17:52:39 +01:00
Dominik
9a3fcf2a85 Gravity database resilience (#5818) 2025-01-27 01:29:37 +01:00
DL6ER
6d4d35e848 Merge branch 'development' into tweak/gravity_backup 2025-01-26 19:53:06 +01:00
DL6ER
69bfb3ff3b Store timestamp of the backup creation instead of the filename on restoring gravity.db
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-26 19:52:46 +01:00
yubiuser
f7727f98bd Bump actions/stale from 9.0.0 to 9.1.0 (#5863) 2025-01-26 08:44:57 +01:00
yubiuser
05f8bb128c Bump tox from 4.23.2 to 4.24.1 in /test (#5864) 2025-01-26 06:28:22 +01:00
dependabot[bot]
66757de3fb Bump tox from 4.23.2 to 4.24.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.23.2 to 4.24.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.23.2...4.24.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-25 10:34:03 +00:00
dependabot[bot]
08e3257f37 Bump actions/stale from 9.0.0 to 9.1.0
Bumps [actions/stale](https://github.com/actions/stale) from 9.0.0 to 9.1.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v9.0.0...v9.1.0)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-25 10:08:17 +00:00
Adam Warner
0f318027fc Remove unused code from debug log and skip some tests inside containers (#5854) 2025-01-16 17:13:41 +00:00
RD WebDesign
254b67bca3 Using more user-friendly messages on git describe failure
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-01-13 20:11:41 -03:00
RD WebDesign
0ae50eab87 Suppress error message on git describe failure
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-01-12 20:25:32 -03:00
DL6ER
cc25ee940e Fix unreachable code
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-12 13:42:51 +01:00
DL6ER
12927f8a3d Put gravity backup files into dedicated directory for cleaness
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-12 13:41:27 +01:00
yubiuser
efaa0f4287 Bump eps1lon/actions-label-merge-conflict from 3.0.2 to 3.0.3 (#5856) 2025-01-11 15:04:52 +01:00
dependabot[bot]
83d464e85f Bump eps1lon/actions-label-merge-conflict from 3.0.2 to 3.0.3
Bumps [eps1lon/actions-label-merge-conflict](https://github.com/eps1lon/actions-label-merge-conflict) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/eps1lon/actions-label-merge-conflict/releases)
- [Changelog](https://github.com/eps1lon/actions-label-merge-conflict/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eps1lon/actions-label-merge-conflict/compare/v3.0.2...v3.0.3)

---
updated-dependencies:
- dependency-name: eps1lon/actions-label-merge-conflict
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-11 10:54:32 +00:00
RD WebDesign
27fb2bbe3a Replace some hardcoded paths with pihole.toml values
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-01-09 19:11:22 -03:00
RD WebDesign
c78be8a89d No systemctl or service inside containers
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-01-09 19:11:22 -03:00
RD WebDesign
0590bbba2d Skip some checks in docker container
These commands always fail in containers with "command not found" (as expected).

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-01-09 19:11:21 -03:00
RD WebDesign
733dce1c4c If it's a docker container, consider the OS is supported
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-01-09 19:11:15 -03:00
RD WebDesign
bd9cc7cbb7 Clean up unused WEBCALL code
Debug Log is no longer available via web interface

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-01-09 17:15:12 -03:00
Dominik
4902c70063 Explicitly migrate from v5 to v6 (#5830) 2025-01-09 19:39:27 +01:00
Dominik
4be130971e Update automated install/basic-install.sh
Co-authored-by: yubiuser <github@yubiuser.dev>
Signed-off-by: Dominik <DL6ER@users.noreply.github.com>
2025-01-09 18:32:04 +01:00
Dominik
211a881888 Apply suggestions from code review
Co-authored-by: yubiuser <github@yubiuser.dev>
Signed-off-by: Dominik <DL6ER@users.noreply.github.com>
2025-01-08 19:28:15 +01:00
DL6ER
4d23187f86 Add missing newline
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-07 17:49:57 +01:00
Christian König
b544b74f7a Merge branch 'development' into fix/migration 2025-01-06 16:43:18 +01:00
Dominik
6e633e4cfd Improve lighttpd disabling (#5849) 2025-01-02 15:05:00 +01:00
DL6ER
364281354c Check if service is currently enabled when checking if lighttpd may need to be disabled
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-02 13:43:32 +01:00
yubiuser
4c5285e469 Remove now unused function test_dpkg_lock() (#5848) 2025-01-01 18:56:19 +01:00
DL6ER
79087fb252 SHow lighttpd disable dialog only once during v6 migration and when lighttpd is actually installed
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-01 18:55:49 +01:00
DL6ER
fab1ca3a40 Merge branch 'development' into tweak/gravity_backup 2025-01-01 18:46:33 +01:00
Christian König
4fd77f57fa Remove now unused function test_dpkg_lock()
Signed-off-by: Christian König <github@yubiuser.dev>
2025-01-01 12:20:50 +01:00
Adam Warner
bd9cb00574 Perform os_check during update, in case the user has updated to an unsupported OS between Pi-hole updates.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-12-31 15:31:04 +00:00
Dominik
b0e0bdc436 Disable lighttpd if found (#5835) 2024-12-30 17:01:04 +01:00
DL6ER
1835827371 Ensure Yes to keeping lighttpd doesn't trigger set -e during the upgrade
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-30 15:35:41 +01:00
Adam Warner
cb32a7f81c Merge branch 'master' into development 2024-12-29 14:06:24 +00:00
Adam Warner
2cf046d559 Fix v5 for Fedora 41 (#5839) 2024-12-29 13:53:35 +00:00
Adam Warner
a1ccee6694 use rpm -q to check if packages are already installed, this is due to a change in the behaviour of dnf in Fedora 41
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-12-29 13:32:07 +00:00
Adam Warner
dff0c0105d remove EOL OS from test suite
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-12-29 12:43:08 +00:00
Adam Warner
d972ffa53a while v6 is still not released, update tests in master to NOT use development branch of FTL
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-12-29 12:35:32 +00:00
Adam Warner
22b6dc7dae Add test scripts for fed 41 for v5
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-12-29 12:23:37 +00:00
Dominik
3406915917 Exit early when neither service nor systemctl commands are available (#5834) 2024-12-26 07:19:22 +01:00
Dominik
50645c2924 Apply suggestions from code review
Co-authored-by: Adam Warner <me@adamwarner.co.uk>
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: Dominik <DL6ER@users.noreply.github.com>
2024-12-24 02:19:37 +01:00
DL6ER
d14273f958 Add comment where setupVars.conf goes when v6 migration is done
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-24 02:17:50 +01:00
DL6ER
47d5a08565 Ask the user if they want to disable lighttpd
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-23 19:12:47 +01:00
DL6ER
e08f65d1c4 Disable lighttpd if found
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-23 09:30:37 +01:00
yubiuser
b964657b62 Speedup api response handling (#5833) 2024-12-23 09:14:47 +01:00
DL6ER
a2a22c4e13 Exit early when neither service nor systemctl commands are available
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-23 09:13:34 +01:00
DL6ER
8faa28d8a0 Explicitly log migration process
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-23 08:57:34 +01:00
Dominik
a9948304db Fix v5 -> v6 update (#5832) 2024-12-23 08:54:26 +01:00
Christian König
3011d48b6f Use tail instead of parameter expansion
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-22 23:44:31 +01:00
Christian König
c777152c04 Only separat data and status when needed
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-22 21:57:47 +01:00
Christian König
92a3c73f80 Fix v5 -> v6 update
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-22 21:46:32 +01:00
DL6ER
4f268ed193 Explicitly migrate from v5 to v6
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-21 07:10:46 +01:00
yubiuser
d80259ee8f Improve dependency package output (#5828) 2024-12-16 17:22:12 +01:00
Christian König
83224e7729 Improve dependency package output
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-16 15:55:34 +01:00
yubiuser
6cca30ca45 Improve v6 user output (#5829) 2024-12-16 14:06:33 +01:00
Christian König
b2a5564685 FTL allows non-numieric port notation - we need to strip this
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-16 13:06:25 +01:00
Christian König
7dc542f3c2 Get WEBPORT from pihole.toml
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-16 12:54:39 +01:00
Christian König
3ac426b5d1 Update manpage
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-16 12:42:07 +01:00
Christian König
4d55bc1ae3 pihole -a is gone
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-16 12:08:16 +01:00
Christian König
26ef0be9d6 One check less
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-16 11:56:04 +01:00
yubiuser
d030492664 Fix rare case when apt and rpm package managers are found (#5827) 2024-12-15 07:19:53 +01:00
Christian König
cc01c110f1 Also check during installlation of the dependency package
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-14 22:31:02 +01:00
Christian König
fdda40994b Fix rare case when apt and rpm package managers are found
Signed-off-by: Christian König <github@yubiuser.dev>
2024-12-14 22:26:05 +01:00
Dominik
4dbf9a0bbb Install dependencies by creating a meta package on-the-fly (#5785) 2024-12-14 08:33:15 +01:00
Adam Warner
eb4b6ecf25 Remove no-longer-needed utils (#5826) 2024-12-11 17:36:21 +00:00
Christian König
c380c23592 Merge branch 'development' into packages 2024-12-11 18:34:34 +01:00
yubiuser
a41426474e move the sourcing of utils.sh outside of installPihole (#5825) 2024-12-11 18:32:16 +01:00
Adam Warner
764aa48c14 Remove no-longer-needed utils
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-12-11 17:22:49 +00:00
Adam Warner
8f1fce8f4b move the sourcing of utils.sh outside of installPihole
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-12-10 19:01:58 +00:00
Dominik
76a6b42075 Fix ARP flush command (#5823) 2024-12-07 13:37:34 +01:00
yubiuser
5c6b286a62 Bump pytest from 8.3.3 to 8.3.4 in /test (#5824) 2024-12-07 11:24:06 +01:00
DL6ER
11e00e04b5 Fix ARP flush command
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-12-07 11:22:58 +01:00
dependabot[bot]
5ef4a5e8b0 Bump pytest from 8.3.3 to 8.3.4 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.3 to 8.3.4.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.3...8.3.4)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-07 10:09:54 +00:00
Dan Schaper
03932e8ca7 Remove Ubuntu 23 tests, it is EOL (#5822) 2024-11-26 13:31:46 -08:00
DL6ER
579dc07046 Merge branch 'development' into tweak/gravity_backup
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-26 21:08:09 +01:00
DL6ER
b23348916b Remove Ubuntu 23 tests, it is EOL
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-26 21:07:11 +01:00
Dominik
7d727555e2 Fix empty adlists (#5821) 2024-11-26 20:09:41 +01:00
DL6ER
1c4a48258f Only set ownership/permissions once the file was created
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-26 18:16:15 +01:00
DL6ER
d9288b896e Do not touch list files as this creates them. This causes issues down the line in the Heisenberg compensator
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-26 18:01:52 +01:00
Dominik
553c0f7f07 Fix possible gravity permissions issue (#5819) 2024-11-25 17:51:45 +01:00
DL6ER
531490397d When new domains are added to gravity and users run the first time gravity in the terminal (not via web), the list.123.abc.com file is created as root and stays like that. This causes issues down the line when users later try to run gravity from the web interface where we do not have root capabilities. This commit checks for write permissions and suggests what to do on error. It always ensures ownership and permissions are correct
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-25 12:40:55 +01:00
DL6ER
633c971a44 Store failed gravity restoration status in message table
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-23 09:44:39 +01:00
Dominik
6b423f534c Remove remaining traces of audit log (#5817) 2024-11-17 21:25:22 +01:00
Christian König
4137275f24 Merge branch 'development' into packages
Signed-off-by: Christian König <github@yubiuser.dev>
2024-11-17 21:13:16 +01:00
Dominik
9a9af719f0 Update gravity.sh
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: Dominik <DL6ER@users.noreply.github.com>
2024-11-17 17:05:26 +01:00
Dominik
d2cbe1f712 Add Fedora 41 and remove Fedora 39 from tests (#5813) 2024-11-16 17:52:18 +01:00
DL6ER
62b63f87e0 Use rpm instead of dnf to check for installed package. dnf changed to returning success even for not-installed packages wit Fedora 41
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-16 12:46:43 +01:00
DL6ER
fdf44355d2 Keep up to 10 database backups
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-16 12:08:27 +01:00
DL6ER
a5cb07c76e Attempt to restore from all possibly available gravity.db backups
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-16 11:52:31 +01:00
DL6ER
59e9bac794 Only try to obtain sources after possible database restore following a corruption
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-16 11:49:11 +01:00
DL6ER
b2ad878f4a Try to restore from gravity backup on database preparation error (if backup is available)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-16 10:18:00 +01:00
DL6ER
6ff30f7294 Backup a stripped-down version of gravity.db after each pihole -g run
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-16 10:09:44 +01:00
DL6ER
2dc5bd15cc Remove remaining traces of audit log
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-16 09:45:53 +01:00
RD WebDesign
7341f85c2d Add Fedora 41 and remove Fedora 39 from tests
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2024-11-12 16:48:52 -03:00
Christian König
9478e35cb7 Create a random temp direcotry to build the packages and remove leftovers
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: yubiuser <ckoenig@posteo.de>
2024-11-06 20:12:09 +01:00
Christian König
cd7e5abe25 Add TRAP to the installer
Signed-off-by: Christian König <github@yubiuser.dev>
2024-11-06 20:12:09 +01:00
Christian König
c47f8c2cd6 Overhaul uninstall script
Signed-off-by: Christian König <github@yubiuser.dev>
2024-11-06 20:12:09 +01:00
Christian König
f08c54e166 Create dependency package on RPM distros
Signed-off-by: Christian König <github@yubiuser.dev>
2024-11-06 20:12:09 +01:00
Christian König
fd5b3be03f Create meta package on the fly ... Debian
Signed-off-by: Christian König <github@yubiuser.dev>
2024-11-06 20:11:56 +01:00
yubiuser
112b961762 Fix errors on fresh installations while setting privacy levels and query logging due to absence of pihole.toml (#5799) 2024-10-28 18:04:46 +01:00
yubiuser
250fbd217f Bump tox from 4.23.0 to 4.23.2 in /test (#5809) 2024-10-26 14:11:11 +02:00
yubiuser
0421e3784c Bump actions/setup-python from 5.2.0 to 5.3.0 (#5808) 2024-10-26 14:10:27 +02:00
yubiuser
8ec7651075 Bump actions/checkout from 4.2.1 to 4.2.2 (#5807) 2024-10-26 14:10:06 +02:00
dependabot[bot]
6d8b4fdfc6 Bump tox from 4.23.0 to 4.23.2 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.23.0 to 4.23.2.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.23.0...4.23.2)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-26 10:22:13 +00:00
dependabot[bot]
9abb240105 Bump actions/setup-python from 5.2.0 to 5.3.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.2.0...v5.3.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-26 10:07:42 +00:00
dependabot[bot]
8acfa029d9 Bump actions/checkout from 4.2.1 to 4.2.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-26 10:07:38 +00:00
yubiuser
16af216b80 Improved error message for invalid protocol in adlist download (#5806) 2024-10-24 21:02:40 +02:00
Sebastián Dinator
5589fa171c Remove example from error message on invalid protocol
Signed-off-by: Sebastián Dinator <sdinator@alumnos.uai.cl>
2024-10-24 14:04:06 -03:00
Sebastian Dinator
0e7706ffa3 Improved error message for invalid protocol in adlist download
Signed-off-by: Sebastian Dinator <sdinator@alumnos.uai.cl>
Signed-off-by: Sebastián Dinator <sdinator@alumnos.uai.cl>
2024-10-24 14:04:06 -03:00
yubiuser
1a4870690b Exit 1 on failure (#5803) 2024-10-21 06:15:58 +02:00
Christian König
8bf6480aed Set exit code explicitly everywhere
Signed-off-by: Christian König <github@yubiuser.dev>
2024-10-20 09:36:28 +02:00
Christian König
7ae0b207fc Exit 1 if update script failed
Signed-off-by: Christian König <github@yubiuser.dev>
2024-10-20 09:34:15 +02:00
yubiuser
fa194e0a0c Do not print FTL update check details on pihole -up (#5800) 2024-10-19 14:39:24 +02:00
yubiuser
8fc0f1f26a Bump tox from 4.21.2 to 4.23.0 in /test (#5802) 2024-10-19 12:35:17 +02:00
dependabot[bot]
8c39365db1 Bump tox from 4.21.2 to 4.23.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.21.2 to 4.23.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.21.2...4.23.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-19 10:32:25 +00:00
yubiuser
c3a762823d Fix gavity version 19 (#5801) 2024-10-19 07:03:04 +02:00
Christian König
2fd51bd244 Fix gavity version 19
Signed-off-by: Christian König <github@yubiuser.dev>
2024-10-18 23:00:31 +02:00
Christian König
1ad135ad69 Do not print FTL update check details on pihole -up
Signed-off-by: Christian König <github@yubiuser.dev>
2024-10-18 22:30:22 +02:00
Christian König
6e905a7f80 Use setFTLConfigValue to set privacy level and logging. The function is sourced already at this point from utils.sh
Signed-off-by: Christian König <github@yubiuser.dev>
2024-10-18 20:22:13 +02:00
Christian König
3956ca49b6 Don't attempt writing to pihole.toml if file does not exit. FTL needs to be started first
Signed-off-by: Christian König <github@yubiuser.dev>
2024-10-18 20:19:02 +02:00
yubiuser
cd8d9ab84e Use pihole.toml to decide if installer runs on an update (#5790) 2024-10-18 16:44:43 +02:00
Adam Warner
38c561ae41 Add color (#5798) 2024-10-13 22:11:44 +01:00
Christian König
fa45a4bec8 Add color
Signed-off-by: Christian König <github@yubiuser.dev>
2024-10-13 22:16:42 +02:00
yubiuser
1bec0d2c7e Bump actions/checkout from 4.2.0 to 4.2.1 (#5797) 2024-10-12 14:28:32 +02:00
dependabot[bot]
aedb2f0a93 Bump actions/checkout from 4.2.0 to 4.2.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.2.0...v4.2.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-12 10:02:08 +00:00
yubiuser
8e5ac2dbac Bump tox from 4.20.0 to 4.21.2 in /test (#5793) 2024-10-05 13:57:17 +02:00
dependabot[bot]
d4cf5d95a6 Bump tox from 4.20.0 to 4.21.2 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.20.0 to 4.21.2.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.20.0...4.21.2)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-05 10:39:29 +00:00
Adam Warner
5cef02e60d Remove restartdns: Redux (#5791) 2024-10-03 09:07:43 +01:00
Adam Warner
afdf45031f Missed a couple of references in the previous PR
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-10-02 21:51:56 +01:00
Adam Warner
7dd2eb20a2 Remove the restartdns functionality and promote the reloaddns functions (#5780) 2024-10-02 21:27:08 +01:00
Adam Warner
6645136f6b Align the indentation for the case statement in the bottom part of pihole script
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-10-02 21:21:09 +01:00
Adam Warner
84a659dfac Update pihole
Co-authored-by: yubiuser <github@yubiuser.dev>
Signed-off-by: Adam Warner <github@adamwarner.co.uk>
2024-10-02 19:41:17 +01:00
Adam Warner
be00f3e723 Rename reloaddns-lists to reloadlists per suggestion
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: Adam Warner <github@adamwarner.co.uk>
2024-10-02 19:39:34 +01:00
Christian König
74e52675f1 Use pihole.toml to decide if installer runs on an update
Signed-off-by: Christian König <github@yubiuser.dev>
2024-10-02 13:50:33 +02:00
yubiuser
74d451a9c7 Show version information after an web only update (#5788) 2024-10-01 05:57:34 +02:00
yubiuser
ba058be236 Fix removing old man page (#5789) 2024-10-01 05:57:19 +02:00
Christian König
ada7d2bd31 Fix removing old man page
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-30 21:10:33 +02:00
Christian König
bcc3a7e35e Show version information after an web only update
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-30 21:04:55 +02:00
yubiuser
c0e39087bc Grouped common dependencies of distros (#5762) 2024-09-28 13:37:11 +02:00
yubiuser
c1a8607e54 Bump actions/checkout from 4.1.7 to 4.2.0 (#5781) 2024-09-28 12:15:11 +02:00
dependabot[bot]
8c56572d0b Bump actions/checkout from 4.1.7 to 4.2.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.7...v4.2.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-28 10:12:44 +00:00
Wouter Servaes
e9fdfac569 Added common dependencies to uninstall script for removal
Signed-off-by: Wouter Servaes <wouterservaes@protonmail.com>
2024-09-27 19:09:09 +02:00
Wouter Servaes
5f1e4680f7 Grouped common dependencies of distros
Signed-off-by: Wouter Servaes <wouterservaes@protonmail.com>
2024-09-27 19:09:09 +02:00
Dominik
65806a905a Add database optimization and gravity timing (#5773) 2024-09-25 03:25:02 -04:00
Adam Warner
cc476a49fe remove the restartdns functionality and promote the reloaddns functions
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-09-24 14:15:15 +01:00
yubiuser
564957c203 Remove lines containing Adguard JavaScript rules from adlists (#5754) 2024-09-23 23:33:14 +02:00
yubiuser
8dbdae40e8 Add fallback option for OS check without hard-coded nameserver (#5751) 2024-09-23 22:59:56 +02:00
yubiuser
e3dc06708c Bump tox from 4.18.1 to 4.20.0 in /test (#5777) 2024-09-21 12:22:24 +02:00
dependabot[bot]
885895e994 Bump tox from 4.18.1 to 4.20.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.18.1 to 4.20.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.18.1...4.20.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-21 10:10:37 +00:00
Dominik
0f4ad7734c Update gravity.sh to use color with -t
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: Dominik <DL6ER@users.noreply.github.com>
2024-09-18 16:13:35 -04:00
DL6ER
111dfc63ff Add new option allowing timing the individual parts of gravity
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-17 20:23:09 +02:00
DL6ER
73301da68f Optimize the database by running ANALYZE after gravity finished
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-17 20:03:07 +02:00
yubiuser
0cf0b2ab76 Bump pytest from 8.3.2 to 8.3.3 in /test (#5769) 2024-09-14 12:47:09 +02:00
dependabot[bot]
05707c624d Bump pytest from 8.3.2 to 8.3.3 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.2 to 8.3.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.2...8.3.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-14 10:36:07 +00:00
yubiuser
65d6f5d890 Bump tox from 4.18.0 to 4.18.1 in /test (#5770) 2024-09-14 12:35:25 +02:00
dependabot[bot]
20d20e116c Bump tox from 4.18.0 to 4.18.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.18.0 to 4.18.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.18.0...4.18.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-14 10:25:32 +00:00
yubiuser
b1acea33a1 Revert "Return early during v6 migration if migration dir exists" (#5768) 2024-09-14 07:04:47 +02:00
Christian König
6888897999 Revert "Return early during v6 migration if migration dir exists"
This reverts commit 251f3295f3.
2024-09-13 21:15:25 +02:00
yubiuser
3daaabfebd Return early during v6 migration if migration dir exists (#5766) 2024-09-12 21:44:46 +02:00
Christian König
251f3295f3 Return early during v6 migration if migration dir exists
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-12 21:32:36 +02:00
Adam Warner
23f6c3069a Sync master back into development (#5764) 2024-09-11 23:11:03 +01:00
Adam Warner
7128c18b4c Make install command copyable (#5763) 2024-09-11 23:10:30 +01:00
Jim Bennett
3e8189e9ce Make install command copyable
The instal command was in a header with inline markdown. This means there's no copy button on GitHub. Moving to a markdown block gives the copy button.

Signed-off-by: Jim Bennett <jimbobbennett@mac.com>
2024-09-11 15:00:57 -07:00
yubiuser
62ef2d1777 Add forgetting dash
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: yubiuser <ckoenig@posteo.de>
2024-09-11 18:44:17 +02:00
Christian König
ce5ef79a3a Reduce code duplications and add check via IPv6 without hard-coded nameserver
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-11 13:43:57 +02:00
yubiuser
092891aeb4 Add /etc/pihole/dnsmasq.conf to debug log (stripped-down version) (#5740) 2024-09-09 21:41:30 +02:00
DL6ER
d60ad57cac Add /etc/pihole/dnsmasq.conf to debug log (stripped-down version)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-09 21:37:34 +02:00
Dominik
53220cb5d6 Fix wrong message being displayed while waiting for the DNS (#5757) 2024-09-09 19:34:02 +02:00
Jack'lul
129272a695 Fix wrong message being displayed while waiting for DNS
Signed-off-by: Jack'lul <jacklulcat@gmail.com>
2024-09-09 19:08:47 +02:00
Christian König
f02162b021 Update comment
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-06 21:22:22 +02:00
yubiuser
0ad2a79624 Apply suggestions from code review
Co-authored-by: Adam Warner <me@adamwarner.co.uk>
Signed-off-by: yubiuser <ckoenig@posteo.de>
2024-09-06 21:20:36 +02:00
yubiuser
e291a9f7e0 It's Adguard not ABP
Co-authored-by: Adam Warner <me@adamwarner.co.uk>
Signed-off-by: yubiuser <ckoenig@posteo.de>
2024-09-05 13:42:10 +02:00
Christian König
cffb3117d4 Remove lines containing ABP JavaScript rules from adlists
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-04 22:32:03 +02:00
yubiuser
1789b1ce99 Account for renaming of devel branch on web repo (#5753) 2024-09-04 22:05:12 +02:00
Christian König
333764a7c1 Account for renaming of devel branch on web repo
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-04 21:59:43 +02:00
yubiuser
915352aefb Fix risk of popd without a pushd (#5701) 2024-09-04 21:46:21 +02:00
yubiuser
c911bf30ab Tweak/gravity dns (#5752) 2024-09-04 21:45:32 +02:00
SkyLined
fc73cee156 Fix risk of popd without a pushd
`pushd` was inside if, `popd` was outside; there was a risk of not doing a `pushd` and only doing a `popd`.

Signed-off-by: SkyLined <cojmpjum_github.com@sxd.be>
2024-09-04 20:33:54 +02:00
Dominik
59e25d0283 Wait after restarting FTL before trying to check version (#5613) 2024-09-04 20:17:15 +02:00
Christian König
f80efa51aa Wait until DNS resolution is available
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-03 23:32:41 +02:00
Christian König
ba2d10c65e DNS check in gravity should not check for FTL as it might not be the host's name server
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-03 23:03:59 +02:00
Christian König
a57d539098 Remove leftover DNS check via dig as it now only doubles what we already have with getent hosts
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-03 23:02:15 +02:00
Christian König
50dcd8d62f Add fallback option for OS check without hard-coded nameserver
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-03 22:31:13 +02:00
yubiuser
a965afa249 Remove obsolet Debian 10 (#5707) 2024-09-02 23:56:07 +02:00
Christian König
cd7226d5e9 Remove obsolet Debian 10
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-02 23:52:14 +02:00
Adam Warner
f2cb6e35ed Sync master back into development (#5750) 2024-09-02 22:28:41 +01:00
Adam Warner
3df0a6a996 remove development-v6 references from dependabot yml (#5749) 2024-09-02 22:26:11 +01:00
Adam Warner
76d7863270 remove development-v6 references from dependabot yml
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-09-02 22:22:24 +01:00
yubiuser
e566338a79 Bump actions/setup-python from 5.1.1 to 5.2.0 (#5742) 2024-09-02 22:34:06 +02:00
dependabot[bot]
f66707bd3e Bump actions/setup-python from 5.1.1 to 5.2.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.1 to 5.2.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.1.1...v5.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 20:30:11 +00:00
Adam Warner
dcc057cd1f Development v6 (#5100) 2024-09-02 21:04:41 +01:00
yubiuser
f277f5d202 Disable SELINUX on CentOS 9 test dockerfile v5 (#5744) 2024-09-02 20:15:40 +02:00
Dominik
80143325e8 Fix pihole status on not-ready states (#5747) 2024-09-02 19:18:05 +02:00
DL6ER
bcef4f0c97 pihole status should return (= exit) early on error instead of continuing the script
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-02 18:59:42 +02:00
Adam Warner
1d7071fb19 Merge branch 'development' into development-v6 2024-09-02 17:29:59 +01:00
DL6ER
b4444023a2 Wait after restarting FTL before trying to check version
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-09-02 15:54:27 +02:00
Dominik
4209e7dee8 Disable SELINUX on CentOS 9 test dockerfile (#5743) 2024-09-02 15:54:15 +02:00
Christian König
632d8af4b0 Disable SELINUX on CentOS 9 test dockerfile
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-01 22:35:23 +02:00
Christian König
5e69078ed1 Disable SELINUX on CentOS 9 test dockerfile
Signed-off-by: Christian König <github@yubiuser.dev>
2024-09-01 22:30:45 +02:00
yubiuser
bd9915105a Update existing logrotate files to inlcude webserver.log (#5738) 2024-08-28 08:48:44 +02:00
Christian König
a21b4c5203 Update existing logrotate files to inlcude webserver.log
Signed-off-by: Christian König <github@yubiuser.dev>
2024-08-28 08:46:16 +02:00
Dominik
e3fc5cc8f2 Make the help text of "pihole checkout [what] [branch]" more colorful (#5734) 2024-08-28 08:43:11 +02:00
Dominik
c26b043c58 Add pihole api [endpoint] callback suitable for local API requests (#5736) 2024-08-28 08:36:39 +02:00
Adam Warner
8b078f67b8 Add missing creation of table antigravity in migration script 16 to 17 (#5737) 2024-08-27 16:30:09 +01:00
Adam Warner
cfbf3f61cd Update advanced/Scripts/database_migration/gravity/16_to_17.sql
Co-authored-by: Dominik <DL6ER@users.noreply.github.com>
Signed-off-by: Adam Warner <github@adamwarner.co.uk>
2024-08-26 21:30:12 +01:00
DL6ER
e8582f7740 Add pihole -h and autocompletion entry
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-26 19:44:42 +02:00
DL6ER
9e9c985245 FTL checkout: Check for availability of branches before trying to download from the webserver. Also, fix check_download_exists() possibly killing the script on non-availability of requested branches
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-26 06:11:42 +02:00
DL6ER
a302d7b5d7 Make the help text of "pihole checkout [what] [branch]" more colorful
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-26 05:22:15 +02:00
Adam Warner
72afa1073d Add missing creation of table antigravity in migration script 16 to 17
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-08-25 21:47:07 +01:00
DL6ER
b304562c8e Add session details to API command output
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-24 10:39:12 +02:00
DL6ER
8e4fc27168 Add pihole api [endpoint] callback suitable for local API requests
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-08-24 10:06:48 +02:00
yubiuser
7206569b1d Fix setting query logging and privacy level (#5724) 2024-08-20 07:18:15 +02:00
Christian König
fc156f521c Fix setting query logging and privacy level
Signed-off-by: Christian König <github@yubiuser.dev>
2024-08-19 20:58:34 +02:00
yubiuser
4972cc6fdc Bump tox from 4.17.1 to 4.18.0 in /test (#5731) 2024-08-17 12:41:32 +02:00
dependabot[bot]
f6681f75fb Bump tox from 4.17.1 to 4.18.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.17.1 to 4.18.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.17.1...4.18.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-17 10:39:02 +00:00
yubiuser
c672b66eb4 Bump tox from 4.17.1 to 4.18.0 in /test (#5730) 2024-08-17 12:11:07 +02:00
dependabot[bot]
5024a98a4f Bump tox from 4.17.1 to 4.18.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.17.1 to 4.18.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.17.1...4.18.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-17 10:06:35 +00:00
yubiuser
9564a6e92d [fix] [v6] typo in bash-completion allow-regex option (#5729) 2024-08-15 06:53:56 +02:00
Allen
27fd80c01e [fix] [v6] typo in bash-completion allow-regex option
also removes a space from double whitespace

Signed-off-by: Allen Dema <64094914+allendema@users.noreply.github.com>

Signed-off-by: Allen <64094914+allendema@users.noreply.github.com>
2024-08-15 02:31:33 +02:00
yubiuser
e89d93a5d3 Merge development > development-v6 (#5725) 2024-08-10 15:26:41 +02:00
Christian König
904a1a18b0 Merge branch 'development' into development-v6 2024-08-10 14:27:19 +02:00
yubiuser
a69c2df36e Bump tox from 4.16.0 to 4.17.1 in /test (#5723) 2024-08-10 14:03:51 +02:00
dependabot[bot]
4f52c6afc0 Bump tox from 4.16.0 to 4.17.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.16.0 to 4.17.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.16.0...4.17.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-10 12:01:35 +00:00
yubiuser
bc54b5b2ff Bump pyyaml from 6.0.1 to 6.0.2 in /test (#5722) 2024-08-10 14:00:52 +02:00
dependabot[bot]
c42890ad54 Bump pyyaml from 6.0.1 to 6.0.2 in /test
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/main/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/6.0.1...6.0.2)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-10 10:56:14 +00:00
yubiuser
6bdb3cb87c Bump pyyaml from 6.0.1 to 6.0.2 in /test (#5721) 2024-08-10 12:38:14 +02:00
yubiuser
9186e81a93 Bump tox from 4.16.0 to 4.17.1 in /test (#5720) 2024-08-10 12:37:47 +02:00
dependabot[bot]
21a9410242 Bump pyyaml from 6.0.1 to 6.0.2 in /test
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/main/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/6.0.1...6.0.2)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-10 10:19:42 +00:00
dependabot[bot]
58a41641ab Bump tox from 4.16.0 to 4.17.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.16.0 to 4.17.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.16.0...4.17.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-10 10:19:39 +00:00
yubiuser
a16e053b2a Remove obsolet files and log file symlink code (#5711) 2024-07-29 09:36:24 +02:00
Christian König
1ed5994fa5 Remove temporal log file symlink code. It was introduced 2 years ago with v5.11 and always thought to be temporarily only
Signed-off-by: Christian König <github@yubiuser.dev>
2024-07-29 09:25:12 +02:00
Christian König
db1431a1ae Remove obsolet files
Signed-off-by: Christian König <github@yubiuser.dev>
2024-07-29 09:25:12 +02:00
yubiuser
67de7be802 Remove obsolet getFTLPIDFile() (#5710) 2024-07-29 09:23:34 +02:00
Christian König
2c32d485bd Remove obsolet getFTLPIDFile()
We can get the path of the PID file via getFTLConfigValue files.pid

Signed-off-by: Christian König <github@yubiuser.dev>
2024-07-27 22:00:52 +02:00
yubiuser
15d7fab2cb Bump pytest from 8.2.2 to 8.3.2 in /test (#5709) 2024-07-27 13:45:00 +02:00
yubiuser
3ca6ca53a4 Bump pytest from 8.2.2 to 8.3.2 in /test (#5708) 2024-07-27 13:42:27 +02:00
dependabot[bot]
0980f9acf6 Bump pytest from 8.2.2 to 8.3.2 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.2 to 8.3.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.2.2...8.3.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-27 10:38:22 +00:00
dependabot[bot]
3cc1945942 Bump pytest from 8.2.2 to 8.3.2 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.2 to 8.3.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.2.2...8.3.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-27 10:08:11 +00:00
Dominik
7b980ed9ac Finish core v6 implementation (#5689) 2024-07-23 18:04:41 +02:00
DL6ER
0614c3c7a0 Merge branch 'development-v6' into new/cli_pw 2024-07-16 11:01:03 +02:00
DL6ER
897e23089c Implement pihole enable/disable using the API
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-16 10:56:37 +02:00
DL6ER
7ca4b59b34 Do not test API availability outside of LoginAPI
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-16 10:27:07 +02:00
yubiuser
7d82b0294b Bump actions/setup-python from 5.1.0 to 5.1.1 (#5706) 2024-07-13 12:32:40 +02:00
yubiuser
b22731c613 Bump actions/setup-python from 5.1.0 to 5.1.1 (#5705) 2024-07-13 12:32:08 +02:00
dependabot[bot]
e90df12053 Bump actions/setup-python from 5.1.0 to 5.1.1
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.1.0...v5.1.1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-13 10:15:25 +00:00
dependabot[bot]
bdbec058e9 Bump actions/setup-python from 5.1.0 to 5.1.1
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.1.0...v5.1.1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-13 10:14:54 +00:00
yubiuser
bffffa4d1e Fix minor spelling mistake (#5704) 2024-07-10 10:36:09 +02:00
Ikko Eltociear Ashimine
5cb740ef01 chore: update basic-install.sh
minor fix

Signed-off-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
2024-07-10 14:29:40 +09:00
DL6ER
12fbf86f66 Merge branch 'development-v6' into new/cli_pw
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-08 19:18:21 +02:00
yubiuser
8b324741e0 Add protocol validation when downloading blocklist from URL (#5698) 2024-07-07 07:37:29 +02:00
DL6ER
6ffb20f09e Add protocol validation when downloading blocklist from URL
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-07 07:35:00 +02:00
yubiuser
5c670c21f2 Bump tox from 4.15.1 to 4.16.0 in /test (#5697) 2024-07-06 22:12:01 +02:00
dependabot[bot]
e8802173f5 Bump tox from 4.15.1 to 4.16.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.15.1 to 4.16.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.15.1...4.16.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-06 20:09:24 +00:00
Adam Warner
325c9fc0a2 Add pytest-clarity to test environment to improve error log output (#5692) 2024-07-06 21:08:41 +01:00
yubiuser
9c6d4ffa9b Bump tox from 4.15.1 to 4.16.0 in /test (#5696) 2024-07-06 12:29:47 +02:00
dependabot[bot]
2b33a0494b Bump tox from 4.15.1 to 4.16.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.15.1 to 4.16.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.15.1...4.16.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-06 10:12:06 +00:00
Adam Warner
19deafedae Sync master back into development (#5695) 2024-07-05 19:18:26 +01:00
Adam Warner
be5a8dc51a Pi-hole core v5.18.3 (#5694) 2024-07-05 19:12:15 +01:00
Adam Warner
4148f2cb5b tabs->spaces for editorconfig (Not sure how this has nto been caught before...)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-07-05 19:03:40 +01:00
DL6ER
2c497a9a3e Add protocol validation when downloading blocklist from URL
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-07-05 18:35:19 +01:00
Christian König
fafd47ba75 Please editorconfig-checker
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-07-02 20:57:28 +02:00
Christian König
ddc289ca3e Fix Dockerfile syntax ENV legacy warning
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-07-02 20:45:34 +02:00
Christian König
6b1d0e09d1 Set column width to 120
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-07-02 20:39:22 +02:00
Christian König
aa704a2e0e Add pytest-clarity to test environment to improve error log output
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-07-01 21:07:09 +02:00
DL6ER
21fb5dabe1 Use "remove" and "delete" instead of "not" to trigger listed domain removals
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-29 09:32:13 +02:00
DL6ER
c2ed30480d Show when requested domains were not found on the list
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-25 14:10:35 +02:00
DL6ER
ccdbfd4130 Use natural langauge for list manipulations, like pihole allow example.com or pihole deny other.net. Also remove using pihole deny not bad.org
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-25 13:56:49 +02:00
dependabot[bot]
548e142406 Bump pytest from 8.2.1 to 8.2.2 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.1 to 8.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.2.1...8.2.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-22 22:54:49 +01:00
dependabot[bot]
bfc2cf69e5 Bump tox from 4.15.0 to 4.15.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.15.0 to 4.15.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.15.0...4.15.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-22 22:54:41 +01:00
DL6ER
fe8e63853c Use concatenate of arguments instead of using the array directly
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-22 20:49:44 +02:00
DL6ER
b835fa06a6 Further black -> deny renaming
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-22 20:48:07 +02:00
DL6ER
424e825bd9 Do not auto-sudo in the pihole command
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-22 20:42:22 +02:00
DL6ER
7e91b9ab47 Update help text
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-22 20:35:06 +02:00
Adam Warner
97324ae97e remove centos8 tests from development to prevent build fails (yes, I know it's likely that we will merge development-v6 -> development" soon" but.. just in case)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-06-22 16:59:59 +01:00
DL6ER
5dfcd02c40 Improve pihole -f
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-22 10:31:03 +02:00
DL6ER
25f384a923 Do not use CLI password when no password is set at all
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-20 19:41:47 +02:00
DL6ER
bfc18f8329 Rewrite list functions to use the API
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-19 23:04:39 +02:00
DL6ER
92b15cf744 Modify pihole arpflush to stop FTL while performing the action and use the new TOML config values
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-19 22:49:11 +02:00
DL6ER
8f24e8aa5f Modify pihole -t to use TOML config items
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-19 22:41:42 +02:00
DL6ER
5cb9f4faaa Modify pihole -f to use TOML config items
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-19 22:28:14 +02:00
DL6ER
4df7cee6c2 Add partial matching hint if exact matching found nothing
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-19 22:21:43 +02:00
DL6ER
a2951cd3b8 Hide successful login/logout messages to avoid cluttering the terminal
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-19 22:19:54 +02:00
DL6ER
520641fa5e Try to use the CLI password for logins (if enabled and readable by the current user)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-19 22:18:11 +02:00
yubiuser
ca9eaf9688 Bump actions/checkout from 4.1.6 to 4.1.7 (#5687) 2024-06-15 14:20:04 +02:00
yubiuser
1e6fe9c3f2 Bump actions/checkout from 4.1.6 to 4.1.7 (#5686) 2024-06-15 14:16:16 +02:00
dependabot[bot]
5d2cb552d3 Bump actions/checkout from 4.1.6 to 4.1.7
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.6...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-15 10:25:08 +00:00
dependabot[bot]
fdd5b5ced0 Bump actions/checkout from 4.1.6 to 4.1.7
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.6...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-15 10:14:34 +00:00
yubiuser
81e628a943 Remove CentOS8 from test suite (#5682) 2024-06-08 19:28:07 +02:00
yubiuser
4a1dd7f79e Bump pytest from 8.2.1 to 8.2.2 in /test (#5679) 2024-06-08 14:34:09 +02:00
Christian König
cfc0d07173 Remove CentOS8 from test suite
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-06-08 12:57:45 +02:00
dependabot[bot]
0742c017a8 Bump pytest from 8.2.1 to 8.2.2 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.1 to 8.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.2.1...8.2.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-08 10:57:29 +00:00
yubiuser
c1d6bcbcc2 Bump tox from 4.15.0 to 4.15.1 in /test (#5678) 2024-06-08 12:56:45 +02:00
dependabot[bot]
2fdb6559dc Bump tox from 4.15.0 to 4.15.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.15.0 to 4.15.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.15.0...4.15.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-08 10:15:56 +00:00
Dominik
dc5a7c4f16 Add CAP_SYS_TIME to FTL's ambient capabilities (#5676) 2024-06-08 11:00:31 +02:00
DL6ER
e232361b2d Add CAP_SYS_TIME to FTL's ambient capabilities
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-06-07 19:02:43 +02:00
yubiuser
3cf538e307 Bump pytest-testinfra from 10.1.0 to 10.1.1 in /test (#5672) 2024-06-01 13:02:37 +02:00
yubiuser
159be01e0e Bump pytest-testinfra from 10.1.0 to 10.1.1 in /test (#5671) 2024-06-01 13:01:08 +02:00
yubiuser
f6a3b0247d Bump eps1lon/actions-label-merge-conflict from 3.0.1 to 3.0.2 (#5670) 2024-06-01 13:00:33 +02:00
dependabot[bot]
36f05cb20f Bump pytest-testinfra from 10.1.0 to 10.1.1 in /test
Bumps [pytest-testinfra](https://github.com/pytest-dev/pytest-testinfra) from 10.1.0 to 10.1.1.
- [Release notes](https://github.com/pytest-dev/pytest-testinfra/releases)
- [Changelog](https://github.com/pytest-dev/pytest-testinfra/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-testinfra/compare/10.1.0...10.1.1)

---
updated-dependencies:
- dependency-name: pytest-testinfra
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 10:29:56 +00:00
dependabot[bot]
628e1bbe41 Bump pytest-testinfra from 10.1.0 to 10.1.1 in /test
Bumps [pytest-testinfra](https://github.com/pytest-dev/pytest-testinfra) from 10.1.0 to 10.1.1.
- [Release notes](https://github.com/pytest-dev/pytest-testinfra/releases)
- [Changelog](https://github.com/pytest-dev/pytest-testinfra/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-testinfra/compare/10.1.0...10.1.1)

---
updated-dependencies:
- dependency-name: pytest-testinfra
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 10:22:49 +00:00
dependabot[bot]
4add164d43 Bump eps1lon/actions-label-merge-conflict from 3.0.1 to 3.0.2
Bumps [eps1lon/actions-label-merge-conflict](https://github.com/eps1lon/actions-label-merge-conflict) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/eps1lon/actions-label-merge-conflict/releases)
- [Changelog](https://github.com/eps1lon/actions-label-merge-conflict/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eps1lon/actions-label-merge-conflict/compare/v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: eps1lon/actions-label-merge-conflict
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 10:20:46 +00:00
yubiuser
78bd872b41 Bump eps1lon/actions-label-merge-conflict from 3.0.1 to 3.0.2 (#5669) 2024-06-01 12:15:39 +02:00
dependabot[bot]
70376c24bd Bump eps1lon/actions-label-merge-conflict from 3.0.1 to 3.0.2
Bumps [eps1lon/actions-label-merge-conflict](https://github.com/eps1lon/actions-label-merge-conflict) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/eps1lon/actions-label-merge-conflict/releases)
- [Changelog](https://github.com/eps1lon/actions-label-merge-conflict/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eps1lon/actions-label-merge-conflict/compare/v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: eps1lon/actions-label-merge-conflict
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 10:01:49 +00:00
Jack'lul
7b19b650d4 Fix version check for release Docker images
Signed-off-by: Jack'lul <jacklulcat@gmail.com>
2024-05-27 23:04:53 +01:00
yubiuser
741b9e1b3e Bump pytest from 8.2.0 to 8.2.1 in /test (#5665) 2024-05-25 21:54:01 +02:00
yubiuser
8a924867c9 Bump pytest from 8.2.0 to 8.2.1 in /test (#5666) 2024-05-25 21:50:24 +02:00
Christian König
d15beff4ba Fix codespell
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-05-25 21:49:24 +02:00
dependabot[bot]
d30a7612ab Bump pytest from 8.2.0 to 8.2.1 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.0 to 8.2.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.2.0...8.2.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-25 11:02:34 +00:00
dependabot[bot]
01e0c60959 Bump pytest from 8.2.0 to 8.2.1 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.0 to 8.2.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.2.0...8.2.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-25 10:38:28 +00:00
yubiuser
250a44ca9d Bump actions/checkout from 4.1.5 to 4.1.6 (#5662) 2024-05-22 21:34:44 +02:00
yubiuser
dd64cf7872 Bump actions/checkout from 4.1.5 to 4.1.6 (#5661) 2024-05-22 21:29:54 +02:00
dependabot[bot]
5270336679 Bump actions/checkout from 4.1.5 to 4.1.6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.5 to 4.1.6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.5...v4.1.6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-18 10:56:18 +00:00
dependabot[bot]
443c5e8243 Bump actions/checkout from 4.1.5 to 4.1.6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.5 to 4.1.6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.5...v4.1.6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-18 10:31:36 +00:00
Dominik
dd2c1c69dd Migrate dnsmasq config files (#5479) 2024-05-12 18:53:07 +02:00
DL6ER
7bf97cf02a Merge branch 'development-v6' into new/migrate_dnsmasq_conf 2024-05-12 09:51:55 +02:00
Dominik
3abd2c04ce Also check for IPv6 address for configured DNS servers (#5560) 2024-05-12 09:33:08 +02:00
yubiuser
99e72f61d8 Bump actions/checkout from 4.1.4 to 4.1.5 (#5656) 2024-05-11 22:40:58 +02:00
dependabot[bot]
f478913dee Bump actions/checkout from 4.1.4 to 4.1.5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.4...v4.1.5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-11 20:36:33 +00:00
yubiuser
1812d9c358 Bump eps1lon/actions-label-merge-conflict from 3.0.0 to 3.0.1 (#5655) 2024-05-11 22:35:46 +02:00
dependabot[bot]
7426076297 Bump eps1lon/actions-label-merge-conflict from 3.0.0 to 3.0.1
Bumps [eps1lon/actions-label-merge-conflict](https://github.com/eps1lon/actions-label-merge-conflict) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/eps1lon/actions-label-merge-conflict/releases)
- [Changelog](https://github.com/eps1lon/actions-label-merge-conflict/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eps1lon/actions-label-merge-conflict/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: eps1lon/actions-label-merge-conflict
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-11 20:32:20 +00:00
Christian König
c0cc9bac35 Add Ubuntu 24.04 and Fedora 40, remove Fedora 38
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-05-11 21:21:18 +01:00
yubiuser
8886232faa Bump actions/checkout from 4.1.4 to 4.1.5 (#5654) 2024-05-11 17:53:22 +02:00
yubiuser
8141fdd003 Bump eps1lon/actions-label-merge-conflict from 3.0.0 to 3.0.1 (#5653) 2024-05-11 17:47:48 +02:00
dependabot[bot]
3ad90c1006 Bump actions/checkout from 4.1.4 to 4.1.5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.4...v4.1.5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-11 15:47:44 +00:00
dependabot[bot]
f4c9278b86 Bump eps1lon/actions-label-merge-conflict from 3.0.0 to 3.0.1
Bumps [eps1lon/actions-label-merge-conflict](https://github.com/eps1lon/actions-label-merge-conflict) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/eps1lon/actions-label-merge-conflict/releases)
- [Changelog](https://github.com/eps1lon/actions-label-merge-conflict/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eps1lon/actions-label-merge-conflict/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: eps1lon/actions-label-merge-conflict
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-11 15:45:15 +00:00
Christian König
cd30772c43 Add Ubuntu 24.04 and Fedora 40, remove Fedora 38
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-05-11 15:57:21 +01:00
Adam Warner
200a82acfb Merge development into development-v6 2024-05-08 21:25:26 +01:00
yubiuser
2371f43609 Bump pytest from 8.1.2 to 8.2.0 in /test (#5648) 2024-05-04 13:11:13 +02:00
yubiuser
6ce747c935 Bump pytest-xdist from 3.5.0 to 3.6.1 in /test (#5646) 2024-05-04 12:57:33 +02:00
dependabot[bot]
9f7cd050e9 Bump pytest from 8.1.2 to 8.2.0 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.2 to 8.2.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.1.2...8.2.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-04 10:56:23 +00:00
yubiuser
976dc1c32d Bump pytest-xdist from 3.5.0 to 3.6.1 in /test (#5647) 2024-05-04 12:55:40 +02:00
dependabot[bot]
24ade13c02 Bump pytest-xdist from 3.5.0 to 3.6.1 in /test
Bumps [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) from 3.5.0 to 3.6.1.
- [Release notes](https://github.com/pytest-dev/pytest-xdist/releases)
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-xdist/compare/v3.5.0...v3.6.1)

---
updated-dependencies:
- dependency-name: pytest-xdist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-04 10:52:00 +00:00
yubiuser
7ec20d867b Bump pytest from 8.1.2 to 8.2.0 in /test (#5645) 2024-05-04 12:51:15 +02:00
dependabot[bot]
29d4ed1134 Bump pytest-xdist from 3.5.0 to 3.6.1 in /test
Bumps [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) from 3.5.0 to 3.6.1.
- [Release notes](https://github.com/pytest-dev/pytest-xdist/releases)
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-xdist/compare/v3.5.0...v3.6.1)

---
updated-dependencies:
- dependency-name: pytest-xdist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-04 10:15:49 +00:00
dependabot[bot]
bf0c3c0e0f Bump pytest from 8.1.2 to 8.2.0 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.2 to 8.2.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.1.2...8.2.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-04 10:04:20 +00:00
yubiuser
cb30943c2d Bump tox from 4.14.2 to 4.15.0 in /test (#5642) 2024-04-27 13:34:41 +02:00
yubiuser
c19bfb912f Bump pytest from 8.1.1 to 8.1.2 in /test (#5641) 2024-04-27 13:34:01 +02:00
yubiuser
e6c15c3d9f Bump actions/checkout from 4.1.3 to 4.1.4 (#5640) 2024-04-27 13:33:28 +02:00
yubiuser
448b1f4d6c Bump pytest from 8.1.1 to 8.1.2 in /test (#5639) 2024-04-27 13:03:40 +02:00
dependabot[bot]
78c755b538 Bump pytest from 8.1.1 to 8.1.2 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.1 to 8.1.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.1.1...8.1.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-27 11:03:12 +00:00
yubiuser
4474268ae8 Bump tox from 4.14.2 to 4.15.0 in /test (#5638) 2024-04-27 13:02:33 +02:00
yubiuser
2955737782 Bump actions/checkout from 4.1.3 to 4.1.4 (#5637) 2024-04-27 12:55:34 +02:00
dependabot[bot]
b33bbd7e28 Bump tox from 4.14.2 to 4.15.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.14.2 to 4.15.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.14.2...4.15.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-27 10:53:28 +00:00
dependabot[bot]
b5a7567f3b Bump pytest from 8.1.1 to 8.1.2 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.1 to 8.1.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.1.1...8.1.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-27 10:53:24 +00:00
dependabot[bot]
3cebb3f060 Bump actions/checkout from 4.1.3 to 4.1.4
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.3 to 4.1.4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.3...v4.1.4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-27 10:46:03 +00:00
dependabot[bot]
09ce000340 Bump tox from 4.14.2 to 4.15.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.14.2 to 4.15.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.14.2...4.15.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-27 10:28:36 +00:00
dependabot[bot]
91d95e2c8a Bump actions/checkout from 4.1.3 to 4.1.4
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.3 to 4.1.4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.3...v4.1.4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-27 10:21:11 +00:00
dependabot[bot]
091a6891eb Bump actions/setup-python from 5.0.0 to 5.1.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.0.0...v5.1.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-21 20:18:50 +01:00
dependabot[bot]
5d77c2b362 Bump actions/checkout from 4.1.2 to 4.1.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.2...v4.1.3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-21 17:23:44 +01:00
dependabot[bot]
44703bbbc6 Bump actions/checkout from 4.1.2 to 4.1.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.2...v4.1.3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-21 17:23:40 +01:00
Adam Warner
26132faf46 Bump eps1lon/actions-label-merge-conflict from 2.1.0 to 3.0.0 (#5626) 2024-04-01 14:23:05 +01:00
Adam Warner
32ab5aa50b Bump eps1lon/actions-label-merge-conflict from 2.1.0 to 3.0.0 (#5625) 2024-04-01 14:22:47 +01:00
Adam Warner
5391513fe7 Bump actions/setup-python from 5.0.0 to 5.1.0 (#5624) 2024-04-01 14:22:24 +01:00
Adam Warner
b32f778654 Bump tox from 4.14.1 to 4.14.2 in /test (#5611) 2024-04-01 14:17:30 +01:00
dependabot[bot]
f01362caf1 Bump actions/setup-python from 5.0.0 to 5.1.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.0.0...v5.1.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 13:17:20 +00:00
Adam Warner
c69e0eb254 Bump pytest from 8.0.2 to 8.1.1 in /test (#5607) 2024-04-01 14:17:03 +01:00
Adam Warner
48a4693a5a Bump actions/checkout from 4.1.1 to 4.1.2 (#5606) 2024-04-01 14:16:43 +01:00
Adam Warner
db07cc9070 Bump pytest from 8.0.2 to 8.1.1 in /test (#5605) 2024-04-01 13:13:38 +01:00
Adam Warner
9f5d4f0eb0 Sync master back into development (#5630) 2024-03-31 21:59:44 +01:00
Adam Warner
5490a6ea6d Release 5.18.2 (#5629) 2024-03-31 19:46:24 +01:00
Dominik
80db52691b Only use local files (file://) when they have explicit permissions a+r (#5622) 2024-03-30 20:14:55 +01:00
Dominik
91e0d668e0 Code style: Use explicit form of CLI arguments
Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net>
Signed-off-by: Dominik <DL6ER@users.noreply.github.com>
2024-03-30 20:03:15 +01:00
dependabot[bot]
81ad1a76e6 Bump eps1lon/actions-label-merge-conflict from 2.1.0 to 3.0.0
Bumps [eps1lon/actions-label-merge-conflict](https://github.com/eps1lon/actions-label-merge-conflict) from 2.1.0 to 3.0.0.
- [Release notes](https://github.com/eps1lon/actions-label-merge-conflict/releases)
- [Changelog](https://github.com/eps1lon/actions-label-merge-conflict/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eps1lon/actions-label-merge-conflict/compare/v2.1.0...v3.0.0)

---
updated-dependencies:
- dependency-name: eps1lon/actions-label-merge-conflict
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-30 10:50:22 +00:00
dependabot[bot]
67ddb64bcc Bump eps1lon/actions-label-merge-conflict from 2.1.0 to 3.0.0
Bumps [eps1lon/actions-label-merge-conflict](https://github.com/eps1lon/actions-label-merge-conflict) from 2.1.0 to 3.0.0.
- [Release notes](https://github.com/eps1lon/actions-label-merge-conflict/releases)
- [Changelog](https://github.com/eps1lon/actions-label-merge-conflict/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eps1lon/actions-label-merge-conflict/compare/v2.1.0...v3.0.0)

---
updated-dependencies:
- dependency-name: eps1lon/actions-label-merge-conflict
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-30 10:10:21 +00:00
Dominik
c7d60295d9 Improve changed binary message during update process (#5621) 2024-03-28 18:51:40 +01:00
Dan Schaper
8cfccf9d1f More checks when downloading from file:// scheme (#5620) 2024-03-28 09:44:51 -07:00
DL6ER
b595b3b5f4 Port most recent changes of PRs #5615, #5618 amd #5620 to v6
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-03-28 15:41:45 +01:00
DL6ER
398f90f7f4 Non-matching checksums are not always corruption. Actually, they will instead be caused by binaries updated on the remote branch. This is most seen with frequently channging branchs such as development-v6 at this time.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-03-28 09:12:51 +01:00
Dan Schaper
47998e1c8a Bump actions/checkout from 4.1.1 to 4.1.2 (#5604) 2024-03-27 16:31:40 -07:00
Orazio
d80fcf2e62 More checks when downloading from file:// scheme
Signed-off-by: Orazio <22700499+orazioedoardo@users.noreply.github.com>
2024-03-27 22:10:12 +01:00
dependabot[bot]
9f9e5dffc2 Bump pytest from 8.0.2 to 8.1.1 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.2 to 8.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.0.2...8.1.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-27 20:27:30 +00:00
Adam Warner
fcb98d7e4a Bump tox from 4.14.1 to 4.14.2 in /test (#5612) 2024-03-27 20:26:39 +00:00
Adam Warner
7879f07011 Sync master back into development (#5619) 2024-03-27 20:15:28 +00:00
Adam Warner
74a44cad7a v5.18.1 (#5618) 2024-03-27 19:18:09 +00:00
Adam Warner
32c640e838 Remove double quotes that prevented _any_ local files from being read by gravity (#5617) 2024-03-27 19:16:25 +00:00
Adam Warner
eb7daf4d2c Fix file permission check in gravity.sh. Remove quotes that were added after complaints from shellcheck, this stopped the comparisson from working
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-03-27 19:12:59 +00:00
Adam Warner
7442454d32 Sync master back into development (#5616) 2024-03-27 18:25:47 +00:00
Adam Warner
3c7a6ce535 Release 5.18 (#5615) 2024-03-27 18:11:12 +00:00
Adam Warner
f3af03174e Merge pull request from GHSA-95g6-7q26-mp9x
Only use local files (file://) when they have explicit permissions a+r
2024-03-27 18:02:44 +00:00
dependabot[bot]
472602ffb9 Bump tox from 4.14.1 to 4.14.2 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.14.1 to 4.14.2.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.14.1...4.14.2)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-23 10:52:31 +00:00
dependabot[bot]
7aab7d9849 Bump tox from 4.14.1 to 4.14.2 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.14.1 to 4.14.2.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.14.1...4.14.2)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-23 10:34:48 +00:00
dependabot[bot]
08dd321f73 Bump pytest from 8.0.2 to 8.1.1 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.2 to 8.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.0.2...8.1.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-16 10:44:52 +00:00
dependabot[bot]
58a1e85826 Bump actions/checkout from 4.1.1 to 4.1.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.1...v4.1.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-16 10:21:49 +00:00
dependabot[bot]
eb23fbf879 Bump actions/checkout from 4.1.1 to 4.1.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.1...v4.1.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-16 10:08:27 +00:00
Dominik
206cf9c4ea Fix edge-case where an adlist domain is blocked (#5571) 2024-03-16 09:08:03 +01:00
Dominik
71b17294bc Verify remote FTL checksum (#5603) 2024-03-11 19:14:20 +01:00
DL6ER
82a83c497d Reduce code-duplication
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-03-10 21:18:13 +01:00
DL6ER
2fd0de4743 Verify that we actually downloaded a valid checksum before comparing it to the local one. This covers situations where downloading the checksum from remote might have failed
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-03-10 08:43:37 +01:00
Dominik
dedaf5432e Highlight "### CHANGED" strings in the debug log of pihole.toml (#5601) 2024-03-09 21:49:29 +01:00
DL6ER
c02401b81e Highlight "### CHANGED" strings in the debug log of pihole.toml
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-03-09 16:57:28 +01:00
yubiuser
eaa878e7a4 Bump tox from 4.13.0 to 4.14.1 in /test (#5602) 2024-03-09 12:03:35 +01:00
dependabot[bot]
8042d9e3fd Bump tox from 4.13.0 to 4.14.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.13.0 to 4.14.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.13.0...4.14.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-09 10:21:53 +00:00
yubiuser
cb4f6d4159 Bump tox from 4.13.0 to 4.14.1 in /test (#5600) 2024-03-09 11:12:22 +01:00
dependabot[bot]
bfd8b572cb Bump tox from 4.13.0 to 4.14.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.13.0 to 4.14.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.13.0...4.14.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-09 10:07:37 +00:00
DL6ER
8fb3a594eb Merge branch 'development-v6' into fix/gravity_domain
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-03-09 07:47:32 +01:00
DL6ER
9dd138b033 Only use local files (file://) when they have explicit permissions a+r
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-03-04 19:38:13 +01:00
Dominik
0635ea7455 Allow adlist duplicates (#5572) 2024-03-02 18:28:47 +01:00
yubiuser
0597128de8 Bump pytest-testinfra from 10.0.0 to 10.1.0 in /test (#5579) 2024-03-02 12:56:52 +01:00
dependabot[bot]
0fdd959c7f Bump pytest-testinfra from 10.0.0 to 10.1.0 in /test
Bumps [pytest-testinfra](https://github.com/pytest-dev/pytest-testinfra) from 10.0.0 to 10.1.0.
- [Release notes](https://github.com/pytest-dev/pytest-testinfra/releases)
- [Changelog](https://github.com/pytest-dev/pytest-testinfra/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-testinfra/compare/10.0.0...10.1.0)

---
updated-dependencies:
- dependency-name: pytest-testinfra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-02 11:52:21 +00:00
yubiuser
e03ddf5d41 Bump pytest from 8.0.0 to 8.0.2 in /test (#5598) 2024-03-02 12:51:31 +01:00
dependabot[bot]
cb3e448b38 Bump pytest from 8.0.0 to 8.0.2 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.0 to 8.0.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.0.0...8.0.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-02 10:18:47 +00:00
yubiuser
6bb7d10a6d Bump pytest from 8.0.1 to 8.0.2 in /test (#5597) 2024-03-02 11:09:20 +01:00
dependabot[bot]
fd1372df3e Bump pytest from 8.0.1 to 8.0.2 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.0.1...8.0.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-02 10:01:31 +00:00
yubiuser
760f903d12 Bump pytest-testinfra from 10.0.0 to 10.1.0 in /test (#5583) 2024-02-24 13:53:55 +01:00
dependabot[bot]
07e6c0d250 Bump pytest-testinfra from 10.0.0 to 10.1.0 in /test
Bumps [pytest-testinfra](https://github.com/pytest-dev/pytest-testinfra) from 10.0.0 to 10.1.0.
- [Release notes](https://github.com/pytest-dev/pytest-testinfra/releases)
- [Changelog](https://github.com/pytest-dev/pytest-testinfra/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-testinfra/compare/10.0.0...10.1.0)

---
updated-dependencies:
- dependency-name: pytest-testinfra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-24 12:49:07 +00:00
yubiuser
48c1d5a3d2 Bump pytest from 8.0.0 to 8.0.1 in /test (#5582) 2024-02-24 13:48:06 +01:00
dependabot[bot]
3ed29f494b Bump pytest from 8.0.0 to 8.0.1 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.0.0...8.0.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-24 12:45:22 +00:00
yubiuser
b57cf27103 Bump tox from 4.12.1 to 4.13.0 in /test (#5581) 2024-02-24 13:44:20 +01:00
yubiuser
f5e6364f98 Bump tox from 4.12.1 to 4.13.0 in /test (#5584) 2024-02-24 13:43:34 +01:00
DL6ER
ed1a6278b7 Merge branch 'development-v6' into new/migrate_dnsmasq_conf 2024-02-19 21:29:11 +01:00
dependabot[bot]
b322f1e98b Bump tox from 4.12.1 to 4.13.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.12.1 to 4.13.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.12.1...4.13.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-17 10:50:41 +00:00
dependabot[bot]
5b75cb1950 Bump tox from 4.12.1 to 4.13.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.12.1 to 4.13.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.12.1...4.13.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-17 10:29:46 +00:00
DL6ER
9ff43040ec Add list type in pihole -q
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-02-13 09:58:29 +01:00
DL6ER
75fadb9b55 Adlists need to be grouped by both address and type to differentiate between anti-/gravity lists
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-02-13 08:55:26 +01:00
DL6ER
1a59b407e0 Merge branch 'development-v6' into tweak/allow_adlist_dups 2024-02-13 07:47:30 +01:00
Dominik
c771739f68 Fix gravity (#5573) 2024-02-12 06:42:04 +01:00
DL6ER
bcb712b6e3 Fix accidential double -ni from one of the last PRs
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-02-11 21:07:15 +01:00
Adam Warner
bb095bb209 Merge development into development-v6 (with merge conflicts resolved) (#5570) 2024-02-11 17:11:04 +00:00
DL6ER
b5ab8ac198 Change UNIQUEness constraint from (address) to (address, type) in the adlist table. This will allow certain adlists to be associated to different groups. A possible scenario is an adlist meant to block a specific service (e.g. Twitter, Youtube, etc.). It can then either be used to ensure these services are really blocked on the devices of group A but will never be blocked on devices of group B.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-02-11 16:54:22 +01:00
DL6ER
8b3469cabc Merge branch 'development-v6' into development-v6-merge-development
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-02-11 16:41:41 +01:00
yubiuser
aca7b31b83 Remove local.list and openVPN traces (#5480) 2024-02-10 06:16:00 +01:00
Dominik
8f36fdf11c Make IDs of anti-/gravity lists available in vw_(anti)gravity (#5526) 2024-02-09 20:52:29 +01:00
Adam Warner
f193edd428 Merge branch 'development' into development-v6-merge-development (resolved conflicts)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-02-09 19:22:53 +00:00
yubiuser
3ba6ab5ec7 Bump pytest from 7.4.4 to 8.0.0 in /test (#5566) 2024-02-05 13:53:45 +01:00
dependabot[bot]
f0878c0890 Bump pytest from 7.4.4 to 8.0.0 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.4 to 8.0.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.4...8.0.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-04 21:39:17 +00:00
Adam Warner
2009fa85ec Fedora (#5568) 2024-02-04 21:36:37 +00:00
Christian König
7b6f0d1596 Also remove Fedora 37
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-02-04 16:41:20 +01:00
Christian König
f8bfd59f11 Drop Fedora 36 and add Fedora 39 to the test suite
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-02-04 16:40:12 +01:00
yubiuser
499ba9785f Bump pytest from 7.4.4 to 8.0.0 in /test (#5567) 2024-02-04 16:22:41 +01:00
dependabot[bot]
6e946f76d6 Bump pytest from 7.4.4 to 8.0.0 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.4 to 8.0.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.4...8.0.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-03 10:21:48 +00:00
Dominik
92e741fd5a Test ftl.pi-hole.net availability (#5563) 2024-02-02 19:02:54 +01:00
DL6ER
31a8f150b2 Add checking for availability of ftl.pi-hole.net when using FTL from a custom branch. If the server is down (or the user is offline, cannot resolve the domain, etc.), we fail early and hard instead of possibly corrupting the installation
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-01-31 08:00:28 +01:00
DL6ER
07b448d784 Also check for IPv6 address for configured DNS servers
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-01-30 19:24:33 +01:00
Adam Warner
9a3affd81e Drop Fedora 36 and add Fedora 39 to the test suite (#5482) 2024-01-29 18:21:16 +00:00
Christian König
935a4ce0b3 Also remove Fedora 37
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-01-28 16:56:57 +01:00
yubiuser
cc8f9fe057 Use 204 return code for deleted sessions (#5541) 2024-01-27 22:05:09 +01:00
yubiuser
e1c41fe4d5 Bump tox from 4.12.0 to 4.12.1 in /test (#5556) 2024-01-20 12:25:01 +01:00
yubiuser
37c6b353b3 Bump tox from 4.12.0 to 4.12.1 in /test (#5555) 2024-01-20 12:23:35 +01:00
dependabot[bot]
60de50bb73 Bump tox from 4.12.0 to 4.12.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.12.0 to 4.12.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.12.0...4.12.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-20 10:49:27 +00:00
dependabot[bot]
ba2682c907 Bump tox from 4.12.0 to 4.12.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.12.0 to 4.12.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.12.0...4.12.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-20 10:38:21 +00:00
Dominik
d6dbb40ef1 Do not store remote version in versions file if on custom branch (#5549) 2024-01-15 22:09:29 +01:00
DL6ER
47f06dfd71 Do not store remote version in versions file if on custom branch. It's always wrong here
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-01-15 20:53:34 +01:00
yubiuser
e773d0399f Bump tox from 4.11.4 to 4.12.0 in /test (#5547) 2024-01-13 20:42:30 +01:00
yubiuser
ebb0db0a3b Bump tox from 4.11.4 to 4.12.0 in /test (#5548) 2024-01-13 20:40:53 +01:00
dependabot[bot]
b662fd6f01 Bump tox from 4.11.4 to 4.12.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.11.4 to 4.12.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.11.4...4.12.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-13 10:43:13 +00:00
dependabot[bot]
9eb47319f5 Bump tox from 4.11.4 to 4.12.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.11.4 to 4.12.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.11.4...4.12.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-13 10:32:36 +00:00
Christian König
debab10792 Use 204
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-01-11 20:42:32 +01:00
Adam Warner
b756262ebe Fix failing tests in development-v6 branch (#5542) 2024-01-10 11:14:50 +00:00
Dominik
e781311f23 pihole -d: Fix gateway ping if it is a LL address (#5527) 2024-01-09 19:19:32 +01:00
Adam Warner
df9c60e351 Reduce code duplication in FTL arch detect tests.
Use parametrize to run the same test with different parameters for each arch we need to test.
Also include detection of unusupported in this test.
Create FTL_BRANCH constant to be used in functions (less places to remember to change it)

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-01-08 18:26:59 +00:00
Adam Warner
aa4ceb4198 Sync master back into development (#5537) 2024-01-07 21:17:15 +00:00
Adam Warner
220c0675ef As we do in other tests, specify development-v6 branch of FTL is downloaded for the tests. We need to change this to develoment once v6 is released
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2024-01-07 21:03:48 +00:00
Adam Warner
19bfa08b83 Pi-hole core v5.17.3 (#5520) 2024-01-06 16:53:38 +00:00
yubiuser
7eb69a5cc8 Bump pytest from 7.4.3 to 7.4.4 in /test (#5536) 2024-01-06 11:14:52 +01:00
yubiuser
e14792bc48 Bump pytest from 7.4.3 to 7.4.4 in /test (#5535) 2024-01-06 11:14:28 +01:00
dependabot[bot]
05e7d0ee92 Bump pytest from 7.4.3 to 7.4.4 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.3 to 7.4.4.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.3...7.4.4)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-06 10:10:22 +00:00
dependabot[bot]
9c3578856f Bump pytest from 7.4.3 to 7.4.4 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.3 to 7.4.4.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.3...7.4.4)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-06 10:02:39 +00:00
DL6ER
d2828310f2 Modify DELETE triggers to delete BEFORE instead of AFTER to prevent possible foreign key constraint violations
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-28 11:12:20 +01:00
DL6ER
00340136bd Extend %iface logic to the dig test. Also fix intentation in this function
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-26 21:35:24 +01:00
DL6ER
0c6363572b Append the interface to the gateway address if it is a link-local address
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-25 22:00:49 +01:00
DL6ER
1b87ec067e Exit early if the database does not exist (e.g. in some CI tests)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-25 06:12:18 +01:00
DL6ER
8e8c7ecad2 Run gravity upgrade on checkout/update
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-25 05:59:41 +01:00
DL6ER
0066c6fbff Make IDs of anti-/gravity lists available in vw_(anti)gravity
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-25 05:29:29 +01:00
yubiuser
6e8029f69f Bump github/codeql-action from 2 to 3 (#5521) 2023-12-16 17:42:03 +01:00
yubiuser
12c6dd5dff Bump github/codeql-action from 2 to 3 (#5522) 2023-12-16 17:38:44 +01:00
dependabot[bot]
c6049d4002 Bump github/codeql-action from 2 to 3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-16 10:30:20 +00:00
dependabot[bot]
0cfcdc4b50 Bump github/codeql-action from 2 to 3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-16 10:08:32 +00:00
Dominik
2ae79f2443 Add "-ni" to all sqlite3 invocations (v5) (#5519) 2023-12-10 18:02:23 +01:00
DL6ER
e8338d0590 Install FTL's development branch to get the latest features during tests
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-10 11:06:48 +01:00
Dominik
719ce801f5 Add "-ni" to all sqlite3 invocations (#5518) 2023-12-10 10:17:48 +01:00
yubiuser
13676c40ca Simplify pihole -v (#5517) 2023-12-09 23:21:52 +01:00
Christian König
c3c31a1a60 Print version details automatically if not on master
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-12-09 23:14:58 +01:00
Christian König
b333e30162 Remove version options from bash completion
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-12-09 23:14:58 +01:00
Christian König
fe4d934a40 Simplify pihole -v
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-12-09 23:13:04 +01:00
yubiuser
a6c0d279b6 Remove obsolete sudo file (#5514) 2023-12-09 23:11:04 +01:00
DL6ER
3f7413d538 Add "-ni" to all sqlite3 invocations
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-09 23:07:35 +01:00
DL6ER
c90a27c509 Add "-ni" to all sqlite3 invocations
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-09 23:06:50 +01:00
yubiuser
ac86ae1e4c Bash completion (#5516) 2023-12-09 23:02:29 +01:00
Christian König
6d02d4056f Rename option --admin to --web in version function
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-12-09 22:01:30 +01:00
Christian König
fe7299323c Update bash_completion
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-12-09 21:40:32 +01:00
Christian König
274d4c263c Add bash-completion to PIHOLE_DEPS
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-12-09 21:23:39 +01:00
Christian König
54186a63ee Remove test for sudo file as well
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-12-09 21:04:56 +01:00
Christian König
a87d1bbc4f Remove pihole.sudo
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-12-09 21:04:56 +01:00
yubiuser
750fb66a8c Bump actions/setup-python from 4.7.1 to 5.0.0 (#5510) 2023-12-09 18:46:19 +01:00
yubiuser
0b23b9b268 Bump actions/stale from 8.0.0 to 9.0.0 (#5511) 2023-12-09 18:45:25 +01:00
dependabot[bot]
e49d7fa5f1 Bump actions/setup-python from 4.7.1 to 5.0.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.7.1 to 5.0.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.7.1...v5.0.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-09 17:39:42 +00:00
dependabot[bot]
8a71e4253e Bump actions/stale from 8.0.0 to 9.0.0
Bumps [actions/stale](https://github.com/actions/stale) from 8.0.0 to 9.0.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v8.0.0...v9.0.0)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-09 17:39:18 +00:00
yubiuser
2529fbeacd Treat FTL return data as strings (#5509) 2023-12-09 18:35:14 +01:00
yubiuser
63b2a1f44a Bump actions/setup-python from 4.7.1 to 5.0.0 (#5512) 2023-12-09 12:43:52 +01:00
yubiuser
c6756b1678 Bump actions/stale from 8.0.0 to 9.0.0 (#5513) 2023-12-09 12:42:36 +01:00
dependabot[bot]
c34464d1e8 Bump actions/stale from 8.0.0 to 9.0.0
Bumps [actions/stale](https://github.com/actions/stale) from 8.0.0 to 9.0.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v8.0.0...v9.0.0)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-09 10:36:49 +00:00
dependabot[bot]
16180e4b23 Bump actions/setup-python from 4.7.1 to 5.0.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.7.1 to 5.0.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.7.1...v5.0.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-09 10:36:44 +00:00
Dominik
03637e9081 Use files.gravity_tmp as temporary directory for the intermediate lists (#5504) 2023-12-09 09:30:28 +01:00
Christian König
159817b7e2 Use development-v6 as ftl branch for binary test
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-12-06 20:35:26 +01:00
Christian König
2681835f94 Treat FTL return data as strings
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-12-06 00:23:15 +01:00
Dominik
7f7ec13c82 Support special webserver.port ports ending in "s" (secure) and "r" (redirect) (#5499) 2023-12-04 23:48:08 +01:00
DL6ER
32a741b5c7 We do not follow 308 but FTL also doesn't suggest it
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-02 22:42:36 +01:00
yubiuser
bbbb4609d2 Bump tox from 4.11.3 to 4.11.4 in /test (#5506) 2023-12-02 14:23:13 +01:00
yubiuser
e364349901 Bump tox from 4.11.3 to 4.11.4 in /test (#5507) 2023-12-02 14:22:53 +01:00
dependabot[bot]
f5fe550a2e Bump tox from 4.11.3 to 4.11.4 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.11.3 to 4.11.4.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.11.3...4.11.4)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-02 10:35:21 +00:00
dependabot[bot]
bfc824f2ff Bump tox from 4.11.3 to 4.11.4 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.11.3 to 4.11.4.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.11.3...4.11.4)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-02 10:04:50 +00:00
DL6ER
29d010dc2c Use files.gravity_tmp as temporary directory for the intermediate lists
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-01 10:21:13 +01:00
DL6ER
96bf07863f Use CHAOS TXT local.api.txt instead of trying to parse pihole-FTL --config webserver.ports
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-01 09:10:06 +01:00
yubiuser
62f9694aa4 Bump pytest-xdist from 3.4.0 to 3.5.0 in /test (#5500) 2023-12-01 00:15:20 +01:00
yubiuser
4523f078bb Bump pytest-xdist from 3.4.0 to 3.5.0 in /test (#5501) 2023-12-01 00:13:41 +01:00
DL6ER
6016131280 Ensure we also check the last port
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-28 22:59:49 +01:00
DL6ER
974fea592d Iterate over ports, skip redirected ports
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-28 00:05:55 +01:00
dependabot[bot]
9d57f64937 Bump pytest-xdist from 3.4.0 to 3.5.0 in /test
Bumps [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/pytest-dev/pytest-xdist/releases)
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-xdist/compare/v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: pytest-xdist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-25 10:58:21 +00:00
dependabot[bot]
1276242a4e Bump pytest-xdist from 3.4.0 to 3.5.0 in /test
Bumps [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/pytest-dev/pytest-xdist/releases)
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-xdist/compare/v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: pytest-xdist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-25 10:16:35 +00:00
DL6ER
a6565bf9a1 Support special webserver.port ports ending in "s" (secure) and "r" (redirect)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-23 22:07:31 +01:00
DL6ER
c785667efe Trim leading and trailing spaces and tabs in upstream servers (if any)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-23 09:56:43 +01:00
DL6ER
cc333f79cc Check if this domain is blocked by Pi-hole but only if the domain is not a local file or empty
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-22 21:10:22 +01:00
DL6ER
df7633bd1b Add missing value for ${gravityDBfile_default}
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-22 21:08:06 +01:00
DL6ER
4efcdf1189 Add missing double quotes to prevent globbing and word splitting
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-22 21:06:09 +01:00
DL6ER
f16cf71781 ${PIHOLE_DNS_1} is gone, use the first server from pihole-FTL --config dns.upstreams instead
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-22 21:04:46 +01:00
DL6ER
19d3489bcb gravity_DownloadBlocklistFromUrl needs ${domain} but it was declared local before and was not passed as argument, making gravity currently depend on undefined behavior. It seems to be working well in the vast majority of cases, however, it seems we have at least one report where it is not working.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-22 20:56:23 +01:00
yubiuser
2338c9e916 Bump pytest-xdist from 3.3.1 to 3.4.0 in /test (#5490) 2023-11-18 12:31:11 +01:00
yubiuser
536d170009 Bump pytest-testinfra from 9.0.0 to 10.0.0 in /test (#5492) 2023-11-18 12:30:21 +01:00
dependabot[bot]
f4b67065cc Bump pytest-xdist from 3.3.1 to 3.4.0 in /test
Bumps [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) from 3.3.1 to 3.4.0.
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-xdist/compare/v3.3.1...v3.4.0)

---
updated-dependencies:
- dependency-name: pytest-xdist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-18 10:55:51 +00:00
yubiuser
2b79abb948 Bump pytest-testinfra from 9.0.0 to 10.0.0 in /test (#5491) 2023-11-18 11:55:06 +01:00
dependabot[bot]
2e73eb36ef Bump pytest-testinfra from 9.0.0 to 10.0.0 in /test
Bumps [pytest-testinfra](https://github.com/pytest-dev/pytest-testinfra) from 9.0.0 to 10.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-testinfra/releases)
- [Changelog](https://github.com/pytest-dev/pytest-testinfra/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-testinfra/compare/9.0.0...10.0.0)

---
updated-dependencies:
- dependency-name: pytest-testinfra
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-18 10:54:16 +00:00
yubiuser
271884c4bb Bump pytest-xdist from 3.3.1 to 3.4.0 in /test (#5493) 2023-11-18 11:53:28 +01:00
dependabot[bot]
3c4f217876 Bump pytest-xdist from 3.3.1 to 3.4.0 in /test
Bumps [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) from 3.3.1 to 3.4.0.
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-xdist/compare/v3.3.1...v3.4.0)

---
updated-dependencies:
- dependency-name: pytest-xdist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-18 10:27:10 +00:00
dependabot[bot]
ab09233753 Bump pytest-testinfra from 9.0.0 to 10.0.0 in /test
Bumps [pytest-testinfra](https://github.com/pytest-dev/pytest-testinfra) from 9.0.0 to 10.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-testinfra/releases)
- [Changelog](https://github.com/pytest-dev/pytest-testinfra/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-testinfra/compare/9.0.0...10.0.0)

---
updated-dependencies:
- dependency-name: pytest-testinfra
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-18 10:17:34 +00:00
yubiuser
af9b8df118 Improve v6 debug log and remove leftovers (#5481) 2023-11-14 00:04:16 +01:00
Christian König
b61e8be3b4 Address reviewer's comment
Co-authored-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 23:04:44 +01:00
Christian König
54ab71d817 Don't use hardcoded ports to check for
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 23:04:44 +01:00
Christian König
e7c89ce25f No need to pass a default value to get_ftl_conf_value()
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 23:04:44 +01:00
Christian König
d3813c4be5 Update check for required ports
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 23:04:44 +01:00
Christian König
d854eb1a97 Add lshw to Pi-hole deps
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 23:04:44 +01:00
Christian König
86aa6b1df6 Improve v6 debug log and remove leftovers
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 23:04:44 +01:00
yubiuser
1da36bd4e7 Move custom.list to /hosts/custom.list (#5488) 2023-11-13 22:58:16 +01:00
Christian König
f65b126433 Move custom.list to /hosts/custom.list
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 21:37:41 +01:00
Christian König
766cb26af5 Drop Fedora 36 and add Fedora 39 to the test suite
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-07 22:24:34 +01:00
DL6ER
e8884083ef Apply suggestions from code review
Signed-off-by: DL6ER <DL6ER@users.noreply.github.com>
2023-11-07 08:58:31 +01:00
DL6ER
e3c6f162d8 Apply suggestions from code review
Co-authored-by: Adam Warner <me@adamwarner.co.uk>
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: DL6ER <DL6ER@users.noreply.github.com>
2023-11-07 08:57:56 +01:00
Christian König
de6e61705e Remove local.list and openVPN traces
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-06 21:40:32 +01:00
DL6ER
834e52f15d pihole -d: Include pihole.toml only once (#5478) 2023-11-06 19:46:33 +01:00
DL6ER
0b4131189d Migrate Pi-hole created files out of /etc/dnsmasq.d into a pihole owned directory
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-06 14:55:34 +01:00
DL6ER
72c972175d Remove left-over parts of setupVars processing and only include pihole.toml once
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-06 13:53:08 +01:00
yubiuser
2746ee3ae9 Tweak help text of pihole setpassword (#5476) 2023-11-05 23:24:31 +01:00
Christian König
bc96d3b0a9 Tweak help text of pihole setpassword
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-05 21:18:46 +01:00
DL6ER
395110f92f When setting a blank password, use webserver.api.password instead of webserver.api.pwhash (#5465) 2023-11-04 17:43:09 +01:00
yubiuser
758ace57c0 Check for valid OS via IPv4 and IPv6 (#5305) 2023-11-04 08:02:38 +01:00
yubiuser
4c129afb10 Start counting at postion 1 (#5470) 2023-11-02 07:00:23 +01:00
Christian König
ced1c5d50b Start counting at postion 1
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-01 21:57:36 +01:00
yubiuser
ce21b4c731 Remove idn2 as punycode conversion is handled by FTL (#5468) 2023-11-01 21:06:02 +01:00
Christian König
480a8c8d7f Remove idn2 as punycode conversion is handled by FTL
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-31 21:02:26 +01:00
DL6ER
0a193f98a4 Tweak Pi-hole's debug facility for v6 (#5461) 2023-10-29 06:13:22 +01:00
Adam Warner
4c4a2ad5bd Use suffixed temp file (#5457) 2023-10-28 22:20:33 +01:00
Adam Warner
ab3b6dfa67 No need to >/dev/null because setFTLConfigValue already does this
adjust output of setFTLConfigValue to test for the exit code of `pihole-FTL --config`
2023-10-28 19:46:45 +01:00
Adam Warner
6292e65b37 When setting a blank password, use webserver.api.password instead of webserver.api.pwhash (fixed in https://github.com/pi-hole/FTL/pull/1702)
This prevents the password from being blanked out on the command line when it has been set by an environment variable
2023-10-28 17:56:37 +01:00
yubiuser
300a4e2299 Bump pytest from 7.4.2 to 7.4.3 in /test (#5463) 2023-10-28 14:03:52 +02:00
yubiuser
ed5d794008 Bump pytest from 7.4.2 to 7.4.3 in /test (#5462) 2023-10-28 14:02:35 +02:00
dependabot[bot]
ec86124997 Bump pytest from 7.4.2 to 7.4.3 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.2 to 7.4.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.2...7.4.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-28 10:32:55 +00:00
dependabot[bot]
2e9e579bba Bump pytest from 7.4.2 to 7.4.3 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.2 to 7.4.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.2...7.4.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-28 10:31:54 +00:00
DL6ER
d377cfbc3e Extract the first entry in the answer section from dig's output, replacing any multiple spaces and tabs with a single space
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:34:30 +02:00
DL6ER
15be8eeffa Remove lighttpd config test
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:21:08 +02:00
DL6ER
635b4e952f Add NOERROR/NXDOMAIN support in the DNS resolution test
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:20:31 +02:00
DL6ER
c86e7b3f96 Generalize CPU check to a short hardware information output
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:13:31 +02:00
DL6ER
dcc7e96d2f Remove detection of addresses of PIHOLE_INTERFACE as it is gone, too
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:07:11 +02:00
DL6ER
ccd8c470a5 check_x_headers is no more
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:03:37 +02:00
DL6ER
00d7e998b4 setupVars.conf and pihole-FTL.conf are no more - use pihole.toml instead
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:03:09 +02:00
Christian König
fd8fdd3513 Use suffixed temp file
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-23 21:36:18 +02:00
DL6ER
a44e51bf76 Fix and simplify binary download (#5451) 2023-10-22 23:03:42 +02:00
DL6ER
91c5967b27 Fix gravity swapping (#5455) 2023-10-22 23:03:30 +02:00
DL6ER
842a9d7778 Address review comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-22 08:33:56 +02:00
DL6ER
7523c49f62 Swapping the databases must be the last step before the cleanup. Otherwise, FTL may be reloading from an only partially completed database causing spurious errors and/or warnings.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-22 08:14:11 +02:00
DL6ER
369ccf13a8 Move FTL binary availability check after the supported OS check
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-21 21:40:21 +02:00
DL6ER
38ecc1693f Further simplify the ARMv6 test
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-21 20:39:32 +02:00
DL6ER
30bfc7cc9f Add binutils tot he OS check dependencies as we need it to check if the local system is abel to run any of our precompiled FTL binaries
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-21 19:15:10 +02:00
DL6ER
45687d675b Fix the binary detection for ARMv6 and simplify the router overall
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-21 19:13:45 +02:00
DL6ER
ca7836bf71 Remove now obsolete GLIBC version check
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-21 19:05:45 +02:00
DL6ER
8bcd1d4c54 *BREAKING* Drop support for ancient ARMv4 and ARMv5 (#5445) 2023-10-21 18:27:42 +02:00
yubiuser
19e081b8ac Bump actions/checkout from 4.1.0 to 4.1.1 (#5448) 2023-10-21 13:51:37 +02:00
DL6ER
ba61ee284b Bump actions/checkout from 4.1.0 to 4.1.1 (#5449) 2023-10-21 13:02:30 +02:00
dependabot[bot]
2a72012ca1 Bump actions/checkout from 4.1.0 to 4.1.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-21 10:55:06 +00:00
dependabot[bot]
79ebbacc4a Bump actions/checkout from 4.1.0 to 4.1.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-21 10:27:01 +00:00
yubiuser
6cf39d9b92 Remove temp dir created when downloading FTL (#5429) 2023-10-20 09:25:10 +02:00
DL6ER
c571d8d37d Drop support for ancient ARMv4 and ARMv5, the Debian binaries turn out to cause unresolvable SIGFPE on ARMv6 and lower. Fortunately, we can still use the Alpine binaries on all Raspberry Pi models (even the oldest ones)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-19 22:13:44 +02:00
yubiuser
33a41391b5 Logrotate config file needs to be owned by root (#5444) 2023-10-18 23:00:47 +02:00
Christian König
d77dbf736c Logrotate config file needs to be owned by root
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-18 22:09:38 +02:00
yubiuser
2deadb2e4a Avoid printing getFTLConfigValue return in statusFunc() (#5442) 2023-10-18 13:19:02 +02:00
RD WebDesign
2c7fa4a7b3 Avoid printing getFTLConfigValue return in statusFunc()
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2023-10-18 02:07:06 -03:00
DL6ER
ed0dfa8b77 Add a final message to gravity (#5441) 2023-10-16 23:00:12 +02:00
RD WebDesign
27522fbc18 Add a final message to gravity
The terminal version doesn't really need a final message, but this will be
read by the web interface to show a success message

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2023-10-16 17:19:44 -03:00
yubiuser
aaa9acc0b9 Update query.sh to use FTL's API instead of directly interacting with the database (#5361) 2023-10-16 21:00:42 +02:00
Christian König
123ba1f154 Remove temp dir created when downloading FTL
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-15 22:15:11 +02:00
Christian König
2005d04625 Exact search is the new default
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-14 21:50:57 +02:00
yubiuser
2841a33b81 Set owner of gravity output files to pihole (#5419) 2023-10-14 19:40:27 +02:00
yubiuser
539f379cb4 Remove Chronometer (#5423) 2023-10-14 19:40:02 +02:00
Christian König
ec83d6b793 No help for gone functions
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-14 14:06:47 +02:00
Christian König
f7ba059b94 Query directly and authenticate only if required
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-14 14:03:56 +02:00
Christian König
e374950915 Merge branch 'development-v6' into query_list_v6 2023-10-13 21:49:09 +02:00
yubiuser
6ae713eaf5 Allow pihole to access subdirs in /etc/pihole (#5427) 2023-10-13 20:29:38 +02:00
Christian König
40c75289b5 Allow pihole to access subdirs in /etc/pihole
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-13 20:07:25 +02:00
Christian König
188b2b858a PADD is fine, really!
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-12 13:48:01 +02:00
Christian König
46ff257344 Remove Chronometer
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-12 13:44:51 +02:00
Christian König
2061f3a70e Set owner/permissions at the right place
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-11 21:22:12 +02:00
Adam Warner
51de1dcfcd Sync master back into development (#5422) 2023-10-11 10:42:31 +01:00
Adam Warner
60b6a1016c v5.17.2 (#5421) 2023-10-11 10:41:25 +01:00
Christian König
22863845a0 Set owner/group of /etc/pihole to pihole
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-09 22:05:01 +02:00
Christian König
679aab10d0 Run gravity as user pihole
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-09 21:53:37 +02:00
Christian König
6001fe34ec Set owner of gravity output files to pihole
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-08 23:03:33 +02:00
Adam Warner
96640ea2c8 Update references to web repo (#5417) 2023-10-08 19:51:42 +01:00
Adam Warner
1fa5cb84db Update references to web repo (#5418) 2023-10-08 19:51:39 +01:00
Adam Warner
9622265c8d Disable checkout function for (official) docker containers (#5416) 2023-10-08 16:08:36 +01:00
Adam Warner
71357ecae7 adminlte->web
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-10-08 14:12:02 +01:00
Adam Warner
7886dc0172 adminlte->web
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-10-08 14:09:47 +01:00
Adam Warner
044e856e6b Disable checkout function for (official) docker containers
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-10-08 13:23:44 +01:00
yubiuser
0385b1d076 Bump actions/setup-python from 4.7.0 to 4.7.1 (#5412) 2023-10-07 16:45:34 +02:00
yubiuser
e87d03a5ef Bump actions/setup-python from 4.7.0 to 4.7.1 (#5413) 2023-10-07 13:21:54 +02:00
dependabot[bot]
70547755d6 Bump actions/setup-python from 4.7.0 to 4.7.1
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.7.0 to 4.7.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.7.0...v4.7.1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-07 10:39:32 +00:00
dependabot[bot]
f52b2b9863 Bump actions/setup-python from 4.7.0 to 4.7.1
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.7.0 to 4.7.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.7.0...v4.7.1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-07 10:23:00 +00:00
yubiuser
bef5d85e6b Yu vs uh (#5411) 2023-10-07 06:09:23 +02:00
Christian König
afa688e3a0 Yu vs uh
(https://www.theguardian.com/guardian-observer-style-guide-r#:~:text=re/re%2D,re%2Dsign/resign)

Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-07 00:21:06 +02:00
yubiuser
f5885c8f64 Fix spellcheck errors (#5410) 2023-10-07 00:15:11 +02:00
Christian König
edf0060acf Fix spellcheck errors
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-06 22:26:08 +02:00
Adam Warner
7b341cc005 Some verbiage change to outputs (plus a couple of comments) (#5406) 2023-10-04 19:49:48 +01:00
Adam Warner
885b626a68 Some unrelated spelling mistakes that spellcheck is grumbling about
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-10-04 16:22:01 +01:00
Adam Warner
aba41b45b0 Some verbiage change to outputs
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-10-04 16:20:38 +01:00
Adam Warner
69a264a3c2 Add antigravity support to gravity (#5330) 2023-09-29 19:09:24 +01:00
DL6ER
43ddfcf2ca Ensure pihole-FTL can write to all files in /etc/pihole, /run/pihole and /var/log/pihole (#5356) 2023-09-26 19:59:56 +02:00
Adam Warner
0bf33edda1 Ignore ABP style entries in debug log dig test (#5382) 2023-09-26 17:35:25 +01:00
yubiuser
fc72902029 Bump actions/checkout from 4.0.0 to 4.1.0 (#5397) 2023-09-23 13:31:14 +02:00
yubiuser
3f4e2105b3 Bump actions/checkout from 4.0.0 to 4.1.0 (#5396) 2023-09-23 13:17:29 +02:00
dependabot[bot]
ec9d84692f Bump actions/checkout from 4.0.0 to 4.1.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-23 10:45:09 +00:00
dependabot[bot]
c3d1f366ec Bump actions/checkout from 4.0.0 to 4.1.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-23 10:39:24 +00:00
DL6ER
ea23c8364d Move antigravity-related changed to gravits database migration step 16->17
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-09-16 10:04:29 +02:00
DL6ER
df92b8ac14 Add missing creation of view vw_antigravity as well as schema change to vw_adlist
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-09-12 20:43:34 +02:00
DL6ER
f19a56cf87 Merge branch 'development-v6' into new/antigravity
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-09-11 11:43:56 +02:00
yubiuser
4955c52af7 Remove fake user agent when downloading adlists (#5366) 2023-09-10 21:20:14 +02:00
yubiuser
20a35936ca Remove fake user agent when downloading adlist (#5367) 2023-09-10 21:19:27 +02:00
Adam Warner
d6a018a3f8 Sync master back into development (#5391) 2023-09-10 16:22:32 +01:00
Adam Warner
fef2861eae Do not try to remove stale label on PRs (#5292) 2023-09-10 12:52:27 +01:00
yubiuser
babe7a7798 Bump actions/checkout from 3.6.0 to 4.0.0 (#5388) 2023-09-09 20:52:29 +02:00
yubiuser
7fbc7d458b Bump tox from 4.11.1 to 4.11.3 in /test (#5389) 2023-09-09 19:54:45 +02:00
yubiuser
c46a06b522 Bump pytest from 7.4.0 to 7.4.2 in /test (#5390) 2023-09-09 19:54:05 +02:00
yubiuser
0ff736fadd Bump pytest from 7.4.0 to 7.4.2 in /test (#5386) 2023-09-09 19:53:19 +02:00
yubiuser
3f6e41e8f4 Bump actions/checkout from 3.6.0 to 4.0.0 (#5387) 2023-09-09 17:08:51 +02:00
dependabot[bot]
dc73ace7c4 Bump pytest from 7.4.0 to 7.4.2 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.0 to 7.4.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.0...7.4.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-09 15:07:06 +00:00
yubiuser
76d978144f Bump tox from 4.11.1 to 4.11.3 in /test (#5385) 2023-09-09 17:06:26 +02:00
dependabot[bot]
55f72ac925 Bump pytest from 7.4.0 to 7.4.2 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.0 to 7.4.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.4.0...7.4.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-09 10:58:32 +00:00
dependabot[bot]
047eac6d9c Bump tox from 4.11.1 to 4.11.3 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.11.1 to 4.11.3.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.11.1...4.11.3)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-09 10:58:28 +00:00
dependabot[bot]
16ea50ad55 Bump actions/checkout from 3.6.0 to 4.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 4.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.6.0...v4.0.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-09 10:17:15 +00:00
dependabot[bot]
1f241a3d45 Bump actions/checkout from 3.6.0 to 4.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 4.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.6.0...v4.0.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-09 10:08:40 +00:00
dependabot[bot]
a229a623bb Bump tox from 4.11.1 to 4.11.3 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.11.1 to 4.11.3.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.11.1...4.11.3)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-09 10:05:32 +00:00
yubiuser
f035687fca Ignore ABP style entries in debug log dig test (#5381) 2023-09-07 22:49:57 +02:00
Christian König
52268f0155 Ignore ABP style entries in debug log dig test
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-09-07 22:32:09 +02:00
Christian König
843f57399c Ignore ABP style entries in debug log dig test
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-09-07 22:27:49 +02:00
Christian König
cdc1c1ace1 Remove user agent when downloading adlists
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-09-03 23:40:58 +02:00
yubiuser
ff72650b8d Bump tox from 4.10.0 to 4.11.1 in /test (#5379) 2023-09-02 18:14:39 +02:00
yubiuser
a74887db20 Bump tox from 4.10.0 to 4.11.1 in /test (#5378) 2023-09-02 14:54:27 +02:00
dependabot[bot]
9084b170cb Bump tox from 4.10.0 to 4.11.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.10.0 to 4.11.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.10.0...4.11.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-02 10:35:16 +00:00
dependabot[bot]
ff2c2290c7 Bump tox from 4.10.0 to 4.11.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.10.0 to 4.11.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.10.0...4.11.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-02 10:27:10 +00:00
Christian König
c33963b250 Check for valid OS via IPv4 and IPv6
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-27 15:11:47 +02:00
Christian König
eca84e0986 Remove user agent when downloading adlists
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-27 14:59:47 +02:00
yubiuser
fb831b5f48 Bump actions/checkout from 3.5.3 to 3.6.0 (#5372) 2023-08-27 14:41:25 +02:00
yubiuser
2878c1ba84 Bump tox from 4.9.0 to 4.10.0 in /test (#5371) 2023-08-27 14:34:14 +02:00
dependabot[bot]
9b68fa0b27 Bump tox from 4.9.0 to 4.10.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.9.0 to 4.10.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.9.0...4.10.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-27 12:28:54 +00:00
yubiuser
a7ed968ee2 Bump pytest-testinfra from 8.1.0 to 9.0.0 in /test (#5370) 2023-08-27 14:28:17 +02:00
yubiuser
487a64abec Bump tox from 4.9.0 to 4.10.0 in /test (#5374) 2023-08-26 14:44:00 +02:00
yubiuser
1330aa8f1c Bump actions/checkout from 3.5.3 to 3.6.0 (#5375) 2023-08-26 14:43:21 +02:00
dependabot[bot]
53e8127781 Bump actions/checkout from 3.5.3 to 3.6.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 3.6.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.5.3...v3.6.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-26 11:33:09 +00:00
dependabot[bot]
e65b171aea Bump tox from 4.9.0 to 4.10.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.9.0 to 4.10.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.9.0...4.10.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-26 11:24:09 +00:00
yubiuser
268a5dac40 Bump pytest-testinfra from 8.1.0 to 9.0.0 in /test (#5373) 2023-08-26 13:23:31 +02:00
dependabot[bot]
1afc96c055 Bump pytest-testinfra from 8.1.0 to 9.0.0 in /test
Bumps [pytest-testinfra](https://github.com/pytest-dev/pytest-testinfra) from 8.1.0 to 9.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-testinfra/releases)
- [Changelog](https://github.com/pytest-dev/pytest-testinfra/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-testinfra/compare/8.1.0...9.0.0)

---
updated-dependencies:
- dependency-name: pytest-testinfra
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-26 10:46:28 +00:00
dependabot[bot]
924f8b8844 Bump actions/checkout from 3.5.3 to 3.6.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 3.6.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.5.3...v3.6.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-26 10:20:12 +00:00
dependabot[bot]
1c6919cf07 Bump pytest-testinfra from 8.1.0 to 9.0.0 in /test
Bumps [pytest-testinfra](https://github.com/pytest-dev/pytest-testinfra) from 8.1.0 to 9.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-testinfra/releases)
- [Changelog](https://github.com/pytest-dev/pytest-testinfra/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-testinfra/compare/8.1.0...9.0.0)

---
updated-dependencies:
- dependency-name: pytest-testinfra
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-26 10:08:08 +00:00
yubiuser
996234ad66 Bump tox from 4.7.0 to 4.9.0 in /test (#5365) 2023-08-19 18:14:20 +02:00
yubiuser
18c9ae64b4 Bump tox from 4.7.0 to 4.9.0 in /test (#5364) 2023-08-19 15:33:31 +02:00
dependabot[bot]
272ca8c55d Bump tox from 4.7.0 to 4.9.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.7.0 to 4.9.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.7.0...4.9.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-19 10:48:18 +00:00
dependabot[bot]
43882693a5 Bump tox from 4.7.0 to 4.9.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.7.0 to 4.9.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.7.0...4.9.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-19 10:19:26 +00:00
Christian König
ee4eb8db20 chmod +x
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-13 22:26:44 +02:00
Christian König
8e0a40e717 Use api.sh within query.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-13 22:24:05 +02:00
yubiuser
9fc01263e6 Bump tox from 4.6.4 to 4.7.0 in /test (#5360) 2023-08-12 13:32:41 +02:00
yubiuser
052f9763b5 Bump tox from 4.6.4 to 4.7.0 in /test (#5359) 2023-08-12 13:24:30 +02:00
dependabot[bot]
7747cd2232 Bump tox from 4.6.4 to 4.7.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.6.4 to 4.7.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.6.4...4.7.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-12 10:52:02 +00:00
dependabot[bot]
bd55b2e566 Bump tox from 4.6.4 to 4.7.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.6.4 to 4.7.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.6.4...4.7.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-12 10:25:00 +00:00
Christian König
2227a2c569 Add API functions
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-09 21:25:50 +02:00
yubiuser
48dd045d91 Remove webpage.sh (#5357) 2023-08-07 23:17:41 +02:00
Christian König
3c693c1da5 Apply suggestions from code review
Co-authored-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-06 12:04:55 +02:00
Christian König
7bb0ca59d1 Remove traces of /run/pihole
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-05 14:54:09 +02:00
Christian König
587a2a1c04 # allow all users to enter der directories
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-04 23:52:53 +02:00
Christian König
c360743d41 Re-add file/folder permissions
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-04 21:12:40 +02:00
Christian König
8ef8a27583 Remove webpage.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-04 20:04:45 +02:00
Christian König
a3ea2cd8c3 User pihole should be allowed to edit all its files
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-04 19:32:19 +02:00
Christian König
5ae0405446 Ensure pihole-FTL can write custom.list
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-03 20:46:01 +02:00
Adam Warner
eda83a4141 If ${USER} variable is blank, then populate it with whoami (#5341) 2023-07-18 09:12:25 +01:00
Adam Warner
03a1f4370a Merge development -> development-v6 (#5345) 2023-07-18 09:11:55 +01:00
Adam Warner
f270642d67 Merge branch 'development' into development-v6-merge-dev
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-07-18 08:15:40 +01:00
DL6ER
2a03671fb9 Reinstall gravity cleanup on error
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-07-18 08:13:36 +01:00
DL6ER
375d4d9bc1 Add type as new field of view vw_adlist
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-07-18 08:13:36 +01:00
DL6ER
35512c4dc9 Fix adlist.list migration step failing during tests
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-07-18 08:13:36 +01:00
DL6ER
00cbb8bc8a Add antigravity support to gravity
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-07-18 08:13:36 +01:00
Adam Warner
98c7d877ec Update test dependencies (v5) (#5343) 2023-07-18 08:12:34 +01:00
Adam Warner
6edd6a4d55 if ${USER} variable is blank, then populate it with whoami
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-07-18 08:11:48 +01:00
Adam Warner
aec852fa51 Update test dependencies (v6) (#5344) 2023-07-18 08:11:37 +01:00
Adam Warner
e42c692ec7 Drop docker-compose from requirements.txt, it's not used. This was the only thing preventing us from using pyyaml 6.0.1 which fixes issues we were seeing with tests not running (https://github.com/yaml/pyyaml/pull/702)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-07-18 08:04:33 +01:00
Adam Warner
7e240251d5 Drop docker-compose from requirements.txt, it's not used. This was the only thing preventing us from using pyyaml 6.0.1 which fixes issues we were seeing with tests not running (https://github.com/yaml/pyyaml/pull/702)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-07-18 08:03:05 +01:00
Adam Warner
ab2aea7bbf Bump tox from 4.6.2 to 4.6.4 in /test (#5339) 2023-07-16 22:52:26 +01:00
dependabot[bot]
8dd8f989ab Bump tox from 4.6.2 to 4.6.4 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.6.2 to 4.6.4.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.6.2...4.6.4)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-16 21:44:31 +00:00
Adam Warner
762256a71b Bump pytest from 7.3.2 to 7.4.0 in /test (#5340) 2023-07-16 22:43:43 +01:00
Adam Warner
78cd440a61 Bump actions/setup-python from 4.6.1 to 4.7.0 (#5338) 2023-07-16 22:42:53 +01:00
Adam Warner
30661fedcb Sync master back into development (#5337) 2023-07-16 22:36:32 +01:00
dependabot[bot]
a3955a7ebb Bump pytest from 7.3.2 to 7.4.0 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.2 to 7.4.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.3.2...7.4.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-16 21:36:15 +00:00
dependabot[bot]
e295997d51 Bump actions/setup-python from 4.6.1 to 4.7.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.6.1 to 4.7.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.6.1...v4.7.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-16 21:36:02 +00:00
Adam Warner
8495565a6f Update dependabot.yml (#5334) 2023-07-16 22:35:34 +01:00
Adam Warner
cefbfdf2a4 Bump actions/setup-python from 4.6.1 to 4.7.0 (#5336) 2023-07-16 22:24:01 +01:00
dependabot[bot]
91dabc574d Bump actions/setup-python from 4.6.1 to 4.7.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.6.1 to 4.7.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.6.1...v4.7.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-15 10:30:37 +00:00
Adam Warner
80091232a7 Add missing env:, tweak conditional
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-07-13 17:43:48 +01:00
Adam Warner
924de1d9ed Update dependabot.yml
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-07-11 23:51:28 +01:00
yubiuser
60a7c50120 Bump tox from 4.6.3 to 4.6.4 in /test (#5332) 2023-07-08 14:55:31 +02:00
dependabot[bot]
a01d31e25d Bump tox from 4.6.3 to 4.6.4 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.6.3 to 4.6.4.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.6.3...4.6.4)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-08 10:15:54 +00:00
DL6ER
2d4d9078c4 Add /var/log/pihole/webserver.log to the logrotate scripts (#5329) 2023-07-06 19:27:49 +02:00
DL6ER
64319fa96e Add /var/log/pihole/webserver.log to the logrotate scripts. While it may be empty for most, it can grow quickly if either API or TLS debugging is enabled (it can quickly reach several hundreds of MB per day when debugging TLS)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-07-05 22:11:56 +01:00
Adam Warner
047017dc6a Set new gravity database version to 16 (#5328) 2023-07-04 08:32:50 +01:00
Adam Warner
c557f29db2 Set new gravity database version to 16, which was missed in 5459daa
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-07-03 23:01:27 +01:00
yubiuser
1eb4ad8238 Bump pytest from 7.3.2 to 7.4.0 in /test (#5325) 2023-06-25 11:46:08 +02:00
dependabot[bot]
5490625d8d Bump pytest from 7.3.2 to 7.4.0 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.2 to 7.4.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.3.2...7.4.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-24 16:03:56 +00:00
yubiuser
5389ef1a70 Bump tox from 4.6.2 to 4.6.3 in /test (#5324) 2023-06-24 18:03:17 +02:00
dependabot[bot]
198ca65f7d Bump tox from 4.6.2 to 4.6.3 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.6.2 to 4.6.3.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.6.2...4.6.3)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-24 10:57:28 +00:00
Adam Warner
04c3f7a603 Development -> development-v6 (#5321) 2023-06-18 22:21:11 +01:00
Adam Warner
85d256d53c Switch to new branch name for FTL v6 development (#5319) 2023-06-18 22:17:39 +01:00
Adam Warner
ca66c1ea9c Switch to new branch name for FTL v6 development
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-06-18 22:05:18 +01:00
Adam Warner
0fa5c62450 Add code to remove old lighttpd config files left over from v5. (#5314) 2023-06-18 21:53:07 +01:00
Adam Warner
a3bb3872bf adlist table now contains 11 columns, not 10.
Co-authored-by: Christian König <ckoenig@posteo.de>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-06-18 21:10:12 +01:00
Adam Warner
d637d2a7a5 Simplify nested if statements.
Co-authored-by: yubiuser <ckoenig@posteo.de>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-06-18 21:10:06 +01:00
Adam Warner
001f2012a2 Update automated install/basic-install.sh
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: Adam Warner <github@adamwarner.co.uk>
2023-06-18 15:45:30 +01:00
Adam Warner
c39cb8cfe0 Escape the sed command for removing a line in fed/centos lighttpd.conf
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-06-18 15:45:30 +01:00
Adam Warner
d5013bfd6c Add code to remove old lighttpd config files left over from v5. Web config is all dealt with by FTL now
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-06-18 15:45:30 +01:00
yubiuser
7bc1126978 Bump tox from 4.6.0 to 4.6.2 in /test (#5317) 2023-06-17 19:46:04 +02:00
dependabot[bot]
7a66083e68 Bump tox from 4.6.0 to 4.6.2 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.6.0 to 4.6.2.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.6.0...4.6.2)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-17 11:35:38 +00:00
yubiuser
17fffa4e49 Bump pytest from 7.3.1 to 7.3.2 in /test (#5318) 2023-06-17 13:35:00 +02:00
dependabot[bot]
3fd7b4ee24 Bump pytest from 7.3.1 to 7.3.2 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.1 to 7.3.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.3.1...7.3.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-17 10:59:42 +00:00
DL6ER
5459daa03d Add abp_entries column (default 0) to the adlist table for newly created gravity databases. This updates the gravity database version to 16
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-06-15 09:36:17 +02:00
DL6ER
306df56203 Add tests for Debian 12 (#5312) 2023-06-11 08:46:59 +02:00
Christian König
117c15319d Add tests for Debian 12
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-10 23:03:43 +02:00
yubiuser
b8419ba3c5 Bump tox from 4.5.2 to 4.6.0 in /test (#5311) 2023-06-10 14:14:59 +02:00
yubiuser
8347de1cc6 Bump actions/checkout from 3.5.2 to 3.5.3 (#5310) 2023-06-10 14:06:32 +02:00
dependabot[bot]
8e481e27da Bump tox from 4.5.2 to 4.6.0 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.5.2 to 4.6.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.5.2...4.6.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-10 11:00:35 +00:00
dependabot[bot]
7d3f354dd7 Bump actions/checkout from 3.5.2 to 3.5.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.5.2...v3.5.3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-10 10:57:12 +00:00
DL6ER
e0d7e5df85 Install binutils as installer deps (needed to pick correct architecture for FTL)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-06-09 19:30:28 +02:00
DL6ER
913be6c349 Print detected CPU arch
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-06-09 19:01:14 +02:00
DL6ER
1c4e58efe3 Use exact architecture matching binaries where appropriate
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-06-09 15:53:02 +02:00
DL6ER
9c27e4766d Decide which FTL architecture to pick by by installed architectures rather than by detected processor (this may be wrong in an emulated Docker environment)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-06-08 22:17:14 +02:00
Adam Warner
eb0bd026d7 Sync master back into development (#5296) 2023-06-04 22:16:58 +01:00
Adam Warner
7e95371fe8 Do not remove -all|exact when not surrounded by space in query.sh (#5300) 2023-06-04 22:16:35 +01:00
Adam Warner
499998c537 Remove option to set static IP address if DHCPCD is installed (#5111) 2023-06-04 22:09:04 +01:00
Christian König
8bf4ab0cd6 Remove option to set static IP address if DHCPCD is installed
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-04 22:59:44 +02:00
Christian König
088b2c2920 Do not remove -all|excat when not sourrounded by space in query.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-04 22:57:31 +02:00
yubiuser
34a261e522 Bump tox from 4.5.1 to 4.5.2 in /test (#5304) 2023-06-04 22:15:36 +02:00
Christian König
ba3e290915 Fix shellcheck errors
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-04 21:21:48 +02:00
Christian König
53fb7ae0ef Use shellcheck in smoke-tests. RIP stickler
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-04 21:06:44 +02:00
Christian König
366345e87e Fix no_installs
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-04 20:31:48 +02:00
DL6ER
667418c71d Use new FTL binary names
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-06-04 20:02:38 +02:00
dependabot[bot]
b0fa3795e9 Bump tox from 4.5.1 to 4.5.2 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.5.1 to 4.5.2.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.5.1...4.5.2)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-03 10:58:23 +00:00
Christian König
ec82aec55f centos_common_support.py was removed
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-02 00:13:57 +02:00
Christian König
7da57c6acd Don't check and install old FTL config file
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-02 00:08:50 +02:00
Christian König
0becc7615a Run prestart
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-01 23:51:03 +02:00
Christian König
a4322c624f Fix gravity in tests
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-01 22:00:40 +02:00
Christian König
001024b4da Fix Tests No2
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-01 20:41:54 +02:00
Adam Warner
792b0d419b Test fixes
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-06-01 19:29:47 +01:00
Christian König
7351a4d3b1 Merge branch 'development' into development-v6
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-01 15:45:05 +02:00
Christian König
364537b324 Use env variable
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-01 15:15:49 +02:00
Christian König
b2c73f8325 Do not try to remove stale lables on PRs
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-01 15:15:49 +02:00
Christian König
f7b9d70054 Remove man page for pihole-FTL
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-30 21:39:10 +02:00
Adam Warner
6a45c6a8e0 v5.17.1 (#5295) 2023-05-30 19:27:52 +01:00
DL6ER
c1335c6852 Fix gravity adlist status not being updated (#5294) 2023-05-30 19:02:07 +02:00
DL6ER
6c302c9bc8 Adlist properties need to be stored in the new ("temp") database rather than the old.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-05-30 17:01:58 +02:00
yubiuser
fc67de8c19 Fix Faulty Regex pattern in custom DNS domain validation (#5291) 2023-05-29 09:13:33 +02:00
Adam Warner
494734bf27 Add in a test case
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-28 23:48:16 +01:00
Adam Warner
11679a5188 @MrDuck2742 dropped a ] on the floor without me seeing. I picked it up and put it back again
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-28 23:31:51 +01:00
Adam Warner
aa9b4530c8 Sync master back into development (#5289) 2023-05-28 13:08:25 +01:00
Adam Warner
bea63f9d2d Pi-hole v5.17 (#5288) 2023-05-28 12:01:25 +01:00
DL6ER
137e6dc184 Remove all the undocumented now useless stuff from pihole -a
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-05-28 09:01:02 +02:00
DL6ER
de5e6e4163 Add support for RISC-V 64-bit installs (#5196) 2023-05-28 07:44:06 +02:00
DL6ER
350c9e02ea Add Ubuntu 23 to test suite (#5284) 2023-05-28 07:39:34 +02:00
yubiuser
f59610081e remove outdated comments (#5227) 2023-05-27 22:41:11 +02:00
yubiuser
50d67dce73 Bump actions/setup-python from 4.6.0 to 4.6.1 (#5286) 2023-05-27 15:22:47 +02:00
yubiuser
43ba31f402 Bump pytest-testinfra from 8.0.0 to 8.1.0 in /test (#5287) 2023-05-27 14:45:28 +02:00
dependabot[bot]
3ae72114c7 Bump pytest-testinfra from 8.0.0 to 8.1.0 in /test
Bumps [pytest-testinfra](https://github.com/pytest-dev/pytest-testinfra) from 8.0.0 to 8.1.0.
- [Release notes](https://github.com/pytest-dev/pytest-testinfra/releases)
- [Changelog](https://github.com/pytest-dev/pytest-testinfra/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-testinfra/compare/8.0.0...8.1.0)

---
updated-dependencies:
- dependency-name: pytest-testinfra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-27 10:59:32 +00:00
dependabot[bot]
783f9e5569 Bump actions/setup-python from 4.6.0 to 4.6.1
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-27 10:56:41 +00:00
Christian König
b5800ef718 Remove getFTLAPIPort() function and fix pihole status
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-27 11:53:00 +01:00
Christian König
44bfb8ebf0 Remove the ability to reboot/shutdown via webpage.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-27 11:53:00 +01:00
Adam Warner
ea748822ef REVISIT: I don't _think_ this line is nessacery. Why should gravity restart FTL if it is offline? It might be offline on purpose.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:53:00 +01:00
Adam Warner
c0e352094d REVISIT: Remove some references to setupVars (some files can probably go entirely...)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
a91eb48d48 Remove some code from gravity that gets values from setupVars.conf / pihole-FTL.conf - use getFTLConfigValue from utils.sh instead
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
6b1c8a7fff @DL6ER changed the config key names...
Remove superfluous test

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
7cbe713873 REVISIT: Don't rely on existence of setupVars.conf
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
0e8f285f4f Always assume that the web interface will be installed.
We could revist this again in future if we decide that there should still be a choice to install the interface or not

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
cd17040f95 setupVars.conf not existing is no longer a critical error
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
2784b267ec pihole command: read values from pihole-FTL instead of setupvars.conf
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
dbc6b814b2 Should not need to reloadDNS manually any more as FTL will detect that it needs to reload by itself
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
0568a69d83 Use WEBPORT instead of PRIVACY_LEVEL to set the web port...
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Christian König
3cb3adc5ca Fix setting webpassword via pihole -a -p
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-27 11:51:16 +01:00
DL6ER
3695610300 Allow running pihole -g without root (run as user pihole)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-05-27 11:51:16 +01:00
Adam Warner
bf16fe4a37 Remove the EPEL related tests on centos/fedora - no longer neccasery
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
9bf372ef43 [REVISIT] Remove test_installPihole_fresh_install_readableBlockpage for now. We may be able to recylcle it later, but I have my doubts
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
414df5b372 Remove no longer required checks in test_installPihole_fresh_install_readableFiles
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
5e431210fd [REVISIT] Remove test_setupVars_saved_to_file for now - it may no longer be needed as we move towards getting rid of the file.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
8f7c828407 No need for test_installPiholeWeb_fresh_install_no_errors
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
b8acccde90 Update comments on the move of /etc/dnsmasq.old -> /etc/dnsmasq.old to better reflect why we are doing it
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
019be067d9 Convert SetWebPassword to use new FTL config
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
632aead691 add wrappers to utils.sh for setting FTL config & add tests
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
e3ffec5762 Change when old configs are removed
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:15 +01:00
Adam Warner
0e558e4c36 Remove some code that installs the blockpage/sets up web directories
Remove some code that disables dnsmasq if it is running
Create dnsmasq.d directory if it does not exist
2023-05-27 11:51:15 +01:00
Adam Warner
31f16510e2 Clear out some no longer needed ftl/dnsmasq config code
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:15 +01:00
Adam Warner
d2d1195928 Needs tweaking, offer chance to change web interface port
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:15 +01:00
Adam Warner
c520b29326 some more lighttpd refs (tests can come later)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:15 +01:00
Adam Warner
31ee15200d gut the install script of references to web server/lighttpd
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:15 +01:00
Adam Warner
9f31ab8a6f Debug log does not need to check php/lighttpd
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:15 +01:00
DL6ER
23f2db01bb Use list parsing functionality of FTL (#5275) 2023-05-27 12:48:26 +02:00
Adam Warner
82b60b09d4 Fix issue with Adding Local DNS Records does not add to /etc/pihole/custom.list when using grep 3.10 (#5269) 2023-05-27 11:28:19 +01:00
Christian König
5bdb089b7f Add Ubuntu 23 to test suite
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-24 22:54:47 +02:00
DL6ER
c92826c152 Do not copy info table during pihole -g
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-05-24 21:32:34 +02:00
yubiuser
85e7fc5a0e Bump pytest-testinfra from 7.0.0 to 8.0.0 in /test (#5279) 2023-05-20 17:05:33 +02:00
dependabot[bot]
10fe85933b Bump pytest-testinfra from 7.0.0 to 8.0.0 in /test
Bumps [pytest-testinfra](https://github.com/pytest-dev/pytest-testinfra) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-testinfra/releases)
- [Changelog](https://github.com/pytest-dev/pytest-testinfra/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-testinfra/compare/7.0.0...8.0.0)

---
updated-dependencies:
- dependency-name: pytest-testinfra
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-20 13:41:46 +00:00
yubiuser
412079a798 Bump pytest-xdist from 3.3.0 to 3.3.1 in /test (#5278) 2023-05-20 15:41:00 +02:00
dependabot[bot]
f9b29cfb62 Bump pytest-xdist from 3.3.0 to 3.3.1 in /test
Bumps [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) from 3.3.0 to 3.3.1.
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-xdist/compare/v3.3.0...v3.3.1)

---
updated-dependencies:
- dependency-name: pytest-xdist
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-20 11:02:15 +00:00
DL6ER
73733308ba Use parseList function offered by pihole-FTL 2023-05-15 19:25:56 +02:00
yubiuser
614554f26f Bump pytest-xdist from 3.2.1 to 3.3.0 in /test (#5274) 2023-05-13 14:01:05 +02:00
dependabot[bot]
8d91ca874b Bump pytest-xdist from 3.2.1 to 3.3.0 in /test
Bumps [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) from 3.2.1 to 3.3.0.
- [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-xdist/compare/v3.2.1...v3.3.0)

---
updated-dependencies:
- dependency-name: pytest-xdist
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-13 11:01:21 +00:00
yubiuser
b075e25ab9 Remove forgotten variables (#5273) 2023-05-12 09:56:33 +02:00
Christian König
eaded9fdb1 Remove forgotten variables
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-11 22:16:21 +02:00
yubiuser
19d50b9669 Don't source the install script in webpage.sh (#5270) 2023-05-10 19:55:51 +02:00
yubiuser
8e5467de70 Remove unused code from query.sh (#5266) 2023-05-10 19:54:57 +02:00
yubiuser
fe1618d697 Don't use '--suffix' in mktemp (#5272) 2023-05-10 08:07:59 +02:00
Christian König
a3e610dbf2 Don't use '--suffix' in mktemp
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-10 06:52:51 +02:00
MrDuck2742
b8c3f6d999 Adding Local DNS Records does not add to /etc/pihole/custom.list
Fixes #5268

Signed-off-by: MrDuck2742 <jim@datachord.co.uk>
2023-05-08 04:41:53 +01:00
Christian König
e6ae2e98cc Don't source the install script in webpage.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-07 13:21:23 +02:00
Adam Warner
654e111038 Sync master back into development (#5221) 2023-05-06 11:14:50 +01:00
yubiuser
cd638b102f Filter ABP CSS selectors (#5247) 2023-05-04 12:01:20 +02:00
MichaIng
b74c6d5120 Add support for RISC-V 64-bit installs
Signed-off-by: MichaIng <micha@dietpi.com>
2023-05-03 20:52:28 +02:00
Christian König
fd4e8766e4 Remove unused code from query.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-02 22:50:51 +02:00
yubiuser
c95d34389b Bump tox from 4.4.12 to 4.5.1 in /test (#5264) 2023-04-29 18:33:35 +02:00
dependabot[bot]
83afff953f Bump tox from 4.4.12 to 4.5.1 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.4.12 to 4.5.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.4.12...4.5.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-29 10:57:31 +00:00
yubiuser
b8ffd2700c Bump actions/checkout from 3.4.0 to 3.5.2 (#5261) 2023-04-23 07:31:05 +02:00
dependabot[bot]
9bcb323568 Bump actions/checkout from 3.4.0 to 3.5.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.4.0 to 3.5.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.4.0...v3.5.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-22 13:37:35 +00:00
yubiuser
e9e0aa37f4 Bump actions/setup-python from 4.5.0 to 4.6.0 (#5260) 2023-04-22 15:36:15 +02:00
dependabot[bot]
0df06dc2fb Bump actions/setup-python from 4.5.0 to 4.6.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.5.0...v4.6.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-22 10:56:37 +00:00
Dan Schaper
53d09417dd Add Fedora 38 to the test suite (#5257) 2023-04-19 14:01:17 -07:00
Christian König
eed4b70512 Add Fedora 38 to the test suite
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-04-19 21:03:12 +02:00
Dan Schaper
8fbad01d45 Trigger stale workflow on issue comments to remove stale label immediately (#5252) 2023-04-17 12:53:23 -07:00
Christian König
1a9dbec83c Use env variable
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-04-17 20:52:51 +02:00
Christian König
5985d506f1 Run seperate job to trigger removal on comments
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-04-16 15:04:26 +02:00
yubiuser
fc706b6cbb Bump actions/stale from 7.0.0 to 8.0.0 (#5231) 2023-04-15 14:52:16 +02:00
yubiuser
7eeedf1b5f Bump pytest from 7.2.2 to 7.3.1 in /test (#5253) 2023-04-15 14:51:54 +02:00
dependabot[bot]
364fd38996 Bump pytest from 7.2.2 to 7.3.1 in /test
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.2.2 to 7.3.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.2.2...7.3.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-15 12:34:19 +00:00
yubiuser
b412e88b02 Bump tox from 4.4.7 to 4.4.12 in /test (#5254) 2023-04-15 14:33:42 +02:00
yubiuser
11725a0999 Bump actions/checkout from 3.4.0 to 3.5.2 (#5255) 2023-04-15 14:32:41 +02:00
dependabot[bot]
d065afdbb1 Bump actions/checkout from 3.4.0 to 3.5.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.4.0 to 3.5.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.4.0...v3.5.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-15 10:57:41 +00:00
dependabot[bot]
c36d0257ec Bump tox from 4.4.7 to 4.4.12 in /test
Bumps [tox](https://github.com/tox-dev/tox) from 4.4.7 to 4.4.12.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.4.7...4.4.12)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-15 10:57:39 +00:00
Christian König
87a612f884 Trigger stale workflow on issue comments to remove stale label immediately
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-04-15 10:28:39 +02:00
Christian König
dd3a7a4edb Only delete lines containing separator when preceded by a letter to reduce false positiv (deleting valid comments)
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-04-08 14:59:26 +02:00
Christian König
d10d59303e There is no ! but an $ rule
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-04-07 21:44:49 +02:00
Adam Warner
b9cf2d9959 Remove special handling of pgl.yoyo.org (#5249) 2023-04-07 12:46:19 +01:00
Christian König
aaf828117d Remove unecessary $cmd_ext
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-04-07 12:36:50 +02:00
Christian König
9c4e74ffa7 Remove special handling of pgl.yoyo.org
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-04-07 12:23:11 +02:00
Christian König
2a0f720153 Don't delete lines containing / as they should count as invalid
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-04-07 10:25:25 +02:00
Christian König
cc17fe18a9 Remove lines with ABP extended CSS selector
Co-authored-by: Adam Warner <me@adamwarner.co.uk>
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-04-07 10:14:59 +02:00
Christian König
61ff5b2c76 Unifiy sed commands
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-04-07 09:44:31 +02:00
Adam Warner
56eae4afbe Allow TLD blocking using ABP style (#5240) 2023-03-29 21:48:15 +01:00
RD WebDesign
66bfa606a7 Using a better text for the comment
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2023-03-29 14:17:41 -03:00
RD WebDesign
32fb2e69ff Spliting the regex into TLD_pattern and subdomain_pattern
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2023-03-29 00:05:01 -03:00
RD WebDesign
c71460e4b6 Allow TLD blocking using ABP style
This validates patterns without dots (only for abp style), allowing TLDs to be blocked

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2023-03-28 17:21:50 -03:00
Dan Schaper
d885e92674 Hotfix Core v5.16.2 (#5235) 2023-03-25 12:02:26 -07:00
Dan Schaper
9d4a69c1d0 Fix for gravity's unchecked resource consumption. (#5234) 2023-03-25 11:39:49 -07:00
Adam Warner
0656ceb149 Speed things up a bit with some humble greps. Consolodate regexes and remove the need for so many mapfile/arrays
Signed-off-by: Adam Warner <me@adamwarner.co.uk>

Use temp files for parsing and remove when done.

Always rm the non-domains temp file.

exit 1 if gravity database creation fails.

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net>
Co-authored-by: DL6ER <dl6er@dl6er.de>
Co-authored-by: Adam Warner <me@adamwarner.co.uk>
2023-03-25 11:19:23 -07:00
dependabot[bot]
95b12bad34 Bump actions/stale from 7.0.0 to 8.0.0
Bumps [actions/stale](https://github.com/actions/stale) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v7.0.0...v8.0.0)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-25 10:56:35 +00:00
ipitio
fa116389c2 remove old comments
Signed-off-by: ipitio <21136719+ipitio@users.noreply.github.com>
2023-03-23 01:23:35 +00:00
Adam Warner
8ca5788561 Release v5.16.1 (#5226) 2023-03-22 22:19:00 +00:00
Adam Warner
1dc33129e5 Fix getting 'privacylevel' (#5224) 2023-03-22 22:11:50 +00:00
Christian König
c96463bda2 Fix getting 'privacylevel'
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-03-22 23:00:10 +01:00
Dan Schaper
edbaf6d697 Revert "Ignore commented lines when reading PRIVACYLEVEL from config file" (#5223) 2023-03-22 14:59:09 -07:00
Adam Warner
58275ecd13 Revert "Ignore commented lines when reading PRIVACYLEVEL from config file" 2023-03-22 21:52:39 +00:00
109 changed files with 4887 additions and 8024 deletions

View File

@@ -1,3 +1,4 @@
doubleclick
wan
nwe
padd

5
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,5 @@
# see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-syntax
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
* @pi-hole/core-maintainers

View File

@@ -8,8 +8,10 @@ updates:
time: "10:00"
open-pull-requests-limit: 10
target-branch: development
reviewers:
- "pi-hole/core-maintainers"
groups:
github-actions-dependencies:
patterns:
- "*"
- package-ecosystem: pip
directory: "/test"
schedule:
@@ -18,5 +20,7 @@ updates:
time: "10:00"
open-pull-requests-limit: 10
target-branch: development
reviewers:
- "pi-hole/core-maintainers"
groups:
python-dependencies:
patterns:
- "*"

1
.github/release.yml vendored
View File

@@ -2,6 +2,7 @@ changelog:
exclude:
labels:
- internal
- dependencies
authors:
- dependabot
- github-actions

View File

@@ -25,16 +25,16 @@ jobs:
steps:
-
name: Checkout repository
uses: actions/checkout@v3.4.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
# Initializes the CodeQL tools for scanning.
-
name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 #v4.32.6
with:
languages: 'python'
-
name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@0d579ffd059c29b07949a3cce3983f0780820c98 #v4.32.6
-
name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 #v4.32.6

View File

@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check if PRs are have merge conflicts
uses: eps1lon/actions-label-merge-conflict@v2.1.0
uses: eps1lon/actions-label-merge-conflict@1df065ebe6e3310545d4f4c4e862e43bdca146f0 #v3.0.3
with:
dirtyLabel: "PR: Merge Conflict"
repoToken: "${{ secrets.GITHUB_TOKEN }}"

View File

@@ -4,23 +4,44 @@ on:
schedule:
- cron: '0 8 * * *'
workflow_dispatch:
issue_comment:
env:
stale_label: stale
jobs:
stale:
stale_action:
if: github.event_name != 'issue_comment'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/stale@v7.0.0
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f #v10.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
days-before-close: 5
stale-issue-message: '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.'
stale-issue-label: 'stale'
exempt-issue-labels: 'Internal, Fixed in next release, Bug: Confirmed, Documentation Needed'
stale-issue-label: '${{ env.stale_label }}'
exempt-issue-labels: 'Internal, Fixed in next release, Bug: Confirmed, Documentation Needed, never-stale'
exempt-all-issue-assignees: true
operations-per-run: 300
close-issue-reason: 'not_planned'
remove_stale:
# trigger "stale" removal immediately when stale issues are commented on
# we need to explicitly check that the trigger does not run on comment on a PR as
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment-on-issues-only-or-pull-requests-only
if: ${{ !github.event.issue.pull_request && github.event_name != 'schedule' }}
permissions:
contents: read # for actions/checkout
issues: write # to edit issues label
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
- name: Remove 'stale' label
run: gh issue edit ${{ github.event.issue.number }} --remove-label ${{ env.stale_label }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -17,7 +17,7 @@ jobs:
pull-requests: write
steps:
- uses: actions/stale@v7.0.0
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f #v10.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Do not automatically mark PR/issue as stale

View File

@@ -33,7 +33,7 @@ jobs:
name: Syncing branches
steps:
- name: Checkout
uses: actions/checkout@v3.4.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
- name: Opening pull request
run: gh pr create -B development -H master --title 'Sync master back into development' --body 'Created by Github action' --label 'internal'
env:

View File

@@ -7,13 +7,20 @@ on:
permissions:
contents: read
env:
FORCE_COLOR: 1
PYTHONUNBUFFERED: 1
PYTHONUTF8: 1
jobs:
smoke-tests:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3.4.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
with:
fetch-depth: 0 # Differential ShellCheck requires full git history
- name: Check scripts in repository are executable
run: |
@@ -23,19 +30,30 @@ jobs:
# If FAIL is 1 then we fail.
[[ $FAIL == 1 ]] && exit 1 || echo "Scripts are executable!"
- name: Differential ShellCheck
uses: redhat-plumbers-in-action/differential-shellcheck@d965e66ec0b3b2f821f75c8eff9b12442d9a7d1e #v5.5.6
with:
severity: warning
display-engine: sarif-fmt
- name: Secret Scanning with TruffleHog
uses: trufflesecurity/trufflehog@821e8b9e5cdf8dc484dd23e06f78941fcf6b9191 #v3.91.2
with:
extra_args: --results=verified,unknown
- name: Spell-Checking
uses: codespell-project/actions-codespell@master
uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 #v2.2
with:
ignore_words_file: .codespellignore
- name: Get editorconfig-checker
uses: editorconfig-checker/action-editorconfig-checker@main # tag v1.0.0 is really out of date
uses: editorconfig-checker/action-editorconfig-checker@4b6cd6190d435e7e084fb35e36a096e98506f7b9 #v2.1.0
- name: Run editorconfig-checker
run: editorconfig-checker
- name: Check python code formatting with black
uses: psf/black@stable
uses: psf/black@c6755bb741b6481d6b3d3bb563c83fa060db96c9 #26.3.1
with:
src: "./test"
options: "--check --diff --color"
@@ -49,25 +67,32 @@ jobs:
matrix:
distro:
[
debian_10,
debian_11,
debian_12,
debian_13,
ubuntu_20,
ubuntu_22,
centos_8,
ubuntu_24,
centos_9,
fedora_36,
fedora_37,
centos_10,
fedora_40,
fedora_41,
fedora_42,
fedora_43,
alpine_3_21,
alpine_3_22,
alpine_3_23,
]
env:
DISTRO: ${{matrix.distro}}
steps:
- name: Checkout repository
uses: actions/checkout@v3.4.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
- name: Set up Python 3.10
uses: actions/setup-python@v4.5.0
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 #v6.2.0
with:
python-version: "3.10"
python-version: "3.13"
- name: Install wheel
run: pip install wheel

3
.gitignore vendored
View File

@@ -10,3 +10,6 @@ __pycache__
.idea/
*.iml
.vscode/
.venv/
.fleet/
.cache/

6
.shellcheckrc Normal file
View File

@@ -0,0 +1,6 @@
external-sources=true # allow shellcheck to read external sources
disable=SC3043 #disable SC3043: In POSIX sh, local is undefined.
enable=useless-use-of-cat # disabled by default as of shellcheck 0.11.0
enable=avoid-negated-conditions # avoid-negated-conditions is optional as of shellcheck 0.11.0
enable=require-variable-braces
enable=deprecate-which

View File

@@ -1,10 +0,0 @@
---
linters:
shellcheck:
shell: bash
phpcs:
flake8:
max-line-length: 120
yamllint:
config: ./.yamllint.conf
remarklint:

View File

@@ -1,3 +0,0 @@
rules:
line-length: disable
document-start: disable

View File

@@ -3,13 +3,9 @@
#
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://pi-hole.github.io/graphics/Vortex/Vortex_Vertical_wordmark_darkmode.png">
<source media="(prefers-color-scheme: light)" srcset="https://pi-hole.github.io/graphics/Vortex/Vortex_Vertical_wordmark_lightmode.png">
<img src="https://pi-hole.github.io/graphics/Vortex/Vortex_Vertical_wordmark_lightmode.png" width="168" height="270" alt="Pi-hole website">
</picture>
<br>
<strong>Network-wide ad blocking via your own Linux hardware</strong>
<img src="https://raw.githubusercontent.com/pi-hole/graphics/refs/heads/master/Vortex/vortex_with_text.svg" alt="Pi-hole website" width="168" height="270">
<br>
<strong>Network-wide ad blocking via your own Linux hardware</strong>
</p>
<!-- markdownlint-enable MD033 -->
@@ -33,7 +29,9 @@ The Pi-hole® is a [DNS sinkhole](https://en.wikipedia.org/wiki/DNS_Sinkhole) th
Those who want to get started quickly and conveniently may install Pi-hole using the following command:
### `curl -sSL https://install.pi-hole.net | bash`
```bash
curl -sSL https://install.pi-hole.net | bash
```
## Alternative Install Methods
@@ -130,7 +128,10 @@ Some of the statistics you can integrate include:
- Queries cached
- Unique clients
Access the API via [`telnet`](https://github.com/pi-hole/FTL), the Web (`admin/api.php`) and Command Line (`pihole -c -j`). You can find out [more details over here](https://discourse.pi-hole.net/t/pi-hole-api/1863).
Access the API using:
- your browser: http://pi.hole/api/docs
- `curl`: `curl --connect-timeout 2 -ks "https://pi.hole/api/stats/summary" -H "Accept: application/json"`;
- the command line - examples: `pihole api config/webserver/port` or `pihole api stats/summary`.
### The Command-Line Interface
@@ -138,7 +139,7 @@ The [pihole](https://docs.pi-hole.net/core/pihole-command/) command has all the
Some notable features include:
- [Whitelisting, Blacklisting, and Regex](https://docs.pi-hole.net/core/pihole-command/#whitelisting-blacklisting-and-regex)
- [Allowlisting, Denylisting (fka Whitelisting, Blacklisting), and Regex](https://docs.pi-hole.net/core/pihole-command/#allowlisting-denylisting-and-regex)
- [Debugging utility](https://docs.pi-hole.net/core/pihole-command/#debugger)
- [Viewing the live log file](https://docs.pi-hole.net/core/pihole-command/#tail)
- [Updating Ad Lists](https://docs.pi-hole.net/core/pihole-command/#gravity)
@@ -150,7 +151,7 @@ You can read our [Core Feature Breakdown](https://docs.pi-hole.net/core/pihole-c
### The Web Interface Dashboard
This [optional dashboard](https://github.com/pi-hole/AdminLTE) allows you to view stats, change settings, and configure your Pi-hole. It's the power of the Command Line Interface, with none of the learning curve!
This [optional dashboard](https://github.com/pi-hole/web) allows you to view stats, change settings, and configure your Pi-hole. It's the power of the Command Line Interface, with none of the learning curve!
Some notable features include:

View File

@@ -1,35 +0,0 @@
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Dnsmasq config for Pi-hole's FTLDNS
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
###############################################################################
# FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE. #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
# #
# IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN: #
# /etc/pihole/setupVars.conf #
# #
# ANY OTHER CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE #
# WITHIN /etc/dnsmasq.d/yourname.conf #
###############################################################################
addn-hosts=/etc/pihole/local.list
addn-hosts=/etc/pihole/custom.list
domain-needed
localise-queries
bogus-priv
no-resolv
log-queries
log-facility=/var/log/pihole/pihole.log
log-async

View File

@@ -1,42 +0,0 @@
# Pi-hole: A black hole for Internet advertisements
# (c) 2021 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# RFC 6761 config file for Pi-hole
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
###############################################################################
# FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE. #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
# #
# CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE #
# WITHIN /etc/dnsmasq.d/yourname.conf #
###############################################################################
# RFC 6761: Caching DNS servers SHOULD recognize
# test, localhost, invalid
# names as special and SHOULD NOT attempt to look up NS records for them, or
# otherwise query authoritative DNS servers in an attempt to resolve these
# names.
server=/test/
server=/localhost/
server=/invalid/
# The same RFC requests something similar for
# 10.in-addr.arpa. 21.172.in-addr.arpa. 27.172.in-addr.arpa.
# 16.172.in-addr.arpa. 22.172.in-addr.arpa. 28.172.in-addr.arpa.
# 17.172.in-addr.arpa. 23.172.in-addr.arpa. 29.172.in-addr.arpa.
# 18.172.in-addr.arpa. 24.172.in-addr.arpa. 30.172.in-addr.arpa.
# 19.172.in-addr.arpa. 25.172.in-addr.arpa. 31.172.in-addr.arpa.
# 20.172.in-addr.arpa. 26.172.in-addr.arpa. 168.192.in-addr.arpa.
# Pi-hole implements this via the dnsmasq option "bogus-priv" (see
# 01-pihole.conf) because this also covers IPv6.
# OpenWRT furthermore blocks bind, local, onion domains
# see https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob_plain;f=package/network/services/dnsmasq/files/rfc6761.conf;hb=HEAD
# and https://www.iana.org/assignments/special-use-domain-names/special-use-domain-names.xhtml
# We do not include the ".local" rule ourselves, see https://github.com/pi-hole/pi-hole/pull/4282#discussion_r689112972
server=/bind/
server=/onion/

View File

@@ -1,10 +1,12 @@
#!/usr/bin/env sh
# shellcheck disable=SC2034 # Disable warning about unused variables
# Determine if terminal is capable of showing colors
if ([[ -t 1 ]] && [[ $(tput colors) -ge 8 ]]) || [[ "${WEBCALL}" ]]; then
# When COL_TABLE is sourced via gravity invoked by FTL, FORCE_COLOR is set to true
if { [ -t 1 ] && [ "$(tput colors)" -ge 8 ]; } || [ "${FORCE_COLOR}" ]; then
# Bold and underline may not show up on all clients
# If something MUST be emphasized, use both
COL_BOLD=''
COL_ULINE=''
COL_NC=''
COL_GRAY=''
COL_RED=''
@@ -16,8 +18,6 @@ if ([[ -t 1 ]] && [[ $(tput colors) -ge 8 ]]) || [[ "${WEBCALL}" ]]; then
else
# Provide empty variables for `set -u`
COL_BOLD=""
COL_ULINE=""
COL_NC=""
COL_GRAY=""
COL_RED=""
@@ -28,22 +28,8 @@ else
COL_CYAN=""
fi
# Deprecated variables
COL_WHITE="${COL_BOLD}"
COL_BLACK="${COL_NC}"
COL_LIGHT_BLUE="${COL_BLUE}"
COL_LIGHT_GREEN="${COL_GREEN}"
COL_LIGHT_CYAN="${COL_CYAN}"
COL_LIGHT_RED="${COL_RED}"
COL_URG_RED="${COL_RED}${COL_BOLD}${COL_ULINE}"
COL_LIGHT_PURPLE="${COL_PURPLE}"
COL_BROWN="${COL_YELLOW}"
COL_LIGHT_GRAY="${COL_GRAY}"
COL_DARK_GRAY="${COL_GRAY}"
TICK="[${COL_GREEN}✓${COL_NC}]"
CROSS="[${COL_RED}✗${COL_NC}]"
INFO="[i]"
QST="[?]"
DONE="${COL_GREEN} done!${COL_NC}"
OVER="\\r"

376
advanced/Scripts/api.sh Executable file
View File

@@ -0,0 +1,376 @@
#!/usr/bin/env sh
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Script to hold api functions for use in other scripts
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
# The basic usage steps are
# 1) Test Availability of the API
# 2) Try to authenticate (read password if needed)
# 3) Get the data from the API endpoint
# 4) Delete the session
TestAPIAvailability() {
local chaos_api_list authResponse authStatus authData apiAvailable DNSport
# as we are running locally, we can get the port value from FTL directly
PI_HOLE_SCRIPT_DIR="/opt/pihole"
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
# shellcheck source=./advanced/Scripts/utils.sh
. "${utilsfile}"
DNSport=$(getFTLConfigValue dns.port)
# Query the API URLs from FTL using CHAOS TXT local.api.ftl
# The result is a space-separated enumeration of full URLs
# e.g., "http://localhost:80/api/" "https://localhost:443/api/"
chaos_api_list="$(dig +short -p "${DNSport}" chaos txt local.api.ftl @127.0.0.1)"
# If the query was not successful, the variable is empty
if [ -z "${chaos_api_list}" ]; then
echo "API not available. Please check connectivity"
exit 1
fi
# If an error occurred, the variable starts with ;;
if [ "${chaos_api_list#;;}" != "${chaos_api_list}" ]; then
echo "Communication error. Is FTL running?"
exit 1
fi
# Iterate over space-separated list of URLs
while [ -n "${chaos_api_list}" ]; do
# Get the first URL
API_URL="${chaos_api_list%% *}"
# Strip leading and trailing quotes
API_URL="${API_URL%\"}"
API_URL="${API_URL#\"}"
# Test if the API is available at this URL, include delimiter for ease in splitting payload
authResponse=$(curl --connect-timeout 2 -skS -w ">>%{http_code}" "${API_URL}auth")
# authStatus is the response http_code, eg. 200, 401.
# Shell parameter expansion, remove everything up to and including the >> delim
authStatus=${authResponse#*>>}
# data is everything from response
# Shell parameter expansion, remove the >> delim and everything after
authData=${authResponse%>>*}
# Test if http status code was 200 (OK) or 401 (authentication required)
if [ "${authStatus}" = 200 ]; then
# API is available without authentication
apiAvailable=true
needAuth=false
break
elif [ "${authStatus}" = 401 ]; then
# API is available with authentication
apiAvailable=true
needAuth=true
# Check if 2FA is required
needTOTP=$(echo "${authData}"| jq --raw-output .session.totp 2>/dev/null)
break
else
# API is not available at this port/protocol combination
apiAvailable=false
# Remove the first URL from the list
local last_api_list
last_api_list="${chaos_api_list}"
chaos_api_list="${chaos_api_list#* }"
# If the list did not change, we are at the last element
if [ "${last_api_list}" = "${chaos_api_list}" ]; then
# Remove the last element
chaos_api_list=""
fi
fi
done
# if apiAvailable is false, no working API was found
if [ "${apiAvailable}" = false ]; then
echo "API not available. Please check FTL.log"
echo "Exiting."
exit 1
fi
}
LoginAPI() {
# If the API URL is not set, test the availability
if [ -z "${API_URL}" ]; then
TestAPIAvailability
fi
# Exit early if authentication is not needed
if [ "${needAuth}" = false ]; then
if [ "${1}" = "verbose" ]; then
echo "API Authentication: Not needed"
fi
return
fi
# Try to read the CLI password (if enabled and readable by the current user)
if [ -r /etc/pihole/cli_pw ]; then
password=$(cat /etc/pihole/cli_pw)
if [ "${1}" = "verbose" ]; then
echo "API Authentication: Trying to use CLI password"
fi
# If we can read the CLI password, we can skip 2FA even when it's required otherwise
needTOTP=false
elif [ "${1}" = "verbose" ]; then
echo "API Authentication: CLI password not available"
fi
if [ -z "${password}" ]; then
# no password read from CLI file
echo "Please enter your password:"
# secretly read the password
secretRead; printf '\n'
fi
if [ "${needTOTP}" = true ]; then
# 2FA required
echo "Please enter the correct second factor."
echo "(Can be any number if you used the app password)"
read -r totp
fi
# Try to authenticate using the supplied password (CLI file or user input) and TOTP
Authentication "${1}"
# Try to login again until the session is valid
while [ ! "${validSession}" = true ] ; do
# Print the error message if there is one
if [ ! "${sessionError}" = "null" ] && [ "${1}" = "verbose" ]; then
echo "Error: ${sessionError}"
fi
# Print the session message if there is one
if [ ! "${sessionMessage}" = "null" ] && [ "${1}" = "verbose" ]; then
echo "Error: ${sessionMessage}"
fi
if [ "${1}" = "verbose" ]; then
# If we are not in verbose mode, no need to print the error message again
echo "Please enter your Pi-hole password"
else
echo "Authentication failed. Please enter your Pi-hole password"
fi
# secretly read the password
secretRead; printf '\n'
if [ "${needTOTP}" = true ]; then
echo "Please enter the correct second factor:"
echo "(Can be any number if you used the app password)"
read -r totp
fi
# Try to authenticate again
Authentication "${1}"
done
}
Authentication() {
sessionResponse="$(curl --connect-timeout 2 -skS -X POST "${API_URL}auth" --user-agent "Pi-hole cli" --data "{\"password\":\"${password}\", \"totp\":${totp:-null}}" )"
if [ -z "${sessionResponse}" ]; then
echo "No response from FTL server. Please check connectivity"
exit 1
fi
# obtain validity, session ID, sessionMessage and error message from
# session response, apply default values if none returned
result=$(echo "${sessionResponse}" | jq -r '
(.session.valid // false),
(.session.sid // null),
(.session.message // null),
(.error.message // null)
' 2>/dev/null)
validSession=$(echo "${result}" | sed -n '1p')
SID=$(echo "${result}" | sed -n '2p')
sessionMessage=$(echo "${result}" | sed -n '3p')
sessionError=$(echo "${result}" | sed -n '4p')
if [ "${1}" = "verbose" ]; then
if [ "${validSession}" = true ]; then
echo "API Authentication: ${COL_GREEN}Success${COL_NC}"
else
echo "API Authentication: ${COL_RED}Failed${COL_NC}"
fi
fi
}
LogoutAPI() {
# if a valid Session exists (no password required or successful Authentication) and
# SID is not null (successful Authentication only), delete the session
if [ "${validSession}" = true ] && [ ! "${SID}" = null ]; then
# Try to delete the session. Omit the output, but get the http status code
deleteResponse=$(curl -skS -o /dev/null -w "%{http_code}" -X DELETE "${API_URL}auth" -H "Accept: application/json" -H "sid: ${SID}")
case "${deleteResponse}" in
"401") echo "Logout attempt without a valid session. Unauthorized!";;
"204") if [ "${1}" = "verbose" ]; then echo "API Logout: ${COL_GREEN}Success${COL_NC} (session deleted)"; fi;;
esac;
elif [ "${1}" = "verbose" ]; then
echo "API Logout: ${COL_GREEN}Success${COL_NC} (no valid session)"
fi
}
GetFTLData() {
local data response status
# get the data from querying the API as well as the http status code
response=$(curl -skS -w "%{http_code}" -X GET "${API_URL}$1" -H "Accept: application/json" -H "sid: ${SID}" )
if [ "${2}" = "raw" ]; then
# return the raw response
echo "${response}"
else
# status are the last 3 characters
# not using ${response#"${response%???}"}" here because it's extremely slow on big responses
status=$(printf "%s" "${response}" | tail -c 3)
# data is everything from response without the last 3 characters
data="${response%???}"
# return only the data
if [ "${status}" = 200 ]; then
# response OK
printf %s "${data}"
else
# connection lost
echo "${status}"
fi
fi
}
PostFTLData() {
local data response status
# send the data to the API
response=$(curl -skS -w "%{http_code}" -X POST "${API_URL}$1" --data-raw "$2" -H "Accept: application/json" -H "sid: ${SID}" )
# data is everything from response without the last 3 characters
if [ "${3}" = "status" ]; then
# Keep the status code appended if requested
printf %s "${response}"
else
# Strip the status code
printf %s "${response%???}"
fi
}
secretRead() {
# POSIX compliant function to read user-input and
# mask every character entered by (*)
#
# This is challenging, because in POSIX, `read` does not support
# `-s` option (suppressing the input) or
# `-n` option (reading n chars)
# This workaround changes the terminal characteristics to not echo input and later resets this option
# credits https://stackoverflow.com/a/4316765
# showing asterisk instead of password
# https://stackoverflow.com/a/24600839
# https://unix.stackexchange.com/a/464963
# Save current terminal settings (needed for later restore after password prompt)
stty_orig=$(stty -g)
stty -echo # do not echo user input
stty -icanon min 1 time 0 # disable canonical mode https://man7.org/linux/man-pages/man3/termios.3.html
unset password
unset key
unset charcount
charcount=0
while key=$(dd ibs=1 count=1 2>/dev/null); do #read one byte of input
if [ "${key}" = "$(printf '\0' | tr -d '\0')" ] ; then
# Enter - accept password
break
fi
if [ "${key}" = "$(printf '\177')" ] ; then
# Backspace
if [ $charcount -gt 0 ] ; then
charcount=$((charcount-1))
printf '\b \b'
password="${password%?}"
fi
else
# any other character
charcount=$((charcount+1))
printf '*'
password="$password$key"
fi
done
# restore original terminal settings
stty "${stty_orig}"
}
apiFunc() {
local data response status status_col verbosity
# Define if the output will be silent (default) or verbose
verbosity="silent"
if [ "$1" = "verbose" ]; then
verbosity="verbose"
shift
fi
# Authenticate with the API
LoginAPI "${verbosity}"
if [ "${verbosity}" = "verbose" ]; then
echo ""
echo "Requesting: ${COL_PURPLE}GET ${COL_CYAN}${API_URL}${COL_YELLOW}$1${COL_NC}"
echo ""
fi
# Get the data from the API
response=$(GetFTLData "$1" raw)
# status are the last 3 characters
# not using ${response#"${response%???}"}" here because it's extremely slow on big responses
status=$(printf "%s" "${response}" | tail -c 3)
# data is everything from response without the last 3 characters
data="${response%???}"
# Output the status (200 -> green, else red)
if [ "${status}" = 200 ]; then
status_col="${COL_GREEN}"
else
status_col="${COL_RED}"
fi
# Only print the status in verbose mode or if the status is not 200
if [ "${verbosity}" = "verbose" ] || [ "${status}" != 200 ]; then
echo "Status: ${status_col}${status}${COL_NC}"
fi
# Output the data. Format it with jq if available and data is actually JSON.
# Otherwise just print it
if [ "${verbosity}" = "verbose" ]; then
echo "Data:"
fi
# Attempt to print the data with jq, if it is not valid JSON, or not installed
# then print the plain text.
echo "${data}" | jq . 2>/dev/null || echo "${data}"
# Delete the session
LogoutAPI "${verbosity}"
}

View File

@@ -1,577 +0,0 @@
#!/usr/bin/env bash
# shellcheck disable=SC1090,SC1091
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Calculates stats and displays to an LCD
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
LC_ALL=C
LC_NUMERIC=C
# Retrieve stats from FTL engine
pihole-FTL() {
local ftl_port LINE
# shellcheck disable=SC1091
. /opt/pihole/utils.sh
ftl_port=$(getFTLAPIPort)
if [[ -n "$ftl_port" ]]; then
# Open connection to FTL
exec 3<>"/dev/tcp/127.0.0.1/$ftl_port"
# Test if connection is open
if { "true" >&3; } 2> /dev/null; then
# Send command to FTL and ask to quit when finished
echo -e ">$1 >quit" >&3
# Read input until we received an empty string and the connection is
# closed
read -r -t 1 LINE <&3
until [[ -z "${LINE}" ]] && [[ ! -t 3 ]]; do
echo "$LINE" >&1
read -r -t 1 LINE <&3
done
# Close connection
exec 3>&-
exec 3<&-
fi
else
echo "0"
fi
}
# Print spaces to align right-side additional text
printFunc() {
local text_last
title="$1"
title_len="${#title}"
text_main="$2"
text_main_nocol="$text_main"
if [[ "${text_main:0:1}" == "" ]]; then
text_main_nocol=$(sed 's/\[[0-9;]\{1,5\}m//g' <<< "$text_main")
fi
text_main_len="${#text_main_nocol}"
text_addn="$3"
if [[ "$text_addn" == "last" ]]; then
text_addn=""
text_last="true"
fi
# If there is additional text, define max length of text_main
if [[ -n "$text_addn" ]]; then
case "$scr_cols" in
[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-4]) text_main_max_len="9";;
4[5-9]) text_main_max_len="14";;
*) text_main_max_len="19";;
esac
fi
[[ -z "$text_addn" ]] && text_main_max_len="$(( scr_cols - title_len ))"
# Remove excess characters from main text
if [[ "$text_main_len" -gt "$text_main_max_len" ]]; then
# Trim text without colors
text_main_trim="${text_main_nocol:0:$text_main_max_len}"
# Replace with trimmed text
text_main="${text_main/$text_main_nocol/$text_main_trim}"
fi
# Determine amount of spaces for each line
if [[ -n "$text_last" ]]; then
# Move cursor to end of screen
spc_num=$(( scr_cols - ( title_len + text_main_len ) ))
else
spc_num=$(( text_main_max_len - text_main_len ))
fi
[[ "$spc_num" -le 0 ]] && spc_num="0"
spc=$(printf "%${spc_num}s")
#spc="${spc// /.}" # Debug: Visualize spaces
printf "%s%s$spc" "$title" "$text_main"
if [[ -n "$text_addn" ]]; then
printf "%s(%s)%s\\n" "$COL_NC$COL_DARK_GRAY" "$text_addn" "$COL_NC"
else
# Do not print trailing newline on final line
[[ -z "$text_last" ]] && printf "%s\\n" "$COL_NC"
fi
}
# Perform on first Chrono run (not for JSON formatted string)
get_init_stats() {
calcFunc(){ awk "BEGIN {print $*}" 2> /dev/null; }
# Convert bytes to human-readable format
hrBytes() {
awk '{
num=$1;
if(num==0) {
print "0 B"
} else {
xxx=(num<0?-num:num)
sss=(num<0?-1:1)
split("B KB MB GB TB PB",type)
for(i=5;yyy < 1;i--) {
yyy=xxx / (2^(10*i))
}
printf "%.0f " type[i+2], yyy*sss
}
}' <<< "$1";
}
# Convert seconds to human-readable format
hrSecs() {
day=$(( $1/60/60/24 )); hrs=$(( $1/3600%24 ))
mins=$(( ($1%3600)/60 )); secs=$(( $1%60 ))
[[ "$day" -ge "2" ]] && plu="s"
[[ "$day" -ge "1" ]] && days="$day day${plu}, " || days=""
printf "%s%02d:%02d:%02d\\n" "$days" "$hrs" "$mins" "$secs"
}
# Set Color Codes
coltable="/opt/pihole/COL_TABLE"
if [[ -f "${coltable}" ]]; then
source ${coltable}
else
COL_NC=""
COL_DARK_GRAY=""
COL_LIGHT_GREEN=""
COL_LIGHT_BLUE=""
COL_LIGHT_RED=""
COL_YELLOW=""
COL_LIGHT_RED=""
COL_URG_RED=""
fi
# Get RPi throttle state (RPi 3B only) & model number, or OS distro info
if command -v vcgencmd &> /dev/null; then
local sys_throttle_raw
local sys_rev_raw
sys_throttle_raw=$(vgt=$(sudo vcgencmd get_throttled); echo "${vgt##*x}")
# Active Throttle Notice: https://bit.ly/2gnunOo
if [[ "$sys_throttle_raw" != "0" ]]; then
case "$sys_throttle_raw" in
*0001) thr_type="${COL_YELLOW}Under Voltage";;
*0002) thr_type="${COL_LIGHT_BLUE}Arm Freq Cap";;
*0003) thr_type="${COL_YELLOW}UV${COL_DARK_GRAY},${COL_NC} ${COL_LIGHT_BLUE}AFC";;
*0004) thr_type="${COL_LIGHT_RED}Throttled";;
*0005) thr_type="${COL_YELLOW}UV${COL_DARK_GRAY},${COL_NC} ${COL_LIGHT_RED}TT";;
*0006) thr_type="${COL_LIGHT_BLUE}AFC${COL_DARK_GRAY},${COL_NC} ${COL_LIGHT_RED}TT";;
*0007) thr_type="${COL_YELLOW}UV${COL_DARK_GRAY},${COL_NC} ${COL_LIGHT_BLUE}AFC${COL_DARK_GRAY},${COL_NC} ${COL_LIGHT_RED}TT";;
esac
[[ -n "$thr_type" ]] && sys_throttle="$thr_type${COL_DARK_GRAY}"
fi
sys_rev_raw=$(awk '/Revision/ {print $3}' < /proc/cpuinfo)
case "$sys_rev_raw" in
000[2-6]) sys_model=" 1, Model B";; # 256MB
000[7-9]) sys_model=" 1, Model A";; # 256MB
000d|000e|000f) sys_model=" 1, Model B";; # 512MB
0010|0013) sys_model=" 1, Model B+";; # 512MB
0012|0015) sys_model=" 1, Model A+";; # 256MB
a0104[0-1]|a21041|a22042) sys_model=" 2, Model B";; # 1GB
900021) sys_model=" 1, Model A+";; # 512MB
900032) sys_model=" 1, Model B+";; # 512MB
90009[2-3]|920093) sys_model=" Zero";; # 512MB
9000c1) sys_model=" Zero W";; # 512MB
a02082|a[2-3]2082) sys_model=" 3, Model B";; # 1GB
a020d3) sys_model=" 3, Model B+";; # 1GB
*) sys_model="";;
esac
sys_type="Raspberry Pi$sys_model"
else
source "/etc/os-release"
CODENAME=$(sed 's/[()]//g' <<< "${VERSION/* /}")
sys_type="${NAME/ */} ${CODENAME^} $VERSION_ID"
fi
# Get core count
sys_cores=$(grep -c "^processor" /proc/cpuinfo)
# Test existence of clock speed file for ARM CPU
if [[ -f "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" ]]; then
scaling_freq_file="/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"
fi
# Test existence of temperature file
if [[ -f "/sys/class/thermal/thermal_zone0/temp" ]]; then
temp_file="/sys/class/thermal/thermal_zone0/temp"
elif [[ -f "/sys/class/hwmon/hwmon0/temp1_input" ]]; then
temp_file="/sys/class/hwmon/hwmon0/temp1_input"
else
temp_file=""
fi
# Test existence of setupVars config
if [[ -f "/etc/pihole/setupVars.conf" ]]; then
setupVars="/etc/pihole/setupVars.conf"
fi
}
get_sys_stats() {
local ph_ver_raw
local cpu_raw
local ram_raw
local disk_raw
# Update every 12 refreshes (Def: every 60s)
count=$((count+1))
if [[ "$count" == "1" ]] || (( "$count" % 12 == 0 )); then
# Do not source setupVars if file does not exist
[[ -n "$setupVars" ]] && source "$setupVars"
mapfile -t ph_ver_raw < <(pihole -v -c 2> /dev/null | sed -n 's/^.* v/v/p')
if [[ -n "${ph_ver_raw[0]}" ]]; then
ph_core_ver="${ph_ver_raw[0]}"
if [[ ${#ph_ver_raw[@]} -eq 2 ]]; then
# AdminLTE not installed
ph_lte_ver="(not installed)"
ph_ftl_ver="${ph_ver_raw[1]}"
else
ph_lte_ver="${ph_ver_raw[1]}"
ph_ftl_ver="${ph_ver_raw[2]}"
fi
else
ph_core_ver="-1"
fi
sys_name=$(hostname)
[[ -n "$TEMPERATUREUNIT" ]] && temp_unit="${TEMPERATUREUNIT^^}" || temp_unit="C"
# Get storage stats for partition mounted on /
read -r -a disk_raw <<< "$(df -B1 / 2> /dev/null | awk 'END{ print $3,$2,$5 }')"
disk_used="${disk_raw[0]}"
disk_total="${disk_raw[1]}"
disk_perc="${disk_raw[2]}"
net_gateway=$(ip route | grep default | cut -d ' ' -f 3 | head -n 1)
# Get DHCP stats, if feature is enabled
if [[ "$DHCP_ACTIVE" == "true" ]]; then
ph_dhcp_max=$(( ${DHCP_END##*.} - ${DHCP_START##*.} + 1 ))
fi
# Get DNS server count
dns_count="0"
[[ -n "${PIHOLE_DNS_1}" ]] && dns_count=$((dns_count+1))
[[ -n "${PIHOLE_DNS_2}" ]] && dns_count=$((dns_count+1))
[[ -n "${PIHOLE_DNS_3}" ]] && dns_count=$((dns_count+1))
[[ -n "${PIHOLE_DNS_4}" ]] && dns_count=$((dns_count+1))
[[ -n "${PIHOLE_DNS_5}" ]] && dns_count=$((dns_count+1))
[[ -n "${PIHOLE_DNS_6}" ]] && dns_count=$((dns_count+1))
[[ -n "${PIHOLE_DNS_7}" ]] && dns_count=$((dns_count+1))
[[ -n "${PIHOLE_DNS_8}" ]] && dns_count=$((dns_count+1))
[[ -n "${PIHOLE_DNS_9}" ]] && dns_count="$dns_count+"
fi
# Get screen size
read -r -a scr_size <<< "$(stty size 2>/dev/null || echo 24 80)"
scr_lines="${scr_size[0]}"
scr_cols="${scr_size[1]}"
# Determine Chronometer size behavior
if [[ "$scr_cols" -ge 58 ]]; then
chrono_width="large"
elif [[ "$scr_cols" -gt 40 ]]; then
chrono_width="medium"
else
chrono_width="small"
fi
# Determine max length of divider string
scr_line_len=$(( scr_cols - 2 ))
[[ "$scr_line_len" -ge 58 ]] && scr_line_len="58"
scr_line_str=$(printf "%${scr_line_len}s")
scr_line_str="${scr_line_str// /—}"
sys_uptime=$(hrSecs "$(cut -d. -f1 /proc/uptime)")
sys_loadavg=$(cut -d " " -f1,2,3 /proc/loadavg)
# Get CPU usage, only counting processes over 1% as active
# shellcheck disable=SC2009
cpu_raw=$(ps -eo pcpu,rss --no-headers | grep -E -v " 0")
cpu_tasks=$(wc -l <<< "$cpu_raw")
cpu_taskact=$(sed -r "/(^ 0.)/d" <<< "$cpu_raw" | wc -l)
cpu_perc=$(awk '{sum+=$1} END {printf "%.0f\n", sum/'"$sys_cores"'}' <<< "$cpu_raw")
# Get CPU clock speed
if [[ -n "$scaling_freq_file" ]]; then
cpu_mhz=$(( $(< /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq) / 1000 ))
else
cpu_mhz=$(lscpu | awk -F ":" '/MHz/ {print $2;exit}')
cpu_mhz=$(printf "%.0f" "${cpu_mhz//[[:space:]]/}")
fi
# Determine whether to display CPU clock speed as MHz or GHz
if [[ -n "$cpu_mhz" ]]; then
[[ "$cpu_mhz" -le "999" ]] && cpu_freq="$cpu_mhz MHz" || cpu_freq="$(printf "%.1f" $(calcFunc "$cpu_mhz"/1000)) GHz"
[[ "${cpu_freq}" == *".0"* ]] && cpu_freq="${cpu_freq/.0/}"
fi
# Determine color for temperature
if [[ -n "$temp_file" ]]; then
if [[ "$temp_unit" == "C" ]]; then
cpu_temp=$(printf "%.0fc\\n" "$(calcFunc "$(< $temp_file) / 1000")")
case "${cpu_temp::-1}" in
-*|[0-9]|[1-3][0-9]) cpu_col="$COL_LIGHT_BLUE";;
4[0-9]) cpu_col="";;
5[0-9]) cpu_col="$COL_YELLOW";;
6[0-9]) cpu_col="$COL_LIGHT_RED";;
*) cpu_col="$COL_URG_RED";;
esac
# $COL_NC$COL_DARK_GRAY is needed for $COL_URG_RED
cpu_temp_str=" @ $cpu_col$cpu_temp$COL_NC$COL_DARK_GRAY"
elif [[ "$temp_unit" == "F" ]]; then
cpu_temp=$(printf "%.0ff\\n" "$(calcFunc "($(< $temp_file) / 1000) * 9 / 5 + 32")")
case "${cpu_temp::-1}" in
-*|[0-9]|[0-9][0-9]) cpu_col="$COL_LIGHT_BLUE";;
1[0-1][0-9]) cpu_col="";;
1[2-3][0-9]) cpu_col="$COL_YELLOW";;
1[4-5][0-9]) cpu_col="$COL_LIGHT_RED";;
*) cpu_col="$COL_URG_RED";;
esac
cpu_temp_str=" @ $cpu_col$cpu_temp$COL_NC$COL_DARK_GRAY"
else
cpu_temp_str=$(printf " @ %.0fk\\n" "$(calcFunc "($(< $temp_file) / 1000) + 273.15")")
fi
else
cpu_temp_str=""
fi
read -r -a ram_raw <<< "$(awk '/MemTotal:/{total=$2} /MemFree:/{free=$2} /Buffers:/{buffers=$2} /^Cached:/{cached=$2} END {printf "%.0f %.0f %.0f", (total-free-buffers-cached)*100/total, (total-free-buffers-cached)*1024, total*1024}' /proc/meminfo)"
ram_perc="${ram_raw[0]}"
ram_used="${ram_raw[1]}"
ram_total="${ram_raw[2]}"
if [[ "$(pihole status web 2> /dev/null)" -ge "1" ]]; then
ph_status="${COL_LIGHT_GREEN}Active"
else
ph_status="${COL_LIGHT_RED}Offline"
fi
if [[ "$DHCP_ACTIVE" == "true" ]]; then
local ph_dhcp_range
ph_dhcp_range=$(seq -s "|" -f "${DHCP_START%.*}.%g" "${DHCP_START##*.}" "${DHCP_END##*.}")
# Count dynamic leases from available range, and not static leases
ph_dhcp_num=$(grep -cE "$ph_dhcp_range" "/etc/pihole/dhcp.leases")
ph_dhcp_percent=$(( ph_dhcp_num * 100 / ph_dhcp_max ))
fi
}
get_ftl_stats() {
local stats_raw
mapfile -t stats_raw < <(pihole-FTL "stats")
domains_being_blocked_raw="${stats_raw[0]#* }"
dns_queries_today_raw="${stats_raw[1]#* }"
ads_blocked_today_raw="${stats_raw[2]#* }"
ads_percentage_today_raw="${stats_raw[3]#* }"
queries_forwarded_raw="${stats_raw[5]#* }"
queries_cached_raw="${stats_raw[6]#* }"
# Only retrieve these stats when not called from jsonFunc
if [[ -z "$1" ]]; then
local top_ad_raw
local top_domain_raw
local top_client_raw
domains_being_blocked=$(printf "%.0f\\n" "${domains_being_blocked_raw}" 2> /dev/null)
dns_queries_today=$(printf "%.0f\\n" "${dns_queries_today_raw}")
ads_blocked_today=$(printf "%.0f\\n" "${ads_blocked_today_raw}")
ads_percentage_today=$(printf "%'.0f\\n" "${ads_percentage_today_raw}")
queries_cached_percentage=$(printf "%.0f\\n" "$(calcFunc "$queries_cached_raw * 100 / ( $queries_forwarded_raw + $queries_cached_raw )")")
recent_blocked=$(pihole-FTL recentBlocked)
read -r -a top_ad_raw <<< "$(pihole-FTL "top-ads (1)")"
read -r -a top_domain_raw <<< "$(pihole-FTL "top-domains (1)")"
read -r -a top_client_raw <<< "$(pihole-FTL "top-clients (1)")"
top_ad="${top_ad_raw[2]}"
top_domain="${top_domain_raw[2]}"
if [[ "${top_client_raw[3]}" ]]; then
top_client="${top_client_raw[3]}"
else
top_client="${top_client_raw[2]}"
fi
fi
}
get_strings() {
# Expand or contract strings depending on screen size
if [[ "$chrono_width" == "large" ]]; then
phc_str=" ${COL_DARK_GRAY}Core"
lte_str=" ${COL_DARK_GRAY}Web"
ftl_str=" ${COL_DARK_GRAY}FTL"
api_str="${COL_LIGHT_RED}API Offline"
host_info="$sys_type"
sys_info="$sys_throttle"
sys_info2="Active: $cpu_taskact of $cpu_tasks tasks"
used_str="Used: "
leased_str="Leased: "
domains_being_blocked=$(printf "%'.0f" "$domains_being_blocked")
ads_blocked_today=$(printf "%'.0f" "$ads_blocked_today")
dns_queries_today=$(printf "%'.0f" "$dns_queries_today")
ph_info="Blocking: $domains_being_blocked sites"
total_str="Total: "
else
phc_str=" ${COL_DARK_GRAY}Core"
lte_str=" ${COL_DARK_GRAY}Web"
ftl_str=" ${COL_DARK_GRAY}FTL"
api_str="${COL_LIGHT_RED}API Down"
ph_info="$domains_being_blocked blocked"
fi
[[ "$sys_cores" -ne 1 ]] && sys_cores_txt="${sys_cores}x "
cpu_info="$sys_cores_txt$cpu_freq$cpu_temp_str"
ram_info="$used_str$(hrBytes "$ram_used") of $(hrBytes "$ram_total")"
disk_info="$used_str$(hrBytes "$disk_used") of $(hrBytes "$disk_total")"
lan_info="Gateway: $net_gateway"
dhcp_info="$leased_str$ph_dhcp_num of $ph_dhcp_max"
ads_info="$total_str$ads_blocked_today of $dns_queries_today"
dns_info="$dns_count DNS servers"
[[ "$recent_blocked" == "0" ]] && recent_blocked="${COL_LIGHT_RED}FTL offline${COL_NC}"
}
chronoFunc() {
local extra_arg="$1"
local extra_value="$2"
get_init_stats
for (( ; ; )); do
get_sys_stats
get_ftl_stats
get_strings
# Strip excess development version numbers
if [[ "$ph_core_ver" != "-1" ]]; then
phc_ver_str="$phc_str: ${ph_core_ver%-*}${COL_NC}"
lte_ver_str="$lte_str: ${ph_lte_ver%-*}${COL_NC}"
ftl_ver_str="$ftl_str: ${ph_ftl_ver%-*}${COL_NC}"
else
phc_ver_str="$phc_str: $api_str${COL_NC}"
fi
# Get refresh number
if [[ "${extra_arg}" = "refresh" ]]; then
num="${extra_value}"
num_str="Refresh set for every $num seconds"
else
num_str=""
fi
clear
# Remove exit message heading on third refresh
if [[ "$count" -le 2 ]] && [[ "${extra_arg}" != "exit" ]]; then
echo -e " ${COL_LIGHT_GREEN}Pi-hole Chronometer${COL_NC}
$num_str
${COL_LIGHT_RED}Press Ctrl-C to exit${COL_NC}
${COL_DARK_GRAY}$scr_line_str${COL_NC}"
else
echo -e "|¯¯¯(¯)_|¯|_ ___|¯|___$phc_ver_str\\n| ¯_/¯|_| ' \\/ _ \\ / -_)$lte_ver_str\\n|_| |_| |_||_\\___/_\\___|$ftl_ver_str\\n ${COL_DARK_GRAY}$scr_line_str${COL_NC}"
fi
printFunc " Hostname: " "$sys_name" "$host_info"
printFunc " Uptime: " "$sys_uptime" "$sys_info"
printFunc " Task Load: " "$sys_loadavg" "$sys_info2"
printFunc " CPU usage: " "$cpu_perc%" "$cpu_info"
printFunc " RAM usage: " "$ram_perc%" "$ram_info"
printFunc " HDD usage: " "$disk_perc" "$disk_info"
if [[ "$DHCP_ACTIVE" == "true" ]]; then
printFunc "DHCP usage: " "$ph_dhcp_percent%" "$dhcp_info"
fi
printFunc " Pi-hole: " "$ph_status" "$ph_info"
printFunc " Blocked: " "$ads_percentage_today%" "$ads_info"
printFunc "Local Qrys: " "$queries_cached_percentage%" "$dns_info"
printFunc "Last Block: " "$recent_blocked"
printFunc " Top Block: " "$top_ad"
# Provide more stats on screens with more lines
if [[ "$scr_lines" -eq 17 ]]; then
if [[ "$DHCP_ACTIVE" == "true" ]]; then
printFunc "Top Domain: " "$top_domain" "last"
else
print_client="true"
fi
else
print_client="true"
fi
if [[ -n "$print_client" ]]; then
printFunc "Top Domain: " "$top_domain"
printFunc "Top Client: " "$top_client" "last"
fi
# Handle exit/refresh options
if [[ "${extra_arg}" == "exit" ]]; then
exit 0
else
if [[ "${extra_arg}" == "refresh" ]]; then
sleep "$num"
else
sleep 5
fi
fi
done
}
jsonFunc() {
get_ftl_stats "json"
echo "{\"domains_being_blocked\":${domains_being_blocked_raw},\"dns_queries_today\":${dns_queries_today_raw},\"ads_blocked_today\":${ads_blocked_today_raw},\"ads_percentage_today\":${ads_percentage_today_raw}}"
}
helpFunc() {
if [[ "$1" == "?" ]]; then
echo "Unknown option. Please view 'pihole -c --help' for more information"
else
echo "Usage: pihole -c [options]
Example: 'pihole -c -j'
Calculates stats and displays to an LCD
Options:
-j, --json Output stats as JSON formatted string
-r, --refresh Set update frequency (in seconds)
-e, --exit Output stats and exit without refreshing
-h, --help Display this help text"
fi
exit 0
}
if [[ $# = 0 ]]; then
chronoFunc
fi
case "$1" in
"-j" | "--json" ) jsonFunc;;
"-h" | "--help" ) helpFunc;;
"-r" | "--refresh" ) chronoFunc refresh "$2";;
"-e" | "--exit" ) chronoFunc exit;;
* ) helpFunc "?";;
esac

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# shellcheck disable=SC1090
# Pi-hole: A black hole for Internet advertisements
# (c) 2019 Pi-hole, LLC (https://pi-hole.net)
@@ -13,119 +13,147 @@
readonly scriptPath="/etc/.pihole/advanced/Scripts/database_migration/gravity"
upgrade_gravityDB(){
local database piholeDir auditFile version
database="${1}"
piholeDir="${2}"
auditFile="${piholeDir}/auditlog.list"
local database version
database="${1}"
# Get database version
version="$(pihole-FTL sqlite3 "${database}" "SELECT \"value\" FROM \"info\" WHERE \"property\" = 'version';")"
# Exit early if the database does not exist (e.g. in CI tests)
if [[ ! -f "${database}" ]]; then
return
fi
if [[ "$version" == "1" ]]; then
# This migration script upgrades the gravity.db file by
# adding the domain_audit table
echo -e " ${INFO} Upgrading gravity database from version 1 to 2"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/1_to_2.sql"
version=2
# Get database version
version="$(pihole-FTL sqlite3 -ni "${database}" "SELECT \"value\" FROM \"info\" WHERE \"property\" = 'version';")"
# Store audit domains in database table
if [ -e "${auditFile}" ]; then
echo -e " ${INFO} Migrating content of ${auditFile} into new database"
# database_table_from_file is defined in gravity.sh
database_table_from_file "domain_audit" "${auditFile}"
fi
fi
if [[ "$version" == "2" ]]; then
# This migration script upgrades the gravity.db file by
# renaming the regex table to regex_blacklist, and
# creating a new regex_whitelist table + corresponding linking table and views
echo -e " ${INFO} Upgrading gravity database from version 2 to 3"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/2_to_3.sql"
version=3
fi
if [[ "$version" == "3" ]]; then
# This migration script unifies the formally separated domain
# lists into a single table with a UNIQUE domain constraint
echo -e " ${INFO} Upgrading gravity database from version 3 to 4"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/3_to_4.sql"
version=4
fi
if [[ "$version" == "4" ]]; then
# This migration script upgrades the gravity and list views
# implementing necessary changes for per-client blocking
echo -e " ${INFO} Upgrading gravity database from version 4 to 5"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/4_to_5.sql"
version=5
fi
if [[ "$version" == "5" ]]; then
# This migration script upgrades the adlist view
# to return an ID used in gravity.sh
echo -e " ${INFO} Upgrading gravity database from version 5 to 6"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/5_to_6.sql"
version=6
fi
if [[ "$version" == "6" ]]; then
# This migration script adds a special group with ID 0
# which is automatically associated to all clients not
# having their own group assignments
echo -e " ${INFO} Upgrading gravity database from version 6 to 7"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/6_to_7.sql"
version=7
fi
if [[ "$version" == "7" ]]; then
# This migration script recreated the group table
# to ensure uniqueness on the group name
# We also add date_added and date_modified columns
echo -e " ${INFO} Upgrading gravity database from version 7 to 8"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/7_to_8.sql"
version=8
fi
if [[ "$version" == "8" ]]; then
# This migration fixes some issues that were introduced
# in the previous migration script.
echo -e " ${INFO} Upgrading gravity database from version 8 to 9"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/8_to_9.sql"
version=9
fi
if [[ "$version" == "9" ]]; then
# This migration drops unused tables and creates triggers to remove
# obsolete groups assignments when the linked items are deleted
echo -e " ${INFO} Upgrading gravity database from version 9 to 10"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/9_to_10.sql"
version=10
fi
if [[ "$version" == "10" ]]; then
# This adds timestamp and an optional comment field to the client table
# These fields are only temporary and will be replaces by the columns
# defined in gravity.db.sql during gravity swapping. We add them here
# to keep the copying process generic (needs the same columns in both the
# source and the destination databases).
echo -e " ${INFO} Upgrading gravity database from version 10 to 11"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/10_to_11.sql"
version=11
fi
if [[ "$version" == "11" ]]; then
# Rename group 0 from "Unassociated" to "Default"
echo -e " ${INFO} Upgrading gravity database from version 11 to 12"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/11_to_12.sql"
version=12
fi
if [[ "$version" == "12" ]]; then
# Add column date_updated to adlist table
echo -e " ${INFO} Upgrading gravity database from version 12 to 13"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/12_to_13.sql"
version=13
fi
if [[ "$version" == "13" ]]; then
# Add columns number and status to adlist table
echo -e " ${INFO} Upgrading gravity database from version 13 to 14"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/13_to_14.sql"
version=14
fi
if [[ "$version" == "14" ]]; then
# Changes the vw_adlist created in 5_to_6
echo -e " ${INFO} Upgrading gravity database from version 14 to 15"
pihole-FTL sqlite3 "${database}" < "${scriptPath}/14_to_15.sql"
version=15
fi
if [[ "$version" == "1" ]]; then
# This migration script upgraded the gravity.db file by
# adding the domain_audit table. It is now a no-op
echo -e " ${INFO} Upgrading gravity database from version 1 to 2"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/1_to_2.sql"
version=2
fi
if [[ "$version" == "2" ]]; then
# This migration script upgrades the gravity.db file by
# renaming the regex table to regex_blacklist, and
# creating a new regex_whitelist table + corresponding linking table and views
echo -e " ${INFO} Upgrading gravity database from version 2 to 3"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/2_to_3.sql"
version=3
fi
if [[ "$version" == "3" ]]; then
# This migration script unifies the formally separated domain
# lists into a single table with a UNIQUE domain constraint
echo -e " ${INFO} Upgrading gravity database from version 3 to 4"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/3_to_4.sql"
version=4
fi
if [[ "$version" == "4" ]]; then
# This migration script upgrades the gravity and list views
# implementing necessary changes for per-client blocking
echo -e " ${INFO} Upgrading gravity database from version 4 to 5"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/4_to_5.sql"
version=5
fi
if [[ "$version" == "5" ]]; then
# This migration script upgrades the adlist view
# to return an ID used in gravity.sh
echo -e " ${INFO} Upgrading gravity database from version 5 to 6"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/5_to_6.sql"
version=6
fi
if [[ "$version" == "6" ]]; then
# This migration script adds a special group with ID 0
# which is automatically associated to all clients not
# having their own group assignments
echo -e " ${INFO} Upgrading gravity database from version 6 to 7"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/6_to_7.sql"
version=7
fi
if [[ "$version" == "7" ]]; then
# This migration script recreated the group table
# to ensure uniqueness on the group name
# We also add date_added and date_modified columns
echo -e " ${INFO} Upgrading gravity database from version 7 to 8"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/7_to_8.sql"
version=8
fi
if [[ "$version" == "8" ]]; then
# This migration fixes some issues that were introduced
# in the previous migration script.
echo -e " ${INFO} Upgrading gravity database from version 8 to 9"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/8_to_9.sql"
version=9
fi
if [[ "$version" == "9" ]]; then
# This migration drops unused tables and creates triggers to remove
# obsolete groups assignments when the linked items are deleted
echo -e " ${INFO} Upgrading gravity database from version 9 to 10"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/9_to_10.sql"
version=10
fi
if [[ "$version" == "10" ]]; then
# This adds timestamp and an optional comment field to the client table
# These fields are only temporary and will be replaces by the columns
# defined in gravity.db.sql during gravity swapping. We add them here
# to keep the copying process generic (needs the same columns in both the
# source and the destination databases).
echo -e " ${INFO} Upgrading gravity database from version 10 to 11"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/10_to_11.sql"
version=11
fi
if [[ "$version" == "11" ]]; then
# Rename group 0 from "Unassociated" to "Default"
echo -e " ${INFO} Upgrading gravity database from version 11 to 12"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/11_to_12.sql"
version=12
fi
if [[ "$version" == "12" ]]; then
# Add column date_updated to adlist table
echo -e " ${INFO} Upgrading gravity database from version 12 to 13"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/12_to_13.sql"
version=13
fi
if [[ "$version" == "13" ]]; then
# Add columns number and status to adlist table
echo -e " ${INFO} Upgrading gravity database from version 13 to 14"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/13_to_14.sql"
version=14
fi
if [[ "$version" == "14" ]]; then
# Changes the vw_adlist created in 5_to_6
echo -e " ${INFO} Upgrading gravity database from version 14 to 15"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/14_to_15.sql"
version=15
fi
if [[ "$version" == "15" ]]; then
# Add column abp_entries to adlist table
echo -e " ${INFO} Upgrading gravity database from version 15 to 16"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/15_to_16.sql"
version=16
fi
if [[ "$version" == "16" ]]; then
# Add antigravity table
# Add column type to adlist table (to support adlist types)
echo -e " ${INFO} Upgrading gravity database from version 16 to 17"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/16_to_17.sql"
version=17
fi
if [[ "$version" == "17" ]]; then
# Add adlist.id to vw_gravity and vw_antigravity
echo -e " ${INFO} Upgrading gravity database from version 17 to 18"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/17_to_18.sql"
version=18
fi
if [[ "$version" == "18" ]]; then
# Modify DELETE triggers to delete BEFORE instead of AFTER to prevent
# foreign key constraint violations
echo -e " ${INFO} Upgrading gravity database from version 18 to 19"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/18_to_19.sql"
version=19
fi
if [[ "$version" == "19" ]]; then
# Update views to use new allowlist/denylist names
echo -e " ${INFO} Upgrading gravity database from version 19 to 20"
pihole-FTL sqlite3 -ni "${database}" < "${scriptPath}/19_to_20.sql"
version=20
fi
}

View File

@@ -0,0 +1,11 @@
.timeout 30000
PRAGMA FOREIGN_KEYS=OFF;
BEGIN TRANSACTION;
ALTER TABLE adlist ADD COLUMN abp_entries INTEGER NOT NULL DEFAULT 0;
UPDATE info SET value = 16 WHERE property = 'version';
COMMIT;

View File

@@ -0,0 +1,33 @@
.timeout 30000
PRAGMA FOREIGN_KEYS=OFF;
BEGIN TRANSACTION;
ALTER TABLE adlist ADD COLUMN type INTEGER NOT NULL DEFAULT 0;
UPDATE adlist SET type = 0;
CREATE TABLE IF NOT EXISTS antigravity
(
domain TEXT NOT NULL,
adlist_id INTEGER NOT NULL REFERENCES adlist (id)
);
CREATE VIEW vw_antigravity AS SELECT domain, adlist_by_group.group_id AS group_id
FROM antigravity
LEFT JOIN adlist_by_group ON adlist_by_group.adlist_id = antigravity.adlist_id
LEFT JOIN adlist ON adlist.id = antigravity.adlist_id
LEFT JOIN "group" ON "group".id = adlist_by_group.group_id
WHERE adlist.enabled = 1 AND (adlist_by_group.group_id IS NULL OR "group".enabled = 1) AND adlist.type = 1;
DROP VIEW vw_adlist;
CREATE VIEW vw_adlist AS SELECT DISTINCT address, id, type
FROM adlist
WHERE enabled = 1
ORDER BY id;
UPDATE info SET value = 17 WHERE property = 'version';
COMMIT;

View File

@@ -0,0 +1,25 @@
.timeout 30000
PRAGMA FOREIGN_KEYS=OFF;
BEGIN TRANSACTION;
DROP VIEW vw_gravity;
CREATE VIEW vw_gravity AS SELECT domain, adlist.id AS adlist_id, adlist_by_group.group_id AS group_id
FROM gravity
LEFT JOIN adlist_by_group ON adlist_by_group.adlist_id = gravity.adlist_id
LEFT JOIN adlist ON adlist.id = gravity.adlist_id
LEFT JOIN "group" ON "group".id = adlist_by_group.group_id
WHERE adlist.enabled = 1 AND (adlist_by_group.group_id IS NULL OR "group".enabled = 1);
DROP VIEW vw_antigravity;
CREATE VIEW vw_antigravity AS SELECT domain, adlist.id AS adlist_id, adlist_by_group.group_id AS group_id
FROM antigravity
LEFT JOIN adlist_by_group ON adlist_by_group.adlist_id = antigravity.adlist_id
LEFT JOIN adlist ON adlist.id = antigravity.adlist_id
LEFT JOIN "group" ON "group".id = adlist_by_group.group_id
WHERE adlist.enabled = 1 AND (adlist_by_group.group_id IS NULL OR "group".enabled = 1) AND adlist.type = 1;
UPDATE info SET value = 18 WHERE property = 'version';
COMMIT;

View File

@@ -0,0 +1,27 @@
.timeout 30000
PRAGMA FOREIGN_KEYS=OFF;
BEGIN TRANSACTION;
DROP TRIGGER tr_domainlist_delete;
CREATE TRIGGER tr_domainlist_delete BEFORE DELETE ON domainlist
BEGIN
DELETE FROM domainlist_by_group WHERE domainlist_id = OLD.id;
END;
DROP TRIGGER tr_adlist_delete;
CREATE TRIGGER tr_adlist_delete BEFORE DELETE ON adlist
BEGIN
DELETE FROM adlist_by_group WHERE adlist_id = OLD.id;
END;
DROP TRIGGER tr_client_delete;
CREATE TRIGGER tr_client_delete BEFORE DELETE ON client
BEGIN
DELETE FROM client_by_group WHERE client_id = OLD.id;
END;
UPDATE info SET value = 19 WHERE property = 'version';
COMMIT;

View File

@@ -0,0 +1,43 @@
.timeout 30000
BEGIN TRANSACTION;
DROP VIEW vw_whitelist;
CREATE VIEW vw_allowlist AS SELECT domain, domainlist.id AS id, domainlist_by_group.group_id AS group_id
FROM domainlist
LEFT JOIN domainlist_by_group ON domainlist_by_group.domainlist_id = domainlist.id
LEFT JOIN "group" ON "group".id = domainlist_by_group.group_id
WHERE domainlist.enabled = 1 AND (domainlist_by_group.group_id IS NULL OR "group".enabled = 1)
AND domainlist.type = 0
ORDER BY domainlist.id;
DROP VIEW vw_blacklist;
CREATE VIEW vw_denylist AS SELECT domain, domainlist.id AS id, domainlist_by_group.group_id AS group_id
FROM domainlist
LEFT JOIN domainlist_by_group ON domainlist_by_group.domainlist_id = domainlist.id
LEFT JOIN "group" ON "group".id = domainlist_by_group.group_id
WHERE domainlist.enabled = 1 AND (domainlist_by_group.group_id IS NULL OR "group".enabled = 1)
AND domainlist.type = 1
ORDER BY domainlist.id;
DROP VIEW vw_regex_whitelist;
CREATE VIEW vw_regex_allowlist AS SELECT domain, domainlist.id AS id, domainlist_by_group.group_id AS group_id
FROM domainlist
LEFT JOIN domainlist_by_group ON domainlist_by_group.domainlist_id = domainlist.id
LEFT JOIN "group" ON "group".id = domainlist_by_group.group_id
WHERE domainlist.enabled = 1 AND (domainlist_by_group.group_id IS NULL OR "group".enabled = 1)
AND domainlist.type = 2
ORDER BY domainlist.id;
DROP VIEW vw_regex_blacklist;
CREATE VIEW vw_regex_denylist AS SELECT domain, domainlist.id AS id, domainlist_by_group.group_id AS group_id
FROM domainlist
LEFT JOIN domainlist_by_group ON domainlist_by_group.domainlist_id = domainlist.id
LEFT JOIN "group" ON "group".id = domainlist_by_group.group_id
WHERE domainlist.enabled = 1 AND (domainlist_by_group.group_id IS NULL OR "group".enabled = 1)
AND domainlist.type = 3
ORDER BY domainlist.id;
UPDATE info SET value = 20 WHERE property = 'version';
COMMIT;

View File

@@ -2,13 +2,6 @@
BEGIN TRANSACTION;
CREATE TABLE domain_audit
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
domain TEXT UNIQUE NOT NULL,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int))
);
UPDATE info SET value = 2 WHERE property = 'version';
COMMIT;

View File

@@ -8,9 +8,9 @@ ALTER TABLE regex RENAME TO regex_blacklist;
CREATE TABLE regex_blacklist_by_group
(
regex_blacklist_id INTEGER NOT NULL REFERENCES regex_blacklist (id),
group_id INTEGER NOT NULL REFERENCES "group" (id),
PRIMARY KEY (regex_blacklist_id, group_id)
regex_blacklist_id INTEGER NOT NULL REFERENCES regex_blacklist (id),
group_id INTEGER NOT NULL REFERENCES "group" (id),
PRIMARY KEY (regex_blacklist_id, group_id)
);
INSERT INTO regex_blacklist_by_group SELECT * FROM regex_by_group;
@@ -32,19 +32,19 @@ CREATE TRIGGER tr_regex_blacklist_update AFTER UPDATE ON regex_blacklist
CREATE TABLE regex_whitelist
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
domain TEXT UNIQUE NOT NULL,
enabled BOOLEAN NOT NULL DEFAULT 1,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
comment TEXT
id INTEGER PRIMARY KEY AUTOINCREMENT,
domain TEXT UNIQUE NOT NULL,
enabled BOOLEAN NOT NULL DEFAULT 1,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
comment TEXT
);
CREATE TABLE regex_whitelist_by_group
(
regex_whitelist_id INTEGER NOT NULL REFERENCES regex_whitelist (id),
group_id INTEGER NOT NULL REFERENCES "group" (id),
PRIMARY KEY (regex_whitelist_id, group_id)
regex_whitelist_id INTEGER NOT NULL REFERENCES regex_whitelist (id),
group_id INTEGER NOT NULL REFERENCES "group" (id),
PRIMARY KEY (regex_whitelist_id, group_id)
);
CREATE VIEW vw_regex_whitelist AS SELECT DISTINCT domain

View File

@@ -6,13 +6,13 @@ BEGIN TRANSACTION;
CREATE TABLE domainlist
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
type INTEGER NOT NULL DEFAULT 0,
domain TEXT UNIQUE NOT NULL,
enabled BOOLEAN NOT NULL DEFAULT 1,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
comment TEXT
id INTEGER PRIMARY KEY AUTOINCREMENT,
type INTEGER NOT NULL DEFAULT 0,
domain TEXT UNIQUE NOT NULL,
enabled BOOLEAN NOT NULL DEFAULT 1,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
comment TEXT
);
ALTER TABLE whitelist ADD COLUMN type INTEGER;
@@ -41,9 +41,9 @@ DROP TABLE regex_whitelist_by_group;
DROP TABLE regex_blacklist_by_group;
CREATE TABLE domainlist_by_group
(
domainlist_id INTEGER NOT NULL REFERENCES domainlist (id),
group_id INTEGER NOT NULL REFERENCES "group" (id),
PRIMARY KEY (domainlist_id, group_id)
domainlist_id INTEGER NOT NULL REFERENCES domainlist (id),
group_id INTEGER NOT NULL REFERENCES "group" (id),
PRIMARY KEY (domainlist_id, group_id)
);
DROP TRIGGER tr_whitelist_update;

View File

@@ -7,9 +7,9 @@ BEGIN TRANSACTION;
DROP TABLE gravity;
CREATE TABLE gravity
(
domain TEXT NOT NULL,
adlist_id INTEGER NOT NULL REFERENCES adlist (id),
PRIMARY KEY(domain, adlist_id)
domain TEXT NOT NULL,
adlist_id INTEGER NOT NULL REFERENCES adlist (id),
PRIMARY KEY(domain, adlist_id)
);
DROP VIEW vw_gravity;
@@ -22,15 +22,15 @@ CREATE VIEW vw_gravity AS SELECT domain, adlist_by_group.group_id AS group_id
CREATE TABLE client
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
ip TEXT NOL NULL UNIQUE
id INTEGER PRIMARY KEY AUTOINCREMENT,
ip TEXT NOL NULL UNIQUE
);
CREATE TABLE client_by_group
(
client_id INTEGER NOT NULL REFERENCES client (id),
group_id INTEGER NOT NULL REFERENCES "group" (id),
PRIMARY KEY (client_id, group_id)
client_id INTEGER NOT NULL REFERENCES client (id),
group_id INTEGER NOT NULL REFERENCES "group" (id),
PRIMARY KEY (client_id, group_id)
);
UPDATE info SET value = 5 WHERE property = 'version';

View File

@@ -15,4 +15,3 @@ CREATE VIEW vw_adlist AS SELECT DISTINCT address, adlist.id AS id
UPDATE info SET value = 6 WHERE property = 'version';
COMMIT;

View File

@@ -8,12 +8,12 @@ ALTER TABLE "group" RENAME TO "group__";
CREATE TABLE "group"
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
enabled BOOLEAN NOT NULL DEFAULT 1,
name TEXT UNIQUE NOT NULL,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
description TEXT
id INTEGER PRIMARY KEY AUTOINCREMENT,
enabled BOOLEAN NOT NULL DEFAULT 1,
name TEXT UNIQUE NOT NULL,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
description TEXT
);
CREATE TRIGGER tr_group_update AFTER UPDATE ON "group"

View File

@@ -1,309 +1,229 @@
#!/usr/bin/env bash
# shellcheck disable=SC1090
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Whitelist and blacklist domains
# allowlist and denylist domains
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
# Globals
piholeDir="/etc/pihole"
GRAVITYDB="${piholeDir}/gravity.db"
# Source pihole-FTL from install script
pihole_FTL="${piholeDir}/pihole-FTL.conf"
if [[ -f "${pihole_FTL}" ]]; then
source "${pihole_FTL}"
PI_HOLE_SCRIPT_DIR="/opt/pihole"
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
# shellcheck source="./advanced/Scripts/utils.sh"
source "${utilsfile}"
apifile="${PI_HOLE_SCRIPT_DIR}/api.sh"
# shellcheck source="./advanced/Scripts/api.sh"
source "${apifile}"
# Determine database location
DBFILE=$(getFTLConfigValue "files.database")
if [ -z "$DBFILE" ]; then
DBFILE="/etc/pihole/pihole-FTL.db"
fi
# Set this only after sourcing pihole-FTL.conf as the gravity database path may
# have changed
gravityDBfile="${GRAVITYDB}"
# Determine gravity database location
GRAVITYDB=$(getFTLConfigValue "files.gravity")
if [ -z "$GRAVITYDB" ]; then
GRAVITYDB="/etc/pihole/gravity.db"
fi
noReloadRequested=false
addmode=true
verbose=true
wildcard=false
web=false
domList=()
typeId=""
comment=""
declare -i domaincount
domaincount=0
reload=false
colfile="/opt/pihole/COL_TABLE"
# shellcheck source="./advanced/Scripts/COL_TABLE"
source ${colfile}
# IDs are hard-wired to domain interpretation in the gravity database scheme
# Clients (including FTL) will read them through the corresponding views
readonly whitelist="0"
readonly blacklist="1"
readonly regex_whitelist="2"
readonly regex_blacklist="3"
GetListnameFromTypeId() {
if [[ "$1" == "${whitelist}" ]]; then
echo "whitelist"
elif [[ "$1" == "${blacklist}" ]]; then
echo "blacklist"
elif [[ "$1" == "${regex_whitelist}" ]]; then
echo "regex whitelist"
elif [[ "$1" == "${regex_blacklist}" ]]; then
echo "regex blacklist"
fi
}
GetListParamFromTypeId() {
if [[ "${typeId}" == "${whitelist}" ]]; then
echo "w"
elif [[ "${typeId}" == "${blacklist}" ]]; then
echo "b"
elif [[ "${typeId}" == "${regex_whitelist}" && "${wildcard}" == true ]]; then
echo "-white-wild"
elif [[ "${typeId}" == "${regex_whitelist}" ]]; then
echo "-white-regex"
elif [[ "${typeId}" == "${regex_blacklist}" && "${wildcard}" == true ]]; then
echo "-wild"
elif [[ "${typeId}" == "${regex_blacklist}" ]]; then
echo "-regex"
fi
}
helpFunc() {
local listname param
listname="$(GetListnameFromTypeId "${typeId}")"
param="$(GetListParamFromTypeId)"
echo "Usage: pihole -${param} [options] <domain> <domain2 ...>
Example: 'pihole -${param} site.com', or 'pihole -${param} site1.com site2.com'
${listname^} one or more domains
echo "Usage: pihole ${abbrv} [options] <domain> <domain2 ...>
Example: 'pihole ${abbrv} site.com', or 'pihole ${abbrv} site1.com site2.com'
${typeId^} one or more ${kindId} domains
Options:
-d, --delmode Remove domain(s) from the ${listname}
-nr, --noreload Update ${listname} without reloading the DNS server
remove, delete, -d Remove domain(s)
-q, --quiet Make output less verbose
-h, --help Show this help dialog
-l, --list Display all your ${listname}listed domains
--nuke Removes all entries in a list
-l, --list Display domains
--comment \"text\" Add a comment to the domain. If adding multiple domains the same comment will be used for all"
exit 0
}
ValidateDomain() {
# Convert to lowercase
domain="${1,,}"
local str validDomain
# Check validity of domain (don't check for regex entries)
if [[ ( "${typeId}" == "${regex_blacklist}" || "${typeId}" == "${regex_whitelist}" ) && "${wildcard}" == false ]]; then
validDomain="${domain}"
else
# Check max length
if [[ "${#domain}" -le 253 ]]; then
validDomain=$(grep -P "^((-|_)*[a-z\\d]((-|_)*[a-z\\d])*(-|_)*)(\\.(-|_)*([a-z\\d]((-|_)*[a-z\\d])*))*$" <<< "${domain}") # Valid chars check
validDomain=$(grep -P "^[^\\.]{1,63}(\\.[^\\.]{1,63})*$" <<< "${validDomain}") # Length of each label
# set error string
str="is not a valid argument or domain name!"
else
validDomain=
str="is too long!"
fi
CreateDomainList() {
# Format domain into regex filter if requested
local dom=${1}
if [[ "${wildcard}" == true ]]; then
dom="(\\.|^)${dom//\./\\.}$"
fi
if [[ -n "${validDomain}" ]]; then
domList=("${domList[@]}" "${validDomain}")
else
echo -e " ${CROSS} ${domain} ${str}"
fi
domaincount=$((domaincount+1))
}
ProcessDomainList() {
for dom in "${domList[@]}"; do
# Format domain into regex filter if requested
if [[ "${wildcard}" == true ]]; then
dom="(\\.|^)${dom//\./\\.}$"
fi
# Logic: If addmode then add to desired list and remove from the other;
# if delmode then remove from desired list but do not add to the other
if ${addmode}; then
AddDomain "${dom}"
else
RemoveDomain "${dom}"
fi
done
domList=("${domList[@]}" "${dom}")
}
AddDomain() {
local domain num requestedListname existingTypeId existingListname
domain="$1"
local json num data
# Is the domain in the list we want to add it to?
num="$(pihole-FTL sqlite3 "${gravityDBfile}" "SELECT COUNT(*) FROM domainlist WHERE domain = '${domain}';")"
requestedListname="$(GetListnameFromTypeId "${typeId}")"
# Authenticate with the API
LoginAPI
if [[ "${num}" -ne 0 ]]; then
existingTypeId="$(pihole-FTL sqlite3 "${gravityDBfile}" "SELECT type FROM domainlist WHERE domain = '${domain}';")"
if [[ "${existingTypeId}" == "${typeId}" ]]; then
if [[ "${verbose}" == true ]]; then
echo -e " ${INFO} ${1} already exists in ${requestedListname}, no need to add!"
# Prepare request to POST /api/domains/{type}/{kind}
# Build JSON object of the following form
# {
# "domain": [ <domains> ],
# "comment": <comment>
# }
# where <domains> is an array of domain strings and <comment> is a string
# We use jq to build the JSON object
json=$(jq --null-input --compact-output --arg domains "${domList[*]}" --arg comment "${comment}" '{domain: $domains | split(" "), comment: $comment}')
# Send the request
data=$(PostFTLData "domains/${typeId}/${kindId}" "${json}")
# Display domain(s) added
# (they are listed in .processed.success, use jq)
num=$(echo "${data}" | jq '.processed.success | length')
if [[ "${num}" -gt 0 ]] && [[ "${verbose}" == true ]]; then
echo -e " ${TICK} Added ${num} domain(s):"
for i in $(seq 0 $((num-1))); do
echo -e " - ${COL_BLUE}$(echo "${data}" | jq --raw-output ".processed.success[$i].item")${COL_NC}"
done
fi
# Display failed domain(s)
# (they are listed in .processed.errors, use jq)
num=$(echo "${data}" | jq '.processed.errors | length')
if [[ "${num}" -gt 0 ]] && [[ "${verbose}" == true ]]; then
echo -e " ${CROSS} Failed to add ${num} domain(s):"
for i in $(seq 0 $((num-1))); do
echo -e " - ${COL_BLUE}$(echo "${data}" | jq --raw-output ".processed.errors[$i].item")${COL_NC}"
error=$(echo "${data}" | jq --raw-output ".processed.errors[$i].error")
if [[ "${error}" == "UNIQUE constraint failed: domainlist.domain, domainlist.type" ]]; then
error="Domain already in the specified list"
fi
else
existingListname="$(GetListnameFromTypeId "${existingTypeId}")"
pihole-FTL sqlite3 "${gravityDBfile}" "UPDATE domainlist SET type = ${typeId} WHERE domain='${domain}';"
if [[ "${verbose}" == true ]]; then
echo -e " ${INFO} ${1} already exists in ${existingListname}, it has been moved to ${requestedListname}!"
fi
fi
return
echo -e " ${error}"
done
fi
# Domain not found in the table, add it!
if [[ "${verbose}" == true ]]; then
echo -e " ${INFO} Adding ${domain} to the ${requestedListname}..."
fi
reload=true
# Insert only the domain here. The enabled and date_added fields will be filled
# with their default values (enabled = true, date_added = current timestamp)
if [[ -z "${comment}" ]]; then
pihole-FTL sqlite3 "${gravityDBfile}" "INSERT INTO domainlist (domain,type) VALUES ('${domain}',${typeId});"
else
# also add comment when variable has been set through the "--comment" option
pihole-FTL sqlite3 "${gravityDBfile}" "INSERT INTO domainlist (domain,type,comment) VALUES ('${domain}',${typeId},'${comment}');"
fi
# Log out
LogoutAPI
}
RemoveDomain() {
local domain num requestedListname
domain="$1"
local json num data status
# Is the domain in the list we want to remove it from?
num="$(pihole-FTL sqlite3 "${gravityDBfile}" "SELECT COUNT(*) FROM domainlist WHERE domain = '${domain}' AND type = ${typeId};")"
# Authenticate with the API
LoginAPI
requestedListname="$(GetListnameFromTypeId "${typeId}")"
# Prepare request to POST /api/domains:batchDelete
# Build JSON object of the following form
# [{
# "item": <domain>,
# "type": "${typeId}",
# "kind": "${kindId}",
# }]
# where <domain> is the domain string and ${typeId} and ${kindId} are the type and kind IDs
# We use jq to build the JSON object)
json=$(jq --null-input --compact-output --arg domains "${domList[*]}" --arg typeId "${typeId}" --arg kindId "${kindId}" '[ $domains | split(" ")[] as $item | {item: $item, type: $typeId, kind: $kindId} ]')
if [[ "${num}" -eq 0 ]]; then
if [[ "${verbose}" == true ]]; then
echo -e " ${INFO} ${domain} does not exist in ${requestedListname}, no need to remove!"
fi
return
# Send the request
data=$(PostFTLData "domains:batchDelete" "${json}" "status")
# Separate the status from the data
status=$(printf %s "${data#"${data%???}"}")
data=$(printf %s "${data%???}")
# If there is an .error object in the returned data, display it
local error
error=$(jq --compact-output <<< "${data}" '.error')
if [[ $error != "null" && $error != "" ]]; then
echo -e " ${CROSS} Failed to remove domain(s):"
echo -e " $(jq <<< "${data}" '.error')"
elif [[ "${verbose}" == true && "${status}" == "204" ]]; then
echo -e " ${TICK} Domain(s) removed from the ${kindId} ${typeId}list"
elif [[ "${verbose}" == true && "${status}" == "404" ]]; then
echo -e " ${TICK} Requested domain(s) not found on ${kindId} ${typeId}list"
fi
# Domain found in the table, remove it!
if [[ "${verbose}" == true ]]; then
echo -e " ${INFO} Removing ${domain} from the ${requestedListname}..."
fi
reload=true
# Remove it from the current list
pihole-FTL sqlite3 "${gravityDBfile}" "DELETE FROM domainlist WHERE domain = '${domain}' AND type = ${typeId};"
# Log out
LogoutAPI
}
Displaylist() {
local count num_pipes domain enabled status nicedate requestedListname
local data
requestedListname="$(GetListnameFromTypeId "${typeId}")"
data="$(pihole-FTL sqlite3 "${gravityDBfile}" "SELECT domain,enabled,date_modified FROM domainlist WHERE type = ${typeId};" 2> /dev/null)"
if [[ -z $data ]]; then
echo -e "Not showing empty list"
else
echo -e "Displaying ${requestedListname}:"
count=1
while IFS= read -r line
do
# Count number of pipes seen in this line
# This is necessary because we can only detect the pipe separating the fields
# from the end backwards as the domain (which is the first field) may contain
# pipe symbols as they are perfectly valid regex filter control characters
num_pipes="$(grep -c "^" <<< "$(grep -o "|" <<< "${line}")")"
# Extract domain and enabled status based on the obtained number of pipe characters
domain="$(cut -d'|' -f"-$((num_pipes-1))" <<< "${line}")"
enabled="$(cut -d'|' -f"$((num_pipes))" <<< "${line}")"
datemod="$(cut -d'|' -f"$((num_pipes+1))" <<< "${line}")"
# Translate boolean status into human readable string
if [[ "${enabled}" -eq 1 ]]; then
status="enabled"
else
status="disabled"
fi
# Get nice representation of numerical date stored in database
nicedate=$(date --rfc-2822 -d "@${datemod}")
echo " ${count}: ${domain} (${status}, last modified ${nicedate})"
count=$((count+1))
done <<< "${data}"
# if either typeId or kindId is empty, we cannot display the list
if [[ -z "${typeId}" ]] || [[ -z "${kindId}" ]]; then
echo " ${CROSS} Unable to display list. Please specify a list type and kind."
exit 1
fi
exit 0;
}
NukeList() {
count=$(pihole-FTL sqlite3 "${gravityDBfile}" "SELECT COUNT(1) FROM domainlist WHERE type = ${typeId};")
listname="$(GetListnameFromTypeId "${typeId}")"
if [ "$count" -gt 0 ];then
pihole-FTL sqlite3 "${gravityDBfile}" "DELETE FROM domainlist WHERE type = ${typeId};"
echo " ${TICK} Removed ${count} domain(s) from the ${listname}"
# Authenticate with the API
LoginAPI
# Send the request
data=$(GetFTLData "domains/${typeId}/${kindId}")
# Display the list
num=$(echo "${data}" | jq '.domains | length')
if [[ "${num}" -gt 0 ]]; then
echo -e " ${TICK} Found ${num} domain(s) in the ${kindId} ${typeId}list:"
for i in $(seq 0 $((num-1))); do
echo -e " - ${COL_BLUE}$(echo "${data}" | jq --compact-output ".domains[$i].domain")${COL_NC}"
echo -e " Comment: $(echo "${data}" | jq --compact-output ".domains[$i].comment")"
echo -e " Groups: $(echo "${data}" | jq --compact-output ".domains[$i].groups")"
echo -e " Added: $(date -d @"$(echo "${data}" | jq --compact-output ".domains[$i].date_added")")"
echo -e " Last modified: $(date -d @"$(echo "${data}" | jq --compact-output ".domains[$i].date_modified")")"
done
else
echo " ${INFO} ${listname} already empty. Nothing to do!"
echo -e " ${INFO} No domains found in the ${kindId} ${typeId}list"
fi
exit 0;
# Log out
LogoutAPI
# Return early without adding/deleting domains
exit 0
}
GetComment() {
comment="$1"
if [[ "${comment}" =~ [^a-zA-Z0-9_\#:/\.,\ -] ]]; then
echo " ${CROSS} Found invalid characters in domain comment!"
exit
exit 1
fi
}
while (( "$#" )); do
case "${1}" in
"-w" | "whitelist" ) typeId=0;;
"-b" | "blacklist" ) typeId=1;;
"--white-regex" | "white-regex" ) typeId=2;;
"--white-wild" | "white-wild" ) typeId=2; wildcard=true;;
"--wild" | "wildcard" ) typeId=3; wildcard=true;;
"--regex" | "regex" ) typeId=3;;
"-nr"| "--noreload" ) noReloadRequested=true;;
"-d" | "--delmode" ) addmode=false;;
"allow" | "allowlist" ) kindId="exact"; typeId="allow"; abbrv="allow";;
"deny" | "denylist" ) kindId="exact"; typeId="deny"; abbrv="deny";;
"--allow-regex" | "allow-regex" ) kindId="regex"; typeId="allow"; abbrv="--allow-regex";;
"--allow-wild" | "allow-wild" ) kindId="regex"; typeId="allow"; wildcard=true; abbrv="--allow-wild";;
"--regex" | "regex" ) kindId="regex"; typeId="deny"; abbrv="--regex";;
"--wild" | "wildcard" ) kindId="regex"; typeId="deny"; wildcard=true; abbrv="--wild";;
"-d" | "remove" | "delete" ) addmode=false;;
"-q" | "--quiet" ) verbose=false;;
"-h" | "--help" ) helpFunc;;
"-l" | "--list" ) Displaylist;;
"--nuke" ) NukeList;;
"--web" ) web=true;;
"--comment" ) GetComment "${2}"; shift;;
* ) ValidateDomain "${1}";;
* ) CreateDomainList "${1}";;
esac
shift
done
shift
if [[ ${domaincount} == 0 ]]; then
if [[ ${#domList[@]} == 0 ]]; then
helpFunc
fi
ProcessDomainList
# Used on web interface
if $web; then
echo "DONE"
fi
if [[ ${reload} == true && ${noReloadRequested} == false ]]; then
pihole restartdns reload-lists
if ${addmode}; then
AddDomain
else
RemoveDomain
fi

View File

@@ -1,23 +0,0 @@
#!/bin/bash
# Pi-hole: A black hole for Internet advertisements
# (c) 2020 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
#
#
# The pihole disable command has the option to set a specified time before
# blocking is automatically re-enabled.
#
# Present script is responsible for the sleep & re-enable part of the job and
# is automatically terminated if it is still running when pihole is enabled by
# other means.
#
# This ensures that pihole ends up in the correct state after a sequence of
# commands suchs as: `pihole disable 30s; pihole enable; pihole disable`
readonly PI_HOLE_BIN_DIR="/usr/local/bin"
sleep "${1}"
"${PI_HOLE_BIN_DIR}"/pihole enable

View File

@@ -1,66 +0,0 @@
#!/usr/bin/env bash
# shellcheck disable=SC1090
# Pi-hole: A black hole for Internet advertisements
# (c) 2019 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# ARP table interaction
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
coltable="/opt/pihole/COL_TABLE"
if [[ -f ${coltable} ]]; then
source ${coltable}
fi
# Determine database location
# Obtain DBFILE=... setting from pihole-FTL.db
# Constructed to return nothing when
# a) the setting is not present in the config file, or
# b) the setting is commented out (e.g. "#DBFILE=...")
FTLconf="/etc/pihole/pihole-FTL.conf"
if [ -e "$FTLconf" ]; then
DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' ${FTLconf})"
fi
# Test for empty string. Use standard path in this case.
if [ -z "$DBFILE" ]; then
DBFILE="/etc/pihole/pihole-FTL.db"
fi
flushARP(){
local output
if [[ "${args[1]}" != "quiet" ]]; then
echo -ne " ${INFO} Flushing network table ..."
fi
# Truncate network_addresses table in pihole-FTL.db
# This needs to be done before we can truncate the network table due to
# foreign key constraints
if ! output=$(pihole-FTL sqlite3 "${DBFILE}" "DELETE FROM network_addresses" 2>&1); then
echo -e "${OVER} ${CROSS} Failed to truncate network_addresses table"
echo " Database location: ${DBFILE}"
echo " Output: ${output}"
return 1
fi
# Truncate network table in pihole-FTL.db
if ! output=$(pihole-FTL sqlite3 "${DBFILE}" "DELETE FROM network" 2>&1); then
echo -e "${OVER} ${CROSS} Failed to truncate network table"
echo " Database location: ${DBFILE}"
echo " Output: ${output}"
return 1
fi
if [[ "${args[1]}" != "quiet" ]]; then
echo -e "${OVER} ${TICK} Flushed network table"
fi
}
args=("$@")
case "${args[0]}" in
"arpflush" ) flushARP;;
esac

View File

@@ -10,25 +10,23 @@
readonly PI_HOLE_FILES_DIR="/etc/.pihole"
SKIP_INSTALL="true"
# shellcheck source="./automated install/basic-install.sh"
source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh"
# webInterfaceGitUrl set in basic-install.sh
# webInterfaceDir set in basic-install.sh
# piholeGitURL set in basic-install.sh
# is_repo() sourced from basic-install.sh
# setupVars set in basic-install.sh
# check_download_exists sourced from basic-install.sh
# fully_fetch_repo sourced from basic-install.sh
# get_available_branches sourced from basic-install.sh
# fetch_checkout_pull_branch sourced from basic-install.sh
# checkout_pull_branch sourced from basic-install.sh
source "${setupVars}"
warning1() {
echo " Please note that changing branches severely alters your Pi-hole subsystems"
echo " Features that work on the master branch, may not on a development branch"
echo -e " ${COL_LIGHT_RED}This feature is NOT supported unless a Pi-hole developer explicitly asks!${COL_NC}"
echo -e " ${COL_RED}This feature is NOT supported unless a Pi-hole developer explicitly asks!${COL_NC}"
read -r -p " Have you read and understood this? [y/N] " response
case "${response}" in
[yY][eE][sS]|[yY])
@@ -43,6 +41,22 @@ warning1() {
}
checkout() {
local skipFTL additionalFlag
skipFTL=false
# Check arguments
for var in "$@"; do
case "$var" in
"--skipFTL") skipFTL=true ;;
esac
done
if [ "${skipFTL}" == true ]; then
additionalFlag="--skipFTL"
else
additionalFlag=""
fi
local corebranches
local webbranches
@@ -57,20 +71,19 @@ checkout() {
# This is unlikely
if ! is_repo "${PI_HOLE_FILES_DIR}" ; then
echo -e " ${COL_LIGHT_RED}Error: Core Pi-hole repo is missing from system!"
echo -e " ${COL_RED}Error: Core Pi-hole repo is missing from system!"
echo -e " Please re-run install script from https://github.com/pi-hole/pi-hole${COL_NC}"
exit 1;
fi
if [[ "${INSTALL_WEB_INTERFACE}" == "true" ]]; then
if ! is_repo "${webInterfaceDir}" ; then
echo -e " ${COL_LIGHT_RED}Error: Web Admin repo is missing from system!"
echo -e " Please re-run install script from https://github.com/pi-hole/pi-hole${COL_NC}"
exit 1;
fi
if ! is_repo "${webInterfaceDir}" ; then
echo -e " ${COL_RED}Error: Web Admin repo is missing from system!"
echo -e " Please re-run install script from https://github.com/pi-hole/pi-hole${COL_NC}"
exit 1;
fi
if [[ -z "${1}" ]]; then
echo -e " ${COL_LIGHT_RED}Invalid option${COL_NC}"
echo -e " ${COL_RED}Invalid option${COL_NC}"
echo -e " Try 'pihole checkout --help' for more information."
exit 1
fi
@@ -81,15 +94,13 @@ checkout() {
if [[ "${1}" == "dev" ]] ; then
# Shortcut to check out development branches
echo -e " ${INFO} Shortcut \"dev\" detected - checking out development / devel branches..."
echo -e " ${INFO} Shortcut \"${COL_YELLOW}dev${COL_NC}\" detected - checking out development branches..."
echo ""
echo -e " ${INFO} Pi-hole Core"
fetch_checkout_pull_branch "${PI_HOLE_FILES_DIR}" "development" || { echo " ${CROSS} Unable to pull Core development branch"; exit 1; }
if [[ "${INSTALL_WEB_INTERFACE}" == "true" ]]; then
echo ""
echo -e " ${INFO} Web interface"
fetch_checkout_pull_branch "${webInterfaceDir}" "devel" || { echo " ${CROSS} Unable to pull Web development branch"; exit 1; }
fi
echo ""
echo -e " ${INFO} Web interface"
fetch_checkout_pull_branch "${webInterfaceDir}" "development" || { echo " ${CROSS} Unable to pull Web development branch"; exit 1; }
#echo -e " ${TICK} Pi-hole Core"
local path
@@ -98,13 +109,11 @@ checkout() {
chmod 644 /etc/pihole/ftlbranch
elif [[ "${1}" == "master" ]] ; then
# Shortcut to check out master branches
echo -e " ${INFO} Shortcut \"master\" detected - checking out master branches..."
echo -e " ${INFO} Shortcut \"${COL_YELLOW}master${COL_NC}\" detected - checking out master branches..."
echo -e " ${INFO} Pi-hole core"
fetch_checkout_pull_branch "${PI_HOLE_FILES_DIR}" "master" || { echo " ${CROSS} Unable to pull Core master branch"; exit 1; }
if [[ ${INSTALL_WEB_INTERFACE} == "true" ]]; then
echo -e " ${INFO} Web interface"
fetch_checkout_pull_branch "${webInterfaceDir}" "master" || { echo " ${CROSS} Unable to pull Web master branch"; exit 1; }
fi
echo -e " ${INFO} Web interface"
fetch_checkout_pull_branch "${webInterfaceDir}" "master" || { echo " ${CROSS} Unable to pull Web master branch"; exit 1; }
#echo -e " ${TICK} Web Interface"
local path
path="master/${binary}"
@@ -117,7 +126,7 @@ checkout() {
echo -e "${OVER} ${CROSS} $str"
exit 1
fi
corebranches=($(get_available_branches "${PI_HOLE_FILES_DIR}"))
mapfile -t corebranches < <(get_available_branches "${PI_HOLE_FILES_DIR}")
if [[ "${corebranches[*]}" == *"master"* ]]; then
echo -e "${OVER} ${TICK} $str"
@@ -131,20 +140,20 @@ checkout() {
echo ""
# Have the user choose the branch they want
if ! (for e in "${corebranches[@]}"; do [[ "$e" == "${2}" ]] && exit 0; done); then
echo -e " ${INFO} Requested branch \"${2}\" is not available"
echo -e " ${INFO} Requested branch \"${COL_CYAN}${2}${COL_NC}\" is not available"
echo -e " ${INFO} Available branches for Core are:"
for e in "${corebranches[@]}"; do echo " - $e"; done
exit 1
fi
checkout_pull_branch "${PI_HOLE_FILES_DIR}" "${2}"
elif [[ "${1}" == "web" ]] && [[ "${INSTALL_WEB_INTERFACE}" == "true" ]] ; then
elif [[ "${1}" == "web" ]] ; then
str="Fetching branches from ${webInterfaceGitUrl}"
echo -ne " ${INFO} $str"
if ! fully_fetch_repo "${webInterfaceDir}" ; then
echo -e "${OVER} ${CROSS} $str"
exit 1
fi
webbranches=($(get_available_branches "${webInterfaceDir}"))
mapfile -t webbranches < <(get_available_branches "${webInterfaceDir}")
if [[ "${webbranches[*]}" == *"master"* ]]; then
echo -e "${OVER} ${TICK} $str"
@@ -158,7 +167,7 @@ checkout() {
echo ""
# Have the user choose the branch they want
if ! (for e in "${webbranches[@]}"; do [[ "$e" == "${2}" ]] && exit 0; done); then
echo -e " ${INFO} Requested branch \"${2}\" is not available"
echo -e " ${INFO} Requested branch \"${COL_CYAN}${2}${COL_NC}\" is not available"
echo -e " ${INFO} Available branches for Web Admin are:"
for e in "${webbranches[@]}"; do echo " - $e"; done
exit 1
@@ -169,39 +178,83 @@ checkout() {
elif [[ "${1}" == "ftl" ]] ; then
local path
local oldbranch
local existing=false
path="${2}/${binary}"
oldbranch="$(pihole-FTL -b)"
if check_download_exists "$path"; then
echo " ${TICK} Branch ${2} exists"
echo "${2}" > /etc/pihole/ftlbranch
chmod 644 /etc/pihole/ftlbranch
echo -e " ${INFO} Switching to branch: \"${2}\" from \"${oldbranch}\""
FTLinstall "${binary}"
restart_service pihole-FTL
enable_service pihole-FTL
# Update local and remote versions via updatechecker
/opt/pihole/updatecheck.sh
else
echo " ${CROSS} Requested branch \"${2}\" is not available"
ftlbranches=( $(git ls-remote https://github.com/pi-hole/ftl | grep 'heads' | sed 's/refs\/heads\///;s/ //g' | awk '{print $2}') )
echo -e " ${INFO} Available branches for FTL are:"
for e in "${ftlbranches[@]}"; do echo " - $e"; done
# Check if requested branch is available
echo -e " ${INFO} Checking for availability of branch ${COL_CYAN}${2}${COL_NC} on GitHub"
mapfile -t ftlbranches < <(git ls-remote https://github.com/pi-hole/ftl | grep "refs/heads" | cut -d'/' -f3- -)
# If returned array is empty -> connectivity issue
if [[ ${#ftlbranches[@]} -eq 0 ]]; then
echo -e " ${CROSS} Unable to fetch branches from GitHub. Please check your Internet connection and try again later."
exit 1
fi
for e in "${ftlbranches[@]}"; do [[ "$e" == "${2}" ]] && existing=true; done
if [[ "${existing}" == false ]]; then
echo -e " ${CROSS} Requested branch is not available\n"
echo -e " ${INFO} Available branches are:"
for e in "${ftlbranches[@]}"; do echo " - $e"; done
exit 1
fi
echo -e " ${TICK} Branch ${2} exists on GitHub"
echo -e " ${INFO} Checking for ${COL_YELLOW}${binary}${COL_NC} binary on https://ftl.pi-hole.net"
if check_download_exists "$path"; then
echo " ${TICK} Binary exists"
echo "${2}" > /etc/pihole/ftlbranch
chmod 644 /etc/pihole/ftlbranch
echo -e " ${INFO} Switching to branch: ${COL_CYAN}${2}${COL_NC} from ${COL_CYAN}${oldbranch}${COL_NC}"
FTLinstall "${binary}"
restart_service pihole-FTL
enable_service pihole-FTL
str="Restarting FTL..."
echo -ne " ${INFO} ${str}"
# Wait until name resolution is working again after restarting FTL,
# so that the updatechecker can run successfully and does not fail
# trying to resolve github.com
until getent hosts github.com &> /dev/null; do
# Append one dot for each second waiting
str="${str}."
echo -ne " ${OVER} ${INFO} ${str}"
sleep 1
done
echo -e " ${OVER} ${TICK} Restarted FTL service"
# Update local and remote versions via updatechecker
/opt/pihole/updatecheck.sh
else
local status
status=$?
if [ $status -eq 1 ]; then
# Binary for requested branch is not available, may still be
# int he process of being built or CI build job failed
printf " %b Binary for requested branch is not available, please try again later.\\n" "${CROSS}"
printf " If the issue persists, please contact Pi-hole Support and ask them to re-generate the binary.\\n"
exit 1
elif [ $status -eq 2 ]; then
printf " %b Unable to download from ftl.pi-hole.net. Please check your Internet connection and try again later.\\n" "${CROSS}"
exit 1
else
printf " %b Unknown checkout error. Please contact Pi-hole Support\\n" "${CROSS}"
exit 1
fi
fi
else
echo -e " ${INFO} Requested option \"${1}\" is not available"
echo -e " ${CROSS} Requested option \"${1}\" is not available"
exit 1
fi
# Force updating everything
if [[ ! "${1}" == "web" && ! "${1}" == "ftl" ]]; then
echo -e " ${INFO} Running installer to upgrade your installation"
if "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh" --unattended; then
if "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh" --unattended ${additionalFlag}; then
exit 0
else
echo -e " ${COL_LIGHT_RED} Error: Unable to complete update, please contact support${COL_NC}"
echo -e " ${COL_RED} Error: Unable to complete update, please contact support${COL_NC}"
exit 1
fi
fi

File diff suppressed because it is too large Load Diff

View File

@@ -9,67 +9,68 @@
# Please see LICENSE file for your rights under this license.
colfile="/opt/pihole/COL_TABLE"
# shellcheck source="./advanced/Scripts/COL_TABLE"
source ${colfile}
# In case we're running at the same time as a system logrotate, use a
# separate logrotate state file to prevent stepping on each other's
# toes.
STATEFILE="/var/lib/logrotate/pihole"
readonly PI_HOLE_SCRIPT_DIR="/opt/pihole"
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
# shellcheck source="./advanced/Scripts/utils.sh"
source "${utilsfile}"
# Determine database location
# Obtain DBFILE=... setting from pihole-FTL.db
# Constructed to return nothing when
# a) the setting is not present in the config file, or
# b) the setting is commented out (e.g. "#DBFILE=...")
FTLconf="/etc/pihole/pihole-FTL.conf"
if [ -e "$FTLconf" ]; then
DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' ${FTLconf})"
fi
# Test for empty string. Use standard path in this case.
DBFILE=$(getFTLConfigValue "files.database")
if [ -z "$DBFILE" ]; then
DBFILE="/etc/pihole/pihole-FTL.db"
fi
if [[ "$@" != *"quiet"* ]]; then
echo -ne " ${INFO} Flushing /var/log/pihole/pihole.log ..."
# Determine log file location
LOGFILE=$(getFTLConfigValue "files.log.dnsmasq")
if [ -z "$LOGFILE" ]; then
LOGFILE="/var/log/pihole/pihole.log"
fi
if [[ "$@" == *"once"* ]]; then
# Nightly logrotation
if command -v /usr/sbin/logrotate >/dev/null; then
# Logrotate once
/usr/sbin/logrotate --force --state "${STATEFILE}" /etc/pihole/logrotate
else
# Copy pihole.log over to pihole.log.1
# and empty out pihole.log
# Note that moving the file is not an option, as
# dnsmasq would happily continue writing into the
# moved file (it will have the same file handler)
cp -p /var/log/pihole/pihole.log /var/log/pihole/pihole.log.1
echo " " > /var/log/pihole/pihole.log
chmod 640 /var/log/pihole/pihole.log
fi
else
# Manual flushing
if command -v /usr/sbin/logrotate >/dev/null; then
# Logrotate twice to move all data out of sight of FTL
/usr/sbin/logrotate --force --state "${STATEFILE}" /etc/pihole/logrotate; sleep 3
/usr/sbin/logrotate --force --state "${STATEFILE}" /etc/pihole/logrotate
else
# Flush both pihole.log and pihole.log.1 (if existing)
echo " " > /var/log/pihole/pihole.log
if [ -f /var/log/pihole/pihole.log.1 ]; then
echo " " > /var/log/pihole/pihole.log.1
chmod 640 /var/log/pihole/pihole.log.1
fi
fi
# Delete most recent 24 hours from FTL's database, leave even older data intact (don't wipe out all history)
deleted=$(pihole-FTL sqlite3 "${DBFILE}" "DELETE FROM query_storage WHERE timestamp >= strftime('%s','now')-86400; select changes() from query_storage limit 1")
# Restart pihole-FTL to force reloading history
sudo pihole restartdns
FTLFILE=$(getFTLConfigValue "files.log.ftl")
if [ -z "$FTLFILE" ]; then
FTLFILE="/var/log/pihole/FTL.log"
fi
WEBFILE=$(getFTLConfigValue "files.log.webserver")
if [ -z "$WEBFILE" ]; then
WEBFILE="/var/log/pihole/webserver.log"
fi
if [[ "$@" != *"quiet"* ]]; then
echo -e "${OVER} ${TICK} Flushed /var/log/pihole/pihole.log"
echo -e " ${TICK} Deleted ${deleted} queries from database"
# Helper function to handle log flushing for a single file
flush_log() {
local logfile="$1"
if [[ "$*" != *"quiet"* ]]; then
echo -ne " ${INFO} Flushing ${logfile} ..."
fi
echo " " > "${logfile}"
chmod 640 "${logfile}"
if [ -f "${logfile}.1" ]; then
echo " " > "${logfile}.1"
chmod 640 "${logfile}.1"
fi
if [[ "$*" != *"quiet"* ]]; then
echo -e "${OVER} ${TICK} Flushed ${logfile} ..."
fi
}
# Manual flushing
flush_log "${LOGFILE}"
flush_log "${FTLFILE}"
flush_log "${WEBFILE}"
if [[ "$*" != *"quiet"* ]]; then
echo -ne " ${INFO} Flushing database, DNS resolution temporarily unavailable ..."
fi
# Stop FTL to make sure it doesn't write to the database while we're deleting data
service pihole-FTL stop
# Delete most recent 24 hours from FTL's database, leave even older data intact (don't wipe out all history)
deleted=$(pihole-FTL sqlite3 -ni "${DBFILE}" "DELETE FROM query_storage WHERE timestamp >= strftime('%s','now')-86400; select changes() from query_storage limit 1")
# Restart FTL
service pihole-FTL restart
if [[ "$*" != *"quiet"* ]]; then
echo -e "${OVER} ${TICK} Deleted ${deleted} queries from long-term query database"
fi

View File

@@ -0,0 +1,72 @@
#!/usr/bin/env bash
# Pi-hole: A black hole for Internet advertisements
# (c) 2025 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Rotate Pi-hole's log file
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
colfile="/opt/pihole/COL_TABLE"
# shellcheck source="./advanced/Scripts/COL_TABLE"
source ${colfile}
readonly PI_HOLE_SCRIPT_DIR="/opt/pihole"
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
# shellcheck source="./advanced/Scripts/utils.sh"
source "${utilsfile}"
# In case we're running at the same time as a system logrotate, use a
# separate logrotate state file to prevent stepping on each other's
# toes.
STATEFILE="/var/lib/logrotate/pihole"
# Determine log file location
LOGFILE=$(getFTLConfigValue "files.log.dnsmasq")
if [ -z "$LOGFILE" ]; then
LOGFILE="/var/log/pihole/pihole.log"
fi
FTLFILE=$(getFTLConfigValue "files.log.ftl")
if [ -z "$FTLFILE" ]; then
FTLFILE="/var/log/pihole/FTL.log"
fi
WEBFILE=$(getFTLConfigValue "files.log.webserver")
if [ -z "$WEBFILE" ]; then
WEBFILE="/var/log/pihole/webserver.log"
fi
# Helper function to handle log rotation for a single file
rotate_log() {
# This function copies x.log over to x.log.1
# and then empties x.log
# Note that moving the file is not an option, as
# dnsmasq would happily continue writing into the
# moved file (it will have the same file handler)
local logfile="$1"
if [[ "$*" != *"quiet"* ]]; then
echo -ne " ${INFO} Rotating ${logfile} ..."
fi
cp -p "${logfile}" "${logfile}.1"
echo " " > "${logfile}"
chmod 640 "${logfile}"
if [[ "$*" != *"quiet"* ]]; then
echo -e "${OVER} ${TICK} Rotated ${logfile} ..."
fi
}
# Nightly logrotation
if command -v /usr/sbin/logrotate >/dev/null; then
# Logrotate once
if [[ "$*" != *"quiet"* ]]; then
echo -ne " ${INFO} Running logrotate ..."
fi
mkdir -p "${STATEFILE%/*}"
/usr/sbin/logrotate --force --state "${STATEFILE}" /etc/pihole/logrotate
else
# Handle rotation for each log file
rotate_log "${LOGFILE}"
rotate_log "${FTLFILE}"
rotate_log "${WEBFILE}"
fi

View File

@@ -0,0 +1,84 @@
#!/usr/bin/env bash
# Pi-hole: A black hole for Internet advertisements
# (c) 2019 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Network table flush
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
coltable="/opt/pihole/COL_TABLE"
if [[ -f ${coltable} ]]; then
# shellcheck source="./advanced/Scripts/COL_TABLE"
source ${coltable}
fi
PI_HOLE_SCRIPT_DIR="/opt/pihole"
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
# shellcheck source=./advanced/Scripts/utils.sh
source "${utilsfile}"
# Source api functions
# shellcheck source="./advanced/Scripts/api.sh"
. "${PI_HOLE_SCRIPT_DIR}/api.sh"
flushNetwork(){
local output
echo -ne " ${INFO} Flushing network table ..."
local data status error
# Authenticate with FTL
LoginAPI
# send query again
data=$(PostFTLData "action/flush/network" "" "status")
# Separate the status from the data
status=$(printf %s "${data#"${data%???}"}")
data=$(printf %s "${data%???}")
# If there is an .error object in the returned data, display it
local error
error=$(jq --compact-output <<< "${data}" '.error')
if [[ $error != "null" && $error != "" ]]; then
echo -e "${OVER} ${CROSS} Failed to flush the network table:"
echo -e " $(jq <<< "${data}" '.error')"
LogoutAPI
exit 1
elif [[ "${status}" == "200" ]]; then
echo -e "${OVER} ${TICK} Flushed network table"
fi
# Delete session
LogoutAPI
}
flushArp(){
# Flush ARP cache of the host
if ! output=$(ip -s -s neigh flush all 2>&1); then
echo -e "${OVER} ${CROSS} Failed to flush ARP cache"
echo " Output: ${output}"
return 1
fi
}
# Process all options (if present)
while [ "$#" -gt 0 ]; do
case "$1" in
"--arp" ) doARP=true ;;
esac
shift
done
flushNetwork
if [[ "${doARP}" == true ]]; then
echo -ne " ${INFO} Flushing ARP cache"
if flushArp; then
echo -e "${OVER} ${TICK} Flushed ARP cache"
fi
fi

View File

@@ -1,274 +1,144 @@
#!/usr/bin/env bash
# shellcheck disable=SC1090
#!/usr/bin/env sh
# Pi-hole: A black hole for Internet advertisements
# (c) 2018 Pi-hole, LLC (https://pi-hole.net)
# (c) 2023 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Query Domain Lists
# Search Adlists
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
# Globals
piholeDir="/etc/pihole"
GRAVITYDB="${piholeDir}/gravity.db"
options="$*"
all=""
exact=""
matchType="match"
# Source pihole-FTL from install script
pihole_FTL="${piholeDir}/pihole-FTL.conf"
if [[ -f "${pihole_FTL}" ]]; then
source "${pihole_FTL}"
fi
# Set this only after sourcing pihole-FTL.conf as the gravity database path may
# have changed
gravityDBfile="${GRAVITYDB}"
PI_HOLE_INSTALL_DIR="/opt/pihole"
max_results="20"
partial="false"
domain=""
# Source color table
colfile="/opt/pihole/COL_TABLE"
source "${colfile}"
# shellcheck source="./advanced/Scripts/COL_TABLE"
. "${colfile}"
if [[ "${options}" == "-h" ]] || [[ "${options}" == "--help" ]]; then
# Source api functions
# shellcheck source="./advanced/Scripts/api.sh"
. "${PI_HOLE_INSTALL_DIR}/api.sh"
Help() {
echo "Usage: pihole -q [option] <domain>
Example: 'pihole -q -exact domain.com'
Example: 'pihole -q --partial domain.com'
Query the adlists for a specified domain
Options:
-exact Search the adlists for exact domain matches
-all Return all query matches within the adlists
-h, --help Show this help dialog"
exit 0
fi
--partial Search the adlists for partially matching domains
--all Return all query matches within the adlists
-h, --help Show this help dialog"
exit 0
}
# Handle valid options
[[ "${options}" == *"-all"* ]] && all=true
if [[ "${options}" == *"-exact"* ]]; then
exact="exact"; matchType="exact ${matchType}"
fi
GenerateOutput() {
local counts data num_gravity num_lists search_type_str
local gravity_data_csv lists_data_csv line url type color
data="${1}"
# Strip valid options, leaving only the domain and invalid options
# This allows users to place the options before or after the domain
options=$(sed -E 's/ ?-(all|exact) ?//g' <<< "${options}")
# Get count of list and gravity matches
# Use JQ to count number of entries in lists and gravity
# (output is number of list matches then number of gravity matches)
counts=$(printf %s "${data}" | jq --raw-output '(.search.domains | length), (.search.gravity | group_by(.address,.type) | length)')
num_lists=$(echo "$counts" | sed -n '1p')
num_gravity=$(echo "$counts" | sed -n '2p')
# Handle remaining options
# If $options contain non ASCII characters, convert to punycode
case "${options}" in
"" ) str="No domain specified";;
*" "* ) str="Unknown query option specified";;
*[![:ascii:]]* ) rawDomainQuery=$(idn2 "${options}");;
* ) rawDomainQuery="${options}";;
esac
if [ "${partial}" = true ]; then
search_type_str="partially"
else
search_type_str="exactly"
fi
# convert the domain to lowercase
domainQuery=$(echo "${rawDomainQuery}" | tr '[:upper:]' '[:lower:]')
# Results from allow/deny list
printf "%s\n\n" "Found ${num_lists} domains ${search_type_str} matching '${COL_BLUE}${domain}${COL_NC}'."
if [ "${num_lists}" -gt 0 ]; then
# Convert the data to a csv, each line is a "domain,type" string
# not using jq's @csv here as it quotes each value individually
lists_data_csv=$(printf %s "${data}" | jq --raw-output '.search.domains | map([.domain, .type] | join(",")) | join("\n")')
if [[ -n "${str:-}" ]]; then
echo -e "${str}${COL_NC}\\nTry 'pihole -q --help' for more information."
exit 1
fi
# Generate output for each csv line, separating line in a domain and type substring at the ','
echo "${lists_data_csv}" | while read -r line; do
printf "%s\n\n" " - ${COL_GREEN}${line%,*}${COL_NC} (type: exact ${line#*,} domain)"
done
fi
# Scan an array of files for matching strings
scanList(){
# Escape full stops
local domain="${1}" esc_domain="${1//./\\.}" lists="${2}" list_type="${3:-}"
# Results from gravity
printf "%s\n\n" "Found ${num_gravity} lists ${search_type_str} matching '${COL_BLUE}${domain}${COL_NC}'."
if [ "${num_gravity}" -gt 0 ]; then
# Convert the data to a csv, each line is a "URL,type,domain,domain,...." string
# not using jq's @csv here as it quotes each value individually
gravity_data_csv=$(printf %s "${data}" | jq --raw-output '.search.gravity | group_by(.address,.type) | map([.[0].address, .[0].type, (.[] | .domain)] | join(",")) | join("\n")')
# Prevent grep from printing file path
cd "$piholeDir" || exit 1
# Generate line-by-line output for each csv line
echo "${gravity_data_csv}" | while read -r line; do
# Get first part of the line, the URL
url=${line%%,*}
# Prevent grep -i matching slowly: https://bit.ly/2xFXtUX
export LC_CTYPE=C
# cut off URL, leaving "type,domain,domain,...."
line=${line#*,}
type=${line%%,*}
# type == "block" -> red, type == "allow" -> green
if [ "${type}" = "block" ]; then
color="${COL_RED}"
else
color="${COL_GREEN}"
fi
# /dev/null forces filename to be printed when only one list has been generated
case "${list_type}" in
"exact" ) grep -i -E -l "(^|(?<!#)\\s)${esc_domain}($|\\s|#)" "${lists}" /dev/null 2>/dev/null;;
# Iterate through each regexp and check whether it matches the domainQuery
# If it does, print the matching regexp and continue looping
# Input 1 - regexps | Input 2 - domainQuery
"regex" )
for list in ${lists}; do
if [[ "${domain}" =~ ${list} ]]; then
printf "%b\n" "${list}";
fi
done;;
* ) grep -i "${esc_domain}" "${lists}" /dev/null 2>/dev/null;;
# print adlist URL
printf "%s (%s)\n\n" " - ${COL_BLUE}${url}${COL_NC}" "${color}${type}${COL_NC}"
# cut off type, leaving "domain,domain,...."
line=${line#*,}
# Replace commas with newlines and format output
echo "${line}" | sed 's/,/\n/g' | sed "s/^/ - ${COL_GREEN}/" | sed "s/$/${COL_NC}/"
printf "\n\n"
done
fi
# If no exact results were found, suggest using partial matching
if [ "${num_lists}" -eq 0 ] && [ "${num_gravity}" -eq 0 ] && [ "${partial}" = false ]; then
printf "%s\n" "Hint: Try partial matching with"
printf "%s\n\n" " ${COL_GREEN}pihole -q --partial ${domain}${COL_NC}"
fi
}
Main() {
local data
if [ -z "${domain}" ]; then
echo "No domain specified"
exit 1
fi
# domains are lowercased and converted to punycode by FTL since
# https://github.com/pi-hole/FTL/pull/1715
# no need to do it here
# Authenticate with FTL
LoginAPI
# send query again
data=$(GetFTLData "search/${domain}?N=${max_results}&partial=${partial}")
GenerateOutput "${data}"
# Delete session
LogoutAPI
}
# Process all options (if present)
while [ "$#" -gt 0 ]; do
case "$1" in
"-h" | "--help") Help ;;
"--partial") partial="true" ;;
"--all") max_results=10000 ;; # hard-coded FTL limit
*) domain=$1 ;;
esac
}
scanDatabaseTable() {
local domain table list_type querystr result extra abpquerystr abpfound abpentry searchstr
domain="$(printf "%q" "${1}")"
table="${2}"
list_type="${3:-}"
# As underscores are legitimate parts of domains, we escape them when using the LIKE operator.
# Underscores are SQLite wildcards matching exactly one character. We obviously want to suppress this
# behavior. The "ESCAPE '\'" clause specifies that an underscore preceded by an '\' should be matched
# as a literal underscore character. We pretreat the $domain variable accordingly to escape underscores.
if [[ "${table}" == "gravity" ]]; then
# Are there ABP entries on gravity?
# Return 1 if abp_domain=1 or Zero if abp_domain=0 or not set
abpquerystr="SELECT EXISTS (SELECT 1 FROM info WHERE property='abp_domains' and value='1')"
abpfound="$(pihole-FTL sqlite3 "${gravityDBfile}" "${abpquerystr}")" 2> /dev/null
# Create search string for ABP entries only if needed
if [ "${abpfound}" -eq 1 ]; then
abpentry="${domain}"
searchstr="'||${abpentry}^'"
# While a dot is found ...
while [ "${abpentry}" != "${abpentry/./}" ]
do
# ... remove text before the dot (including the dot) and append the result to $searchstr
abpentry=$(echo "${abpentry}" | cut -f 2- -d '.')
searchstr="$searchstr, '||${abpentry}^'"
done
# The final search string will look like:
# "domain IN ('||sub2.sub1.domain.com^', '||sub1.domain.com^', '||domain.com^', '||com^') OR"
searchstr="domain IN (${searchstr}) OR "
fi
case "${exact}" in
"exact" ) querystr="SELECT gravity.domain,adlist.address,adlist.enabled FROM gravity LEFT JOIN adlist ON adlist.id = gravity.adlist_id WHERE domain = '${domain}'";;
* ) querystr="SELECT gravity.domain,adlist.address,adlist.enabled FROM gravity LEFT JOIN adlist ON adlist.id = gravity.adlist_id WHERE ${searchstr} domain LIKE '%${domain//_/\\_}%' ESCAPE '\\'";;
esac
else
case "${exact}" in
"exact" ) querystr="SELECT domain,enabled FROM domainlist WHERE type = '${list_type}' AND domain = '${domain}'";;
* ) querystr="SELECT domain,enabled FROM domainlist WHERE type = '${list_type}' AND domain LIKE '%${domain//_/\\_}%' ESCAPE '\\'";;
esac
fi
# Send prepared query to gravity database
result="$(pihole-FTL sqlite3 -separator ',' "${gravityDBfile}" "${querystr}")" 2> /dev/null
if [[ -z "${result}" ]]; then
# Return early when there are no matches in this table
return
fi
if [[ "${table}" == "gravity" ]]; then
echo "${result}"
return
fi
# Mark domain as having been white-/blacklist matched (global variable)
wbMatch=true
# Print table name
echo " ${matchType^} found in ${COL_BOLD}exact ${table}${COL_NC}"
# Loop over results and print them
mapfile -t results <<< "${result}"
for result in "${results[@]}"; do
domain="${result/,*}"
if [[ "${result#*,}" == "0" ]]; then
extra=" (disabled)"
else
extra=""
fi
echo " ${domain}${extra}"
done
}
scanRegexDatabaseTable() {
local domain list list_type
domain="${1}"
list="${2}"
list_type="${3:-}"
# Query all regex from the corresponding database tables
mapfile -t regexList < <(pihole-FTL sqlite3 "${gravityDBfile}" "SELECT domain FROM domainlist WHERE type = ${list_type}" 2> /dev/null)
# If we have regexps to process
if [[ "${#regexList[@]}" -ne 0 ]]; then
# Split regexps over a new line
str_regexList=$(printf '%s\n' "${regexList[@]}")
# Check domain against regexps
mapfile -t regexMatches < <(scanList "${domain}" "${str_regexList}" "regex")
# If there were regex matches
if [[ "${#regexMatches[@]}" -ne 0 ]]; then
# Split matching regexps over a new line
str_regexMatches=$(printf '%s\n' "${regexMatches[@]}")
# Form a "matched" message
str_message="${matchType^} found in ${COL_BOLD}regex ${list}${COL_NC}"
# Form a "results" message
str_result="${COL_BOLD}${str_regexMatches}${COL_NC}"
# If we are displaying more than just the source of the block
# Set the wildcard match flag
wcMatch=true
# Echo the "matched" message, indented by one space
echo " ${str_message}"
# Echo the "results" message, each line indented by three spaces
# shellcheck disable=SC2001
echo "${str_result}" | sed 's/^/ /'
fi
fi
}
# Scan Whitelist and Blacklist
scanDatabaseTable "${domainQuery}" "whitelist" "0"
scanDatabaseTable "${domainQuery}" "blacklist" "1"
# Scan Regex table
scanRegexDatabaseTable "${domainQuery}" "whitelist" "2"
scanRegexDatabaseTable "${domainQuery}" "blacklist" "3"
# Query block lists
mapfile -t results <<< "$(scanDatabaseTable "${domainQuery}" "gravity")"
# Handle notices
if [[ -z "${wbMatch:-}" ]] && [[ -z "${wcMatch:-}" ]] && [[ -z "${results[*]}" ]]; then
echo -e " ${INFO} No ${exact/t/t }results found for ${COL_BOLD}${domainQuery}${COL_NC} within the adlists"
exit 0
elif [[ -z "${results[*]}" ]]; then
# Result found in WL/BL/Wildcards
exit 0
elif [[ -z "${all}" ]] && [[ "${#results[*]}" -ge 100 ]]; then
echo -e " ${INFO} Over 100 ${exact/t/t }results found for ${COL_BOLD}${domainQuery}${COL_NC}
This can be overridden using the -all option"
exit 0
fi
# Print "Exact matches for" title
if [[ -n "${exact}" ]]; then
plural=""; [[ "${#results[*]}" -gt 1 ]] && plural="es"
echo " ${matchType^}${plural} for ${COL_BOLD}${domainQuery}${COL_NC} found in:"
fi
for result in "${results[@]}"; do
match="${result/,*/}"
extra="${result#*,}"
adlistAddress="${extra/,*/}"
extra="${extra#*,}"
if [[ "${extra}" == "0" ]]; then
extra=" (disabled)"
else
extra=""
fi
if [[ -n "${exact}" ]]; then
echo " - ${adlistAddress}${extra}"
else
if [[ ! "${adlistAddress}" == "${adlistAddress_prev:-}" ]]; then
count=""
echo " ${matchType^} found in ${COL_BOLD}${adlistAddress}${COL_NC}:"
adlistAddress_prev="${adlistAddress}"
fi
: $((count++))
# Print matching domain if $max_count has not been reached
[[ -z "${all}" ]] && max_count="50"
if [[ -z "${all}" ]] && [[ "${count}" -ge "${max_count}" ]]; then
[[ "${count}" -gt "${max_count}" ]] && continue
echo " ${COL_GRAY}Over ${count} results found, skipping rest of file${COL_NC}"
else
echo " ${match}${extra}"
fi
fi
shift
done
exit 0
Main "${domain}"

View File

@@ -11,37 +11,45 @@
# Please see LICENSE file for your rights under this license.
# Variables
readonly ADMIN_INTERFACE_GIT_URL="https://github.com/pi-hole/AdminLTE.git"
readonly ADMIN_INTERFACE_DIR="/var/www/html/admin"
readonly ADMIN_INTERFACE_GIT_URL="https://github.com/pi-hole/web.git"
readonly PI_HOLE_GIT_URL="https://github.com/pi-hole/pi-hole.git"
readonly PI_HOLE_FILES_DIR="/etc/.pihole"
# shellcheck disable=SC2034
SKIP_INSTALL=true
# when --check-only is passed to this script, it will not perform the actual update
CHECK_ONLY=false
# shellcheck disable=SC1090
# shellcheck source="./automated install/basic-install.sh"
source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh"
# shellcheck disable=SC1091
# shellcheck source=./advanced/Scripts/COL_TABLE
source "/opt/pihole/COL_TABLE"
# shellcheck source="./advanced/Scripts/utils.sh"
source "${PI_HOLE_INSTALL_DIR}/utils.sh"
# is_repo() sourced from basic-install.sh
# make_repo() sourced from basic-install.sh
# update_repo() source from basic-install.sh
# getGitFiles() sourced from basic-install.sh
# FTLcheckUpdate() sourced from basic-install.sh
# getFTLConfigValue() sourced from utils.sh
# Honour configured paths for the web application.
ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome")
readonly ADMIN_INTERFACE_DIR
GitCheckUpdateAvail() {
local directory
local curBranch
directory="${1}"
curdir=$PWD
cd "${directory}" || return
cd "${directory}" || exit 1
# Fetch latest changes in this repo
git fetch --quiet origin
if ! git fetch --quiet origin ; then
echo -e "\\n ${COL_RED}Error: Unable to update local repository. Contact Pi-hole Support.${COL_NC}"
exit 1
fi
# Check current branch. If it is master, then check for the latest available tag instead of latest commit.
curBranch=$(git rev-parse --abbrev-ref HEAD)
@@ -68,20 +76,20 @@ GitCheckUpdateAvail() {
if [[ "${#LOCAL}" == 0 ]]; then
echo -e "\\n ${COL_LIGHT_RED}Error: Local revision could not be obtained, please contact Pi-hole Support"
echo -e "\\n ${COL_RED}Error: Local revision could not be obtained, please contact Pi-hole Support"
echo -e " Additional debugging output:${COL_NC}"
git status
exit
exit 1
fi
if [[ "${#REMOTE}" == 0 ]]; then
echo -e "\\n ${COL_LIGHT_RED}Error: Remote revision could not be obtained, please contact Pi-hole Support"
echo -e "\\n ${COL_RED}Error: Remote revision could not be obtained, please contact Pi-hole Support"
echo -e " Additional debugging output:${COL_NC}"
git status
exit
exit 1
fi
# Change back to original directory
cd "${curdir}" || exit
cd "${curdir}" || exit 1
if [[ "${LOCAL}" != "${REMOTE}" ]]; then
# Local branch is behind remote branch -> Update
@@ -94,8 +102,52 @@ GitCheckUpdateAvail() {
fi
}
updateWarnDialog() {
# Display the warning dialog
local core_str web_str ftl_str
if [[ "${core_update}" == true ]]; then
core_str="Core: \\Zb\\Z1update available\\Zn"
else
core_str="Core: \\Zb\\Z4up to date\\Zn"
fi
if [[ "${web_update}" == true ]]; then
web_str="Web: \\Zb\\Z1update available\\Zn"
else
web_str="Web: \\Zb\\Z4up to date\\Zn"
fi
if [[ "${FTL_update}" == true ]]; then
ftl_str="FTL: \\Zb\\Z1update available\\Zn"
else
ftl_str="FTL: \\Zb\\Z4up to date\\Zn"
fi
# shellcheck disable=SC2154 # Variables "${r}" "${c}" are defined in the main script
dialog --no-shadow --clear --keep-tite \
--colors \
--backtitle "Updating Pi-hole" \
--title "Warning" \
--no-button "Exit" --yes-button "Continue" \
--defaultno \
--yesno "\\nThe following Pi-hole components are going to be updated.\\n\\n\\n\
$core_str\\n\
$web_str\\n\
$ftl_str\\n\\n\\n\
\\Zb\\Z1IMPORTANT:\\Zn Make a (teleporter) backup of your system!\\n\\n\
Updates can come with significant changes. Please read the changelog at https://pi-hole.net/blog carefully.\\n\\n\\n\
Please confirm you want to start the update process." \
"${r}" "${c}" && result=0 || result="$?"
case "${result}" in
"${DIALOG_CANCEL}" | "${DIALOG_ESC}")
printf " %b User canceled the update process.\\n" "${INFO}"
exit 1
;;
esac
}
main() {
local basicError="\\n ${COL_LIGHT_RED}Unable to complete update, please contact Pi-hole Support${COL_NC}"
local basicError="\\n ${COL_RED}Unable to complete update, please contact Pi-hole Support${COL_NC}"
local core_update
local web_update
local FTL_update
@@ -104,16 +156,15 @@ main() {
web_update=false
FTL_update=false
# shellcheck disable=1090,2154
source "${setupVars}"
# Install packages used by this installation script (necessary if users have removed e.g. git from their systems)
package_manager_detect
install_dependent_packages "${INSTALLER_DEPS[@]}"
build_dependency_package
install_dependent_packages
# This is unlikely
if ! is_repo "${PI_HOLE_FILES_DIR}" ; then
echo -e "\\n ${COL_LIGHT_RED}Error: Core Pi-hole repo is missing from system!"
echo -e "\\n ${COL_RED}Error: Core Pi-hole repo is missing from system!"
echo -e " Please re-run install script from https://pi-hole.net${COL_NC}"
exit 1;
fi
@@ -125,44 +176,54 @@ main() {
echo -e " ${INFO} Pi-hole Core:\\t${COL_YELLOW}update available${COL_NC}"
else
core_update=false
echo -e " ${INFO} Pi-hole Core:\\t${COL_LIGHT_GREEN}up to date${COL_NC}"
echo -e " ${INFO} Pi-hole Core:\\t${COL_GREEN}up to date${COL_NC}"
fi
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
if ! is_repo "${ADMIN_INTERFACE_DIR}" ; then
echo -e "\\n ${COL_LIGHT_RED}Error: Web Admin repo is missing from system!"
echo -e " Please re-run install script from https://pi-hole.net${COL_NC}"
exit 1;
fi
if GitCheckUpdateAvail "${ADMIN_INTERFACE_DIR}" ; then
web_update=true
echo -e " ${INFO} Web Interface:\\t${COL_YELLOW}update available${COL_NC}"
else
web_update=false
echo -e " ${INFO} Web Interface:\\t${COL_LIGHT_GREEN}up to date${COL_NC}"
fi
if ! is_repo "${ADMIN_INTERFACE_DIR}" ; then
echo -e "\\n ${COL_RED}Error: Web Admin repo is missing from system!"
echo -e " Please re-run install script from https://pi-hole.net${COL_NC}"
exit 1;
fi
local funcOutput
funcOutput=$(get_binary_name) #Store output of get_binary_name here
local binary
binary="pihole-FTL${funcOutput##*pihole-FTL}" #binary name will be the last line of the output of get_binary_name (it always begins with pihole-FTL)
if FTLcheckUpdate "${binary}" > /dev/null; then
FTL_update=true
echo -e " ${INFO} FTL:\\t\\t${COL_YELLOW}update available${COL_NC}"
if GitCheckUpdateAvail "${ADMIN_INTERFACE_DIR}" ; then
web_update=true
echo -e " ${INFO} Web Interface:\\t${COL_YELLOW}update available${COL_NC}"
else
case $? in
1)
echo -e " ${INFO} FTL:\\t\\t${COL_LIGHT_GREEN}up to date${COL_NC}"
;;
2)
echo -e " ${INFO} FTL:\\t\\t${COL_LIGHT_RED}Branch is not available.${COL_NC}\\n\\t\\t\\tUse ${COL_LIGHT_GREEN}pihole checkout ftl [branchname]${COL_NC} to switch to a valid branch."
;;
*)
echo -e " ${INFO} FTL:\\t\\t${COL_LIGHT_RED}Something has gone wrong, contact support${COL_NC}"
esac
web_update=false
echo -e " ${INFO} Web Interface:\\t${COL_GREEN}up to date${COL_NC}"
fi
# Allow the user to skip this check if they are using a self-compiled FTL binary from an unsupported architecture
if [ "${skipFTL}" != true ]; then
local funcOutput
funcOutput=$(get_binary_name) #Store output of get_binary_name here
local binary
binary="pihole-FTL${funcOutput##*pihole-FTL}" #binary name will be the last line of the output of get_binary_name (it always begins with pihole-FTL)
if FTLcheckUpdate "${binary}" &>/dev/null; then
FTL_update=true
echo -e " ${INFO} FTL:\\t\\t${COL_YELLOW}update available${COL_NC}"
else
case $? in
1)
echo -e " ${INFO} FTL:\\t\\t${COL_GREEN}up to date${COL_NC}"
;;
2)
echo -e " ${INFO} FTL:\\t\\t${COL_RED}Branch is not available.${COL_NC}\\n\\t\\t\\tUse ${COL_GREEN}pihole checkout ftl [branchname]${COL_NC} to switch to a valid branch."
exit 1
;;
3)
echo -e " ${INFO} FTL:\\t\\t${COL_RED}Something has gone wrong, cannot reach download server${COL_NC}"
exit 1
;;
*)
echo -e " ${INFO} FTL:\\t\\t${COL_RED}Something has gone wrong, contact support${COL_NC}"
exit 1
esac
FTL_update=false
fi
else
echo -e " ${INFO} FTL:\\t\\t${COL_YELLOW}--skipFTL set - update check skipped${COL_NC}"
FTL_update=false
fi
@@ -177,7 +238,7 @@ main() {
if [[ ! "${ftlBranch}" == "master" && ! "${ftlBranch}" == "development" ]]; then
# Notify user that they are on a custom branch which might mean they they are lost
# behind if a branch was merged to development and got abandoned
printf " %b %bWarning:%b You are using FTL from a custom branch (%s) and might be missing future releases.\\n" "${INFO}" "${COL_LIGHT_RED}" "${COL_NC}" "${ftlBranch}"
printf " %b %bWarning:%b You are using FTL from a custom branch (%s) and might be missing future releases.\\n" "${INFO}" "${COL_RED}" "${COL_NC}" "${ftlBranch}"
fi
if [[ "${core_update}" == false && "${web_update}" == false && "${FTL_update}" == false ]]; then
@@ -191,6 +252,11 @@ main() {
exit 0
fi
# if there is any update, show the warning dialog and ask for confirmation
if [[ "${core_update}" == true || "${web_update}" == true || "${FTL_update}" == true ]]; then
updateWarnDialog
fi
if [[ "${core_update}" == true ]]; then
echo ""
echo -e " ${INFO} Pi-hole core files out of date, updating local repo."
@@ -202,7 +268,7 @@ main() {
echo ""
echo -e " ${INFO} Pi-hole Web Admin files out of date, updating local repo."
getGitFiles "${ADMIN_INTERFACE_DIR}" "${ADMIN_INTERFACE_GIT_URL}"
echo -e " ${INFO} If you had made any changes in '/var/www/html/admin/', they have been stashed using 'git stash'"
echo -e " ${INFO} If you had made any changes in '${ADMIN_INTERFACE_DIR}', they have been stashed using 'git stash'"
fi
if [[ "${FTL_update}" == true ]]; then
@@ -211,7 +277,14 @@ main() {
fi
if [[ "${FTL_update}" == true || "${core_update}" == true ]]; then
${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --reconfigure --unattended || \
local addionalFlag
if [[ ${skipFTL} == true ]]; then
addionalFlag="--skipFTL"
else
addionalFlag=""
fi
${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --repair --unattended ${addionalFlag} || \
echo -e "${basicError}" && exit 1
fi
@@ -221,12 +294,25 @@ main() {
echo -e " ${INFO} Local version file information updated."
fi
# if there was only a web update, show the new versions
# (on core and FTL updates, this is done as part of the installer run)
if [[ "${web_update}" == true && "${FTL_update}" == false && "${core_update}" == false ]]; then
"${PI_HOLE_BIN_DIR}"/pihole version
fi
echo ""
exit 0
}
if [[ "$1" == "--check-only" ]]; then
CHECK_ONLY=true
fi
CHECK_ONLY=false
skipFTL=false
# Check arguments
for var in "$@"; do
case "$var" in
"--check-only") CHECK_ONLY=true ;;
"--skipFTL") skipFTL=true ;;
esac
done
main

View File

@@ -10,62 +10,66 @@
function get_local_branch() {
# Return active branch
cd "${1}" 2> /dev/null || return 1
git rev-parse --abbrev-ref HEAD || return 1
cd "${1}" 2>/dev/null || { echo "null"; return; }
git rev-parse --abbrev-ref HEAD || echo "null"
}
function get_local_version() {
# Return active version
cd "${1}" 2> /dev/null || return 1
git describe --tags --always 2> /dev/null || return 1
cd "${1}" 2>/dev/null || { echo "null"; return; }
git describe --tags --always 2>/dev/null || echo "null"
}
function get_local_hash() {
cd "${1}" 2> /dev/null || return 1
git rev-parse --short=8 HEAD || return 1
cd "${1}" 2>/dev/null || { echo "null"; return; }
git rev-parse --short=8 HEAD || echo "null"
}
function get_remote_version() {
curl -s "https://api.github.com/repos/pi-hole/${1}/releases/latest" 2> /dev/null | jq --raw-output .tag_name || return 1
# if ${2} is = "master" we need to use the "latest" endpoint, otherwise, we simply return null
if [[ "${2}" == "master" ]]; then
curl -s "https://api.github.com/repos/pi-hole/${1}/releases/latest" 2>/dev/null | jq --raw-output .tag_name || echo "null"
else
echo "null"
fi
}
function get_remote_hash(){
git ls-remote "https://github.com/pi-hole/${1}" --tags "${2}" | awk '{print substr($0, 0,8);}' || return 1
function get_remote_hash() {
git ls-remote "https://github.com/pi-hole/${1}" --tags "${2}" | awk '{print substr($0, 1,8);}' || echo "null"
}
# Source the setupvars config file
# shellcheck disable=SC1091
. /etc/pihole/setupVars.conf
# Source the utils file for addOrEditKeyValPair()
# shellcheck disable=SC1091
# shellcheck source="./advanced/Scripts/utils.sh"
. /opt/pihole/utils.sh
ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome")
readonly ADMIN_INTERFACE_DIR
# Remove the below three legacy files if they exist
rm -f "/etc/pihole/GitHubVersions"
rm -f "/etc/pihole/localbranches"
rm -f "/etc/pihole/localversions"
# Create new versions file if it does not exist
VERSION_FILE="/etc/pihole/versions"
touch "${VERSION_FILE}"
# Truncates the file to zero length if it exists to clear it up, otherwise creates an empty file.
truncate -s 0 "${VERSION_FILE}"
chmod 644 "${VERSION_FILE}"
# if /pihole.docker.tag file exists, we will use it's value later in this script
DOCKER_TAG=$(cat /pihole.docker.tag 2>/dev/null)
regex='^([0-9]+\.){1,2}(\*|[0-9]+)(-.*)?$|(^nightly$)|(^dev.*$)'
release_regex='^([0-9]+\.){1,2}(\*|[0-9]+)(-.*)?$'
regex=$release_regex'|(^nightly$)|(^dev.*$)'
if [[ ! "${DOCKER_TAG}" =~ $regex ]]; then
# DOCKER_TAG does not match the pattern (see https://regex101.com/r/RsENuz/1), so unset it.
unset DOCKER_TAG
# DOCKER_TAG does not match the pattern (see https://regex101.com/r/RsENuz/1), so unset it.
unset DOCKER_TAG
fi
# used in cronjob
if [[ "$1" == "reboot" ]]; then
sleep 30
sleep 30
fi
# get Core versions
CORE_VERSION="$(get_local_version /etc/.pihole)"
@@ -77,33 +81,28 @@ addOrEditKeyValPair "${VERSION_FILE}" "CORE_BRANCH" "${CORE_BRANCH}"
CORE_HASH="$(get_local_hash /etc/.pihole)"
addOrEditKeyValPair "${VERSION_FILE}" "CORE_HASH" "${CORE_HASH}"
GITHUB_CORE_VERSION="$(get_remote_version pi-hole)"
GITHUB_CORE_VERSION="$(get_remote_version pi-hole "${CORE_BRANCH}")"
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_CORE_VERSION" "${GITHUB_CORE_VERSION}"
GITHUB_CORE_HASH="$(get_remote_hash pi-hole "${CORE_BRANCH}")"
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_CORE_HASH" "${GITHUB_CORE_HASH}"
# get Web versions
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
WEB_VERSION="$(get_local_version "${ADMIN_INTERFACE_DIR}")"
addOrEditKeyValPair "${VERSION_FILE}" "WEB_VERSION" "${WEB_VERSION}"
WEB_VERSION="$(get_local_version /var/www/html/admin)"
addOrEditKeyValPair "${VERSION_FILE}" "WEB_VERSION" "${WEB_VERSION}"
WEB_BRANCH="$(get_local_branch "${ADMIN_INTERFACE_DIR}")"
addOrEditKeyValPair "${VERSION_FILE}" "WEB_BRANCH" "${WEB_BRANCH}"
WEB_BRANCH="$(get_local_branch /var/www/html/admin)"
addOrEditKeyValPair "${VERSION_FILE}" "WEB_BRANCH" "${WEB_BRANCH}"
WEB_HASH="$(get_local_hash "${ADMIN_INTERFACE_DIR}")"
addOrEditKeyValPair "${VERSION_FILE}" "WEB_HASH" "${WEB_HASH}"
WEB_HASH="$(get_local_hash /var/www/html/admin)"
addOrEditKeyValPair "${VERSION_FILE}" "WEB_HASH" "${WEB_HASH}"
GITHUB_WEB_VERSION="$(get_remote_version web "${WEB_BRANCH}")"
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_WEB_VERSION" "${GITHUB_WEB_VERSION}"
GITHUB_WEB_VERSION="$(get_remote_version AdminLTE)"
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_WEB_VERSION" "${GITHUB_WEB_VERSION}"
GITHUB_WEB_HASH="$(get_remote_hash AdminLTE "${WEB_BRANCH}")"
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_WEB_HASH" "${GITHUB_WEB_HASH}"
fi
GITHUB_WEB_HASH="$(get_remote_hash web "${WEB_BRANCH}")"
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_WEB_HASH" "${GITHUB_WEB_HASH}"
# get FTL versions
@@ -116,18 +115,23 @@ addOrEditKeyValPair "${VERSION_FILE}" "FTL_BRANCH" "${FTL_BRANCH}"
FTL_HASH="$(pihole-FTL --hash)"
addOrEditKeyValPair "${VERSION_FILE}" "FTL_HASH" "${FTL_HASH}"
GITHUB_FTL_VERSION="$(get_remote_version FTL)"
GITHUB_FTL_VERSION="$(get_remote_version FTL "${FTL_BRANCH}")"
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_FTL_VERSION" "${GITHUB_FTL_VERSION}"
GITHUB_FTL_HASH="$(get_remote_hash FTL "${FTL_BRANCH}")"
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_FTL_HASH" "${GITHUB_FTL_HASH}"
# get Docker versions
if [[ "${DOCKER_TAG}" ]]; then
addOrEditKeyValPair "${VERSION_FILE}" "DOCKER_VERSION" "${DOCKER_TAG}"
GITHUB_DOCKER_VERSION="$(get_remote_version docker-pi-hole)"
# Remote version check only if the tag is a valid release version
docker_branch=""
if [[ "${DOCKER_TAG}" =~ $release_regex ]]; then
docker_branch="master"
fi
GITHUB_DOCKER_VERSION="$(get_remote_version docker-pi-hole "${docker_branch}")"
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_DOCKER_VERSION" "${GITHUB_DOCKER_VERSION}"
fi

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env sh
# shellcheck disable=SC3043 #https://github.com/koalaman/shellcheck/wiki/SC3043#exceptions
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
@@ -31,9 +30,6 @@ addOrEditKeyValPair() {
local key="${2}"
local value="${3}"
# touch file to prevent grep error if file does not exist yet
touch "${file}"
if grep -q "^${key}=" "${file}"; then
# Key already exists in file, modify the value
sed -i "/^${key}=/c\\${key}=${value}" "${file}"
@@ -43,103 +39,6 @@ addOrEditKeyValPair() {
fi
}
#######################
# Takes two arguments: file and key.
# Adds a key to target file
#
# Example usage:
# addKey "/etc/dnsmasq.d/01-pihole.conf" "log-queries"
#######################
addKey(){
local file="${1}"
local key="${2}"
# touch file to prevent grep error if file does not exist yet
touch "${file}"
# Match key against entire line, using both anchors. We assume
# that the file's keys never have bounding whitespace. Anchors
# are necessary to ensure the key is considered absent when it
# is a substring of another key present in the file.
if ! grep -q "^${key}$" "${file}"; then
# Key does not exist, add it.
echo "${key}" >> "${file}"
fi
}
#######################
# Takes two arguments: file and key.
# Deletes a key or key/value pair from target file
#
# Example usage:
# removeKey "/etc/pihole/setupVars.conf" "PIHOLE_DNS_1"
#######################
removeKey() {
local file="${1}"
local key="${2}"
sed -i "/^${key}/d" "${file}"
}
#######################
# Takes two arguments: file and key.
# Returns the value of a given key from target file
# - ignores all commented lines
# - only returns the first value if multiple identical keys exist
#
#
# Example usage:
# getVal "/etc/pihole/setupVars.conf" "PIHOLE_DNS_1"
#######################
getVal() {
local file="${1}"
local key="${2}"
local value
value=$(sed -e '/^[[:blank:]]*#/d' "${file}" | grep "${key}" | awk -F "=" 'NR==1{printf$2}')
printf "%s" "$value"
}
#######################
# returns FTL's current telnet API port based on the setting in /etc/pihole-FTL.conf
########################
getFTLAPIPort(){
local FTLCONFFILE="/etc/pihole/pihole-FTL.conf"
local DEFAULT_FTL_PORT=4711
local ftl_api_port
if [ -s "$FTLCONFFILE" ]; then
# if FTLPORT is not set in pihole-FTL.conf, use the default port
ftl_api_port="$({ grep '^FTLPORT=' "${FTLCONFFILE}" || echo "${DEFAULT_FTL_PORT}"; } | cut -d'=' -f2-)"
# Exploit prevention: set the port to the default port if there is malicious (non-numeric)
# content set in pihole-FTL.conf
expr "${ftl_api_port}" : "[^[:digit:]]" > /dev/null && ftl_api_port="${DEFAULT_FTL_PORT}"
else
# if there is no pihole-FTL.conf, use the default port
ftl_api_port="${DEFAULT_FTL_PORT}"
fi
echo "${ftl_api_port}"
}
#######################
# returns path of FTL's PID file
#######################
getFTLPIDFile() {
local FTLCONFFILE="/etc/pihole/pihole-FTL.conf"
local DEFAULT_PID_FILE="/run/pihole-FTL.pid"
local FTL_PID_FILE
if [ -s "${FTLCONFFILE}" ]; then
# if PIDFILE is not set in pihole-FTL.conf, use the default path
FTL_PID_FILE="$({ grep '^PIDFILE=' "${FTLCONFFILE}" || echo "${DEFAULT_PID_FILE}"; } | cut -d'=' -f2-)"
else
# if there is no pihole-FTL.conf, use the default path
FTL_PID_FILE="${DEFAULT_PID_FILE}"
fi
echo "${FTL_PID_FILE}"
}
#######################
# returns FTL's PID based on the content of the pihole-FTL.pid file
#
@@ -163,3 +62,40 @@ getFTLPID() {
FTL_PID=${FTL_PID:=-1}
echo "${FTL_PID}"
}
#######################
# returns value from FTLs config file using pihole-FTL --config
#
# Takes one argument: key
# Example getFTLConfigValue dns.piholePTR
#######################
getFTLConfigValue(){
# Pipe to cat to avoid pihole-FTL assuming this is an interactive command
# returning colored output.
pihole-FTL --config -q "${1}" | cat
}
#######################
# sets value in FTLs config file using pihole-FTL --config
#
# Takes two arguments: key and value
# Example setFTLConfigValue dns.piholePTR PI.HOLE
#
# Note, for complex values such as dns.upstreams, you should wrap the value in single quotes:
# setFTLConfigValue dns.upstreams '[ "8.8.8.8" , "8.8.4.4" ]'
#######################
setFTLConfigValue(){
local err
{ pihole-FTL --config "${1}" "${2}" >/dev/null; err="$?"; } || true
case $err in
0) ;;
5)
# FTL returns 5 if the value was set by an environment variable and is therefore read-only
printf " %s %s set by environment variable. Please unset it to use this function\n" "${CROSS}" "${1}";
exit 5;;
*)
printf " %s Failed to set %s. Try with sudo power\n" "${CROSS}" "${1}"
exit 1
esac
}

View File

@@ -8,143 +8,56 @@
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
# Source the setupvars config file
# shellcheck disable=SC1091
. /etc/pihole/setupVars.conf
# Source the versions file poupulated by updatechecker.sh
# Source the versions file populated by updatechecker.sh
cachedVersions="/etc/pihole/versions"
if [ -f ${cachedVersions} ]; then
# shellcheck disable=SC1090
. "$cachedVersions"
# shellcheck source=/dev/null
. "${cachedVersions}"
else
echo "Could not find /etc/pihole/versions. Running update now."
pihole updatechecker
# shellcheck disable=SC1090
. "$cachedVersions"
# shellcheck source=/dev/null
. "${cachedVersions}"
fi
getLocalVersion() {
case ${1} in
"Pi-hole" ) echo "${CORE_VERSION:=N/A}";;
"AdminLTE" ) [ "${INSTALL_WEB_INTERFACE}" = true ] && echo "${WEB_VERSION:=N/A}";;
"FTL" ) echo "${FTL_VERSION:=N/A}";;
esac
}
getLocalHash() {
case ${1} in
"Pi-hole" ) echo "${CORE_HASH:=N/A}";;
"AdminLTE" ) [ "${INSTALL_WEB_INTERFACE}" = true ] && echo "${WEB_HASH:=N/A}";;
"FTL" ) echo "${FTL_HASH:=N/A}";;
esac
}
getRemoteHash(){
case ${1} in
"Pi-hole" ) echo "${GITHUB_CORE_HASH:=N/A}";;
"AdminLTE" ) [ "${INSTALL_WEB_INTERFACE}" = true ] && echo "${GITHUB_WEB_HASH:=N/A}";;
"FTL" ) echo "${GITHUB_FTL_HASH:=N/A}";;
esac
}
getRemoteVersion(){
case ${1} in
"Pi-hole" ) echo "${GITHUB_CORE_VERSION:=N/A}";;
"AdminLTE" ) [ "${INSTALL_WEB_INTERFACE}" = true ] && echo "${GITHUB_WEB_VERSION:=N/A}";;
"FTL" ) echo "${GITHUB_FTL_VERSION:=N/A}";;
esac
}
getLocalBranch(){
case ${1} in
"Pi-hole" ) echo "${CORE_BRANCH:=N/A}";;
"AdminLTE" ) [ "${INSTALL_WEB_INTERFACE}" = true ] && echo "${WEB_BRANCH:=N/A}";;
"FTL" ) echo "${FTL_BRANCH:=N/A}";;
esac
}
versionOutput() {
if [ "$1" = "AdminLTE" ] && [ "${INSTALL_WEB_INTERFACE}" != true ]; then
echo " WebAdmin not installed"
return 1
fi
[ "$2" = "-c" ] || [ "$2" = "--current" ] || [ -z "$2" ] && current=$(getLocalVersion "${1}") && branch=$(getLocalBranch "${1}")
[ "$2" = "-l" ] || [ "$2" = "--latest" ] || [ -z "$2" ] && latest=$(getRemoteVersion "${1}")
if [ "$2" = "--hash" ]; then
[ "$3" = "-c" ] || [ "$3" = "--current" ] || [ -z "$3" ] && curHash=$(getLocalHash "${1}") && branch=$(getLocalBranch "${1}")
[ "$3" = "-l" ] || [ "$3" = "--latest" ] || [ -z "$3" ] && latHash=$(getRemoteHash "${1}") && branch=$(getLocalBranch "${1}")
fi
# We do not want to show the branch name when we are on master,
# blank out the variable in this case
if [ "$branch" = "master" ]; then
branch=""
# Convert "null" or empty values to "N/A" for display
normalize_version() {
if [ -z "${1}" ] || [ "${1}" = "null" ]; then
echo "N/A"
else
branch="$branch "
echo "${1}"
fi
}
main() {
local details
details=false
# Automatically show detailed information if
# at least one of the components is not on master branch
if [ ! "${CORE_BRANCH}" = "master" ] || [ ! "${WEB_BRANCH}" = "master" ] || [ ! "${FTL_BRANCH}" = "master" ]; then
details=true
fi
if [ -n "$current" ] && [ -n "$latest" ]; then
output="${1} version is $branch$current (Latest: $latest)"
elif [ -n "$current" ] && [ -z "$latest" ]; then
output="Current ${1} version is $branch$current"
elif [ -z "$current" ] && [ -n "$latest" ]; then
output="Latest ${1} version is $latest"
elif [ -n "$curHash" ] && [ -n "$latHash" ]; then
output="Local ${1} hash is $curHash (Remote: $latHash)"
elif [ -n "$curHash" ] && [ -z "$latHash" ]; then
output="Current local ${1} hash is $curHash"
elif [ -z "$curHash" ] && [ -n "$latHash" ]; then
output="Latest remote ${1} hash is $latHash"
elif [ -z "$curHash" ] && [ -z "$latHash" ]; then
output="Hashes for ${1} not available"
if [ "${details}" = true ]; then
echo "Core"
echo " Version is $(normalize_version "${CORE_VERSION}") (Latest: $(normalize_version "${GITHUB_CORE_VERSION}"))"
echo " Branch is $(normalize_version "${CORE_BRANCH}")"
echo " Hash is $(normalize_version "${CORE_HASH}") (Latest: $(normalize_version "${GITHUB_CORE_HASH}"))"
echo "Web"
echo " Version is $(normalize_version "${WEB_VERSION}") (Latest: $(normalize_version "${GITHUB_WEB_VERSION}"))"
echo " Branch is $(normalize_version "${WEB_BRANCH}")"
echo " Hash is $(normalize_version "${WEB_HASH}") (Latest: $(normalize_version "${GITHUB_WEB_HASH}"))"
echo "FTL"
echo " Version is $(normalize_version "${FTL_VERSION}") (Latest: $(normalize_version "${GITHUB_FTL_VERSION}"))"
echo " Branch is $(normalize_version "${FTL_BRANCH}")"
echo " Hash is $(normalize_version "${FTL_HASH}") (Latest: $(normalize_version "${GITHUB_FTL_HASH}"))"
else
errorOutput
return 1
echo "Core version is $(normalize_version "${CORE_VERSION}") (Latest: $(normalize_version "${GITHUB_CORE_VERSION}"))"
echo "Web version is $(normalize_version "${WEB_VERSION}") (Latest: $(normalize_version "${GITHUB_WEB_VERSION}"))"
echo "FTL version is $(normalize_version "${FTL_VERSION}") (Latest: $(normalize_version "${GITHUB_FTL_VERSION}"))"
fi
[ -n "$output" ] && echo " $output"
}
errorOutput() {
echo " Invalid Option! Try 'pihole -v --help' for more information."
exit 1
}
defaultOutput() {
versionOutput "Pi-hole" "$@"
if [ "${INSTALL_WEB_INTERFACE}" = true ]; then
versionOutput "AdminLTE" "$@"
fi
versionOutput "FTL" "$@"
}
helpFunc() {
echo "Usage: pihole -v [repo | option] [option]
Example: 'pihole -v -p -l'
Show Pi-hole, Admin Console & FTL versions
Repositories:
-p, --pihole Only retrieve info regarding Pi-hole repository
-a, --admin Only retrieve info regarding AdminLTE repository
-f, --ftl Only retrieve info regarding FTL repository
Options:
-c, --current Return the current version
-l, --latest Return the latest version
--hash Return the GitHub hash from your local repositories
-h, --help Show this help dialog"
exit 0
}
case "${1}" in
"-p" | "--pihole" ) shift; versionOutput "Pi-hole" "$@";;
"-a" | "--admin" ) shift; versionOutput "AdminLTE" "$@";;
"-f" | "--ftl" ) shift; versionOutput "FTL" "$@";;
"-h" | "--help" ) helpFunc;;
* ) defaultOutput "$@";;
esac
main

View File

@@ -1,848 +0,0 @@
#!/usr/bin/env bash
# shellcheck disable=SC1090
# shellcheck disable=SC2154
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Web interface settings
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
readonly dnsmasqconfig="/etc/dnsmasq.d/01-pihole.conf"
readonly dhcpconfig="/etc/dnsmasq.d/02-pihole-dhcp.conf"
readonly FTLconf="/etc/pihole/pihole-FTL.conf"
# 03 -> wildcards
readonly dhcpstaticconfig="/etc/dnsmasq.d/04-pihole-static-dhcp.conf"
readonly dnscustomfile="/etc/pihole/custom.list"
readonly dnscustomcnamefile="/etc/dnsmasq.d/05-pihole-custom-cname.conf"
readonly gravityDBfile="/etc/pihole/gravity.db"
# Source install script for ${setupVars}, ${PI_HOLE_BIN_DIR} and valid_ip()
readonly PI_HOLE_FILES_DIR="/etc/.pihole"
# shellcheck disable=SC2034 # used in basic-install to source the script without running it
SKIP_INSTALL="true"
source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh"
utilsfile="/opt/pihole/utils.sh"
source "${utilsfile}"
coltable="/opt/pihole/COL_TABLE"
if [[ -f ${coltable} ]]; then
source ${coltable}
fi
helpFunc() {
echo "Usage: pihole -a [options]
Example: pihole -a -p password
Set options for the Admin Console
Options:
-p, password Set Admin Console password
-c, celsius Set Celsius as preferred temperature unit
-f, fahrenheit Set Fahrenheit as preferred temperature unit
-k, kelvin Set Kelvin as preferred temperature unit
-h, --help Show this help dialog
-i, interface Specify dnsmasq's interface listening behavior
-l, privacylevel Set privacy level (0 = lowest, 3 = highest)
-t, teleporter Backup configuration as an archive
-t, teleporter myname.tar.gz Backup configuration to archive with name myname.tar.gz as specified"
exit 0
}
add_setting() {
addOrEditKeyValPair "${setupVars}" "${1}" "${2}"
}
delete_setting() {
removeKey "${setupVars}" "${1}"
}
change_setting() {
addOrEditKeyValPair "${setupVars}" "${1}" "${2}"
}
addFTLsetting() {
addOrEditKeyValPair "${FTLconf}" "${1}" "${2}"
}
deleteFTLsetting() {
removeKey "${FTLconf}" "${1}"
}
changeFTLsetting() {
addOrEditKeyValPair "${FTLconf}" "${1}" "${2}"
}
add_dnsmasq_setting() {
addOrEditKeyValPair "${dnsmasqconfig}" "${1}" "${2}"
}
delete_dnsmasq_setting() {
removeKey "${dnsmasqconfig}" "${1}"
}
SetTemperatureUnit() {
addOrEditKeyValPair "${setupVars}" "TEMPERATUREUNIT" "${unit}"
echo -e " ${TICK} Set temperature unit to ${unit}"
}
HashPassword() {
# Compute password hash twice to avoid rainbow table vulnerability
return=$(echo -n "${1}" | sha256sum | sed 's/\s.*$//')
return=$(echo -n "${return}" | sha256sum | sed 's/\s.*$//')
echo "${return}"
}
SetWebPassword() {
if [ "${SUDO_USER}" == "www-data" ]; then
echo "Security measure: user www-data is not allowed to change webUI password!"
echo "Exiting"
exit 1
fi
if [ "${SUDO_USER}" == "lighttpd" ]; then
echo "Security measure: user lighttpd is not allowed to change webUI password!"
echo "Exiting"
exit 1
fi
if (( ${#args[2]} > 0 )) ; then
readonly PASSWORD="${args[2]}"
readonly CONFIRM="${PASSWORD}"
else
# Prevents a bug if the user presses Ctrl+C and it continues to hide the text typed.
# So we reset the terminal via stty if the user does press Ctrl+C
trap '{ echo -e "\nNo password will be set" ; stty sane ; exit 1; }' INT
read -s -r -p "Enter New Password (Blank for no password): " PASSWORD
echo ""
if [ "${PASSWORD}" == "" ]; then
addOrEditKeyValPair "${setupVars}" "WEBPASSWORD" ""
echo -e " ${TICK} Password Removed"
exit 0
fi
read -s -r -p "Confirm Password: " CONFIRM
echo ""
fi
if [ "${PASSWORD}" == "${CONFIRM}" ] ; then
# We do not wrap this in brackets, otherwise BASH will expand any appropriate syntax
hash=$(HashPassword "$PASSWORD")
# Save hash to file
addOrEditKeyValPair "${setupVars}" "WEBPASSWORD" "${hash}"
echo -e " ${TICK} New password set"
else
echo -e " ${CROSS} Passwords don't match. Your password has not been changed"
exit 1
fi
}
ProcessDNSSettings() {
source "${setupVars}"
removeKey "${dnsmasqconfig}" "server"
COUNTER=1
while true ; do
var=PIHOLE_DNS_${COUNTER}
if [ -z "${!var}" ]; then
break;
fi
addKey "${dnsmasqconfig}" "server=${!var}"
(( COUNTER++ ))
done
# The option LOCAL_DNS_PORT is deprecated
# We apply it once more, and then convert it into the current format
if [ -n "${LOCAL_DNS_PORT}" ]; then
addOrEditKeyValPair "${dnsmasqconfig}" "server" "127.0.0.1#${LOCAL_DNS_PORT}"
addOrEditKeyValPair "${setupVars}" "PIHOLE_DNS_${COUNTER}" "127.0.0.1#${LOCAL_DNS_PORT}"
removeKey "${setupVars}" "LOCAL_DNS_PORT"
fi
removeKey "${dnsmasqconfig}" "domain-needed"
removeKey "${dnsmasqconfig}" "expand-hosts"
if [[ "${DNS_FQDN_REQUIRED}" == true ]]; then
addKey "${dnsmasqconfig}" "domain-needed"
addKey "${dnsmasqconfig}" "expand-hosts"
fi
removeKey "${dnsmasqconfig}" "bogus-priv"
if [[ "${DNS_BOGUS_PRIV}" == true ]]; then
addKey "${dnsmasqconfig}" "bogus-priv"
fi
removeKey "${dnsmasqconfig}" "dnssec"
removeKey "${dnsmasqconfig}" "trust-anchor"
if [[ "${DNSSEC}" == true ]]; then
echo "dnssec
trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D
" >> "${dnsmasqconfig}"
fi
removeKey "${dnsmasqconfig}" "host-record"
if [ -n "${HOSTRECORD}" ]; then
addOrEditKeyValPair "${dnsmasqconfig}" "host-record" "${HOSTRECORD}"
fi
# Setup interface listening behavior of dnsmasq
removeKey "${dnsmasqconfig}" "interface"
removeKey "${dnsmasqconfig}" "local-service"
removeKey "${dnsmasqconfig}" "except-interface"
removeKey "${dnsmasqconfig}" "bind-interfaces"
if [[ "${DNSMASQ_LISTENING}" == "all" ]]; then
# Listen on all interfaces, permit all origins
addOrEditKeyValPair "${dnsmasqconfig}" "except-interface" "nonexisting"
elif [[ "${DNSMASQ_LISTENING}" == "local" ]]; then
# Listen only on all interfaces, but only local subnets
addKey "${dnsmasqconfig}" "local-service"
else
# Options "bind" and "single"
# Listen only on one interface
# Use eth0 as fallback interface if interface is missing in setupVars.conf
if [ -z "${PIHOLE_INTERFACE}" ]; then
PIHOLE_INTERFACE="eth0"
fi
addOrEditKeyValPair "${dnsmasqconfig}" "interface" "${PIHOLE_INTERFACE}"
if [[ "${DNSMASQ_LISTENING}" == "bind" ]]; then
# Really bind to interface
addKey "${dnsmasqconfig}" "bind-interfaces"
fi
fi
if [[ "${CONDITIONAL_FORWARDING}" == true ]]; then
# Convert legacy "conditional forwarding" to rev-server configuration
# Remove any existing REV_SERVER settings
removeKey "${setupVars}" "REV_SERVER"
removeKey "${setupVars}" "REV_SERVER_DOMAIN"
removeKey "${setupVars}" "REV_SERVER_TARGET"
removeKey "${setupVars}" "REV_SERVER_CIDR"
REV_SERVER=true
addOrEditKeyValPair "${setupVars}" "REV_SERVER" "true"
REV_SERVER_DOMAIN="${CONDITIONAL_FORWARDING_DOMAIN}"
addOrEditKeyValPair "${setupVars}" "REV_SERVER_DOMAIN" "${REV_SERVER_DOMAIN}"
REV_SERVER_TARGET="${CONDITIONAL_FORWARDING_IP}"
addOrEditKeyValPair "${setupVars}" "REV_SERVER_TARGET" "${REV_SERVER_TARGET}"
#Convert CONDITIONAL_FORWARDING_REVERSE if necessary e.g:
# 1.1.168.192.in-addr.arpa to 192.168.1.1/32
# 1.168.192.in-addr.arpa to 192.168.1.0/24
# 168.192.in-addr.arpa to 192.168.0.0/16
# 192.in-addr.arpa to 192.0.0.0/8
if [[ "${CONDITIONAL_FORWARDING_REVERSE}" == *"in-addr.arpa" ]];then
arrRev=("${CONDITIONAL_FORWARDING_REVERSE//./ }")
case ${#arrRev[@]} in
6 ) REV_SERVER_CIDR="${arrRev[3]}.${arrRev[2]}.${arrRev[1]}.${arrRev[0]}/32";;
5 ) REV_SERVER_CIDR="${arrRev[2]}.${arrRev[1]}.${arrRev[0]}.0/24";;
4 ) REV_SERVER_CIDR="${arrRev[1]}.${arrRev[0]}.0.0/16";;
3 ) REV_SERVER_CIDR="${arrRev[0]}.0.0.0/8";;
esac
else
# Set REV_SERVER_CIDR to whatever value it was set to
REV_SERVER_CIDR="${CONDITIONAL_FORWARDING_REVERSE}"
fi
# If REV_SERVER_CIDR is not converted by the above, then use the REV_SERVER_TARGET variable to derive it
if [ -z "${REV_SERVER_CIDR}" ]; then
# Convert existing input to /24 subnet (preserves legacy behavior)
# This sed converts "192.168.1.2" to "192.168.1.0/24"
# shellcheck disable=2001
REV_SERVER_CIDR="$(sed "s+\\.[0-9]*$+\\.0/24+" <<< "${REV_SERVER_TARGET}")"
fi
addOrEditKeyValPair "${setupVars}" "REV_SERVER_CIDR" "${REV_SERVER_CIDR}"
# Remove obsolete settings from setupVars.conf
removeKey "${setupVars}" "CONDITIONAL_FORWARDING"
removeKey "${setupVars}" "CONDITIONAL_FORWARDING_REVERSE"
removeKey "${setupVars}" "CONDITIONAL_FORWARDING_DOMAIN"
removeKey "${setupVars}" "CONDITIONAL_FORWARDING_IP"
fi
removeKey "${dnsmasqconfig}" "rev-server"
if [[ "${REV_SERVER}" == true ]]; then
addKey "${dnsmasqconfig}" "rev-server=${REV_SERVER_CIDR},${REV_SERVER_TARGET}"
if [ -n "${REV_SERVER_DOMAIN}" ]; then
# Forward local domain names to the CF target, too
addKey "${dnsmasqconfig}" "server=/${REV_SERVER_DOMAIN}/${REV_SERVER_TARGET}"
fi
if [[ "${DNS_FQDN_REQUIRED}" != true ]]; then
# Forward unqualified names to the CF target only when the "never
# forward non-FQDN" option is unticked
addKey "${dnsmasqconfig}" "server=//${REV_SERVER_TARGET}"
fi
fi
# We need to process DHCP settings here as well to account for possible
# changes in the non-FQDN forwarding. This cannot be done in 01-pihole.conf
# as we don't want to delete all local=/.../ lines so it's much safer to
# simply rewrite the entire corresponding config file (which is what the
# DHCP settings subroutine is doing)
ProcessDHCPSettings
}
SetDNSServers() {
# Save setting to file
removeKey "${setupVars}" "PIHOLE_DNS"
IFS=',' read -r -a array <<< "${args[2]}"
for index in "${!array[@]}"
do
# Replace possible "\#" by "#". This fixes AdminLTE#1427
local ip
ip="${array[index]//\\#/#}"
if valid_ip "${ip}" || valid_ip6 "${ip}" ; then
addOrEditKeyValPair "${setupVars}" "PIHOLE_DNS_$((index+1))" "${ip}"
else
echo -e " ${CROSS} Invalid IP has been passed"
exit 1
fi
done
if [[ "${args[3]}" == "domain-needed" ]]; then
addOrEditKeyValPair "${setupVars}" "DNS_FQDN_REQUIRED" "true"
else
addOrEditKeyValPair "${setupVars}" "DNS_FQDN_REQUIRED" "false"
fi
if [[ "${args[4]}" == "bogus-priv" ]]; then
addOrEditKeyValPair "${setupVars}" "DNS_BOGUS_PRIV" "true"
else
addOrEditKeyValPair "${setupVars}" "DNS_BOGUS_PRIV" "false"
fi
if [[ "${args[5]}" == "dnssec" ]]; then
addOrEditKeyValPair "${setupVars}" "DNSSEC" "true"
else
addOrEditKeyValPair "${setupVars}" "DNSSEC" "false"
fi
if [[ "${args[6]}" == "rev-server" ]]; then
addOrEditKeyValPair "${setupVars}" "REV_SERVER" "true"
addOrEditKeyValPair "${setupVars}" "REV_SERVER_CIDR" "${args[7]}"
addOrEditKeyValPair "${setupVars}" "REV_SERVER_TARGET" "${args[8]}"
addOrEditKeyValPair "${setupVars}" "REV_SERVER_DOMAIN" "${args[9]}"
else
addOrEditKeyValPair "${setupVars}" "REV_SERVER" "false"
fi
ProcessDNSSettings
# Restart dnsmasq to load new configuration
RestartDNS
}
SetExcludeDomains() {
addOrEditKeyValPair "${setupVars}" "API_EXCLUDE_DOMAINS" "${args[2]}"
}
SetExcludeClients() {
addOrEditKeyValPair "${setupVars}" "API_EXCLUDE_CLIENTS" "${args[2]}"
}
Poweroff(){
nohup bash -c "sleep 5; poweroff" &> /dev/null </dev/null &
}
Reboot() {
nohup bash -c "sleep 5; reboot" &> /dev/null </dev/null &
}
RestartDNS() {
"${PI_HOLE_BIN_DIR}"/pihole restartdns
}
SetQueryLogOptions() {
addOrEditKeyValPair "${setupVars}" "API_QUERY_LOG_SHOW" "${args[2]}"
}
ProcessDHCPSettings() {
source "${setupVars}"
if [[ "${DHCP_ACTIVE}" == "true" ]]; then
interface="${PIHOLE_INTERFACE}"
# Use eth0 as fallback interface
if [ -z ${interface} ]; then
interface="eth0"
fi
if [[ "${PIHOLE_DOMAIN}" == "" ]]; then
PIHOLE_DOMAIN="lan"
addOrEditKeyValPair "${setupVars}" "PIHOLE_DOMAIN" "${PIHOLE_DOMAIN}"
fi
if [[ "${DHCP_LEASETIME}" == "0" ]]; then
leasetime="infinite"
elif [[ "${DHCP_LEASETIME}" == "" ]]; then
leasetime="24h"
addOrEditKeyValPair "${setupVars}" "DHCP_LEASETIME" "24"
else
leasetime="${DHCP_LEASETIME}h"
fi
# Write settings to file
echo "###############################################################################
# DHCP SERVER CONFIG FILE AUTOMATICALLY POPULATED BY PI-HOLE WEB INTERFACE. #
# ANY CHANGES MADE TO THIS FILE WILL BE LOST ON CHANGE #
###############################################################################
dhcp-authoritative
dhcp-range=${DHCP_START},${DHCP_END},${leasetime}
dhcp-option=option:router,${DHCP_ROUTER}
dhcp-leasefile=/etc/pihole/dhcp.leases
#quiet-dhcp
" > "${dhcpconfig}"
chmod 644 "${dhcpconfig}"
if [[ "${PIHOLE_DOMAIN}" != "none" ]]; then
echo "domain=${PIHOLE_DOMAIN}" >> "${dhcpconfig}"
# When there is a Pi-hole domain set and "Never forward non-FQDNs" is
# ticked, we add `local=/domain/` to tell FTL that this domain is purely
# local and FTL may answer queries from /etc/hosts or DHCP but should
# never forward queries on that domain to any upstream servers
if [[ "${DNS_FQDN_REQUIRED}" == true ]]; then
echo "local=/${PIHOLE_DOMAIN}/" >> "${dhcpconfig}"
fi
fi
# Sourced from setupVars
# shellcheck disable=SC2154
if [[ "${DHCP_rapid_commit}" == "true" ]]; then
echo "dhcp-rapid-commit" >> "${dhcpconfig}"
fi
if [[ "${DHCP_IPv6}" == "true" ]]; then
echo "#quiet-dhcp6
#enable-ra
dhcp-option=option6:dns-server,[::]
dhcp-range=::,constructor:${interface},ra-names,ra-stateless,64
" >> "${dhcpconfig}"
fi
else
if [[ -f "${dhcpconfig}" ]]; then
rm "${dhcpconfig}" &> /dev/null
fi
fi
}
EnableDHCP() {
addOrEditKeyValPair "${setupVars}" "DHCP_ACTIVE" "true"
addOrEditKeyValPair "${setupVars}" "DHCP_START" "${args[2]}"
addOrEditKeyValPair "${setupVars}" "DHCP_END" "${args[3]}"
addOrEditKeyValPair "${setupVars}" "DHCP_ROUTER" "${args[4]}"
addOrEditKeyValPair "${setupVars}" "DHCP_LEASETIME" "${args[5]}"
addOrEditKeyValPair "${setupVars}" "PIHOLE_DOMAIN" "${args[6]}"
addOrEditKeyValPair "${setupVars}" "DHCP_IPv6" "${args[7]}"
addOrEditKeyValPair "${setupVars}" "DHCP_rapid_commit" "${args[8]}"
# Remove possible old setting from file
removeKey "${dnsmasqconfig}" "dhcp-"
removeKey "${dnsmasqconfig}" "quiet-dhcp"
# If a DHCP client claims that its name is "wpad", ignore that.
# This fixes a security hole. see CERT Vulnerability VU#598349
# We also ignore "localhost" as Windows behaves strangely if a
# device claims this host name
addKey "${dnsmasqconfig}" "dhcp-name-match=set:hostname-ignore,wpad
dhcp-name-match=set:hostname-ignore,localhost
dhcp-ignore-names=tag:hostname-ignore"
ProcessDHCPSettings
RestartDNS
}
DisableDHCP() {
addOrEditKeyValPair "${setupVars}" "DHCP_ACTIVE" "false"
# Remove possible old setting from file
removeKey "${dnsmasqconfig}" "dhcp-"
removeKey "${dnsmasqconfig}" "quiet-dhcp"
ProcessDHCPSettings
RestartDNS
}
SetWebUILayout() {
addOrEditKeyValPair "${setupVars}" "WEBUIBOXEDLAYOUT" "${args[2]}"
}
SetWebUITheme() {
addOrEditKeyValPair "${setupVars}" "WEBTHEME" "${args[2]}"
}
CheckUrl(){
local regex check_url
# Check for characters NOT allowed in URLs
regex="[^a-zA-Z0-9:/?&%=~._()-;]"
# this will remove first @ that is after schema and before domain
# \1 is optional schema, \2 is userinfo
check_url="$( sed -re 's#([^:/]*://)?([^/]+)@#\1\2#' <<< "$1" )"
if [[ "${check_url}" =~ ${regex} ]]; then
return 1
else
return 0
fi
}
CustomizeAdLists() {
local address
address="${args[3]}"
local comment
comment="${args[4]}"
if CheckUrl "${address}"; then
if [[ "${args[2]}" == "enable" ]]; then
pihole-FTL sqlite3 "${gravityDBfile}" "UPDATE adlist SET enabled = 1 WHERE address = '${address}'"
elif [[ "${args[2]}" == "disable" ]]; then
pihole-FTL sqlite3 "${gravityDBfile}" "UPDATE adlist SET enabled = 0 WHERE address = '${address}'"
elif [[ "${args[2]}" == "add" ]]; then
pihole-FTL sqlite3 "${gravityDBfile}" "INSERT OR IGNORE INTO adlist (address, comment) VALUES ('${address}', '${comment}')"
elif [[ "${args[2]}" == "del" ]]; then
pihole-FTL sqlite3 "${gravityDBfile}" "DELETE FROM adlist WHERE address = '${address}'"
else
echo "Not permitted"
return 1
fi
else
echo "Invalid Url"
return 1
fi
}
AddDHCPStaticAddress() {
mac="${args[2]}"
ip="${args[3]}"
host="${args[4]}"
if [[ "${ip}" == "noip" ]]; then
# Static host name
echo "dhcp-host=${mac},${host}" >> "${dhcpstaticconfig}"
elif [[ "${host}" == "nohost" ]]; then
# Static IP
echo "dhcp-host=${mac},${ip}" >> "${dhcpstaticconfig}"
else
# Full info given
echo "dhcp-host=${mac},${ip},${host}" >> "${dhcpstaticconfig}"
fi
}
RemoveDHCPStaticAddress() {
mac="${args[2]}"
if [[ "$mac" =~ ^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$ ]]; then
sed -i "/dhcp-host=${mac}.*/d" "${dhcpstaticconfig}"
else
echo " ${CROSS} Invalid Mac Passed!"
exit 1
fi
}
SetListeningMode() {
source "${setupVars}"
if [[ "$3" == "-h" ]] || [[ "$3" == "--help" ]]; then
echo "Usage: pihole -a -i [interface]
Example: 'pihole -a -i local'
Specify dnsmasq's network interface listening behavior
Interfaces:
local Only respond to queries from devices that
are at most one hop away (local devices)
single Respond only on interface ${PIHOLE_INTERFACE}
bind Bind only on interface ${PIHOLE_INTERFACE}
all Listen on all interfaces, permit all origins"
exit 0
fi
if [[ "${args[2]}" == "all" ]]; then
echo -e " ${INFO} Listening on all interfaces, permitting all origins. Please use a firewall!"
addOrEditKeyValPair "${setupVars}" "DNSMASQ_LISTENING" "all"
elif [[ "${args[2]}" == "local" ]]; then
echo -e " ${INFO} Listening on all interfaces, permitting origins from one hop away (LAN)"
addOrEditKeyValPair "${setupVars}" "DNSMASQ_LISTENING" "local"
elif [[ "${args[2]}" == "bind" ]]; then
echo -e " ${INFO} Binding on interface ${PIHOLE_INTERFACE}"
addOrEditKeyValPair "${setupVars}" "DNSMASQ_LISTENING" "bind"
else
echo -e " ${INFO} Listening only on interface ${PIHOLE_INTERFACE}"
addOrEditKeyValPair "${setupVars}" "DNSMASQ_LISTENING" "single"
fi
# Don't restart DNS server yet because other settings
# will be applied afterwards if "-web" is set
if [[ "${args[3]}" != "-web" ]]; then
ProcessDNSSettings
# Restart dnsmasq to load new configuration
RestartDNS
fi
}
Teleporter() {
local filename
filename="${args[2]}"
if [[ -z "${filename}" ]]; then
local datetimestamp
local host
datetimestamp=$(date "+%Y-%m-%d_%H-%M-%S")
host=$(hostname)
host="${host//./_}"
filename="pi-hole-${host:-noname}-teleporter_${datetimestamp}.tar.gz"
fi
# webroot is sourced from basic-install above
php "${webroot}/admin/scripts/pi-hole/php/teleporter.php" > "${filename}"
}
checkDomain()
{
local domain validDomain
# Convert to lowercase
domain="${1,,}"
validDomain=$(grep -P "^((-|_)*[a-z\\d]((-|_)*[a-z\\d])*(-|_)*)(\\.(-|_)*([a-z\\d]((-|_)*[a-z\\d])*))*$" <<< "${domain}") # Valid chars check
validDomain=$(grep -P "^[^\\.]{1,63}(\\.[^\\.]{1,63})*$" <<< "${validDomain}") # Length of each label
echo "${validDomain}"
}
escapeDots()
{
# SC suggest bashism ${variable//search/replace}
# shellcheck disable=SC2001
escaped=$(echo "$1" | sed 's/\./\\./g')
echo "${escaped}"
}
addAudit()
{
shift # skip "-a"
shift # skip "audit"
local domains validDomain
domains=""
for domain in "$@"
do
# Check domain to be added. Only continue if it is valid
validDomain="$(checkDomain "${domain}")"
if [[ -n "${validDomain}" ]]; then
# Put comma in between domains when there is
# more than one domains to be added
# SQL INSERT allows adding multiple rows at once using the format
## INSERT INTO table (domain) VALUES ('abc.de'),('fgh.ij'),('klm.no'),('pqr.st');
if [[ -n "${domains}" ]]; then
domains="${domains},"
fi
domains="${domains}('${domain}')"
fi
done
# Insert only the domain here. The date_added field will be
# filled with its default value (date_added = current timestamp)
pihole-FTL sqlite3 "${gravityDBfile}" "INSERT INTO domain_audit (domain) VALUES ${domains};"
}
clearAudit()
{
pihole-FTL sqlite3 "${gravityDBfile}" "DELETE FROM domain_audit;"
}
SetPrivacyLevel() {
# Set privacy level. Minimum is 0, maximum is 3
if [ "${args[2]}" -ge 0 ] && [ "${args[2]}" -le 3 ]; then
addOrEditKeyValPair "${FTLconf}" "PRIVACYLEVEL" "${args[2]}"
pihole restartdns reload-lists
fi
}
AddCustomDNSAddress() {
echo -e " ${TICK} Adding custom DNS entry..."
ip="${args[2]}"
host="${args[3]}"
reload="${args[4]}"
validHost="$(checkDomain "${host}")"
if [[ -n "${validHost}" ]]; then
if valid_ip "${ip}" || valid_ip6 "${ip}" ; then
echo "${ip} ${validHost}" >> "${dnscustomfile}"
else
echo -e " ${CROSS} Invalid IP has been passed"
exit 1
fi
else
echo " ${CROSS} Invalid Domain passed!"
exit 1
fi
# Restart dnsmasq to load new custom DNS entries only if $reload not false
if [[ ! $reload == "false" ]]; then
RestartDNS
fi
}
RemoveCustomDNSAddress() {
echo -e " ${TICK} Removing custom DNS entry..."
ip="${args[2]}"
host="${args[3]}"
reload="${args[4]}"
validHost="$(checkDomain "${host}")"
if [[ -n "${validHost}" ]]; then
if valid_ip "${ip}" || valid_ip6 "${ip}" ; then
validHost=$(escapeDots "${validHost}")
sed -i "/^${ip} ${validHost}$/Id" "${dnscustomfile}"
else
echo -e " ${CROSS} Invalid IP has been passed"
exit 1
fi
else
echo " ${CROSS} Invalid Domain passed!"
exit 1
fi
# Restart dnsmasq to load new custom DNS entries only if reload is not false
if [[ ! $reload == "false" ]]; then
RestartDNS
fi
}
AddCustomCNAMERecord() {
echo -e " ${TICK} Adding custom CNAME record..."
domain="${args[2]}"
target="${args[3]}"
reload="${args[4]}"
validDomain="$(checkDomain "${domain}")"
if [[ -n "${validDomain}" ]]; then
validTarget="$(checkDomain "${target}")"
if [[ -n "${validTarget}" ]]; then
if [ "${validDomain}" = "${validTarget}" ]; then
echo " ${CROSS} Domain and target are the same. This would cause a DNS loop."
exit 1
else
echo "cname=${validDomain},${validTarget}" >> "${dnscustomcnamefile}"
fi
else
echo " ${CROSS} Invalid Target Passed!"
exit 1
fi
else
echo " ${CROSS} Invalid Domain passed!"
exit 1
fi
# Restart dnsmasq to load new custom CNAME records only if reload is not false
if [[ ! $reload == "false" ]]; then
RestartDNS
fi
}
RemoveCustomCNAMERecord() {
echo -e " ${TICK} Removing custom CNAME record..."
domain="${args[2]}"
target="${args[3]}"
reload="${args[4]}"
validDomain="$(checkDomain "${domain}")"
if [[ -n "${validDomain}" ]]; then
validTarget="$(checkDomain "${target}")"
if [[ -n "${validTarget}" ]]; then
validDomain=$(escapeDots "${validDomain}")
validTarget=$(escapeDots "${validTarget}")
sed -i "/^cname=${validDomain},${validTarget}$/Id" "${dnscustomcnamefile}"
else
echo " ${CROSS} Invalid Target Passed!"
exit 1
fi
else
echo " ${CROSS} Invalid Domain passed!"
exit 1
fi
# Restart dnsmasq to update removed custom CNAME records only if $reload not false
if [[ ! $reload == "false" ]]; then
RestartDNS
fi
}
SetRateLimit() {
local rate_limit_count rate_limit_interval reload
rate_limit_count="${args[2]}"
rate_limit_interval="${args[3]}"
reload="${args[4]}"
# Set rate-limit setting inf valid
if [ "${rate_limit_count}" -ge 0 ] && [ "${rate_limit_interval}" -ge 0 ]; then
addOrEditKeyValPair "${FTLconf}" "RATE_LIMIT" "${rate_limit_count}/${rate_limit_interval}"
fi
# Restart FTL to update rate-limit settings only if $reload not false
if [[ ! $reload == "false" ]]; then
RestartDNS
fi
}
main() {
args=("$@")
case "${args[1]}" in
"-p" | "password" ) SetWebPassword;;
"-c" | "celsius" ) unit="C"; SetTemperatureUnit;;
"-f" | "fahrenheit" ) unit="F"; SetTemperatureUnit;;
"-k" | "kelvin" ) unit="K"; SetTemperatureUnit;;
"setdns" ) SetDNSServers;;
"setexcludedomains" ) SetExcludeDomains;;
"setexcludeclients" ) SetExcludeClients;;
"poweroff" ) Poweroff;;
"reboot" ) Reboot;;
"restartdns" ) RestartDNS;;
"setquerylog" ) SetQueryLogOptions;;
"enabledhcp" ) EnableDHCP;;
"disabledhcp" ) DisableDHCP;;
"layout" ) SetWebUILayout;;
"theme" ) SetWebUITheme;;
"-h" | "--help" ) helpFunc;;
"addstaticdhcp" ) AddDHCPStaticAddress;;
"removestaticdhcp" ) RemoveDHCPStaticAddress;;
"-i" | "interface" ) SetListeningMode "$@";;
"-t" | "teleporter" ) Teleporter;;
"adlist" ) CustomizeAdLists;;
"audit" ) addAudit "$@";;
"clearaudit" ) clearAudit;;
"-l" | "privacylevel" ) SetPrivacyLevel;;
"addcustomdns" ) AddCustomDNSAddress;;
"removecustomdns" ) RemoveCustomDNSAddress;;
"addcustomcname" ) AddCustomCNAMERecord;;
"removecustomcname" ) RemoveCustomCNAMERecord;;
"ratelimit" ) SetRateLimit;;
* ) helpFunc;;
esac
shift
if [[ $# = 0 ]]; then
helpFunc
fi
}

View File

@@ -3,90 +3,97 @@ BEGIN TRANSACTION;
CREATE TABLE "group"
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
enabled BOOLEAN NOT NULL DEFAULT 1,
name TEXT UNIQUE NOT NULL,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
description TEXT
id INTEGER PRIMARY KEY AUTOINCREMENT,
enabled BOOLEAN NOT NULL DEFAULT 1,
name TEXT UNIQUE NOT NULL,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
description TEXT
);
INSERT INTO "group" (id,enabled,name,description) VALUES (0,1,'Default','The default group');
CREATE TABLE domainlist
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
type INTEGER NOT NULL DEFAULT 0,
domain TEXT NOT NULL,
enabled BOOLEAN NOT NULL DEFAULT 1,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
comment TEXT,
UNIQUE(domain, type)
id INTEGER PRIMARY KEY AUTOINCREMENT,
type INTEGER NOT NULL DEFAULT 0,
domain TEXT NOT NULL,
enabled BOOLEAN NOT NULL DEFAULT 1,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
comment TEXT,
UNIQUE(domain, type)
);
CREATE TABLE adlist
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
address TEXT UNIQUE NOT NULL,
enabled BOOLEAN NOT NULL DEFAULT 1,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
comment TEXT,
date_updated INTEGER,
number INTEGER NOT NULL DEFAULT 0,
invalid_domains INTEGER NOT NULL DEFAULT 0,
status INTEGER NOT NULL DEFAULT 0
id INTEGER PRIMARY KEY AUTOINCREMENT,
address TEXT NOT NULL,
enabled BOOLEAN NOT NULL DEFAULT 1,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
comment TEXT,
date_updated INTEGER,
number INTEGER NOT NULL DEFAULT 0,
invalid_domains INTEGER NOT NULL DEFAULT 0,
status INTEGER NOT NULL DEFAULT 0,
abp_entries INTEGER NOT NULL DEFAULT 0,
type INTEGER NOT NULL DEFAULT 0,
UNIQUE(address, type)
);
CREATE TABLE adlist_by_group
(
adlist_id INTEGER NOT NULL REFERENCES adlist (id),
group_id INTEGER NOT NULL REFERENCES "group" (id),
PRIMARY KEY (adlist_id, group_id)
adlist_id INTEGER NOT NULL REFERENCES adlist (id) ON DELETE CASCADE,
group_id INTEGER NOT NULL REFERENCES "group" (id) ON DELETE CASCADE,
PRIMARY KEY (adlist_id, group_id)
);
CREATE TABLE gravity
(
domain TEXT NOT NULL,
adlist_id INTEGER NOT NULL REFERENCES adlist (id)
domain TEXT NOT NULL,
adlist_id INTEGER NOT NULL REFERENCES adlist (id)
);
CREATE TABLE antigravity
(
domain TEXT NOT NULL,
adlist_id INTEGER NOT NULL REFERENCES adlist (id)
);
CREATE TABLE info
(
property TEXT PRIMARY KEY,
value TEXT NOT NULL
property TEXT PRIMARY KEY,
value TEXT NOT NULL
);
INSERT INTO "info" VALUES('version','15');
CREATE TABLE domain_audit
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
domain TEXT UNIQUE NOT NULL,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int))
);
INSERT INTO "info" VALUES('version','20');
/* This is a flag to indicate if gravity was restored from a backup
false = not restored,
failed = restoration failed due to no backup
other string = restoration successful with the string being the backup file used */
INSERT INTO "info" VALUES('gravity_restored','false');
CREATE TABLE domainlist_by_group
(
domainlist_id INTEGER NOT NULL REFERENCES domainlist (id),
group_id INTEGER NOT NULL REFERENCES "group" (id),
PRIMARY KEY (domainlist_id, group_id)
domainlist_id INTEGER NOT NULL REFERENCES domainlist (id) ON DELETE CASCADE,
group_id INTEGER NOT NULL REFERENCES "group" (id) ON DELETE CASCADE,
PRIMARY KEY (domainlist_id, group_id)
);
CREATE TABLE client
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
ip TEXT NOT NULL UNIQUE,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
comment TEXT
id INTEGER PRIMARY KEY AUTOINCREMENT,
ip TEXT NOT NULL UNIQUE,
date_added INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
date_modified INTEGER NOT NULL DEFAULT (cast(strftime('%s', 'now') as int)),
comment TEXT
);
CREATE TABLE client_by_group
(
client_id INTEGER NOT NULL REFERENCES client (id),
group_id INTEGER NOT NULL REFERENCES "group" (id),
PRIMARY KEY (client_id, group_id)
client_id INTEGER NOT NULL REFERENCES client (id) ON DELETE CASCADE,
group_id INTEGER NOT NULL REFERENCES "group" (id) ON DELETE CASCADE,
PRIMARY KEY (client_id, group_id)
);
CREATE TRIGGER tr_adlist_update AFTER UPDATE OF address,enabled,comment ON adlist
@@ -104,7 +111,7 @@ CREATE TRIGGER tr_domainlist_update AFTER UPDATE ON domainlist
UPDATE domainlist SET date_modified = (cast(strftime('%s', 'now') as int)) WHERE domain = NEW.domain;
END;
CREATE VIEW vw_whitelist AS SELECT domain, domainlist.id AS id, domainlist_by_group.group_id AS group_id
CREATE VIEW vw_allowlist AS SELECT domain, domainlist.id AS id, domainlist_by_group.group_id AS group_id
FROM domainlist
LEFT JOIN domainlist_by_group ON domainlist_by_group.domainlist_id = domainlist.id
LEFT JOIN "group" ON "group".id = domainlist_by_group.group_id
@@ -112,7 +119,7 @@ CREATE VIEW vw_whitelist AS SELECT domain, domainlist.id AS id, domainlist_by_gr
AND domainlist.type = 0
ORDER BY domainlist.id;
CREATE VIEW vw_blacklist AS SELECT domain, domainlist.id AS id, domainlist_by_group.group_id AS group_id
CREATE VIEW vw_denylist AS SELECT domain, domainlist.id AS id, domainlist_by_group.group_id AS group_id
FROM domainlist
LEFT JOIN domainlist_by_group ON domainlist_by_group.domainlist_id = domainlist.id
LEFT JOIN "group" ON "group".id = domainlist_by_group.group_id
@@ -120,7 +127,7 @@ CREATE VIEW vw_blacklist AS SELECT domain, domainlist.id AS id, domainlist_by_gr
AND domainlist.type = 1
ORDER BY domainlist.id;
CREATE VIEW vw_regex_whitelist AS SELECT domain, domainlist.id AS id, domainlist_by_group.group_id AS group_id
CREATE VIEW vw_regex_allowlist AS SELECT domain, domainlist.id AS id, domainlist_by_group.group_id AS group_id
FROM domainlist
LEFT JOIN domainlist_by_group ON domainlist_by_group.domainlist_id = domainlist.id
LEFT JOIN "group" ON "group".id = domainlist_by_group.group_id
@@ -128,7 +135,7 @@ CREATE VIEW vw_regex_whitelist AS SELECT domain, domainlist.id AS id, domainlist
AND domainlist.type = 2
ORDER BY domainlist.id;
CREATE VIEW vw_regex_blacklist AS SELECT domain, domainlist.id AS id, domainlist_by_group.group_id AS group_id
CREATE VIEW vw_regex_denylist AS SELECT domain, domainlist.id AS id, domainlist_by_group.group_id AS group_id
FROM domainlist
LEFT JOIN domainlist_by_group ON domainlist_by_group.domainlist_id = domainlist.id
LEFT JOIN "group" ON "group".id = domainlist_by_group.group_id
@@ -136,14 +143,21 @@ CREATE VIEW vw_regex_blacklist AS SELECT domain, domainlist.id AS id, domainlist
AND domainlist.type = 3
ORDER BY domainlist.id;
CREATE VIEW vw_gravity AS SELECT domain, adlist_by_group.group_id AS group_id
CREATE VIEW vw_gravity AS SELECT domain, adlist.id AS adlist_id, adlist_by_group.group_id AS group_id
FROM gravity
LEFT JOIN adlist_by_group ON adlist_by_group.adlist_id = gravity.adlist_id
LEFT JOIN adlist ON adlist.id = gravity.adlist_id
LEFT JOIN "group" ON "group".id = adlist_by_group.group_id
WHERE adlist.enabled = 1 AND (adlist_by_group.group_id IS NULL OR "group".enabled = 1);
CREATE VIEW vw_adlist AS SELECT DISTINCT address, id
CREATE VIEW vw_antigravity AS SELECT domain, adlist.id AS adlist_id, adlist_by_group.group_id AS group_id
FROM antigravity
LEFT JOIN adlist_by_group ON adlist_by_group.adlist_id = antigravity.adlist_id
LEFT JOIN adlist ON adlist.id = antigravity.adlist_id
LEFT JOIN "group" ON "group".id = adlist_by_group.group_id
WHERE adlist.enabled = 1 AND (adlist_by_group.group_id IS NULL OR "group".enabled = 1) AND adlist.type = 1;
CREATE VIEW vw_adlist AS SELECT DISTINCT address, id, type
FROM adlist
WHERE enabled = 1
ORDER BY id;

View File

@@ -9,7 +9,6 @@ DROP TRIGGER tr_client_add;
DROP TRIGGER tr_adlist_add;
INSERT OR REPLACE INTO "group" SELECT * FROM OLD."group";
INSERT OR REPLACE INTO domain_audit SELECT * FROM OLD.domain_audit;
INSERT OR REPLACE INTO domainlist SELECT * FROM OLD.domainlist;
DELETE FROM OLD.domainlist_by_group WHERE domainlist_id NOT IN (SELECT id FROM OLD.domainlist);
@@ -19,8 +18,6 @@ INSERT OR REPLACE INTO adlist SELECT * FROM OLD.adlist;
DELETE FROM OLD.adlist_by_group WHERE adlist_id NOT IN (SELECT id FROM OLD.adlist);
INSERT OR REPLACE INTO adlist_by_group SELECT * FROM OLD.adlist_by_group;
INSERT OR REPLACE INTO info SELECT * FROM OLD.info;
INSERT OR REPLACE INTO client SELECT * FROM OLD.client;
DELETE FROM OLD.client_by_group WHERE client_id NOT IN (SELECT id FROM OLD.client);
INSERT OR REPLACE INTO client_by_group SELECT * FROM OLD.client_by_group;

View File

@@ -1,21 +1,32 @@
/var/log/pihole/pihole.log {
# su #
daily
copytruncate
rotate 5
compress
delaycompress
notifempty
nomail
# su #
daily
copytruncate
rotate 5
compress
delaycompress
notifempty
nomail
}
/var/log/pihole/FTL.log {
# su #
weekly
copytruncate
rotate 3
compress
delaycompress
notifempty
nomail
# su #
weekly
copytruncate
rotate 3
compress
delaycompress
notifempty
nomail
}
/var/log/pihole/webserver.log {
# su #
weekly
copytruncate
rotate 3
compress
delaycompress
notifempty
nomail
}

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env sh
# Source utils.sh for getFTLPIDFile()
# Source utils.sh for getFTLConfigValue()
PI_HOLE_SCRIPT_DIR='/opt/pihole'
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
# shellcheck disable=SC1090
# shellcheck source="./advanced/Scripts/utils.sh"
. "${utilsfile}"
# Get file paths
FTL_PID_FILE="$(getFTLPIDFile)"
FTL_PID_FILE="$(getFTLConfigValue files.pid)"
# Cleanup
rm -f /run/pihole/FTL.sock /dev/shm/FTL-* "${FTL_PID_FILE}"

View File

@@ -1,38 +1,42 @@
#!/usr/bin/env sh
# Source utils.sh for getFTLPIDFile()
# Source utils.sh for getFTLConfigValue()
PI_HOLE_SCRIPT_DIR='/opt/pihole'
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
# shellcheck disable=SC1090
# shellcheck source="./advanced/Scripts/utils.sh"
. "${utilsfile}"
# Get file paths
FTL_PID_FILE="$(getFTLPIDFile)"
FTL_PID_FILE="$(getFTLConfigValue files.pid)"
FTL_LOG_FILE="$(getFTLConfigValue files.log.ftl)"
PIHOLE_LOG_FILE="$(getFTLConfigValue files.log.dnsmasq)"
WEBSERVER_LOG_FILE="$(getFTLConfigValue files.log.webserver)"
FTL_PID_FILE="${FTL_PID_FILE:-/run/pihole-FTL.pid}"
FTL_LOG_FILE="${FTL_LOG_FILE:-/var/log/pihole/FTL.log}"
PIHOLE_LOG_FILE="${PIHOLE_LOG_FILE:-/var/log/pihole/pihole.log}"
WEBSERVER_LOG_FILE="${WEBSERVER_LOG_FILE:-/var/log/pihole/webserver.log}"
# Ensure that permissions are set so that pihole-FTL can edit all necessary files
mkdir -p /var/log/pihole
chown -R pihole:pihole /etc/pihole/ /var/log/pihole/
# allow all users read version file (and use pihole -v)
touch /etc/pihole/versions
chmod 0644 /etc/pihole/versions
# allow pihole to access subdirs in /etc/pihole (sets execution bit on dirs)
find /etc/pihole/ /var/log/pihole/ -type d -exec chmod 0755 {} +
# Set all files (except TLS-related ones) to u+rw g+r
find /etc/pihole/ /var/log/pihole/ -type f ! \( -name '*.pem' -o -name '*.crt' \) -exec chmod 0640 {} +
# Set TLS-related files to a more restrictive u+rw *only* (they may contain private keys)
find /etc/pihole/ -type f \( -name '*.pem' -o -name '*.crt' \) -exec chmod 0600 {} +
# Logrotate config file need to be owned by root
chown root:root /etc/pihole/logrotate
# Touch files to ensure they exist (create if non-existing, preserve if existing)
# shellcheck disable=SC2174
mkdir -pm 0755 /run/pihole /var/log/pihole
[ -f "${FTL_PID_FILE}" ] || install -D -m 644 -o pihole -g pihole /dev/null "${FTL_PID_FILE}"
[ -f /var/log/pihole/FTL.log ] || install -m 644 -o pihole -g pihole /dev/null /var/log/pihole/FTL.log
[ -f /var/log/pihole/pihole.log ] || install -m 640 -o pihole -g pihole /dev/null /var/log/pihole/pihole.log
[ -f "${FTL_LOG_FILE}" ] || install -m 640 -o pihole -g pihole /dev/null "${FTL_LOG_FILE}"
[ -f "${PIHOLE_LOG_FILE}" ] || install -m 640 -o pihole -g pihole /dev/null "${PIHOLE_LOG_FILE}"
[ -f "${WEBSERVER_LOG_FILE}" ] || install -m 640 -o pihole -g pihole /dev/null "${WEBSERVER_LOG_FILE}"
[ -f /etc/pihole/dhcp.leases ] || install -m 644 -o pihole -g pihole /dev/null /etc/pihole/dhcp.leases
# Ensure that permissions are set so that pihole-FTL can edit all necessary files
chown pihole:pihole /run/pihole /etc/pihole /var/log/pihole /var/log/pihole/FTL.log /var/log/pihole/pihole.log /etc/pihole/dhcp.leases
# Ensure that permissions are set so that pihole-FTL can edit the files. We ignore errors as the file may not (yet) exist
chmod -f 0644 /etc/pihole/macvendor.db /etc/pihole/dhcp.leases /var/log/pihole/FTL.log
chmod -f 0640 /var/log/pihole/pihole.log
# Chown database files to the user FTL runs as. We ignore errors as the files may not (yet) exist
chown -f pihole:pihole /etc/pihole/pihole-FTL.db /etc/pihole/gravity.db /etc/pihole/macvendor.db
# Chmod database file permissions so that the pihole group (web interface) can edit the file. We ignore errors as the files may not (yet) exist
chmod -f 0664 /etc/pihole/pihole-FTL.db
# Backward compatibility for user-scripts that still expect log files in /var/log instead of /var/log/pihole
# Should be removed with Pi-hole v6.0
if [ ! -f /var/log/pihole.log ]; then
ln -sf /var/log/pihole/pihole.log /var/log/pihole.log
chown -h pihole:pihole /var/log/pihole.log
fi
if [ ! -f /var/log/pihole-FTL.log ]; then
ln -sf /var/log/pihole/FTL.log /var/log/pihole-FTL.log
chown -h pihole:pihole /var/log/pihole-FTL.log
fi

View File

@@ -1,2 +0,0 @@
#; Pi-hole FTL config file
#; Comments should start with #; to avoid issues with PHP and bash reading this file

View File

@@ -0,0 +1,40 @@
#!/sbin/openrc-run
# shellcheck shell=sh disable=SC2034
: "${PI_HOLE_SCRIPT_DIR:=/opt/pihole}"
command="/usr/bin/pihole-FTL"
command_user="pihole:pihole"
supervisor=supervise-daemon
command_args_foreground="-f"
command_background=true
pidfile="/run/${RC_SVCNAME}_openrc.pid"
extra_started_commands="reload"
respawn_max=5
respawn_period=60
capabilities="^CAP_NET_BIND_SERVICE,^CAP_NET_RAW,^CAP_NET_ADMIN,^CAP_SYS_NICE,^CAP_IPC_LOCK,^CAP_CHOWN,^CAP_SYS_TIME"
depend() {
want net
provide dns
}
checkconfig() {
$command -f test
}
start_pre() {
sh "${PI_HOLE_SCRIPT_DIR}/pihole-FTL-prestart.sh"
}
stop_post() {
sh "${PI_HOLE_SCRIPT_DIR}/pihole-FTL-poststop.sh"
}
reload() {
checkconfig || return $?
ebegin "Reloading ${RC_SVCNAME}"
start-stop-daemon --signal HUP --pidfile "${pidfile}"
eend $?
}

View File

@@ -9,10 +9,10 @@
# Description: Enable service provided by pihole-FTL daemon
### END INIT INFO
# Source utils.sh for getFTLPIDFile(), getFTLPID()
# Source utils.sh for getFTLConfigValue(), getFTLPID()
PI_HOLE_SCRIPT_DIR="/opt/pihole"
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
# shellcheck disable=SC1090
# shellcheck source="./advanced/Scripts/utils.sh"
. "${utilsfile}"
@@ -37,7 +37,7 @@ start() {
# Run pre-start script, which pre-creates all expected files with correct permissions
sh "${PI_HOLE_SCRIPT_DIR}/pihole-FTL-prestart.sh"
if setcap CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_NET_ADMIN,CAP_SYS_NICE,CAP_IPC_LOCK,CAP_CHOWN+eip "/usr/bin/pihole-FTL"; then
if setcap CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_NET_ADMIN,CAP_SYS_NICE,CAP_IPC_LOCK,CAP_CHOWN,CAP_SYS_TIME+eip "/usr/bin/pihole-FTL"; then
su -s /bin/sh -c "/usr/bin/pihole-FTL" pihole
else
echo "Warning: Starting pihole-FTL as root because setting capabilities is not supported on this system"
@@ -57,13 +57,16 @@ start() {
stop() {
if is_running; then
kill "${FTL_PID}"
for i in 1 2 3 4 5; do
# Give FTL 120 seconds to gracefully stop
i=1
while [ "${i}" -le 120 ]; do
if ! is_running; then
break
fi
printf "."
sleep 1
i=$((i + 1))
done
echo
@@ -98,7 +101,7 @@ status() {
trap 'cleanup; exit 1' INT HUP TERM ABRT
# Get FTL's PID file path
FTL_PID_FILE="$(getFTLPIDFile)"
FTL_PID_FILE="$(getFTLConfigValue files.pid)"
# Get FTL's current PID
FTL_PID="$(getFTLPID "${FTL_PID_FILE}")"

View File

@@ -17,18 +17,18 @@ StartLimitIntervalSec=60s
[Service]
User=pihole
PermissionsStartOnly=true
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_NET_ADMIN CAP_SYS_NICE CAP_IPC_LOCK CAP_CHOWN
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_NET_ADMIN CAP_SYS_NICE CAP_IPC_LOCK CAP_CHOWN CAP_SYS_TIME
ExecStartPre=/opt/pihole/pihole-FTL-prestart.sh
# Run prestart with elevated permissions
ExecStartPre=+/opt/pihole/pihole-FTL-prestart.sh
ExecStart=/usr/bin/pihole-FTL -f
Restart=on-failure
RestartSec=5s
ExecReload=/bin/kill -HUP $MAINPID
ExecStopPost=/opt/pihole/pihole-FTL-poststop.sh
ExecStopPost=+/opt/pihole/pihole-FTL-poststop.sh
# Use graceful shutdown with a reasonable timeout
TimeoutStopSec=10s
TimeoutStopSec=120s
# Make /usr, /boot, /etc and possibly some more folders read-only...
ProtectSystem=full

View File

@@ -24,7 +24,7 @@
# The flush script will use logrotate if available
# parameter "once": logrotate only once (default is twice)
# parameter "quiet": don't print messages
00 00 * * * root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole flush once quiet
00 00 * * * root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole logrotate quiet
@reboot root /usr/sbin/logrotate --state /var/lib/logrotate/pihole /etc/pihole/logrotate

View File

@@ -1,9 +0,0 @@
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Allows the WebUI to use Pi-hole commands
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
#

View File

@@ -1,79 +0,0 @@
_pihole() {
local cur prev opts opts_admin opts_checkout opts_chronometer opts_debug opts_interface opts_logging opts_privacy opts_query opts_update opts_version
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
prev2="${COMP_WORDS[COMP_CWORD-2]}"
case "${prev}" in
"pihole")
opts="admin blacklist checkout chronometer debug disable enable flush help logging query reconfigure regex restartdns status tail uninstall updateGravity updatePihole version wildcard whitelist arpflush"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
;;
"whitelist"|"blacklist"|"wildcard"|"regex")
opts_lists="\--delmode \--noreload \--quiet \--list \--nuke"
COMPREPLY=( $(compgen -W "${opts_lists}" -- ${cur}) )
;;
"admin")
opts_admin="celsius fahrenheit interface kelvin password privacylevel"
COMPREPLY=( $(compgen -W "${opts_admin}" -- ${cur}) )
;;
"checkout")
opts_checkout="core ftl web master dev"
COMPREPLY=( $(compgen -W "${opts_checkout}" -- ${cur}) )
;;
"chronometer")
opts_chronometer="\--exit \--json \--refresh"
COMPREPLY=( $(compgen -W "${opts_chronometer}" -- ${cur}) )
;;
"debug")
opts_debug="-a"
COMPREPLY=( $(compgen -W "${opts_debug}" -- ${cur}) )
;;
"logging")
opts_logging="on off 'off noflush'"
COMPREPLY=( $(compgen -W "${opts_logging}" -- ${cur}) )
;;
"query")
opts_query="-adlist -all -exact"
COMPREPLY=( $(compgen -W "${opts_query}" -- ${cur}) )
;;
"updatePihole"|"-up")
opts_update="--check-only"
COMPREPLY=( $(compgen -W "${opts_update}" -- ${cur}) )
;;
"version")
opts_version="\--admin \--current \--ftl \--hash \--latest \--pihole"
COMPREPLY=( $(compgen -W "${opts_version}" -- ${cur}) )
;;
"interface")
if ( [[ "$prev2" == "admin" ]] || [[ "$prev2" == "-a" ]] ); then
opts_interface="$(cat /proc/net/dev | cut -d: -s -f1)"
COMPREPLY=( $(compgen -W "${opts_interface}" -- ${cur}) )
else
return 1
fi
;;
"privacylevel")
if ( [[ "$prev2" == "admin" ]] || [[ "$prev2" == "-a" ]] ); then
opts_privacy="0 1 2 3"
COMPREPLY=( $(compgen -W "${opts_privacy}" -- ${cur}) )
else
return 1
fi
;;
"core"|"admin"|"ftl")
if [[ "$prev2" == "checkout" ]]; then
opts_checkout="master dev"
COMPREPLY=( $(compgen -W "${opts_checkout}" -- ${cur}) )
else
return 1
fi
;;
*)
return 1
;;
esac
return 0
}
complete -F _pihole pihole

View File

@@ -0,0 +1,9 @@
#!/bin/bash
#
# Bash completion script for pihole-FTL
#
# This completion script provides tab completion for pihole-FTL CLI flags and commands.
# It uses the `pihole-FTL --complete` command to generate the completion options.
_complete_FTL() { mapfile -t COMPREPLY < <(pihole-FTL --complete "${COMP_WORDS[@]}"); }
complete -F _complete_FTL pihole-FTL

View File

@@ -0,0 +1,59 @@
#!/bin/bash
#
# Bash completion script for pihole
#
_pihole() {
local cur prev prev2 opts opts_lists opts_checkout opts_debug opts_logging opts_query opts_update opts_networkflush
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
prev2="${COMP_WORDS[COMP_CWORD-2]}"
case "${prev}" in
"pihole")
opts="allow allow-regex allow-wild deny checkout debug disable enable flush help logging query repair regex reloaddns reloadlists setpassword status tail uninstall updateGravity updatePihole version wildcard networkflush api"
mapfile -t COMPREPLY < <(compgen -W "${opts}" -- "${cur}")
;;
"allow"|"deny"|"wildcard"|"regex"|"allow-regex"|"allow-wild")
opts_lists="\not \--delmode \--quiet \--list \--help"
mapfile -t COMPREPLY < <(compgen -W "${opts_lists}" -- "${cur}")
;;
"checkout")
opts_checkout="core ftl web master dev"
mapfile -t COMPREPLY < <(compgen -W "${opts_checkout}" -- "${cur}")
;;
"debug")
opts_debug="-a"
mapfile -t COMPREPLY < <(compgen -W "${opts_debug}" -- "${cur}")
;;
"logging")
opts_logging="on off 'off noflush'"
mapfile -t COMPREPLY < <(compgen -W "${opts_logging}" -- "${cur}")
;;
"query")
opts_query="--partial --all"
mapfile -t COMPREPLY < <(compgen -W "${opts_query}" -- "${cur}")
;;
"updatePihole"|"-up")
opts_update="--check-only"
mapfile -t COMPREPLY < <(compgen -W "${opts_update}" -- "${cur}")
;;
"networkflush")
opts_networkflush="--arp"
mapfile -t COMPREPLY < <(compgen -W "${opts_networkflush}" -- "${cur}")
;;
"core"|"web"|"ftl")
if [[ "$prev2" == "checkout" ]]; then
opts_checkout="master development"
mapfile -t COMPREPLY < <(compgen -W "${opts_checkout}" -- "${cur}")
else
return 1
fi
;;
*)
return 1
;;
esac
return 0
}
complete -F _pihole pihole

View File

@@ -1,648 +0,0 @@
# Configuration file for dnsmasq.
#
# Format is one option per line, legal options are the same
# as the long options legal on the command line. See
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
# Listen on this specific port instead of the standard DNS port
# (53). Setting this to zero completely disables DNS function,
# leaving only DHCP and/or TFTP.
#port=5353
# The following two options make you a better netizen, since they
# tell dnsmasq to filter out queries which the public DNS cannot
# answer, and which load the servers (especially the root servers)
# unnecessarily. If you have a dial-on-demand link they also stop
# these requests from bringing up the link unnecessarily.
# Never forward plain names (without a dot or domain part)
#domain-needed
# Never forward addresses in the non-routed address spaces.
#bogus-priv
# Uncomment these to enable DNSSEC validation and caching:
# (Requires dnsmasq to be built with DNSSEC option.)
#conf-file=%%PREFIX%%/share/dnsmasq/trust-anchors.conf
#dnssec
# Replies which are not DNSSEC signed may be legitimate, because the domain
# is unsigned, or may be forgeries. Setting this option tells dnsmasq to
# check that an unsigned reply is OK, by finding a secure proof that a DS
# record somewhere between the root and the domain does not exist.
# The cost of setting this is that even queries in unsigned domains will need
# one or more extra DNS queries to verify.
#dnssec-check-unsigned
# Uncomment this to filter useless windows-originated DNS requests
# which can trigger dial-on-demand links needlessly.
# Note that (amongst other things) this blocks all SRV requests,
# so don't use it if you use eg Kerberos, SIP, XMMP or Google-talk.
# This option only affects forwarding, SRV records originating for
# dnsmasq (via srv-host= lines) are not suppressed by it.
#filterwin2k
# Change this line if you want dns to get its upstream servers from
# somewhere other that /etc/resolv.conf
#resolv-file=
# By default, dnsmasq will send queries to any of the upstream
# servers it knows about and tries to favor servers to are known
# to be up. Uncommenting this forces dnsmasq to try each query
# with each server strictly in the order they appear in
# /etc/resolv.conf
#strict-order
# If you don't want dnsmasq to read /etc/resolv.conf or any other
# file, getting its servers from this file instead (see below), then
# uncomment this.
#no-resolv
# If you don't want dnsmasq to poll /etc/resolv.conf or other resolv
# files for changes and re-read them then uncomment this.
#no-poll
# Add other name servers here, with domain specs if they are for
# non-public domains.
#server=/localnet/192.168.0.1
# Example of routing PTR queries to nameservers: this will send all
# address->name queries for 192.168.3/24 to nameserver 10.1.2.3
#server=/3.168.192.in-addr.arpa/10.1.2.3
# Add local-only domains here, queries in these domains are answered
# from /etc/hosts or DHCP only.
#local=/localnet/
# Add domains which you want to force to an IP address here.
# The example below send any host in double-click.net to a local
# web-server.
#address=/double-click.net/127.0.0.1
# --address (and --server) work with IPv6 addresses too.
#address=/www.thekelleys.org.uk/fe80::20d:60ff:fe36:f83
# Add the IPs of all queries to yahoo.com, google.com, and their
# subdomains to the vpn and search ipsets:
#ipset=/yahoo.com/google.com/vpn,search
# You can control how dnsmasq talks to a server: this forces
# queries to 10.1.2.3 to be routed via eth1
# server=10.1.2.3@eth1
# and this sets the source (ie local) address used to talk to
# 10.1.2.3 to 192.168.1.1 port 55 (there must be a interface with that
# IP on the machine, obviously).
# server=10.1.2.3@192.168.1.1#55
# If you want dnsmasq to change uid and gid to something other
# than the default, edit the following lines.
#user=
#group=
# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
# Repeat the line for more than one interface.
#interface=
# Or you can specify which interface _not_ to listen on
#except-interface=
# Or which to listen on by address (remember to include 127.0.0.1 if
# you use this.)
#listen-address=
# If you want dnsmasq to provide only DNS service on an interface,
# configure it as shown above, and then use the following line to
# disable DHCP and TFTP on it.
#no-dhcp-interface=
# On systems which support it, dnsmasq binds the wildcard address,
# even when it is listening on only some interfaces. It then discards
# requests that it shouldn't reply to. This has the advantage of
# working even when interfaces come and go and change address. If you
# want dnsmasq to really bind only the interfaces it is listening on,
# uncomment this option. About the only time you may need this is when
# running another nameserver on the same machine.
#bind-interfaces
# If you don't want dnsmasq to read /etc/hosts, uncomment the
# following line.
#no-hosts
# or if you want it to read another file, as well as /etc/hosts, use
# this.
#addn-hosts=/etc/banner_add_hosts
# Set this (and domain: see below) if you want to have a domain
# automatically added to simple names in a hosts-file.
#expand-hosts
# Set the domain for dnsmasq. this is optional, but if it is set, it
# does the following things.
# 1) Allows DHCP hosts to have fully qualified domain names, as long
# as the domain part matches this setting.
# 2) Sets the "domain" DHCP option thereby potentially setting the
# domain of all systems configured by DHCP
# 3) Provides the domain part for "expand-hosts"
#domain=thekelleys.org.uk
# Set a different domain for a particular subnet
#domain=wireless.thekelleys.org.uk,192.168.2.0/24
# Same idea, but range rather then subnet
#domain=reserved.thekelleys.org.uk,192.68.3.100,192.168.3.200
# Uncomment this to enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
# a lease time. If you have more than one network, you will need to
# repeat this for each network on which you want to supply DHCP
# service.
#dhcp-range=192.168.0.50,192.168.0.150,12h
# This is an example of a DHCP range where the netmask is given. This
# is needed for networks we reach the dnsmasq DHCP server via a relay
# agent. If you don't know what a DHCP relay agent is, you probably
# don't need to worry about this.
#dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h
# This is an example of a DHCP range which sets a tag, so that
# some DHCP options may be set only for this network.
#dhcp-range=set:red,192.168.0.50,192.168.0.150
# Use this DHCP range only when the tag "green" is set.
#dhcp-range=tag:green,192.168.0.50,192.168.0.150,12h
# Specify a subnet which can't be used for dynamic address allocation,
# is available for hosts with matching --dhcp-host lines. Note that
# dhcp-host declarations will be ignored unless there is a dhcp-range
# of some type for the subnet in question.
# In this case the netmask is implied (it comes from the network
# configuration on the machine running dnsmasq) it is possible to give
# an explicit netmask instead.
#dhcp-range=192.168.0.0,static
# Enable DHCPv6. Note that the prefix-length does not need to be specified
# and defaults to 64 if missing/
#dhcp-range=1234::2, 1234::500, 64, 12h
# Do Router Advertisements, BUT NOT DHCP for this subnet.
#dhcp-range=1234::, ra-only
# Do Router Advertisements, BUT NOT DHCP for this subnet, also try and
# add names to the DNS for the IPv6 address of SLAAC-configured dual-stack
# hosts. Use the DHCPv4 lease to derive the name, network segment and
# MAC address and assume that the host will also have an
# IPv6 address calculated using the SLAAC algorithm.
#dhcp-range=1234::, ra-names
# Do Router Advertisements, BUT NOT DHCP for this subnet.
# Set the lifetime to 46 hours. (Note: minimum lifetime is 2 hours.)
#dhcp-range=1234::, ra-only, 48h
# Do DHCP and Router Advertisements for this subnet. Set the A bit in the RA
# so that clients can use SLAAC addresses as well as DHCP ones.
#dhcp-range=1234::2, 1234::500, slaac
# Do Router Advertisements and stateless DHCP for this subnet. Clients will
# not get addresses from DHCP, but they will get other configuration information.
# They will use SLAAC for addresses.
#dhcp-range=1234::, ra-stateless
# Do stateless DHCP, SLAAC, and generate DNS names for SLAAC addresses
# from DHCPv4 leases.
#dhcp-range=1234::, ra-stateless, ra-names
# Do router advertisements for all subnets where we're doing DHCPv6
# Unless overridden by ra-stateless, ra-names, et al, the router
# advertisements will have the M and O bits set, so that the clients
# get addresses and configuration from DHCPv6, and the A bit reset, so the
# clients don't use SLAAC addresses.
#enable-ra
# Supply parameters for specified hosts using DHCP. There are lots
# of valid alternatives, so we will give examples of each. Note that
# IP addresses DO NOT have to be in the range given above, they just
# need to be on the same network. The order of the parameters in these
# do not matter, it's permissible to give name, address and MAC in any
# order.
# Always allocate the host with Ethernet address 11:22:33:44:55:66
# The IP address 192.168.0.60
#dhcp-host=11:22:33:44:55:66,192.168.0.60
# Always set the name of the host with hardware address
# 11:22:33:44:55:66 to be "fred"
#dhcp-host=11:22:33:44:55:66,fred
# Always give the host with Ethernet address 11:22:33:44:55:66
# the name fred and IP address 192.168.0.60 and lease time 45 minutes
#dhcp-host=11:22:33:44:55:66,fred,192.168.0.60,45m
# Give a host with Ethernet address 11:22:33:44:55:66 or
# 12:34:56:78:90:12 the IP address 192.168.0.60. Dnsmasq will assume
# that these two Ethernet interfaces will never be in use at the same
# time, and give the IP address to the second, even if it is already
# in use by the first. Useful for laptops with wired and wireless
# addresses.
#dhcp-host=11:22:33:44:55:66,12:34:56:78:90:12,192.168.0.60
# Give the machine which says its name is "bert" IP address
# 192.168.0.70 and an infinite lease
#dhcp-host=bert,192.168.0.70,infinite
# Always give the host with client identifier 01:02:02:04
# the IP address 192.168.0.60
#dhcp-host=id:01:02:02:04,192.168.0.60
# Always give the host with client identifier "marjorie"
# the IP address 192.168.0.60
#dhcp-host=id:marjorie,192.168.0.60
# Enable the address given for "judge" in /etc/hosts
# to be given to a machine presenting the name "judge" when
# it asks for a DHCP lease.
#dhcp-host=judge
# Never offer DHCP service to a machine whose Ethernet
# address is 11:22:33:44:55:66
#dhcp-host=11:22:33:44:55:66,ignore
# Ignore any client-id presented by the machine with Ethernet
# address 11:22:33:44:55:66. This is useful to prevent a machine
# being treated differently when running under different OS's or
# between PXE boot and OS boot.
#dhcp-host=11:22:33:44:55:66,id:*
# Send extra options which are tagged as "red" to
# the machine with Ethernet address 11:22:33:44:55:66
#dhcp-host=11:22:33:44:55:66,set:red
# Send extra options which are tagged as "red" to
# any machine with Ethernet address starting 11:22:33:
#dhcp-host=11:22:33:*:*:*,set:red
# Give a fixed IPv6 address and name to client with
# DUID 00:01:00:01:16:d2:83:fc:92:d4:19:e2:d8:b2
# Note the MAC addresses CANNOT be used to identify DHCPv6 clients.
# Note also the they [] around the IPv6 address are obligatory.
#dhcp-host=id:00:01:00:01:16:d2:83:fc:92:d4:19:e2:d8:b2, fred, [1234::5]
# Ignore any clients which are not specified in dhcp-host lines
# or /etc/ethers. Equivalent to ISC "deny unknown-clients".
# This relies on the special "known" tag which is set when
# a host is matched.
#dhcp-ignore=tag:!known
# Send extra options which are tagged as "red" to any machine whose
# DHCP vendorclass string includes the substring "Linux"
#dhcp-vendorclass=set:red,Linux
# Send extra options which are tagged as "red" to any machine one
# of whose DHCP userclass strings includes the substring "accounts"
#dhcp-userclass=set:red,accounts
# Send extra options which are tagged as "red" to any machine whose
# MAC address matches the pattern.
#dhcp-mac=set:red,00:60:8C:*:*:*
# If this line is uncommented, dnsmasq will read /etc/ethers and act
# on the ethernet-address/IP pairs found there just as if they had
# been given as --dhcp-host options. Useful if you keep
# MAC-address/host mappings there for other purposes.
#read-ethers
# Send options to hosts which ask for a DHCP lease.
# See RFC 2132 for details of available options.
# Common options can be given to dnsmasq by name:
# run "dnsmasq --help dhcp" to get a list.
# Note that all the common settings, such as netmask and
# broadcast address, DNS server and default route, are given
# sane defaults by dnsmasq. You very likely will not need
# any dhcp-options. If you use Windows clients and Samba, there
# are some options which are recommended, they are detailed at the
# end of this section.
# Override the default route supplied by dnsmasq, which assumes the
# router is the same machine as the one running dnsmasq.
#dhcp-option=3,1.2.3.4
# Do the same thing, but using the option name
#dhcp-option=option:router,1.2.3.4
# Override the default route supplied by dnsmasq and send no default
# route at all. Note that this only works for the options sent by
# default (1, 3, 6, 12, 28) the same line will send a zero-length option
# for all other option numbers.
#dhcp-option=3
# Set the NTP time server addresses to 192.168.0.4 and 10.10.0.5
#dhcp-option=option:ntp-server,192.168.0.4,10.10.0.5
# Send DHCPv6 option. Note [] around IPv6 addresses.
#dhcp-option=option6:dns-server,[1234::77],[1234::88]
# Send DHCPv6 option for namservers as the machine running
# dnsmasq and another.
#dhcp-option=option6:dns-server,[::],[1234::88]
# Ask client to poll for option changes every six hours. (RFC4242)
#dhcp-option=option6:information-refresh-time,6h
# Set the NTP time server address to be the same machine as
# is running dnsmasq
#dhcp-option=42,0.0.0.0
# Set the NIS domain name to "welly"
#dhcp-option=40,welly
# Set the default time-to-live to 50
#dhcp-option=23,50
# Set the "all subnets are local" flag
#dhcp-option=27,1
# Send the etherboot magic flag and then etherboot options (a string).
#dhcp-option=128,e4:45:74:68:00:00
#dhcp-option=129,NIC=eepro100
# Specify an option which will only be sent to the "red" network
# (see dhcp-range for the declaration of the "red" network)
# Note that the tag: part must precede the option: part.
#dhcp-option = tag:red, option:ntp-server, 192.168.1.1
# The following DHCP options set up dnsmasq in the same way as is specified
# for the ISC dhcpcd in
# http://www.samba.org/samba/ftp/docs/textdocs/DHCP-Server-Configuration.txt
# adapted for a typical dnsmasq installation where the host running
# dnsmasq is also the host running samba.
# you may want to uncomment some or all of them if you use
# Windows clients and Samba.
#dhcp-option=19,0 # option ip-forwarding off
#dhcp-option=44,0.0.0.0 # set netbios-over-TCP/IP nameserver(s) aka WINS server(s)
#dhcp-option=45,0.0.0.0 # netbios datagram distribution server
#dhcp-option=46,8 # netbios node type
# Send an empty WPAD option. This may be REQUIRED to get windows 7 to behave.
#dhcp-option=252,"\n"
# Send RFC-3397 DNS domain search DHCP option. WARNING: Your DHCP client
# probably doesn't support this......
#dhcp-option=option:domain-search,eng.apple.com,marketing.apple.com
# Send RFC-3442 classless static routes (note the netmask encoding)
#dhcp-option=121,192.168.1.0/24,1.2.3.4,10.0.0.0/8,5.6.7.8
# Send vendor-class specific options encapsulated in DHCP option 43.
# The meaning of the options is defined by the vendor-class so
# options are sent only when the client supplied vendor class
# matches the class given here. (A substring match is OK, so "MSFT"
# matches "MSFT" and "MSFT 5.0"). This example sets the
# mtftp address to 0.0.0.0 for PXEClients.
#dhcp-option=vendor:PXEClient,1,0.0.0.0
# Send microsoft-specific option to tell windows to release the DHCP lease
# when it shuts down. Note the "i" flag, to tell dnsmasq to send the
# value as a four-byte integer - that's what microsoft wants. See
# http://technet2.microsoft.com/WindowsServer/en/library/a70f1bb7-d2d4-49f0-96d6-4b7414ecfaae1033.mspx?mfr=true
#dhcp-option=vendor:MSFT,2,1i
# Send the Encapsulated-vendor-class ID needed by some configurations of
# Etherboot to allow is to recognize the DHCP server.
#dhcp-option=vendor:Etherboot,60,"Etherboot"
# Send options to PXELinux. Note that we need to send the options even
# though they don't appear in the parameter request list, so we need
# to use dhcp-option-force here.
# See http://syslinux.zytor.com/pxe.php#special for details.
# Magic number - needed before anything else is recognized
#dhcp-option-force=208,f1:00:74:7e
# Configuration file name
#dhcp-option-force=209,configs/common
# Path prefix
#dhcp-option-force=210,/tftpboot/pxelinux/files/
# Reboot time. (Note 'i' to send 32-bit value)
#dhcp-option-force=211,30i
# Set the boot filename for netboot/PXE. You will only need
# this is you want to boot machines over the network and you will need
# a TFTP server; either dnsmasq's built in TFTP server or an
# external one. (See below for how to enable the TFTP server.)
#dhcp-boot=pxelinux.0
# The same as above, but use custom tftp-server instead machine running dnsmasq
#dhcp-boot=pxelinux,server.name,192.168.1.100
# Boot for Etherboot gPXE. The idea is to send two different
# filenames, the first loads gPXE, and the second tells gPXE what to
# load. The dhcp-match sets the gpxe tag for requests from gPXE.
#dhcp-match=set:gpxe,175 # gPXE sends a 175 option.
#dhcp-boot=tag:!gpxe,undionly.kpxe
#dhcp-boot=mybootimage
# Encapsulated options for Etherboot gPXE. All the options are
# encapsulated within option 175
#dhcp-option=encap:175, 1, 5b # priority code
#dhcp-option=encap:175, 176, 1b # no-proxydhcp
#dhcp-option=encap:175, 177, string # bus-id
#dhcp-option=encap:175, 189, 1b # BIOS drive code
#dhcp-option=encap:175, 190, user # iSCSI username
#dhcp-option=encap:175, 191, pass # iSCSI password
# Test for the architecture of a netboot client. PXE clients are
# supposed to send their architecture as option 93. (See RFC 4578)
#dhcp-match=peecees, option:client-arch, 0 #x86-32
#dhcp-match=itanics, option:client-arch, 2 #IA64
#dhcp-match=hammers, option:client-arch, 6 #x86-64
#dhcp-match=mactels, option:client-arch, 7 #EFI x86-64
# Do real PXE, rather than just booting a single file, this is an
# alternative to dhcp-boot.
#pxe-prompt="What system shall I netboot?"
# or with timeout before first available action is taken:
#pxe-prompt="Press F8 for menu.", 60
# Available boot services. for PXE.
#pxe-service=x86PC, "Boot from local disk"
# Loads <tftp-root>/pxelinux.0 from dnsmasq TFTP server.
#pxe-service=x86PC, "Install Linux", pxelinux
# Loads <tftp-root>/pxelinux.0 from TFTP server at 1.2.3.4.
# Beware this fails on old PXE ROMS.
#pxe-service=x86PC, "Install Linux", pxelinux, 1.2.3.4
# Use bootserver on network, found my multicast or broadcast.
#pxe-service=x86PC, "Install windows from RIS server", 1
# Use bootserver at a known IP address.
#pxe-service=x86PC, "Install windows from RIS server", 1, 1.2.3.4
# If you have multicast-FTP available,
# information for that can be passed in a similar way using options 1
# to 5. See page 19 of
# http://download.intel.com/design/archives/wfm/downloads/pxespec.pdf
# Enable dnsmasq's built-in TFTP server
#enable-tftp
# Set the root directory for files available via FTP.
#tftp-root=/var/ftpd
# Make the TFTP server more secure: with this set, only files owned by
# the user dnsmasq is running as will be send over the net.
#tftp-secure
# This option stops dnsmasq from negotiating a larger blocksize for TFTP
# transfers. It will slow things down, but may rescue some broken TFTP
# clients.
#tftp-no-blocksize
# Set the boot file name only when the "red" tag is set.
#dhcp-boot=tag:red,pxelinux.red-net
# An example of dhcp-boot with an external TFTP server: the name and IP
# address of the server are given after the filename.
# Can fail with old PXE ROMS. Overridden by --pxe-service.
#dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3
# If there are multiple external tftp servers having a same name
# (using /etc/hosts) then that name can be specified as the
# tftp_servername (the third option to dhcp-boot) and in that
# case dnsmasq resolves this name and returns the resultant IP
# addresses in round robin fashion. This facility can be used to
# load balance the tftp load among a set of servers.
#dhcp-boot=/var/ftpd/pxelinux.0,boothost,tftp_server_name
# Set the limit on DHCP leases, the default is 150
#dhcp-lease-max=150
# The DHCP server needs somewhere on disk to keep its lease database.
# This defaults to a sane location, but if you want to change it, use
# the line below.
#dhcp-leasefile=/var/lib/misc/dnsmasq.leases
# Set the DHCP server to authoritative mode. In this mode it will barge in
# and take over the lease for any client which broadcasts on the network,
# whether it has a record of the lease or not. This avoids long timeouts
# when a machine wakes up on a new network. DO NOT enable this if there's
# the slightest chance that you might end up accidentally configuring a DHCP
# server for your campus/company accidentally. The ISC server uses
# the same option, and this URL provides more information:
# http://www.isc.org/files/auth.html
#dhcp-authoritative
# Run an executable when a DHCP lease is created or destroyed.
# The arguments sent to the script are "add" or "del",
# then the MAC address, the IP address and finally the hostname
# if there is one.
#dhcp-script=/bin/echo
# Set the cachesize here.
#cache-size=150
# If you want to disable negative caching, uncomment this.
#no-negcache
# Normally responses which come from /etc/hosts and the DHCP lease
# file have Time-To-Live set as zero, which conventionally means
# do not cache further. If you are happy to trade lower load on the
# server for potentially stale date, you can set a time-to-live (in
# seconds) here.
#local-ttl=
# If you want dnsmasq to detect attempts by Verisign to send queries
# to unregistered .com and .net hosts to its sitefinder service and
# have dnsmasq instead return the correct NXDOMAIN response, uncomment
# this line. You can add similar lines to do the same for other
# registries which have implemented wildcard A records.
#bogus-nxdomain=64.94.110.11
# If you want to fix up DNS results from upstream servers, use the
# alias option. This only works for IPv4.
# This alias makes a result of 1.2.3.4 appear as 5.6.7.8
#alias=1.2.3.4,5.6.7.8
# and this maps 1.2.3.x to 5.6.7.x
#alias=1.2.3.0,5.6.7.0,255.255.255.0
# and this maps 192.168.0.10->192.168.0.40 to 10.0.0.10->10.0.0.40
#alias=192.168.0.10-192.168.0.40,10.0.0.0,255.255.255.0
# Change these lines if you want dnsmasq to serve MX records.
# Return an MX record named "maildomain.com" with target
# servermachine.com and preference 50
#mx-host=maildomain.com,servermachine.com,50
# Set the default target for MX records created using the localmx option.
#mx-target=servermachine.com
# Return an MX record pointing to the mx-target for all local
# machines.
#localmx
# Return an MX record pointing to itself for all local machines.
#selfmx
# Change the following lines if you want dnsmasq to serve SRV
# records. These are useful if you want to serve ldap requests for
# Active Directory and other windows-originated DNS requests.
# See RFC 2782.
# You may add multiple srv-host lines.
# The fields are <name>,<target>,<port>,<priority>,<weight>
# If the domain part if missing from the name (so that is just has the
# service and protocol sections) then the domain given by the domain=
# config option is used. (Note that expand-hosts does not need to be
# set for this to work.)
# A SRV record sending LDAP for the example.com domain to
# ldapserver.example.com port 389
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389
# A SRV record sending LDAP for the example.com domain to
# ldapserver.example.com port 389 (using domain=)
#domain=example.com
#srv-host=_ldap._tcp,ldapserver.example.com,389
# Two SRV records for LDAP, each with different priorities
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389,1
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389,2
# A SRV record indicating that there is no LDAP server for the domain
# example.com
#srv-host=_ldap._tcp.example.com
# The following line shows how to make dnsmasq serve an arbitrary PTR
# record. This is useful for DNS-SD. (Note that the
# domain-name expansion done for SRV records _does_not
# occur for PTR records.)
#ptr-record=_http._tcp.dns-sd-services,"New Employee Page._http._tcp.dns-sd-services"
# Change the following lines to enable dnsmasq to serve TXT records.
# These are used for things like SPF and zeroconf. (Note that the
# domain-name expansion done for SRV records _does_not
# occur for TXT records.)
#Example SPF.
#txt-record=example.com,"v=spf1 a -all"
#Example zeroconf
#txt-record=_http._tcp.example.com,name=value,paper=A4
# Provide an alias for a "local" DNS name. Note that this _only_ works
# for targets which are names from DHCP or /etc/hosts. Give host
# "bert" another name, bertrand
#cname=bertand,bert
# For debugging purposes, log each DNS query as it passes through
# dnsmasq.
#log-queries
# Log lots of extra information about DHCP transactions.
#log-dhcp
# Include another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
#conf-dir=/etc/dnsmasq.d
# Include all the files in a directory except those ending in .bak
#conf-dir=/etc/dnsmasq.d,.bak
# Include all files in a directory which end in .conf
#conf-dir=/etc/dnsmasq.d/*.conf

View File

@@ -1,73 +0,0 @@
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Lighttpd config for Pi-hole
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
###################################################################################################
# IF THIS HEADER EXISTS, THE FILE WILL BE OVERWRITTEN BY PI-HOLE'S UPDATE PROCEDURE. #
# ANY CHANGES MADE TO THIS FILE WILL BE LOST ON THE NEXT UPDATE UNLESS YOU REMOVE THIS HEADER #
# #
# ENSURE THAT YOU DO NOT REMOVE THE REQUIRED LINE: #
# #
# include "/etc/lighttpd/conf-enabled/*.conf" #
# #
###################################################################################################
server.modules = (
"mod_access",
"mod_auth",
"mod_expire",
"mod_redirect",
"mod_setenv",
"mod_rewrite"
)
server.document-root = "/var/www/html"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error-pihole.log"
server.pid-file = "/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
# For lighttpd version 1.4.46 or above, the port can be overwritten in `/etc/lighttpd/external.conf` using the := operator
# e.g. server.port := 8000
server.port = 80
# Allow streaming response
# reference: https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_stream-response-bodyDetails
server.stream-response-body = 1
#ssl.read-ahead = "disable"
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc", ".md", ".yml", ".ini" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
mimetype.assign = (
".ico" => "image/x-icon",
".jpeg" => "image/jpeg",
".jpg" => "image/jpeg",
".png" => "image/png",
".svg" => "image/svg+xml",
".css" => "text/css; charset=utf-8",
".html" => "text/html; charset=utf-8",
".js" => "text/javascript; charset=utf-8",
".json" => "application/json; charset=utf-8",
".map" => "application/json; charset=utf-8",
".txt" => "text/plain; charset=utf-8",
".eot" => "application/vnd.ms-fontobject",
".otf" => "font/otf",
".ttc" => "font/collection",
".ttf" => "font/ttf",
".woff" => "font/woff",
".woff2" => "font/woff2"
)
# Add user chosen options held in (optional) external file
include "external*.conf"
# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include "/etc/lighttpd/conf-enabled/*.conf"

View File

@@ -1,87 +0,0 @@
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Lighttpd config for Pi-hole
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
###################################################################################################
# IF THIS HEADER EXISTS, THE FILE WILL BE OVERWRITTEN BY PI-HOLE'S UPDATE PROCEDURE. #
# ANY CHANGES MADE TO THIS FILE WILL BE LOST ON THE NEXT UPDATE UNLESS YOU REMOVE THIS HEADER #
# #
# ENSURE THAT YOU DO NOT REMOVE THE REQUIRED LINE: #
# #
# include "/etc/lighttpd/conf.d/pihole-admin.conf" #
# #
###################################################################################################
server.modules = (
"mod_access",
"mod_auth",
"mod_expire",
"mod_fastcgi",
"mod_accesslog",
"mod_redirect",
"mod_setenv",
"mod_rewrite"
)
server.document-root = "/var/www/html"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error-pihole.log"
server.pid-file = "/run/lighttpd.pid"
server.username = "lighttpd"
server.groupname = "lighttpd"
# For lighttpd version 1.4.46 or above, the port can be overwritten in `/etc/lighttpd/external.conf` using the := operator
# e.g. server.port := 8000
server.port = 80
# Allow streaming response
# reference: https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_stream-response-bodyDetails
server.stream-response-body = 1
#ssl.read-ahead = "disable"
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc", ".md", ".yml", ".ini" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
mimetype.assign = (
".ico" => "image/x-icon",
".jpeg" => "image/jpeg",
".jpg" => "image/jpeg",
".png" => "image/png",
".svg" => "image/svg+xml",
".css" => "text/css; charset=utf-8",
".html" => "text/html; charset=utf-8",
".js" => "text/javascript; charset=utf-8",
".json" => "application/json; charset=utf-8",
".map" => "application/json; charset=utf-8",
".txt" => "text/plain; charset=utf-8",
".eot" => "application/vnd.ms-fontobject",
".otf" => "font/otf",
".ttc" => "font/collection",
".ttf" => "font/ttf",
".woff" => "font/woff",
".woff2" => "font/woff2"
)
# Add user chosen options held in (optional) external file
include "external*.conf"
# default listening port for IPv6 falls back to the IPv4 port
#include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
#include_shell "/usr/share/lighttpd/create-mime.assign.pl"
#include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
fastcgi.server = (
".php" => (
"localhost" => (
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi"
)
)
)
include "/etc/lighttpd/conf.d/pihole-admin.conf"

View File

@@ -1,82 +0,0 @@
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Lighttpd config for Pi-hole
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
###############################################################################
# FILE AUTOMATICALLY OVERWRITTEN BY PI-HOLE INSTALL/UPDATE PROCEDURE. #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
###############################################################################
server.errorlog := "/var/log/lighttpd/error-pihole.log"
$HTTP["url"] =~ "^/admin/" {
server.document-root = "/var/www/html"
server.stream-response-body = 1
accesslog.filename = "/var/log/lighttpd/access-pihole.log"
accesslog.format = "%{%s}t|%h|%V|%r|%s|%b"
fastcgi.server = (
".php" => (
"localhost" => (
"socket" => "/run/lighttpd/pihole-php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi",
"min-procs" => 1,
"max-procs" => 1,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "4",
"PHP_FCGI_MAX_REQUESTS" => "10000",
),
"bin-copy-environment" => (
"PATH", "SHELL", "USER"
),
"broken-scriptfilename" => "enable",
)
)
)
# X-Pi-hole is a response header for debugging using curl -I
# X-Frame-Options prevents clickjacking attacks and helps ensure your content is not embedded into other sites via < frame >, < iframe > or < object >.
# X-XSS-Protection sets the configuration for the cross-site scripting filters built into most browsers. This is important because it tells the browser to block the response if a malicious script has been inserted from a user input. (deprecated; disabled)
# X-Content-Type-Options stops a browser from trying to MIME-sniff the content type and forces it to stick with the declared content-type. This is important because the browser will only load external resources if their content-type matches what is expected, and not malicious hidden code.
# Content-Security-Policy tells the browser where resources are allowed to be loaded and if its allowed to parse/run inline styles or Javascript. This is important because it prevents content injection attacks, such as Cross Site Scripting (XSS).
# X-Permitted-Cross-Domain-Policies is an XML document that grants a web client, such as Adobe Flash Player or Adobe Acrobat (though not necessarily limited to these), permission to handle data across domains.
# Referrer-Policy allows control/restriction of the amount of information present in the referral header for links away from your page—the URL path or even if the header is sent at all.
setenv.add-response-header = (
"X-Pi-hole" => "The Pi-hole Web interface is working!",
"X-Frame-Options" => "DENY",
"X-XSS-Protection" => "0",
"X-Content-Type-Options" => "nosniff",
"Content-Security-Policy" => "default-src 'self' 'unsafe-inline';",
"X-Permitted-Cross-Domain-Policies" => "none",
"Referrer-Policy" => "same-origin"
)
# Block . files from being served, such as .git, .github, .gitignore
$HTTP["url"] =~ "^/admin/\." {
url.access-deny = ("")
}
# allow teleporter and API qr code iframe on settings page
$HTTP["url"] =~ "/(teleporter|api_token)\.php$" {
$HTTP["referer"] =~ "/admin/settings\.php" {
setenv.set-response-header = ( "X-Frame-Options" => "SAMEORIGIN" )
}
}
}
else $HTTP["url"] == "/admin" {
url.redirect = ("" => "/admin/")
}
$HTTP["host"] == "pi.hole" {
$HTTP["url"] == "/" {
url.redirect = ("" => "/admin/")
}
}
# (keep this on one line for basic-install.sh filtering during install)
server.modules += ( "mod_access", "mod_accesslog", "mod_redirect", "mod_fastcgi", "mod_setenv" )

File diff suppressed because it is too large Load Diff

View File

@@ -8,13 +8,17 @@
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
# shellcheck source="./advanced/Scripts/COL_TABLE"
source "/opt/pihole/COL_TABLE"
# shellcheck source="./advanced/Scripts/utils.sh"
source "/opt/pihole/utils.sh"
# getFTLConfigValue() from utils.sh
while true; do
read -rp " ${QST} Are you sure you would like to remove ${COL_WHITE}Pi-hole${COL_NC}? [y/N] " answer
read -rp " ${QST} Are you sure you would like to remove ${COL_BOLD}Pi-hole${COL_NC}? [y/N] " answer
case ${answer} in
[Yy]* ) break;;
* ) echo -e "${OVER} ${COL_LIGHT_GREEN}Uninstall has been canceled${COL_NC}"; exit 0;;
* ) echo -e "${OVER} ${COL_GREEN}Uninstall has been canceled${COL_NC}"; exit 0;;
esac
done
@@ -23,238 +27,200 @@ str="Root user check"
if [[ ${EUID} -eq 0 ]]; then
echo -e " ${TICK} ${str}"
else
# Check if sudo is actually installed
# If it isn't, exit because the uninstall can not complete
if [ -x "$(command -v sudo)" ]; then
export SUDO="sudo"
else
echo -e " ${CROSS} ${str}
Script called with non-root privileges
The Pi-hole requires elevated privileges to uninstall"
exit 1
fi
fi
readonly PI_HOLE_FILES_DIR="/etc/.pihole"
SKIP_INSTALL="true"
source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh"
# setupVars set in basic-install.sh
source "${setupVars}"
# package_manager_detect() sourced from basic-install.sh
package_manager_detect
# Uninstall packages used by the Pi-hole
DEPS=("${INSTALLER_DEPS[@]}" "${PIHOLE_DEPS[@]}" "${OS_CHECK_DEPS[@]}")
if [[ "${INSTALL_WEB_SERVER}" == true ]]; then
# Install the Web dependencies
DEPS+=("${PIHOLE_WEB_DEPS[@]}")
fi
# Compatibility
if [ -x "$(command -v apt-get)" ]; then
# Debian Family
PKG_REMOVE=("${PKG_MANAGER}" -y remove --purge)
package_check() {
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
}
elif [ -x "$(command -v rpm)" ]; then
# Fedora Family
PKG_REMOVE=("${PKG_MANAGER}" remove -y)
package_check() {
rpm -qa | grep "^$1-" > /dev/null
}
else
echo -e " ${CROSS} OS distribution not supported"
echo -e " ${CROSS} ${str}
Script called with non-root privileges
The Pi-hole requires elevated privileges to uninstall"
exit 1
fi
removeAndPurge() {
# Purge dependencies
# Get paths for admin interface, log files and database files,
# to allow deletion where user has specified a non-default location
ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome")
FTL_LOG=$(getFTLConfigValue "files.log.ftl")
DNSMASQ_LOG=$(getFTLConfigValue "files.log.dnsmasq")
WEBSERVER_LOG=$(getFTLConfigValue "files.log.webserver")
PIHOLE_DB=$(getFTLConfigValue "files.database")
GRAVITY_DB=$(getFTLConfigValue "files.gravity")
MACVENDOR_DB=$(getFTLConfigValue "files.macvendor")
PI_HOLE_LOCAL_REPO="/etc/.pihole"
# Setting SKIP_INSTALL="true" to source the installer functions without running them
SKIP_INSTALL="true"
# shellcheck source="./automated install/basic-install.sh"
source "${PI_HOLE_LOCAL_REPO}/automated install/basic-install.sh"
# Functions and Variables sources from basic-install:
# package_manager_detect(), disable_service(), stop_service(),
# restart service() and is_command()
# PI_HOLE_CONFIG_DIR PI_HOLE_INSTALL_DIR PI_HOLE_LOCAL_REPO
removeMetaPackage() {
# Purge Pi-hole meta package
echo ""
for i in "${DEPS[@]}"; do
if package_check "${i}" > /dev/null; then
while true; do
read -rp " ${QST} Do you wish to remove ${COL_WHITE}${i}${COL_NC} from your system? [Y/N] " answer
case ${answer} in
[Yy]* )
echo -ne " ${INFO} Removing ${i}...";
${SUDO} "${PKG_REMOVE[@]}" "${i}" &> /dev/null;
echo -e "${OVER} ${INFO} Removed ${i}";
break;;
[Nn]* ) echo -e " ${INFO} Skipped ${i}"; break;;
esac
done
else
echo -e " ${INFO} Package ${i} not installed"
fi
done
# Remove dnsmasq config files
${SUDO} rm -f /etc/dnsmasq.conf /etc/dnsmasq.conf.orig /etc/dnsmasq.d/*-pihole*.conf &> /dev/null
echo -e " ${TICK} Removing dnsmasq config files"
# Call removeNoPurge to remove Pi-hole specific files
removeNoPurge
echo -ne " ${INFO} Removing Pi-hole meta package...";
eval "${PKG_REMOVE}" "pihole-meta" &> /dev/null;
echo -e "${OVER} ${INFO} Removed Pi-hole meta package";
}
removeNoPurge() {
# Only web directories/files that are created by Pi-hole should be removed
removeWebInterface() {
# Remove the web interface of Pi-hole
echo -ne " ${INFO} Removing Web Interface..."
${SUDO} rm -rf /var/www/html/admin &> /dev/null
${SUDO} rm -rf /var/www/html/pihole &> /dev/null
${SUDO} rm -f /var/www/html/index.lighttpd.orig &> /dev/null
# If the web directory is empty after removing these files, then the parent html directory can be removed.
if [ -d "/var/www/html" ]; then
if [[ ! "$(ls -A /var/www/html)" ]]; then
${SUDO} rm -rf /var/www/html &> /dev/null
fi
fi
rm -rf "${ADMIN_INTERFACE_DIR:-/var/www/html/admin/}" &> /dev/null
echo -e "${OVER} ${TICK} Removed Web Interface"
}
# Attempt to preserve backwards compatibility with older versions
# to guarantee no additional changes were made to /etc/crontab after
# the installation of pihole, /etc/crontab.pihole should be permanently
# preserved.
if [[ -f /etc/crontab.orig ]]; then
${SUDO} mv /etc/crontab /etc/crontab.pihole
${SUDO} mv /etc/crontab.orig /etc/crontab
${SUDO} service cron restart
echo -e " ${TICK} Restored the default system cron"
fi
removeFTL() {
# Remove FTL and stop any running FTL service
if is_command "pihole-FTL"; then
# service stop & disable from basic_install.sh
stop_service pihole-FTL
disable_service pihole-FTL
# Attempt to preserve backwards compatibility with older versions
if [[ -f /etc/cron.d/pihole ]];then
${SUDO} rm -f /etc/cron.d/pihole &> /dev/null
echo -e " ${TICK} Removed /etc/cron.d/pihole"
fi
if package_check lighttpd > /dev/null; then
# Attempt to preserve backwards compatibility with older versions
if [[ -f /etc/lighttpd/lighttpd.conf.orig ]]; then
${SUDO} mv /etc/lighttpd/lighttpd.conf.orig /etc/lighttpd/lighttpd.conf
fi
if [[ -f /etc/lighttpd/external.conf ]]; then
${SUDO} rm /etc/lighttpd/external.conf
fi
# Fedora-based
if [[ -f /etc/lighttpd/conf.d/pihole-admin.conf ]]; then
${SUDO} rm /etc/lighttpd/conf.d/pihole-admin.conf
conf=/etc/lighttpd/lighttpd.conf
tconf=/tmp/lighttpd.conf.$$
if awk '!/^include "\/etc\/lighttpd\/conf\.d\/pihole-admin\.conf"$/{print}' \
$conf > $tconf && mv $tconf $conf; then
:
else
rm $tconf
fi
${SUDO} chown root:root $conf
${SUDO} chmod 644 $conf
fi
# Debian-based
if [[ -f /etc/lighttpd/conf-available/pihole-admin.conf ]]; then
if is_command lighty-disable-mod ; then
${SUDO} lighty-disable-mod pihole-admin > /dev/null || true
fi
${SUDO} rm /etc/lighttpd/conf-available/15-pihole-admin.conf
fi
echo -e " ${TICK} Removed lighttpd configs"
fi
${SUDO} rm -f /etc/dnsmasq.d/adList.conf &> /dev/null
${SUDO} rm -f /etc/dnsmasq.d/01-pihole.conf &> /dev/null
${SUDO} rm -f /etc/dnsmasq.d/06-rfc6761.conf &> /dev/null
${SUDO} rm -rf /var/log/*pihole* &> /dev/null
${SUDO} rm -rf /var/log/pihole/*pihole* &> /dev/null
${SUDO} rm -rf /etc/pihole/ &> /dev/null
${SUDO} rm -rf /etc/.pihole/ &> /dev/null
${SUDO} rm -rf /opt/pihole/ &> /dev/null
${SUDO} rm -f /usr/local/bin/pihole &> /dev/null
${SUDO} rm -f /etc/bash_completion.d/pihole &> /dev/null
${SUDO} rm -f /etc/sudoers.d/pihole &> /dev/null
echo -e " ${TICK} Removed config files"
# Restore Resolved
if [[ -e /etc/systemd/resolved.conf.orig ]]; then
${SUDO} cp -p /etc/systemd/resolved.conf.orig /etc/systemd/resolved.conf
systemctl reload-or-restart systemd-resolved
fi
# Remove FTL
if command -v pihole-FTL &> /dev/null; then
echo -ne " ${INFO} Removing pihole-FTL..."
if [[ -x "$(command -v systemctl)" ]]; then
systemctl stop pihole-FTL
else
service pihole-FTL stop
fi
${SUDO} rm -f /etc/systemd/system/pihole-FTL.service
rm -f /etc/systemd/system/pihole-FTL.service &> /dev/null
if [[ -d '/etc/systemd/system/pihole-FTL.service.d' ]]; then
read -rp " ${QST} FTL service override directory /etc/systemd/system/pihole-FTL.service.d detected. Do you wish to remove this from your system? [y/N] " answer
case $answer in
[yY]*)
echo -ne " ${INFO} Removing /etc/systemd/system/pihole-FTL.service.d..."
${SUDO} rm -R /etc/systemd/system/pihole-FTL.service.d
rm -R /etc/systemd/system/pihole-FTL.service.d &> /dev/null
echo -e "${OVER} ${INFO} Removed /etc/systemd/system/pihole-FTL.service.d"
;;
*) echo -e " ${INFO} Leaving /etc/systemd/system/pihole-FTL.service.d in place.";;
esac
fi
${SUDO} rm -f /etc/init.d/pihole-FTL
${SUDO} rm -f /usr/bin/pihole-FTL
rm -f /etc/init.d/pihole-FTL &> /dev/null
rm -f /usr/bin/pihole-FTL &> /dev/null
echo -e "${OVER} ${TICK} Removed pihole-FTL"
# Force systemd reload after service files are removed
if is_command "systemctl"; then
echo -ne " ${INFO} Restarting systemd..."
systemctl daemon-reload
echo -e "${OVER} ${TICK} Restarted systemd..."
fi
fi
}
removeCronFiles() {
# Attempt to preserve backwards compatibility with older versions
# to guarantee no additional changes were made to /etc/crontab after
# the installation of pihole, /etc/crontab.pihole should be permanently
# preserved.
if [[ -f /etc/crontab.orig ]]; then
mv /etc/crontab /etc/crontab.pihole
mv /etc/crontab.orig /etc/crontab
restart_service cron
echo -e " ${TICK} Restored the default system cron"
echo -e " ${INFO} A backup of the most recent crontab is saved at /etc/crontab.pihole"
fi
# If the pihole manpage exists, then delete and rebuild man-db
# Attempt to preserve backwards compatibility with older versions
if [[ -f /etc/cron.d/pihole ]];then
rm -f /etc/cron.d/pihole &> /dev/null
echo -e " ${TICK} Removed /etc/cron.d/pihole"
fi
}
removePiholeFiles() {
# Remove databases (including user specified non-default paths)
rm -f "${PIHOLE_DB:-/etc/pihole/pihole-FTL.db}" &> /dev/null
rm -f "${GRAVITY_DB:-/etc/pihole/gravity.db}" &> /dev/null
rm -f "${MACVENDOR_DB:-/etc/pihole/macvendor.db}" &> /dev/null
# Remove pihole config, repo and local files
rm -rf "${PI_HOLE_CONFIG_DIR:-/etc/pihole}" &> /dev/null
rm -rf "${PI_HOLE_LOCAL_REPO:-/etc/.pihole}" &> /dev/null
rm -rf "${PI_HOLE_INSTALL_DIR:-/opt/pihole}" &> /dev/null
# Remove log files (including user specified non-default paths)
# and rotated logs
# Explicitly escape spaces, in case of trailing space in path before wildcard
rm -f "$(printf '%q' "${FTL_LOG:-/var/log/pihole/FTL.log}")*" &> /dev/null
rm -f "$(printf '%q' "${DNSMASQ_LOG:-/var/log/pihole/pihole.log}")*" &> /dev/null
rm -f "$(printf '%q' "${WEBSERVER_LOG:-/var/log/pihole/webserver.log}")*" &> /dev/null
# remove any remnant log-files from old versions
rm -rf /var/log/*pihole* &> /dev/null
# remove log directory
rm -rf /var/log/pihole &> /dev/null
# remove the pihole command
rm -f /usr/local/bin/pihole &> /dev/null
# remove Pi-hole's bash completion
rm -f /etc/bash_completion.d/pihole &> /dev/null
rm -f /etc/bash_completion.d/pihole-FTL &> /dev/null
# Remove pihole from sudoers for compatibility with old versions
rm -f /etc/sudoers.d/pihole &> /dev/null
echo -e " ${TICK} Removed config files"
}
removeManPage() {
# If the pihole manpage exists, then delete
if [[ -f /usr/local/share/man/man8/pihole.8 ]]; then
${SUDO} rm -f /usr/local/share/man/man8/pihole.8 /usr/local/share/man/man8/pihole-FTL.8 /usr/local/share/man/man5/pihole-FTL.conf.5
${SUDO} mandb -q &>/dev/null
rm -f /usr/local/share/man/man8/pihole.8 /usr/local/share/man/man8/pihole-FTL.8 /usr/local/share/man/man5/pihole-FTL.conf.5
# Rebuild man-db if present
if is_command "mandb"; then
mandb -q &>/dev/null
fi
echo -e " ${TICK} Removed pihole man page"
fi
}
removeUser() {
# If the pihole user exists, then remove
if id "pihole" &> /dev/null; then
if ${SUDO} userdel -r pihole 2> /dev/null; then
if userdel -r pihole 2> /dev/null; then
echo -e " ${TICK} Removed 'pihole' user"
else
echo -e " ${CROSS} Unable to remove 'pihole' user"
fi
fi
# If the pihole group exists, then remove
if getent group "pihole" &> /dev/null; then
if ${SUDO} groupdel pihole 2> /dev/null; then
if groupdel pihole 2> /dev/null; then
echo -e " ${TICK} Removed 'pihole' group"
else
echo -e " ${CROSS} Unable to remove 'pihole' group"
fi
fi
}
restoreResolved() {
# Restore Resolved from saved configuration, if present
if [[ -e /etc/systemd/resolved.conf.orig ]] || [[ -e /etc/systemd/resolved.conf.d/90-pi-hole-disable-stub-listener.conf ]]; then
cp -p /etc/systemd/resolved.conf.orig /etc/systemd/resolved.conf &> /dev/null || true
rm -f /etc/systemd/resolved.conf.d/90-pi-hole-disable-stub-listener.conf &> /dev/null
systemctl reload-or-restart systemd-resolved
fi
}
completionMessage() {
echo -e "\\n We're sorry to see you go, but thanks for checking out Pi-hole!
If you need help, reach out to us on GitHub, Discourse, Reddit or Twitter
Reinstall at any time: ${COL_WHITE}curl -sSL https://install.pi-hole.net | bash${COL_NC}
Reinstall at any time: ${COL_BOLD}curl -sSL https://install.pi-hole.net | bash${COL_NC}
${COL_LIGHT_RED}Please reset the DNS on your router/clients to restore internet connectivity
${COL_LIGHT_GREEN}Uninstallation Complete! ${COL_NC}"
${COL_RED}Please reset the DNS on your router/clients to restore internet connectivity${COL_NC}
${INFO} Pi-hole's meta package has been removed, use the 'autoremove' function from your package manager to remove unused dependencies${COL_NC}
${COL_GREEN}Uninstallation Complete! ${COL_NC}"
}
######### SCRIPT ###########
echo -e " ${INFO} Be sure to confirm if any dependencies should not be removed"
while true; do
echo -e " ${INFO} ${COL_YELLOW}The following dependencies may have been added by the Pi-hole install:"
echo -n " "
for i in "${DEPS[@]}"; do
echo -n "${i} "
done
echo "${COL_NC}"
read -rp " ${QST} Do you wish to go through each dependency for removal? (Choosing No will leave all dependencies installed) [Y/n] " answer
case ${answer} in
[Yy]* ) removeAndPurge; break;;
[Nn]* ) removeNoPurge; break;;
* ) removeAndPurge; break;;
esac
done
# The ordering here allows clean uninstallation with nothing
# removed before anything that depends upon it.
# eg removeFTL relies on scripts removed by removePiholeFiles
# removeUser relies on commands removed by removeMetaPackage
package_manager_detect
removeWebInterface
removeCronFiles
restoreResolved
removeManPage
removeFTL
removeUser
removeMetaPackage
removePiholeFiles
completionMessage

1182
gravity.sh

File diff suppressed because it is too large Load Diff

View File

@@ -1,154 +0,0 @@
.TH "Pihole-FTL" "8" "pihole-FTL" "Pi-hole" "November 2020"
.SH "NAME"
pihole-FTL - Pi-hole : The Faster-Than-Light (FTL) Engine
.br
.SH "SYNOPSIS"
\fBservice pihole-FTL \fR(\fBstart\fR|\fBstop\fR|\fBrestart\fR)
.br
\fBpihole-FTL debug\fR
.br
\fBpihole-FTL test\fR
.br
\fBpihole-FTL -v|-vv\fR
.br
\fBpihole-FTL -t\fR
.br
\fBpihole-FTL -b\fR
.br
\fBpihole-FTL -f\fR
.br
\fBpihole-FTL -h\fR
.br
\fBpihole-FTL dnsmasq-test\fR
.br
\fBpihole-FTL regex-test str\fR
.br
\fBpihole-FTL regex-test str rgx\fR
.br
\fBpihole-FTL lua\fR
.br
\fBpihole-FTL luac\fR
.br
\fBpihole-FTL dhcp-discover\fR
.br
\fBpihole-FTL --\fR (\fBoptions\fR)
.br
.SH "DESCRIPTION"
Pi-hole : The Faster-Than-Light (FTL) Engine is a lightweight, purpose-built daemon used to provide statistics needed for the Pi-hole Web Interface, and its API can be easily integrated into your own projects. Although it is an optional component of the Pi-hole ecosystem, it will be installed by default to provide statistics. As the name implies, FTL does its work \fIvery\fR \fIquickly\fR!
.br
Usage
.br
\fBservice pihole-FTL start\fR
.br
Start the pihole-FTL daemon
.br
\fBservice pihole-FTL stop\fR
.br
Stop the pihole-FTL daemon
.br
\fBservice pihole-FTL restart\fR
.br
If the pihole-FTP daemon is running, stop and then start, otherwise start.
.br
Command line arguments
.br
\fBdebug\fR
.br
Don't go into daemon mode (stay in foreground) + more verbose logging
.br
\fBtest\fR
.br
Start FTL and process everything, but shut down immediately afterwards
.br
\fB-v, version\fR
.br
Don't start FTL, show only version
.br
\fB-vv\fR
.br
Don't start FTL, show verbose version information of embedded applications
.br
\fB-t, tag\fR
.br
Don't start FTL, show only git tag
.br
\fB-b, branch\fR
.br
Don't start FTL, show only git branch FTL was compiled from
.br
\fB-f, no-daemon\fR
.br
Don't go into background (daemon mode)
.br
\fB-h, help\fR
.br
Don't start FTL, show help
.br
\fBdnsmasq-test\fR
.br
Test resolver config file syntax
.br
\fBregex-test str\fR
.br
Test str against all regular expressions in the database
.br
\fBregex-test str rgx\fR
.br
Test str against regular expression given by rgx
.br
\fBlua\fR
.br
Start the embedded Lua interpreter
.br
\fBluac\fR
.br
Execute the embedded Lua compiler
.br
\fBdhcp-discover\fR
.br
Discover DHCP servers in the local network
.br
\fB--\fR (options)
.br
Pass options to internal dnsmasq resolver
.br
.SH "EXAMPLE"
Command line arguments can be arbitrarily combined, e.g:
.br
\fBpihole-FTL debug test\fR
.br
Start ftl in foreground with more verbose logging, process everything and shutdown immediately
.br
.SH "SEE ALSO"
\fBpihole\fR(8)
.br
\fBFor FTL's config options please see https://docs.pi-hole.net/ftldns/configfile/\fR
.br
.SH "COLOPHON"
Get sucked into the latest news and community activity by entering Pi-hole's orbit. Information about Pi-hole, and the latest version of the software can be found at https://pi-hole.net
.br

View File

@@ -5,19 +5,15 @@ Pi-hole : A black-hole for internet advertisements
.br
.SH "SYNOPSIS"
\fBpihole\fR (\fB-w\fR|\fB-b\fR|\fB--wild\fR|\fB--regex\fR) [options] domain(s)
\fBpihole\fR (\fB-allow\fR|\fB-deny\fR) [options] domain(s)
.br
\fBpihole -a\fR \fB-p\fR password
\fBpihole\fR (\fB--allow-regex\fR|\fB--regex\fR) [options] domain(s)
.br
\fBpihole -a\fR (\fB-c|-f|-k\fR)
\fBpihole\fR (\fB--allow-wild\fR|\fB--wild\fR) [options] domain(s)
.br
\fBpihole -a -i\fR interface
\fBpihole setpassword\fR password
.br
\fBpihole -a -l\fR privacylevel
.br
\fBpihole -c\fR [-j|-r|-e]
.br
\fBpihole\fR \fB-d\fR [-a]
\fBpihole\fR \fB-d\fR [-a] [-c]
.br
\fBpihole -f
.br
@@ -25,26 +21,30 @@ pihole -r
.br
\fBpihole\fR \fB-t\fR [arg]
.br
pihole -g\fR
\fBpihole -g\fR
.br
\fBpihole\fR -\fBq\fR [options]
\fBpihole\fR \fB-q\fR [options]
.br
\fBpihole\fR \fB-l\fR (\fBon|off|off noflush\fR)
.br
\fBpihole -up \fR[--check-only]
.br
\fBpihole -v\fR [-p|-a|-f] [-c|-l|-hash]
\fBpihole -v\fR
.br
\fBpihole uninstall
\fBpihole uninstall\fR
.br
pihole status
\fBpihole status\fR
.br
pihole restartdns\fR [options]
\fBpihole reloaddns\fR
.br
\fBpihole reloadlists\fR
.br
\fBpihole\fR (\fBenable\fR|\fBdisable\fR [time])
.br
\fBpihole\fR \fBcheckout\fR repo [branch]
.br
\fBpihole\fR \fBapi\fR [verbose] endpoint
.br
\fBpihole\fR \fBhelp\fR
.br
.SH "DESCRIPTION"
@@ -52,47 +52,43 @@ pihole restartdns\fR [options]
Available commands and options:
.br
\fB-w, whitelist\fR [options] [<domain1> <domain2 ...>]
\fBallow, allowlist\fR [options] [<domain1> <domain2 ...>]
.br
Adds or removes specified domain or domains to the Whitelist
Adds or removes specified domain or domains to the Allowlist
.br
\fB-b, blacklist\fR [options] [<domain1> <domain2 ...>]
\fBdeny, denylist\fR [options] [<domain1> <domain2 ...>]
.br
Adds or removes specified domain or domains to the blacklist
Adds or removes specified domain or domains to the denylist
.br
\fB--regex, regex\fR [options] [<regex1> <regex2 ...>]
.br
Add or removes specified regex filter to the regex blacklist
Add or removes specified regex filter to the regex denylist
.br
\fB--white-regex\fR [options] [<regex1> <regex2 ...>]
\fB--allow-regex\fR [options] [<regex1> <regex2 ...>]
.br
Add or removes specified regex filter to the regex whitelist
Add or removes specified regex filter to the regex allowlist
.br
\fB--wild, wildcard\fR [options] [<domain1> <domain2 ...>]
.br
Add or removes specified domain to the wildcard blacklist
Add or removes specified domain to the wildcard denylist
.br
\fB--white-wild\fR [options] [<domain1> <domain2 ...>]
\fB--allow-wild\fR [options] [<domain1> <domain2 ...>]
.br
Add or removes specified domain to the wildcard whitelist
Add or removes specified domain to the wildcard allowlist
.br
(Whitelist/Blacklist manipulation options):
(Allow-/denylist manipulation options):
.br
-d, --delmode Remove domain(s) from the list
not, -d, --delmode Remove domain(s) from the list
.br
-nr, --noreload Update list without refreshing dnsmasq
-q, --quiet Make output less verbose
.br
-q, --quiet Make output less verbose
.br
-l, --list Display all your listed domains
.br
--nuke Removes all entries in a list
-l, --list Display all your listed domains
.br
\fB-d, debug\fR [-a]
@@ -101,16 +97,20 @@ Available commands and options:
.br
-a Enable automated debugging
-c Include a Pi-hole database integrity check
.br
\fB-f, flush\fR
\fB-f, flush\fR [quite]
.br
Flush the Pi-hole log
Flush the Pi-hole log and last 24h from the query database
.br
\fB-r, reconfigure\fR
quite Suppress output
.br
Reconfigure or Repair Pi-hole subsystems
\fB-r, repair\fR
.br
Repair Pi-hole subsystems
.br
\fB-t, tail\fR [arg]
@@ -122,39 +122,6 @@ Available commands and options:
(regular expressions are supported)
.br
\fB-a, admin\fR [options]
.br
(Admin options):
.br
-p, password Set Web Interface password
.br
-c, celsius Set Celsius as preferred temperature unit
.br
-f, fahrenheit Set Fahrenheit as preferred temperature unit
.br
-k, kelvin Set Kelvin as preferred temperature unit
.br
-i, interface Specify dnsmasq's interface listening behavior
.br
-l, privacylevel <level> Set privacy level
(0 = lowest, 3 = highest)
.br
\fB-c, chronometer\fR [options]
.br
Calculates stats and displays to an LCD
.br
(Chronometer Options):
.br
-j, --json Output stats as JSON formatted string
.br
-r, --refresh Set update frequency (in seconds)
.br
-e, --exit Output stats and exit without refreshing
.br
\fB-g, updateGravity\fR
.br
Update the list of ad-serving domains
@@ -167,11 +134,9 @@ Available commands and options:
(Query options):
.br
-adlist Print the name of the block list URL
-partial Search the adlists for partially matching domains
.br
-exact Search the block lists for exact domain matches
.br
-all Return all query matches within a block list
-all Return all query matches within a adlists
.br
\fB-h, --help, help\fR
@@ -184,7 +149,7 @@ Available commands and options:
Specify whether the Pi-hole log should be used
.br
(Logging options):
(Logging options):
.br
on Enable the Pi-hole log at /var/log/pihole/pihole.log
.br
@@ -202,29 +167,14 @@ Available commands and options:
--check-only Exit script before update is performed.
.br
\fB-v, version\fR [repo] [options]
\fB-v, version\fR
.br
Show installed versions of Pi-hole, Web Interface &amp; FTL
.br
\fBsetpassword\fR
.br
(repo options):
.br
-p, --pihole Only retrieve info regarding Pi-hole repository
.br
-a, --admin Only retrieve info regarding AdminLTE
repository
.br
-f, --ftl Only retrieve info regarding FTL repository
.br
(version options):
.br
-c, --current Return the current version
.br
-l, --latest Return the latest version
.br
--hash Return the GitHub hash from your local
repositories
Set Web Interface password
.br
\fBuninstall\fR
@@ -237,14 +187,14 @@ Available commands and options:
Display the running status of Pi-hole subsystems
.br
\fBenable\fR
\fBenable\fR [time]
.br
Enable Pi-hole subsystems
Enable Pi-hole blocking, optionally for a set duration
.br
\fBdisable\fR [time]
.br
Disable Pi-hole subsystems, optionally for a set duration
Disable Pi-hole blocking, optionally for a set duration
.br
(time options):
@@ -254,16 +204,14 @@ Available commands and options:
#m Disable Pi-hole functionality for # minute(s)
.br
\fBrestartdns\fR [options]
\fBreloaddns\fR
.br
Full restart Pi-hole subsystems. Without any options (see below) a full restart causes config file parsing and history re-reading
Update the lists and flush the cache without restarting the DNS server
.br
(restart options):
\fBreloadlists\fR
.br
reload Updates the lists (incl. HOSTS files) and flushes DNS cache. Does not reparse config files
.br
reload-lists Updates the lists (excl. HOSTS files) WITHOUT flushing the DNS cache. Does not reparse config files
Update the lists WITHOUT flushing the cache or restarting the DNS server
.br
\fBcheckout\fR [repo] [branch]
@@ -288,22 +236,39 @@ Available commands and options:
.br
branchname Update subsystems to the specified branchname
.br
\fBapi\fR [verbose] endpoint
.br
Query the Pi-hole API at <endpoint>
.br
verbose Show authentication and status messages
.br
\fBlogrotate\fR [quite]
.br
Rotate Pi-hole's log files
.br
quite Suppress output
.br
.SH "EXAMPLE"
Some usage examples
.br
Whitelist/blacklist manipulation
Allow-/denylist manipulation
.br
\fBpihole -w iloveads.example.com\fR
\fBpihole allow iloveads.example.com\fR
.br
Adds "iloveads.example.com" to whitelist
Allow "iloveads.example.com"
.br
\fBpihole -b -d noads.example.com\fR
\fBpihole deny remove noads.example.com\fR
.br
Removes "noads.example.com" from blacklist
Removes "noads.example.com" from denylist
.br
\fBpihole --wild example.com\fR
@@ -314,14 +279,14 @@ Whitelist/blacklist manipulation
\fBpihole --regex "ad.*\\.example\\.com$"\fR
.br
Adds "ad.*\\.example\\.com$" to the regex blacklist.
Adds "ad.*\\.example\\.com$" to the regex denylist.
Would block all subdomains of example.com which start with "ad"
.br
Changing the Web Interface password
.br
\fBpihole -a -p ExamplePassword\fR
\fBpihole setpassword ExamplePassword\fR
.br
Change the password to "ExamplePassword"
.br
@@ -337,9 +302,9 @@ Updating lists from internet sources
Displaying version information
.br
\fBpihole -v -a -c\fR
\fBpihole -v\fR
.br
Display the current version of AdminLTE
Display the current version of Pi-hole
.br
Temporarily disabling Pi-hole
@@ -363,15 +328,22 @@ Switching Pi-hole subsystem branches
Switch to core development branch
.br
\fBpihole arpflush\fR
\fBpihole networkflush\fR
.br
Flush information stored in Pi-hole's network tables
Flush information stored in Pi-hole's network table
Add '--arp' to additionally flush the ARP table
.br
.SH "SEE ALSO"
\fBlighttpd\fR(8), \fBpihole-FTL\fR(8)
\fBpihole api stats/summary\fR
.br
Queries FTL for the stats/summary endpoint
.br
\fBpihole api verbose stats/summary\fR
.br
Same as above, but shows authentication and status messages
.br
.SH "COLOPHON"
Get sucked into the latest news and community activity by entering Pi-hole's orbit. Information about Pi-hole, and the latest version of the software can be found at https://pi-hole.net.

505
pihole
View File

@@ -9,32 +9,65 @@
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
readonly PI_HOLE_SCRIPT_DIR="/opt/pihole"
PI_HOLE_SCRIPT_DIR="/opt/pihole"
# setupVars and PI_HOLE_BIN_DIR are not readonly here because in some functions (checkout),
# PI_HOLE_BIN_DIR is not readonly here because in some functions (checkout),
# they might get set again when the installer is sourced. This causes an
# error due to modifying a readonly variable.
setupVars="/etc/pihole/setupVars.conf"
PI_HOLE_BIN_DIR="/usr/local/bin"
readonly colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE"
# shellcheck source=./advanced/Scripts/COL_TABLE
source "${colfile}"
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
# shellcheck source=./advanced/Scripts/utils.sh
source "${utilsfile}"
# Source api functions
readonly apifile="${PI_HOLE_SCRIPT_DIR}/api.sh"
# shellcheck source=./advanced/Scripts/api.sh
source "${apifile}"
versionsfile="/etc/pihole/versions"
if [ -f "${versionsfile}" ]; then
# Only source versionsfile if the file exits
# fixes a warning during installation where versionsfile does not exist yet
# but gravity calls `pihole -status` and thereby sourcing the file
# shellcheck source=/dev/null
source "${versionsfile}"
fi
webpageFunc() {
source "${PI_HOLE_SCRIPT_DIR}/webpage.sh"
main "$@"
exit 0
# TODO: We can probably remove the reliance on this function too, just tell people to pihole-FTL --config webserver.api.password "password"
SetWebPassword() {
if [ -n "$2" ] ; then
readonly PASSWORD="$2"
readonly CONFIRM="${PASSWORD}"
else
# Prevents a bug if the user presses Ctrl+C and it continues to hide the text typed.
# So we reset the terminal via stty if the user does press Ctrl+C
trap '{ echo -e "\nNot changed" ; stty sane ; exit 1; }' INT
read -s -r -p "Enter New Password (Blank for no password): " PASSWORD
echo ""
if [ "${PASSWORD}" == "" ]; then
setFTLConfigValue "webserver.api.password" ""
echo -e " ${TICK} Password Removed"
exit 0
fi
read -s -r -p "Confirm Password: " CONFIRM
echo ""
fi
if [ "${PASSWORD}" == "${CONFIRM}" ] ; then
# pihole-FTL will automatically hash the password
setFTLConfigValue "webserver.api.password" "${PASSWORD}"
echo -e " ${TICK} New password set"
else
echo -e " ${CROSS} Passwords don't match. Your password has not been changed"
exit 1
fi
}
listFunc() {
@@ -44,29 +77,47 @@ listFunc() {
debugFunc() {
local automated
local web
local check_database_integrity
# Pull off the `debug` leaving passed call augmentation flags in $1
shift
for value in "$@"; do
[[ "$value" == *"-a"* ]] && automated="true"
[[ "$value" == *"-w"* ]] && web="true"
[[ "$value" == *"-c"* ]] && check_database_integrity="true"
[[ "$value" == *"--check_database"* ]] && check_database_integrity="true"
done
AUTOMATED=${automated:-} WEBCALL=${web:-} CHECK_DATABASE=${check_database_integrity:-} "${PI_HOLE_SCRIPT_DIR}"/piholeDebug.sh
AUTOMATED=${automated:-} CHECK_DATABASE=${check_database_integrity:-} "${PI_HOLE_SCRIPT_DIR}"/piholeDebug.sh
exit 0
}
flushFunc() {
"${PI_HOLE_SCRIPT_DIR}"/piholeLogFlush.sh "$@"
# unsupported in docker because it requires restarting FTL
if [ -n "${DOCKER_VERSION}" ]; then
unsupportedFunc
else
"${PI_HOLE_SCRIPT_DIR}"/piholeLogFlush.sh "$@"
exit 0
fi
}
# Deprecated function, should be removed in the future
# use networkFlush instead
arpFunc() {
shift
echo -e " ${INFO} The 'arpflush' command is deprecated, use 'networkflush' instead"
"${PI_HOLE_SCRIPT_DIR}"/piholeNetworkFlush.sh "$@"
exit 0
}
arpFunc() {
"${PI_HOLE_SCRIPT_DIR}"/piholeARPTable.sh "$@"
logrotateFunc() {
"${PI_HOLE_SCRIPT_DIR}"/piholeLogRotate.sh "$@"
exit 0
}
networkFlush() {
shift
"${PI_HOLE_SCRIPT_DIR}"/piholeNetworkFlush.sh "$@"
exit 0
}
@@ -80,11 +131,26 @@ updatePiholeFunc() {
fi
}
reconfigurePiholeFunc() {
repairPiholeFunc() {
if [ -n "${DOCKER_VERSION}" ]; then
unsupportedFunc
else
/etc/.pihole/automated\ install/basic-install.sh --reconfigure
local skipFTL additionalFlag
skipFTL=false
# Check arguments
for var in "$@"; do
case "$var" in
"--skipFTL") skipFTL=true ;;
esac
done
if [ "${skipFTL}" == true ]; then
additionalFlag="--skipFTL"
else
additionalFlag=""
fi
/etc/.pihole/automated\ install/basic-install.sh --repair ${additionalFlag}
exit 0;
fi
}
@@ -100,8 +166,7 @@ queryFunc() {
}
chronometerFunc() {
shift
"${PI_HOLE_SCRIPT_DIR}"/chronometer.sh "$@"
echo "Chronometer is gone, use PADD (https://github.com/pi-hole/PADD)"
exit 0
}
@@ -116,16 +181,16 @@ uninstallFunc() {
}
versionFunc() {
shift
exec "${PI_HOLE_SCRIPT_DIR}"/version.sh "$@"
exec "${PI_HOLE_SCRIPT_DIR}"/version.sh
exit 0
}
restartDNS() {
local svcOption svc str output status pid icon FTL_PID_FILE
svcOption="${1:-restart}"
reloadDNS() {
local svcOption svc str output status pid icon FTL_PID_FILE sigrtmin
svcOption="${1:-reload}"
# get the current path to the pihole-FTL.pid
FTL_PID_FILE="$(getFTLPIDFile)"
FTL_PID_FILE="$(getFTLConfigValue files.pid)"
# Determine if we should reload or restart
if [[ "${svcOption}" =~ "reload-lists" ]]; then
@@ -140,7 +205,10 @@ restartDNS() {
str="FTL is not running"
icon="${INFO}"
else
svc="kill -RTMIN ${pid}"
sigrtmin="$(pihole-FTL sigrtmin 2>/dev/null)"
# Make sure sigrtmin is a number, otherwise fallback to RTMIN
[[ "${sigrtmin}" =~ ^[0-9]+$ ]] || unset sigrtmin
svc="kill -${sigrtmin:-RTMIN} ${pid}"
str="Reloading DNS lists"
icon="${TICK}"
fi
@@ -157,11 +225,6 @@ restartDNS() {
str="Flushing DNS cache"
icon="${TICK}"
fi
else
# A full restart has been requested
svc="service pihole-FTL restart"
str="Restarting DNS server"
icon="${TICK}"
fi
# Print output to Terminal, but not to Web Admin
@@ -182,75 +245,65 @@ restartDNS() {
piholeEnable() {
if [[ "${2}" == "-h" ]] || [[ "${2}" == "--help" ]]; then
echo "Usage: pihole disable [time]
Example: 'pihole disable', or 'pihole disable 5m'
Disable Pi-hole subsystems
echo "Usage: pihole enable/disable [time]
Example: 'pihole enable', or 'pihole disable 5m'
En- or disable Pi-hole subsystems
Time:
#s Disable Pi-hole functionality for # second(s)
#m Disable Pi-hole functionality for # minute(s)"
#s En-/disable Pi-hole functionality for # second(s)
#m En-/disable Pi-hole functionality for # minute(s)"
exit 0
elif [[ "${1}" == "0" ]]; then
# Disable Pi-hole
if grep -cq "BLOCKING_ENABLED=false" "${setupVars}"; then
echo -e " ${INFO} Blocking already disabled, nothing to do"
exit 0
fi
if [[ $# > 1 ]]; then
local error=false
if [[ "${2}" == *"s" ]]; then
tt=${2%"s"}
if [[ "${tt}" =~ ^-?[0-9]+$ ]];then
local str="Disabling blocking for ${tt} seconds"
echo -e " ${INFO} ${str}..."
local str="Blocking will be re-enabled in ${tt} seconds"
nohup "${PI_HOLE_SCRIPT_DIR}"/pihole-reenable.sh ${tt} </dev/null &>/dev/null &
else
local error=true
fi
elif [[ "${2}" == *"m" ]]; then
tt=${2%"m"}
if [[ "${tt}" =~ ^-?[0-9]+$ ]];then
local str="Disabling blocking for ${tt} minutes"
echo -e " ${INFO} ${str}..."
local str="Blocking will be re-enabled in ${tt} minutes"
tt=$((${tt}*60))
nohup "${PI_HOLE_SCRIPT_DIR}"/pihole-reenable.sh ${tt} </dev/null &>/dev/null &
else
local error=true
fi
elif [[ -n "${2}" ]]; then
local error=true
else
echo -e " ${INFO} Disabling blocking"
fi
if [[ ${error} == true ]];then
echo -e " ${COL_LIGHT_RED}Unknown format for delayed reactivation of the blocking!${COL_NC}"
echo -e " Try 'pihole disable --help' for more information."
exit 1
fi
local str="Pi-hole Disabled"
addOrEditKeyValPair "${setupVars}" "BLOCKING_ENABLED" "false"
fi
else
# Enable Pi-hole
killall -q pihole-reenable
if grep -cq "BLOCKING_ENABLED=true" "${setupVars}"; then
echo -e " ${INFO} Blocking already enabled, nothing to do"
exit 0
fi
echo -e " ${INFO} Enabling blocking"
local str="Pi-hole Enabled"
addOrEditKeyValPair "${setupVars}" "BLOCKING_ENABLED" "true"
fi
restartDNS reload-lists
# Get timer
local tt="null"
if [[ $# -gt 1 ]]; then
local error=false
if [[ "${2}" == *"s" ]]; then
tt=${2%"s"}
if [[ ! "${tt}" =~ ^-?[0-9]+$ ]];then
local error=true
fi
elif [[ "${2}" == *"m" ]]; then
tt=${2%"m"}
if [[ "${tt}" =~ ^-?[0-9]+$ ]];then
tt=$((${tt}*60))
else
local error=true
fi
elif [[ -n "${2}" ]]; then
local error=true
fi
if [[ ${error} == true ]];then
echo -e " ${COL_RED}Unknown format for blocking timer!${COL_NC}"
echo -e " Try 'pihole disable --help' for more information."
exit 1
fi
fi
# Authenticate with the API
LoginAPI
# Send the request
data=$(PostFTLData "dns/blocking" "{ \"blocking\": ${1}, \"timer\": ${tt} }")
# Check the response
local extra timer
extra=" forever"
timer="$(echo "${data}"| jq --raw-output '.timer' )"
if [[ "${timer}" != "null" ]]; then
extra=" for ${timer}s"
fi
local str
str="Pi-hole $(echo "${data}" | jq --raw-output '.blocking')${extra}"
# Logout from the API
LogoutAPI
echo -e "${OVER} ${TICK} ${str}"
exit 0
}
piholeLogging() {
@@ -267,8 +320,7 @@ Options:
exit 0
elif [[ "${1}" == "off" ]]; then
# Disable logging
removeKey /etc/dnsmasq.d/01-pihole.conf "log-queries"
addOrEditKeyValPair "${setupVars}" "QUERY_LOGGING" "false"
setFTLConfigValue dns.queryLogging false
if [[ "${2}" != "noflush" ]]; then
# Flush logs
"${PI_HOLE_BIN_DIR}"/pihole -f
@@ -277,16 +329,14 @@ Options:
local str="Logging has been disabled!"
elif [[ "${1}" == "on" ]]; then
# Enable logging
addKey /etc/dnsmasq.d/01-pihole.conf "log-queries"
addOrEditKeyValPair "${setupVars}" "QUERY_LOGGING" "true"
setFTLConfigValue dns.queryLogging true
echo -e " ${INFO} Enabling logging..."
local str="Logging has been enabled!"
else
echo -e " ${COL_LIGHT_RED}Invalid option${COL_NC}
echo -e " ${COL_RED}Invalid option${COL_NC}
Try 'pihole logging --help' for more information."
exit 1
fi
restartDNS
echo -e "${OVER} ${TICK} ${str}"
}
@@ -323,28 +373,27 @@ analyze_ports() {
statusFunc() {
# Determine if there is pihole-FTL service is listening
local pid port ftl_api_port ftl_pid_file
local pid port ftl_pid_file block_status
ftl_pid_file="$(getFTLPIDFile)"
ftl_pid_file="$(getFTLConfigValue files.pid)"
pid="$(getFTLPID ${ftl_pid_file})"
ftl_api_port="$(getFTLAPIPort)"
if [[ "$pid" -eq "-1" ]]; then
case "${1}" in
"web") echo "-1";;
*) echo -e " ${CROSS} DNS service is NOT running";;
esac
return 0
exit 0
else
#get the DNS port pihole-FTL is listening on by using FTL's telnet API
port="$(echo ">dns-port >quit" | nc 127.0.0.1 "$ftl_api_port")"
# get the DNS port pihole-FTL is listening on
port="$(getFTLConfigValue dns.port)"
if [[ "${port}" == "0" ]]; then
case "${1}" in
"web") echo "-1";;
*) echo -e " ${CROSS} DNS service is NOT listening";;
esac
return 0
exit 0
else
if [[ "${1}" != "web" ]]; then
echo -e " ${TICK} FTL is listening on port ${port}"
@@ -354,73 +403,79 @@ statusFunc() {
fi
# Determine if Pi-hole's blocking is enabled
if grep -q "BLOCKING_ENABLED=false" /etc/pihole/setupVars.conf; then
# A config is commented out
case "${1}" in
"web") echo 0;;
*) echo -e " ${CROSS} Pi-hole blocking is disabled";;
esac
elif grep -q "BLOCKING_ENABLED=true" /etc/pihole/setupVars.conf; then
# Configs are set
block_status=$(getFTLConfigValue dns.blocking.active)
if [ ${block_status} == "true" ]; then
case "${1}" in
"web") echo "$port";;
*) echo -e " ${TICK} Pi-hole blocking is enabled";;
esac
else
# No configs were found
case "${1}" in
"web") echo -2;;
*) echo -e " ${INFO} Pi-hole blocking will be enabled";;
"web") echo 0;;
*) echo -e " ${CROSS} Pi-hole blocking is disabled";;
esac
# Enable blocking
"${PI_HOLE_BIN_DIR}"/pihole enable
fi
exit 0
exit 0
}
tailFunc() {
# Warn user if Pi-hole's logging is disabled
local logging_enabled=$(grep -c "^log-queries" /etc/dnsmasq.d/01-pihole.conf)
if [[ "${logging_enabled}" == "0" ]]; then
# No "log-queries" lines are found.
# Commented out lines (such as "#log-queries") are ignored
local logging_enabled
logging_enabled=$(getFTLConfigValue dns.queryLogging)
if [[ "${logging_enabled}" != "true" ]]; then
echo " ${CROSS} Warning: Query logging is disabled"
fi
echo -e " ${INFO} Press Ctrl-C to exit"
# Get logfile path
LOGFILE=$(getFTLConfigValue files.log.dnsmasq)
readonly LOGFILE
# Strip date from each line
# Color blocklist/blacklist/wildcard entries as red
# Color blocklist/denylist/wildcard entries as red
# Color A/AAAA/DHCP strings as white
# Color everything else as gray
tail -f /var/log/pihole/pihole.log | grep --line-buffered "${1}" | sed -E \
tail -f $LOGFILE | grep --line-buffered -- "${1}" | sed -E \
-e "s,($(date +'%b %d ')| dnsmasq\[[0-9]*\]),,g" \
-e "s,(.*(blacklisted |gravity blocked ).*),${COL_RED}&${COL_NC}," \
-e "s,(.*(denied |gravity blocked ).*),${COL_RED}&${COL_NC}," \
-e "s,.*(query\\[A|DHCP).*,${COL_NC}&${COL_NC}," \
-e "s,.*,${COL_GRAY}&${COL_NC},"
exit 0
}
piholeCheckoutFunc() {
if [[ "$2" == "-h" ]] || [[ "$2" == "--help" ]]; then
echo "Usage: pihole checkout [repo] [branch]
Example: 'pihole checkout master' or 'pihole checkout core dev'
Switch Pi-hole subsystems to a different GitHub branch
Repositories:
core [branch] Change the branch of Pi-hole's core subsystem
web [branch] Change the branch of Web Interface subsystem
ftl [branch] Change the branch of Pi-hole's FTL subsystem
Branches:
master Update subsystems to the latest stable release
dev Update subsystems to the latest development release
branchname Update subsystems to the specified branchname"
if [ -n "${DOCKER_VERSION}" ]; then
echo -e "${CROSS} Function not supported in Docker images"
echo "Please build a custom image following the steps at"
echo "https://github.com/pi-hole/docker-pi-hole?tab=readme-ov-file#building-the-image-locally"
exit 0
fi
else
if [[ "$2" == "-h" ]] || [[ "$2" == "--help" ]]; then
echo "Switch Pi-hole subsystems to a different GitHub branch
Usage: ${COL_GREEN}pihole checkout${COL_NC} ${COL_YELLOW}shortcut${COL_NC}
or ${COL_GREEN}pihole checkout${COL_NC} ${COL_PURPLE}repo${COL_NC} ${COL_CYAN}branch${COL_NC}
source "${PI_HOLE_SCRIPT_DIR}"/piholeCheckout.sh
shift
checkout "$@"
Example: ${COL_GREEN}pihole checkout${COL_NC} ${COL_YELLOW}master${COL_NC}
or ${COL_GREEN}pihole checkout${COL_NC} ${COL_PURPLE}ftl ${COL_CYAN}development${COL_NC}
Shortcuts:
${COL_YELLOW}master${COL_NC} Update all subsystems to the latest stable release
${COL_YELLOW}dev${COL_NC} Update all subsystems to the latest development release
Individual components:
${COL_PURPLE}core${COL_NC} ${COL_CYAN}branch${COL_NC} Change the branch of Pi-hole's core subsystem
${COL_PURPLE}web${COL_NC} ${COL_CYAN}branch${COL_NC} Change the branch of the web interface subsystem
${COL_PURPLE}ftl${COL_NC} ${COL_CYAN}branch${COL_NC} Change the branch of Pi-hole's FTL subsystem"
exit 0
fi
#shellcheck source=./advanced/Scripts/piholeCheckout.sh
source "${PI_HOLE_SCRIPT_DIR}"/piholeCheckout.sh
shift
checkout "$@"
fi
}
tricorderFunc() {
@@ -456,34 +511,36 @@ unsupportedFunc(){
helpFunc() {
echo "Usage: pihole [options]
Example: 'pihole -w -h'
Example: 'pihole allow -h'
Add '-h' after specific commands for more information on usage
Whitelist/Blacklist Options:
-w, whitelist Whitelist domain(s)
-b, blacklist Blacklist domain(s)
--regex, regex Regex blacklist domains(s)
--white-regex Regex whitelist domains(s)
--wild, wildcard Wildcard blacklist domain(s)
--white-wild Wildcard whitelist domain(s)
Add '-h' for more info on whitelist/blacklist usage
Domain Options:
allow, allowlist Allow domain(s)
deny, denylist Deny domain(s)
--regex, regex Regex deny domains(s)
--allow-regex Regex allow domains(s)
--wild, wildcard Wildcard deny domain(s)
--allow-wild Wildcard allow domain(s)
Add '-h' for more info on allow/deny usage
Debugging Options:
-d, debug Start a debugging session
Add '-c' or '--check-database' to include a Pi-hole database integrity check
Add '-a' to automatically upload the log to tricorder.pi-hole.net
-f, flush Flush the Pi-hole log
-r, reconfigure Reconfigure or Repair Pi-hole subsystems
-f, flush Flush the Pi-hole logs and last 24h from the query database
Add 'quiet' to suppress output messages
-r, repair Repair Pi-hole subsystems
-t, tail [arg] View the live output of the Pi-hole log.
Add an optional argument to filter the log
(regular expressions are supported)
api <endpoint> Query the Pi-hole API at <endpoint>
Precede <endpoint> with 'verbose' option to show authentication and status messages
Options:
-a, admin Web interface options
Add '-h' for more info on Web Interface usage
-c, chronometer Calculates stats and displays to an LCD
Add '-h' for more info on chronometer usage
setpassword [pwd] Set the password for the web interface
Without optional argument, password is read interactively.
When specifying a password directly, enclose it in single quotes.
-g, updateGravity Update the list of ad-serving domains
-h, --help, help Show this help dialog
-l, logging Specify whether the Pi-hole log should be used
@@ -493,18 +550,20 @@ Options:
-up, updatePihole Update Pi-hole subsystems
Add '--check-only' to exit script before update is performed.
-v, version Show installed versions of Pi-hole, Web Interface & FTL
Add '-h' for more info on version usage
uninstall Uninstall Pi-hole from your system
status Display the running status of Pi-hole subsystems
enable Enable Pi-hole subsystems
Add '-h' for more info on enable usage
disable Disable Pi-hole subsystems
Add '-h' for more info on disable usage
restartdns Full restart Pi-hole subsystems
Add 'reload' to update the lists and flush the cache without restarting the DNS server
Add 'reload-lists' to only update the lists WITHOUT flushing the cache or restarting the DNS server
reloaddns Update the lists and flush the cache without restarting the DNS server
reloadlists Update the lists WITHOUT flushing the cache or restarting the DNS server
checkout Switch Pi-hole subsystems to a different GitHub branch
Add '-h' for more info on checkout usage
arpflush Flush information stored in Pi-hole's network tables";
networkflush Flush information stored in Pi-hole's network tables
Add '--arp' to additionally flush the ARP table
logrotate Rotate Pi-hole's log files
Add 'quiet' to suppress output messages";
exit 0
}
@@ -513,72 +572,76 @@ if [[ $# = 0 ]]; then
fi
# functions that do not require sudo power
need_root=
case "${1}" in
"-h" | "help" | "--help" ) helpFunc;;
"-v" | "version" ) versionFunc "$@";;
"-c" | "chronometer" ) chronometerFunc "$@";;
"-q" | "query" ) queryFunc "$@";;
"status" ) statusFunc "$2";;
"tricorder" ) tricorderFunc;;
"-h" | "help" | "--help" ) helpFunc;;
"-v" | "version" ) versionFunc;;
"-c" | "chronometer" ) chronometerFunc "$@";;
"-q" | "query" ) queryFunc "$@";;
"status" ) statusFunc "$2";;
"tricorder" ) tricorderFunc;;
"allow" | "allowlist" ) listFunc "$@";;
"deny" | "denylist" ) listFunc "$@";;
"--wild" | "wildcard" ) listFunc "$@";;
"--regex" | "regex" ) listFunc "$@";;
"--allow-regex" | "allow-regex" ) listFunc "$@";;
"--allow-wild" | "allow-wild" ) listFunc "$@";;
"enable" ) piholeEnable true "$2";;
"disable" ) piholeEnable false "$2";;
"api" ) shift; apiFunc "$@"; exit 0;;
# we need to add all arguments that require sudo power to not trigger the * argument
"-w" | "whitelist" ) ;;
"-b" | "blacklist" ) ;;
"--wild" | "wildcard" ) ;;
"--regex" | "regex" ) ;;
"--white-regex" | "white-regex" ) ;;
"--white-wild" | "white-wild" ) ;;
"-f" | "flush" ) ;;
"-up" | "updatePihole" ) ;;
"-r" | "reconfigure" ) ;;
"-g" | "updateGravity" ) ;;
"-l" | "logging" ) ;;
"uninstall" ) ;;
"enable" ) ;;
"disable" ) ;;
"-d" | "debug" ) ;;
"restartdns" ) ;;
"-a" | "admin" ) ;;
"checkout" ) ;;
"updatechecker" ) ;;
"arpflush" ) ;;
"-t" | "tail" ) ;;
* ) helpFunc;;
"-f" | "flush" ) need_root=true;;
"-up" | "updatePihole" ) need_root=true;;
"-r" | "repair" ) need_root=true;;
"-l" | "logging" ) need_root=true;;
"uninstall" ) need_root=true;;
"-d" | "debug" ) need_root=true;;
"-g" | "updateGravity" ) need_root=true;;
"reloaddns" ) need_root=true;;
"reloadlists" ) need_root=true;;
"setpassword" ) need_root=true;;
"checkout" ) need_root=true;;
"updatechecker" ) need_root=true;;
"arpflush" ) need_root=true;; # Deprecated, use networkflush instead
"networkflush" ) need_root=true;;
"-t" | "tail" ) need_root=true;;
"logrotate" ) need_root=true;;
* ) helpFunc;;
esac
# Must be root to use this tool
if [[ ! $EUID -eq 0 ]];then
if [[ -x "$(command -v sudo)" ]]; then
exec sudo bash "$0" "$@"
exit $?
else
echo -e " ${CROSS} sudo is needed to run pihole commands. Please run this script as root or install sudo."
exit 1
fi
# In the case of alpine running in a container, the USER variable appears to be blank
# which prevents the next trap from working correctly. Set it by running whoami
if [[ -z ${USER} ]]; then
USER=$(whoami)
fi
# Check if the current user is not root and if the command
# requires root. If so, exit with an error message.
# Add an exception for the user "pihole" to allow the webserver running gravity
if [[ ( $EUID -ne 0 && ${USER} != "pihole" ) && -n "${need_root}" ]]; then
echo -e " ${CROSS} This Pi-hole command requires root privileges, try:"
echo -e " ${COL_GREEN}sudo pihole $*${COL_NC}"
exit 1
fi
# Handle redirecting to specific functions based on arguments
case "${1}" in
"-w" | "whitelist" ) listFunc "$@";;
"-b" | "blacklist" ) listFunc "$@";;
"--wild" | "wildcard" ) listFunc "$@";;
"--regex" | "regex" ) listFunc "$@";;
"--white-regex" | "white-regex" ) listFunc "$@";;
"--white-wild" | "white-wild" ) listFunc "$@";;
"-d" | "debug" ) debugFunc "$@";;
"-f" | "flush" ) flushFunc "$@";;
"-up" | "updatePihole" ) updatePiholeFunc "$@";;
"-r" | "reconfigure" ) reconfigurePiholeFunc;;
"-g" | "updateGravity" ) updateGravityFunc "$@";;
"-l" | "logging" ) piholeLogging "$@";;
"uninstall" ) uninstallFunc;;
"enable" ) piholeEnable 1;;
"disable" ) piholeEnable 0 "$2";;
"restartdns" ) restartDNS "$2";;
"-a" | "admin" ) webpageFunc "$@";;
"checkout" ) piholeCheckoutFunc "$@";;
"updatechecker" ) shift; updateCheckFunc "$@";;
"arpflush" ) arpFunc "$@";;
"-t" | "tail" ) tailFunc "$2";;
"-d" | "debug" ) debugFunc "$@";;
"-f" | "flush" ) flushFunc "$@";;
"-up" | "updatePihole" ) updatePiholeFunc "$@";;
"-r" | "repair" ) repairPiholeFunc "$@";;
"-g" | "updateGravity" ) updateGravityFunc "$@";;
"-l" | "logging" ) piholeLogging "$@";;
"uninstall" ) uninstallFunc;;
"reloaddns" ) reloadDNS "reload";;
"reloadlists" ) reloadDNS "reload-lists";;
"setpassword" ) SetWebPassword "$@";;
"checkout" ) piholeCheckoutFunc "$@";;
"updatechecker" ) shift; updateCheckFunc "$@";;
"arpflush" ) arpFunc "$@";; # Deprecated, use networkflush instead
"networkflush" ) networkFlush "$@";;
"-t" | "tail" ) tailFunc "$2";;
"logrotate" ) logrotateFunc "$@";;
* ) helpFunc;;
esac

View File

@@ -0,0 +1,18 @@
FROM alpine:3.21
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN sed -i 's/#\(.*\/community\)/\1/' /etc/apk/repositories
RUN apk --no-cache add bash coreutils curl git jq openrc shadow
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -0,0 +1,18 @@
FROM alpine:3.22
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN sed -i 's/#\(.*\/community\)/\1/' /etc/apk/repositories
RUN apk --no-cache add bash coreutils curl git jq openrc shadow
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -0,0 +1,18 @@
FROM alpine:3.23
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN sed -i 's/#\(.*\/community\)/\1/' /etc/apk/repositories
RUN apk --no-cache add bash coreutils curl git jq openrc shadow
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -0,0 +1,19 @@
FROM quay.io/centos/centos:stream10
# Disable SELinux
RUN echo "SELINUX=disabled" > /etc/selinux/config
RUN yum install -y --allowerasing curl git initscripts
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -1,18 +0,0 @@
FROM quay.io/centos/centos:stream8
RUN yum install -y git initscripts
ENV GITDIR /etc/.pihole
ENV SCRIPTDIR /opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $SCRIPTDIR/
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL true
ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -1,18 +1,19 @@
FROM quay.io/centos/centos:stream9
# Disable SELinux
RUN echo "SELINUX=disabled" > /etc/selinux/config
RUN yum install -y --allowerasing curl git initscripts
ENV GITDIR /etc/.pihole
ENV SCRIPTDIR /opt/pihole
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $SCRIPTDIR/
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL true
ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -1,17 +1,16 @@
FROM buildpack-deps:bullseye-scm
ENV GITDIR /etc/.pihole
ENV SCRIPTDIR /opt/pihole
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $SCRIPTDIR/
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL true
ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -1,17 +1,16 @@
FROM buildpack-deps:buster-scm
FROM buildpack-deps:bookworm-scm
ENV GITDIR /etc/.pihole
ENV SCRIPTDIR /opt/pihole
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $SCRIPTDIR/
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL true
ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -0,0 +1,16 @@
FROM buildpack-deps:trixie-scm
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -1,18 +1,17 @@
FROM fedora:37
FROM fedora:40
RUN dnf install -y git initscripts
ENV GITDIR /etc/.pihole
ENV SCRIPTDIR /opt/pihole
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $SCRIPTDIR/
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL true
ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -1,18 +1,17 @@
FROM fedora:36
FROM fedora:41
RUN dnf install -y git initscripts
ENV GITDIR /etc/.pihole
ENV SCRIPTDIR /opt/pihole
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $SCRIPTDIR/
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL true
ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -0,0 +1,17 @@
FROM fedora:42
RUN dnf install -y git initscripts
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -0,0 +1,17 @@
FROM fedora:43
RUN dnf install -y git initscripts
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -1,18 +1,16 @@
FROM buildpack-deps:focal-scm
ENV GITDIR /etc/.pihole
ENV SCRIPTDIR /opt/pihole
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $SCRIPTDIR/
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
ENV DEBIAN_FRONTEND=noninteractive
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL true
ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -1,18 +1,17 @@
FROM buildpack-deps:jammy-scm
ENV GITDIR /etc/.pihole
ENV SCRIPTDIR /opt/pihole
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $SCRIPTDIR/
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
ENV DEBIAN_FRONTEND=noninteractive
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL true
ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -0,0 +1,17 @@
FROM buildpack-deps:24.04-scm
ENV GITDIR=/etc/.pihole
ENV SCRIPTDIR=/opt/pihole
RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
ADD . $GITDIR
RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $GITDIR/advanced/Scripts/COL_TABLE $SCRIPTDIR/
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
ENV DEBIAN_FRONTEND=noninteractive
RUN true && \
chmod +x $SCRIPTDIR/*
ENV SKIP_INSTALL=true
#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \

View File

@@ -4,17 +4,9 @@ import testinfra.backend.docker
import subprocess
from textwrap import dedent
SETUPVARS = {
"PIHOLE_INTERFACE": "eth99",
"PIHOLE_DNS_1": "4.2.2.1",
"PIHOLE_DNS_2": "4.2.2.2",
}
IMAGE = "pytest_pihole:test_container"
tick_box = "[\x1b[1;32m\u2713\x1b[0m]"
cross_box = "[\x1b[1;31m\u2717\x1b[0m]"
tick_box = "[✓]"
cross_box = "[]"
info_box = "[i]"
@@ -59,29 +51,19 @@ def mock_command(script, args, container):
in unit tests
"""
full_script_path = "/usr/local/bin/{}".format(script)
mock_script = dedent(
r"""\
mock_script = dedent(r"""\
#!/bin/bash -e
echo "\$0 \$@" >> /var/log/{script}
case "\$1" in""".format(
script=script
)
)
case "\$1" in""".format(script=script))
for k, v in args.items():
case = dedent(
"""
case = dedent("""
{arg})
echo {res}
exit {retcode}
;;""".format(
arg=k, res=v[0], retcode=v[1]
)
)
;;""".format(arg=k, res=v[0], retcode=v[1]))
mock_script += case
mock_script += dedent(
"""
esac"""
)
mock_script += dedent("""
esac""")
container.run(
"""
cat <<EOF> {script}\n{content}\nEOF
@@ -102,37 +84,23 @@ def mock_command_passthrough(script, args, container):
"""
orig_script_path = container.check_output("command -v {}".format(script))
full_script_path = "/usr/local/bin/{}".format(script)
mock_script = dedent(
r"""\
mock_script = dedent(r"""\
#!/bin/bash -e
echo "\$0 \$@" >> /var/log/{script}
case "\$1" in""".format(
script=script
)
)
case "\$1" in""".format(script=script))
for k, v in args.items():
case = dedent(
"""
case = dedent("""
{arg})
echo {res}
exit {retcode}
;;""".format(
arg=k, res=v[0], retcode=v[1]
)
)
;;""".format(arg=k, res=v[0], retcode=v[1]))
mock_script += case
mock_script += dedent(
r"""
mock_script += dedent(r"""
*)
{orig_script_path} "\$@"
;;""".format(
orig_script_path=orig_script_path
)
)
mock_script += dedent(
"""
esac"""
)
;;""".format(orig_script_path=orig_script_path))
mock_script += dedent("""
esac""")
container.run(
"""
cat <<EOF> {script}\n{content}\nEOF
@@ -149,29 +117,19 @@ def mock_command_run(script, args, container):
in unit tests
"""
full_script_path = "/usr/local/bin/{}".format(script)
mock_script = dedent(
r"""\
mock_script = dedent(r"""\
#!/bin/bash -e
echo "\$0 \$@" >> /var/log/{script}
case "\$1 \$2" in""".format(
script=script
)
)
case "\$1 \$2" in""".format(script=script))
for k, v in args.items():
case = dedent(
"""
case = dedent("""
\"{arg}\")
echo {res}
exit {retcode}
;;""".format(
arg=k, res=v[0], retcode=v[1]
)
)
;;""".format(arg=k, res=v[0], retcode=v[1]))
mock_script += case
mock_script += dedent(
"""
esac"""
)
mock_script += dedent(r"""
esac""")
container.run(
"""
cat <<EOF> {script}\n{content}\nEOF
@@ -188,29 +146,19 @@ def mock_command_2(script, args, container):
in unit tests
"""
full_script_path = "/usr/local/bin/{}".format(script)
mock_script = dedent(
r"""\
mock_script = dedent(r"""\
#!/bin/bash -e
echo "\$0 \$@" >> /var/log/{script}
case "\$1 \$2" in""".format(
script=script
)
)
case "\$1 \$2" in""".format(script=script))
for k, v in args.items():
case = dedent(
"""
case = dedent("""
\"{arg}\")
echo \"{res}\"
exit {retcode}
;;""".format(
arg=k, res=v[0], retcode=v[1]
)
)
;;""".format(arg=k, res=v[0], retcode=v[1]))
mock_script += case
mock_script += dedent(
"""
esac"""
)
mock_script += dedent(r"""
esac""")
container.run(
"""
cat <<EOF> {script}\n{content}\nEOF

View File

@@ -1,6 +1,6 @@
docker-compose == 1.29.2
pytest == 7.2.2
pytest-xdist == 3.2.1
pytest-testinfra == 7.0.0
tox == 4.4.7
pyyaml == 6.0.3
pytest == 9.0.2
pytest-xdist == 3.8.0
pytest-testinfra == 10.2.2
tox == 4.49.1
pytest-clarity == 1.0.1

File diff suppressed because it is too large Load Diff

View File

@@ -1,188 +1,50 @@
def test_key_val_replacement_works(host):
"""Confirms addOrEditKeyValPair either adds or replaces a key value pair in a given file"""
host.run(
"""
host.run("""
source /opt/pihole/utils.sh
touch ./testoutput
addOrEditKeyValPair "./testoutput" "KEY_ONE" "value1"
addOrEditKeyValPair "./testoutput" "KEY_TWO" "value2"
addOrEditKeyValPair "./testoutput" "KEY_ONE" "value3"
addOrEditKeyValPair "./testoutput" "KEY_FOUR" "value4"
"""
)
output = host.run(
"""
""")
output = host.run("""
cat ./testoutput
"""
)
""")
expected_stdout = "KEY_ONE=value3\nKEY_TWO=value2\nKEY_FOUR=value4\n"
assert expected_stdout == output.stdout
def test_key_addition_works(host):
"""Confirms addKey adds a key (no value) to a file without duplicating it"""
host.run(
"""
source /opt/pihole/utils.sh
addKey "./testoutput" "KEY_ONE"
addKey "./testoutput" "KEY_ONE"
addKey "./testoutput" "KEY_TWO"
addKey "./testoutput" "KEY_TWO"
addKey "./testoutput" "KEY_THREE"
addKey "./testoutput" "KEY_THREE"
"""
)
output = host.run(
"""
cat ./testoutput
"""
)
expected_stdout = "KEY_ONE\nKEY_TWO\nKEY_THREE\n"
assert expected_stdout == output.stdout
def test_key_addition_substr(host):
"""Confirms addKey adds substring keys (no value) to a file"""
host.run(
"""
source /opt/pihole/utils.sh
addKey "./testoutput" "KEY_ONE"
addKey "./testoutput" "KEY_O"
addKey "./testoutput" "KEY_TWO"
addKey "./testoutput" "Y_TWO"
"""
)
output = host.run(
"""
cat ./testoutput
"""
)
expected_stdout = "KEY_ONE\nKEY_O\nKEY_TWO\nY_TWO\n"
assert expected_stdout == output.stdout
def test_key_removal_works(host):
"""Confirms removeKey removes a key or key/value pair"""
host.run(
"""
source /opt/pihole/utils.sh
addOrEditKeyValPair "./testoutput" "KEY_ONE" "value1"
addOrEditKeyValPair "./testoutput" "KEY_TWO" "value2"
addOrEditKeyValPair "./testoutput" "KEY_THREE" "value3"
addKey "./testoutput" "KEY_FOUR"
removeKey "./testoutput" "KEY_TWO"
removeKey "./testoutput" "KEY_FOUR"
"""
)
output = host.run(
"""
cat ./testoutput
"""
)
expected_stdout = "KEY_ONE=value1\nKEY_THREE=value3\n"
assert expected_stdout == output.stdout
def test_get_value_works(host):
"""Confirms getVal returns the correct value for a given key"""
output = host.run(
"""
source /opt/pihole/utils.sh
echo "Somekey=xxx" >> /tmp/testfile
echo "#Testkey=1234" >> /tmp/testfile
echo "Testkey=5678" >> /tmp/testfile
echo "Testkey=abcd" >> /tmp/testfile
getVal "/tmp/testfile" "Testkey"
"""
)
expected_stdout = "5678"
assert expected_stdout == output.stdout
def test_getFTLAPIPort_default(host):
"""Confirms getFTLAPIPort returns the default API port"""
output = host.run(
"""
source /opt/pihole/utils.sh
getFTLAPIPort
"""
)
expected_stdout = "4711\n"
assert expected_stdout == output.stdout
def test_getFTLAPIPort_custom(host):
"""Confirms getFTLAPIPort returns a custom API port"""
host.run(
"""
echo "FTLPORT=1234" > /etc/pihole/pihole-FTL.conf
"""
)
output = host.run(
"""
source /opt/pihole/utils.sh
getFTLAPIPort
"""
)
expected_stdout = "1234\n"
assert expected_stdout == output.stdout
def test_getFTLAPIPort_malicious(host):
"""Confirms getFTLAPIPort returns 4711 if the setting in pihole-FTL.conf contains non-digits"""
host.run(
"""
echo "FTLPORT=*$ssdfsd" > /etc/pihole/pihole-FTL.conf
"""
)
output = host.run(
"""
source /opt/pihole/utils.sh
getFTLAPIPort
"""
)
expected_stdout = "4711\n"
assert expected_stdout == output.stdout
def test_getFTLPIDFile_default(host):
"""Confirms getFTLPIDFile returns the default PID file path"""
output = host.run(
"""
source /opt/pihole/utils.sh
getFTLPIDFile
"""
)
expected_stdout = "/run/pihole-FTL.pid\n"
assert expected_stdout == output.stdout
def test_getFTLPID_default(host):
"""Confirms getFTLPID returns the default value if FTL is not running"""
output = host.run(
"""
output = host.run("""
source /opt/pihole/utils.sh
getFTLPID
"""
)
""")
expected_stdout = "-1\n"
assert expected_stdout == output.stdout
def test_getFTLPIDFile_and_getFTLPID_custom(host):
"""Confirms getFTLPIDFile returns a custom PID file path"""
host.run(
"""
tmpfile=$(mktemp)
echo "PIDFILE=${tmpfile}" > /etc/pihole/pihole-FTL.conf
echo "1234" > ${tmpfile}
def test_setFTLConfigValue_getFTLConfigValue(host):
"""
)
output = host.run(
"""
Confirms getFTLConfigValue works (also assumes setFTLConfigValue works)
Requires FTL to be installed, so we do that first
(taken from test_FTL_development_binary_installed_and_responsive_no_errors)
"""
host.run("""
source /opt/pihole/basic-install.sh
create_pihole_user
funcOutput=$(get_binary_name)
echo "development" > /etc/pihole/ftlbranch
binary="pihole-FTL${funcOutput##*pihole-FTL}"
theRest="${funcOutput%pihole-FTL*}"
FTLdetect "${binary}" "${theRest}"
""")
output = host.run("""
source /opt/pihole/utils.sh
FTL_PID_FILE=$(getFTLPIDFile)
getFTLPID "${FTL_PID_FILE}"
"""
)
expected_stdout = "1234\n"
assert expected_stdout == output.stdout
setFTLConfigValue "dns.upstreams" '["9.9.9.9"]' > /dev/null
getFTLConfigValue "dns.upstreams"
""")
assert "[ 9.9.9.9 ]" in output.stdout

View File

@@ -1,27 +0,0 @@
import pytest
from .conftest import (
tick_box,
info_box,
cross_box,
mock_command,
)
def test_enable_epel_repository_centos(host):
"""
confirms the EPEL package repository is enabled when installed on CentOS
"""
package_manager_detect = host.run(
"""
source /opt/pihole/basic-install.sh
package_manager_detect
"""
)
expected_stdout = info_box + (
" Enabling EPEL package repository " "(https://fedoraproject.org/wiki/EPEL)"
)
assert expected_stdout in package_manager_detect.stdout
expected_stdout = tick_box + " Installed"
assert expected_stdout in package_manager_detect.stdout
epel_package = host.package("epel-release")
assert epel_package.is_installed

View File

@@ -15,14 +15,10 @@ def mock_selinux_config(state, host):
# getenforce returns the running state of SELinux
mock_command("getenforce", {"*": (state.capitalize(), "0")}, host)
# create mock configuration with desired content
host.run(
"""
host.run("""
mkdir /etc/selinux
echo "SELINUX={state}" > /etc/selinux/config
""".format(
state=state.lower()
)
)
""".format(state=state.lower()))
def test_selinux_enforcing_exit(host):
@@ -30,12 +26,10 @@ def test_selinux_enforcing_exit(host):
confirms installer prompts to exit when SELinux is Enforcing by default
"""
mock_selinux_config("enforcing", host)
check_selinux = host.run(
"""
check_selinux = host.run("""
source /opt/pihole/basic-install.sh
checkSelinux
"""
)
""")
expected_stdout = cross_box + " Current SELinux: enforcing"
assert expected_stdout in check_selinux.stdout
expected_stdout = "SELinux Enforcing detected, exiting installer"
@@ -48,12 +42,10 @@ def test_selinux_permissive(host):
confirms installer continues when SELinux is Permissive
"""
mock_selinux_config("permissive", host)
check_selinux = host.run(
"""
check_selinux = host.run("""
source /opt/pihole/basic-install.sh
checkSelinux
"""
)
""")
expected_stdout = tick_box + " Current SELinux: permissive"
assert expected_stdout in check_selinux.stdout
assert check_selinux.rc == 0
@@ -64,12 +56,10 @@ def test_selinux_disabled(host):
confirms installer continues when SELinux is Disabled
"""
mock_selinux_config("disabled", host)
check_selinux = host.run(
"""
check_selinux = host.run("""
source /opt/pihole/basic-install.sh
checkSelinux
"""
)
""")
expected_stdout = tick_box + " Current SELinux: disabled"
assert expected_stdout in check_selinux.stdout
assert check_selinux.rc == 0

View File

@@ -1,15 +0,0 @@
def test_epel_and_remi_not_installed_fedora(host):
"""
confirms installer does not attempt to install EPEL/REMI repositories
on Fedora
"""
package_manager_detect = host.run(
"""
source /opt/pihole/basic-install.sh
package_manager_detect
"""
)
assert package_manager_detect.stdout == ""
epel_package = host.package("epel-release")
assert not epel_package.is_installed

10
test/tox.alpine_3_21.ini Normal file
View File

@@ -0,0 +1,10 @@
[tox]
envlist = py3
[testenv:py3]
allowlist_externals = docker
deps = -rrequirements.txt
setenv =
COLUMNS=120
commands = docker buildx build --load --progress plain -f _alpine_3_21.Dockerfile -t pytest_pihole:test_container ../
pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py

10
test/tox.alpine_3_22.ini Normal file
View File

@@ -0,0 +1,10 @@
[tox]
envlist = py3
[testenv:py3]
allowlist_externals = docker
deps = -rrequirements.txt
setenv =
COLUMNS=120
commands = docker buildx build --load --progress plain -f _alpine_3_22.Dockerfile -t pytest_pihole:test_container ../
pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py

10
test/tox.alpine_3_23.ini Normal file
View File

@@ -0,0 +1,10 @@
[tox]
envlist = py3
[testenv:py3]
allowlist_externals = docker
deps = -rrequirements.txt
setenv =
COLUMNS=120
commands = docker buildx build --load --progress plain -f _alpine_3_23.Dockerfile -t pytest_pihole:test_container ../
pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py

10
test/tox.centos_10.ini Normal file
View File

@@ -0,0 +1,10 @@
[tox]
envlist = py3
[testenv:py3]
allowlist_externals = docker
deps = -rrequirements.txt
setenv =
COLUMNS=120
commands = docker buildx build --load --progress plain -f _centos_10.Dockerfile -t pytest_pihole:test_container ../
pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py ./test_centos_fedora_common_support.py

View File

@@ -1,8 +0,0 @@
[tox]
envlist = py3
[testenv:py3]
allowlist_externals = docker
deps = -rrequirements.txt
commands = docker buildx build --load --progress plain -f _centos_8.Dockerfile -t pytest_pihole:test_container ../
pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py ./test_centos_fedora_common_support.py ./test_centos_common_support.py

View File

@@ -4,5 +4,7 @@ envlist = py3
[testenv:py3]
allowlist_externals = docker
deps = -rrequirements.txt
setenv =
COLUMNS=120
commands = docker buildx build --load --progress plain -f _centos_9.Dockerfile -t pytest_pihole:test_container ../
pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py ./test_centos_fedora_common_support.py ./test_centos_common_support.py
pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py ./test_centos_fedora_common_support.py

View File

@@ -4,5 +4,7 @@ envlist = py3
[testenv:py3]
allowlist_externals = docker
deps = -rrequirements.txt
setenv =
COLUMNS=120
commands = docker buildx build --load --progress plain -f _debian_11.Dockerfile -t pytest_pihole:test_container ../
pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py

Some files were not shown because too many files have changed in this diff Show More