Commit graph

7191 commits

Author SHA1 Message Date
Adam Warner
aac48b75ed
installer: fix custom DNS entry when only one upstream server is provided (#6638)
Some checks failed
Check for merge conflicts / main (push) Has been cancelled
2026-06-25 22:46:58 +01:00
Austin Gilmour
57b86b69a2
fix(dns): support N upstream DNS servers in custom DNS setup
Replace PIHOLE_DNS_1/PIHOLE_DNS_2 numbered variables with a bash array
PIHOLE_DNS=() throughout basic-install.sh. This naturally supports one
or more upstream DNS entries without duplicating a single entry into
both slots when no comma is present in the input.

- User input is split on commas into the array; empty entries skipped
- Invalid entries are filtered out; valid ones retained
- Confirmation dialog joins array elements so it reflects exactly what
  was entered
- Preset DNS selection populates the array from the semicolon-delimited
  preset string, adding a second element only when one is present

Closes #4783.

Signed-off-by: Austin Gilmour <gilmoursa@gmail.com>
2026-06-21 10:14:37 -04:00
yubiuser
730e5cd3f0
Bump the github-actions-dependencies group with 2 updates (#6655)
Some checks failed
Check for merge conflicts / main (push) Has been cancelled
2026-06-20 14:03:59 +02:00
dependabot[bot]
7f18a03e2c
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 [trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog).


Updates `actions/checkout` from 6.0.3 to 7.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](df4cb1c069...9c091bb21b)

Updates `trufflesecurity/trufflehog` from 3.95.5 to 3.95.6
- [Release notes](https://github.com/trufflesecurity/trufflehog/releases)
- [Commits](d411fff7b8...30d5bb91af)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-dependencies
- dependency-name: trufflesecurity/trufflehog
  dependency-version: 3.95.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-20 10:02:30 +00:00
Adam Warner
841976c59b
Include alpine 3.24 in tests (#6654)
Some checks failed
Check for merge conflicts / main (push) Has been cancelled
2026-06-14 21:46:34 +01:00
Christian König
cdb990ad23
Include alpine 3.24 in tests
Signed-off-by: Christian König <github@yubiuser.dev>
2026-06-10 20:30:07 +02:00
Adam Warner
23c3b4a648
fix: check return codes in gravity_build_tree and database_recovery() (#6630)
Some checks failed
Check for merge conflicts / main (push) Has been cancelled
2026-06-08 21:27:14 +01:00
yubiuser
cc63b1088d
Bump the github-actions-dependencies group with 2 updates (#6651)
Some checks failed
Check for merge conflicts / main (push) Has been cancelled
2026-06-06 12:11:08 +02:00
dependabot[bot]
4bf69d42b0
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 [trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog).


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

Updates `trufflesecurity/trufflehog` from 3.95.3 to 3.95.5
- [Release notes](https://github.com/trufflesecurity/trufflehog/releases)
- [Commits](37b77001d0...d411fff7b8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: trufflesecurity/trufflehog
  dependency-version: 3.95.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-06 10:02:38 +00:00
yubiuser
e8b6b4b807
Set BATS pretty output flag depending on the terminal and improve failure output (#6644) 2026-06-01 20:16:58 +02:00
yubiuser
062a4651dd
Bump eps1lon/actions-label-merge-conflict from 3.0.3 to 3.1.0 in the github-actions-dependencies group (#6645) 2026-06-01 19:39:29 +02:00
Christian König
fa1de50068
Use bats_helper also in newly added gravity tests
Signed-off-by: Christian König <github@yubiuser.dev>
2026-06-01 19:31:55 +02:00
Christian König
8a90c77ff2
Fix shellcheck wrning
Signed-off-by: Christian König <github@yubiuser.dev>
2026-06-01 19:30:57 +02:00
Christian König
c5949aaa8f
Move on_failure_hook to helper file
Signed-off-by: Christian König <github@yubiuser.dev>
2026-06-01 19:30:57 +02:00
Christian König
c66159302f
Use on_failure hook to improve failure output
Signed-off-by: Christian König <github@yubiuser.dev>
2026-06-01 19:30:57 +02:00
Christian König
400b3abc26
Set BATS pretty output flag depending on the terminal
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-06-01 19:30:57 +02:00
yubiuser
3b0aad0db2
Add gravity tests (#6639) 2026-05-30 14:31:33 +02:00
dependabot[bot]
1c1855c7f0
Bump eps1lon/actions-label-merge-conflict
Bumps the github-actions-dependencies group with 1 update: [eps1lon/actions-label-merge-conflict](https://github.com/eps1lon/actions-label-merge-conflict).


Updates `eps1lon/actions-label-merge-conflict` from 3.0.3 to 3.1.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](1df065ebe6...0273be72a0)

---
updated-dependencies:
- dependency-name: eps1lon/actions-label-merge-conflict
  dependency-version: 3.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>
2026-05-30 10:02:22 +00:00
Christian König
2671ebc2b8
Ubuntu 20 curl version does not support etag-compare and etag-save on the same file, so the target will always be downloaded and no 304 is returned
Signed-off-by: Christian König <github@yubiuser.dev>
2026-05-25 21:40:35 +02:00
yubiuser
5198095e12
Bump actions/stale from 10.2.0 to 10.3.0 in the github-actions-dependencies group (#6640) 2026-05-24 07:51:44 +02:00
dependabot[bot]
c9f932ab48
Bump actions/stale in the github-actions-dependencies group
Bumps the github-actions-dependencies group with 1 update: [actions/stale](https://github.com/actions/stale).


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

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: 10.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-05-23 10:02:24 +00:00
Adam Warner
a50b35b1a5
Add Fedora 44 and Ubuntu 26.04 LTS to tests (#6623) 2026-05-22 22:37:34 +01:00
Christian König
43840b250d
Account for curl version < 7.75
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-05-21 23:44:47 +02:00
Christian König
a8de5788c6
Be more generous regarding curl's error output
Signed-off-by: Christian König <github@yubiuser.dev>
2026-05-21 23:25:14 +02:00
Christian König
227689f491
Adjust tests to recent changes from https://github.com/pi-hole/pi-hole/pull/6430 and https://github.com/pi-hole/pi-hole/pull/6607 and https://github.com/pi-hole/pi-hole/pull/6605
Signed-off-by: Christian König <github@yubiuser.dev>
2026-05-21 23:16:38 +02:00
Christian König
164a0c134a
Fix shellcheck
Signed-off-by: Christian König <github@yubiuser.dev>
2026-05-21 22:43:41 +02:00
darkexplosiveqwx
d01a893721
replace tox with BATS for new OSes
Signed-off-by: darkexplosiveqwx <101737077+darkexplosiveqwx@users.noreply.github.com>
2026-05-21 22:29:28 +02:00
darkexplosiveqwx
af4df3fa75
Merge branch 'development' into april-os 2026-05-21 22:24:50 +02:00
Christian König
de7cb639d5
Add gravity tests
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Christian König <github@yubiuser.dev>
2026-05-21 22:22:53 +02:00
Adam Warner
bca84e7125
Replace pytest/tox with direct in-container BATS (#6598) 2026-05-21 19:33:31 +01:00
Adam Warner
86562b5eba
Remove spurious runUnattended=true from install test
Move from setup/teardown steps to explicit cleanup in each test that creates a "mess"

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2026-05-21 19:30:20 +01:00
Adam Warner
3468c0c418
test: update README for BATS runner usage
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2026-05-21 19:30:20 +01:00
Adam Warner
e972c758ab
test: split containers, simplify run_suite, improve distro error
Split the BATS suite into two containers: one for mock/function tests
and one for the fresh install, so installer tests can mutate the
filesystem freely without teardown.

Replace mocks.bash with bats-mock and bats-file, baked into the test
images at build time via Docker ARG-versioned git clones.

Improve the invalid-distro error to list available distros rather than
printing an opaque Dockerfile path.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2026-05-21 19:30:20 +01:00
Adam Warner
551b6516d1
test: bake BATS libraries into test images at build time
Add ARG declarations and a build-time RUN step to all Dockerfiles so
bats-core, bats-support, bats-assert, bats-mock, and bats-file are cloned
at image build time rather than at container runtime.  Library versions are
defined once in run.sh and passed down via --build-arg

Add .dockerignore to exclude any locally-cached test/libs/ directory from
the build context, preventing 'destination already exists' failures when
the directory exists from a previous local test run.

Remove the legacy commented-out sed stub command from all Dockerfiles

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2026-05-21 19:30:20 +01:00
Adam Warner
356afe66c5
test: restore executable bit on installer FTL bats file
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2026-05-21 19:30:20 +01:00
Adam Warner
1359c6aff5
test: simplify in-container BATS flow and clarify suite intent
The test refactor intentionally prioritizes deterministic CI behavior and clearer semantics over historical transition scaffolding.

Reasoning behind the changes:

- Keep output consistent across distros by enabling pretty BATS output in all images; Alpine now installs ncurses so tput is available.

- Remove no-longer-needed migration plumbing in test/run.sh (CSV env handoff and extra local filename array), while preserving isolated /tmp tests execution to avoid installer side effects on /etc/.pihole.

- Rename ambiguous terminology from earlier direct-vs-legacy comparison and keep runner naming minimal (TEST_FILES, /tmp/tests).

- Clarify scope of the former FTL suite by renaming it to test_installer_ftl.bats and updating test titles to reflect that these validate installer architecture-detection/install paths.

- Reduce duplicated setup/teardown cleanup code in BATS files via shared reset helpers without changing behavior.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2026-05-21 19:30:20 +01:00
Adam Warner
da333b0982
test: replace pytest/tox with direct in-container BATS
Replace the Python/tox-based test stack with BATS and run tests directly inside each built DISTRO container. Remove docker:cli orchestration and unify local mock helpers in test/helpers/mocks.bash for direct execution.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2026-05-21 19:30:19 +01:00
yubiuser
9648b90194
Bump the github-actions-dependencies group with 2 updates (#6636) 2026-05-16 12:34:35 +02:00
dependabot[bot]
08d44b7a01
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 [trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog).


Updates `github/codeql-action` from 4.35.4 to 4.35.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](68bde559de...9e0d7b8d25)

Updates `trufflesecurity/trufflehog` from 3.95.2 to 3.95.3
- [Release notes](https://github.com/trufflesecurity/trufflehog/releases)
- [Commits](17456f8c7d...37b77001d0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions-dependencies
- dependency-name: trufflesecurity/trufflehog
  dependency-version: 3.95.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-05-16 10:02:59 +00:00
yubiuser
3c65e11672
Bump github/codeql-action from 4.35.3 to 4.35.4 in the github-actions-dependencies group (#6631) 2026-05-09 16:36:28 +02:00
dependabot[bot]
ff8e6357ee
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.35.3 to 4.35.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](e46ed2cbd0...68bde559de)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-09 10:02:55 +00:00
Adam Warner
826b293a7b
Prevent double error message output in gravity run with invalid file (#6607) 2026-05-07 21:03:11 +01:00
John Luzzi
1d61ab09b4
fix: check return codes in gravity_build_tree and database_recovery()
gravity_build_tree is called twice in gravity.sh without exit status
checks. If either call fails (disk full, I/O error, DB corruption),
execution continues and gravity_swap_databases installs a database with
no search indexes. FTL then performs full table scans on every DNS
query against a potentially million-entry blocklist, causing DNS
timeouts with no logged error.

database_recovery() pipes sqlite3 .recover output into a second sqlite3
command without pipefail. A failure in the .recover command is invisible:
the RHS sqlite3 receives empty input, exits 0, and the if-branch signals
success. The empty recovered database is then swapped into production,
silently breaking DNS blocking. This affects the error-recovery path
specifically -- it triggers when the database is already corrupt and
makes it worse.

Add if ! guards to both gravity_build_tree calls. gravity_build_tree
already prints its own error on failure; the guards just stop execution
from continuing past a failed index build, matching the pattern used for
migrate_to_database and gravity_swap_databases in the same flow.

Stage the .recover output to a temp file in database_recovery() so each
command's exit status is checked independently. Use a RETURN trap for
temp-file cleanup so all exit paths are covered without repeating rm -f.
Error branches use return 1 and the call site handles script termination
with || exit 1.

Signed-off-by: John Luzzi <john.luzzi@gmail.com>
2026-05-02 23:14:54 -04:00
yubiuser
b873bf45ab
Bump github/codeql-action from 4.35.2 to 4.35.3 in the github-actions-dependencies group (#6629) 2026-05-02 12:12:57 +02:00
dependabot[bot]
f7d4429d9d
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.35.2 to 4.35.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](95e58e9a2c...e46ed2cbd0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.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-05-02 10:02:56 +00:00
darkexplosiveqwx
9586b470e8
Add Fedora 44 and Ubuntu 26.04 LTS to tests
Signed-off-by: darkexplosiveqwx <101737077+darkexplosiveqwx@users.noreply.github.com>
2026-04-29 20:27:39 +02:00
Dan Schaper
a3b7117404
Explicitly add gawk to APK dependencies (#6622) 2026-04-28 13:30:09 -06:00
Christian König
9beb608147
Explicitly add gawk to APK dependencies
Signed-off-by: Christian König <github@yubiuser.dev>
2026-04-28 21:12:55 +02:00
Dan Schaper
8b250abef1
Use awk to compare curl versions (#6621) 2026-04-27 14:36:12 -06:00
RD WebDesign
7e72e17304
Use awk to compare curl versions
and edit the comments to explain the new commands.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-04-27 17:14:08 -03:00