1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-10-31 20:59:00 +00:00

Compare commits

..

25 Commits

Author SHA1 Message Date
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
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
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
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
b57cf27103
Bump tox from 4.12.1 to 4.13.0 in /test (#5581) 2024-02-24 13:44:20 +01: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
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
37c6b353b3
Bump tox from 4.12.0 to 4.12.1 in /test (#5555) 2024-01-20 12:23:35 +01: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
yubiuser
e773d0399f
Bump tox from 4.11.4 to 4.12.0 in /test (#5547) 2024-01-13 20:42:30 +01: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
Adam Warner
aa4ceb4198
Sync master back into development (#5537) 2024-01-07 21:17:15 +00:00
7 changed files with 39 additions and 38 deletions

View File

@ -57,9 +57,8 @@ jobs:
ubuntu_23, ubuntu_23,
centos_8, centos_8,
centos_9, centos_9,
fedora_36,
fedora_37,
fedora_38, fedora_38,
fedora_39,
] ]
env: env:
DISTRO: ${{matrix.distro}} DISTRO: ${{matrix.distro}}

View File

@ -503,6 +503,7 @@ compareLists() {
gravity_DownloadBlocklistFromUrl() { gravity_DownloadBlocklistFromUrl() {
local url="${1}" adlistID="${2}" saveLocation="${3}" target="${4}" compression="${5}" local url="${1}" adlistID="${2}" saveLocation="${3}" target="${4}" compression="${5}"
local heisenbergCompensator="" listCurlBuffer str httpCode success="" ip cmd_ext local heisenbergCompensator="" listCurlBuffer str httpCode success="" ip cmd_ext
local file_path permissions ip_addr port blocked=false download=true
# Create temp file to store content on disk instead of RAM # Create temp file to store content on disk instead of RAM
# We don't use '--suffix' here because not all implementations of mktemp support it, e.g. on Alpine # We don't use '--suffix' here because not all implementations of mktemp support it, e.g. on Alpine
@ -519,7 +520,6 @@ gravity_DownloadBlocklistFromUrl() {
str="Status:" str="Status:"
echo -ne " ${INFO} ${str} Pending..." echo -ne " ${INFO} ${str} Pending..."
blocked=false
case $BLOCKINGMODE in case $BLOCKINGMODE in
"IP-NODATA-AAAA"|"IP") "IP-NODATA-AAAA"|"IP")
# Get IP address of this domain # Get IP address of this domain
@ -560,8 +560,36 @@ gravity_DownloadBlocklistFromUrl() {
cmd_ext="--resolve $domain:$port:$ip" cmd_ext="--resolve $domain:$port:$ip"
fi fi
# If we are going to "download" a local file, we first check if the target
# file has a+r permission. We explicitly check for all+read because we want
# to make sure that the file is readable by everyone and not just the user
# running the script.
if [[ $url == "file://"* ]]; then
# Get the file path
file_path=$(echo "$url" | cut -d'/' -f3-)
# Check if the file exists
if [[ ! -e $file_path ]]; then
# Output that the file does not exist
echo -e "${OVER} ${CROSS} ${file_path} does not exist"
download=false
else
# Check if the file has a+r permissions
permissions=$(stat -c "%a" "$file_path")
if [[ $permissions == *4 || $permissions == *5 || $permissions == *6 || $permissions == *7 ]]; then
# Output that we are using the local file
echo -e "${OVER} ${INFO} Using local file ${file_path}"
else
# Output that the file does not have the correct permissions
echo -e "${OVER} ${CROSS} Cannot read file (file needs to have a+r permission)"
download=false
fi
fi
fi
if [[ "${download}" == true ]]; then
# shellcheck disable=SC2086 # shellcheck disable=SC2086
httpCode=$(curl --connect-timeout ${curl_connect_timeout} -s -L ${compression} ${cmd_ext} ${heisenbergCompensator} -w "%{http_code}" "${url}" -o "${listCurlBuffer}" 2> /dev/null) httpCode=$(curl --connect-timeout ${curl_connect_timeout} -s -L ${compression} ${cmd_ext} ${heisenbergCompensator} -w "%{http_code}" "${url}" -o "${listCurlBuffer}" 2> /dev/null)
fi
case $url in case $url in
# Did we "download" a local file? # Did we "download" a local file?
@ -569,7 +597,7 @@ gravity_DownloadBlocklistFromUrl() {
if [[ -s "${listCurlBuffer}" ]]; then if [[ -s "${listCurlBuffer}" ]]; then
echo -e "${OVER} ${TICK} ${str} Retrieval successful"; success=true echo -e "${OVER} ${TICK} ${str} Retrieval successful"; success=true
else else
echo -e "${OVER} ${CROSS} ${str} Not found / empty list" echo -e "${OVER} ${CROSS} ${str} Retrieval failed / empty list"
fi;; fi;;
# Did we "download" a remote file? # Did we "download" a remote file?
*) *)

View File

@ -1,18 +0,0 @@
FROM fedora:37
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 $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,4 +1,4 @@
FROM fedora:36 FROM fedora:39
RUN dnf install -y git initscripts RUN dnf install -y git initscripts
ENV GITDIR /etc/.pihole ENV GITDIR /etc/.pihole

View File

@ -1,6 +1,6 @@
pyyaml == 6.0.1 pyyaml == 6.0.1
pytest == 7.4.4 pytest == 8.0.2
pytest-xdist == 3.5.0 pytest-xdist == 3.5.0
pytest-testinfra == 10.0.0 pytest-testinfra == 10.1.0
tox == 4.11.4 tox == 4.14.1

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 _fedora_36.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_fedora_support.py

View File

@ -4,5 +4,5 @@ envlist = py3
[testenv] [testenv]
allowlist_externals = docker allowlist_externals = docker
deps = -rrequirements.txt deps = -rrequirements.txt
commands = docker buildx build --load --progress plain -f _fedora_37.Dockerfile -t pytest_pihole:test_container ../ commands = docker buildx build --load --progress plain -f _fedora_39.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_fedora_support.py pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py ./test_centos_fedora_common_support.py ./test_fedora_support.py