Compare commits

..

8 Commits

Author SHA1 Message Date
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
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
4 changed files with 12 additions and 15 deletions

View File

@@ -29,12 +29,12 @@ jobs:
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- -
name: Initialize CodeQL name: Initialize CodeQL
uses: github/codeql-action/init@f443b600d91635bebf5b0d9ebc620189c0d6fba5 #v4.30.8 uses: github/codeql-action/init@16140ae1a102900babc80a33c44059580f687047 #v4.30.9
with: with:
languages: 'python' languages: 'python'
- -
name: Autobuild name: Autobuild
uses: github/codeql-action/autobuild@f443b600d91635bebf5b0d9ebc620189c0d6fba5 #v4.30.8 uses: github/codeql-action/autobuild@16140ae1a102900babc80a33c44059580f687047 #v4.30.9
- -
name: Perform CodeQL Analysis name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f443b600d91635bebf5b0d9ebc620189c0d6fba5 #v4.30.8 uses: github/codeql-action/analyze@16140ae1a102900babc80a33c44059580f687047 #v4.30.9

View File

@@ -43,7 +43,7 @@ jobs:
ignore_words_file: .codespellignore ignore_words_file: .codespellignore
- name: Get editorconfig-checker - name: Get editorconfig-checker
uses: editorconfig-checker/action-editorconfig-checker@1a41284d59c6fe7f1b21ddc4a2b36400a33dc1b4 # tag v2. is really out of date uses: editorconfig-checker/action-editorconfig-checker@5ecdd656fe347c26f76b1b435b90e1d74fb5e787 # tag v2. is really out of date
- name: Run editorconfig-checker - name: Run editorconfig-checker
run: editorconfig-checker run: editorconfig-checker

View File

@@ -694,10 +694,11 @@ chooseInterface() {
status="OFF" status="OFF"
done done
# Disable check for double quote here as we are passing a string with spaces # Disable check for double quote here as we are passing a string with spaces
# shellcheck disable=SC2086
PIHOLE_INTERFACE=$(dialog --no-shadow --keep-tite --output-fd 1 \ PIHOLE_INTERFACE=$(dialog --no-shadow --keep-tite --output-fd 1 \
--cancel-label "Exit" --ok-label "Select" \ --cancel-label "Exit" --ok-label "Select" \
--radiolist "Choose An Interface (press space to toggle selection)" \ --radiolist "Choose An Interface (press space to toggle selection)" \
${r} ${c} "${interfaceCount}" "${interfacesList}") ${r} ${c} "${interfaceCount}" ${interfacesList})
result=$? result=$?
case ${result} in case ${result} in

View File

@@ -611,7 +611,7 @@ compareLists() {
# Download specified URL and perform checks on HTTP status and file content # Download specified URL and perform checks on HTTP status and file content
gravity_DownloadBlocklistFromUrl() { gravity_DownloadBlocklistFromUrl() {
local url="${1}" adlistID="${2}" saveLocation="${3}" compression="${4}" gravity_type="${5}" domain="${6}" local url="${1}" adlistID="${2}" saveLocation="${3}" compression="${4}" gravity_type="${5}" domain="${6}"
local listCurlBuffer str curlJson httpCode curlErrorMsg="" curlExitCode="" success="" ip customUpstreamResolver="" local listCurlBuffer str httpCode success="" ip customUpstreamResolver=""
local file_path permissions ip_addr port blocked=false download=true local file_path permissions ip_addr port blocked=false download=true
# modifiedOptions is an array to store all the options used to check if the adlist has been changed upstream # modifiedOptions is an array to store all the options used to check if the adlist has been changed upstream
local modifiedOptions=() local modifiedOptions=()
@@ -750,19 +750,14 @@ gravity_DownloadBlocklistFromUrl() {
# Check for allowed protocols # Check for allowed protocols
if [[ $url != "http"* && $url != "https"* && $url != "file"* && $url != "ftp"* && $url != "ftps"* && $url != "sftp"* ]]; then if [[ $url != "http"* && $url != "https"* && $url != "file"* && $url != "ftp"* && $url != "ftps"* && $url != "sftp"* ]]; then
echo -e "${OVER} ${CROSS} ${str} Invalid protocol specified. Ignoring list." echo -e "${OVER} ${CROSS} ${str} Invalid protocol specified. Ignoring list."
echo -e "Ensure your URL starts with a valid protocol like http:// , https:// or file:// ." echo -e " Ensure your URL starts with a valid protocol like http:// , https:// or file:// ."
download=false download=false
fi fi
if [[ "${download}" == true ]]; then if [[ "${download}" == true ]]; then
curlJson=$(curl --connect-timeout ${curl_connect_timeout} -s -L ${compression:+${compression}} ${customUpstreamResolver:+${customUpstreamResolver}} "${modifiedOptions[@]}" -w "%{json}" "${url}" -o "${listCurlBuffer}") httpCode=$(curl --connect-timeout ${curl_connect_timeout} -s -L ${compression:+${compression}} ${customUpstreamResolver:+${customUpstreamResolver}} "${modifiedOptions[@]}" -w "%{http_code}" "${url}" -o "${listCurlBuffer}" 2>/dev/null)
fi fi
# Retrieve the HTTP code, exit code and error message returned by curl command
httpCode=$(echo "${curlJson}" | jq '.http_code')
curlErrorMsg=$(echo "${curlJson}" | jq '.errormsg')
curlExitCode=$(echo "${curlJson}" | jq '.exitcode')
case $url in case $url in
# Did we "download" a local file? # Did we "download" a local file?
"file"*) "file"*)
@@ -785,6 +780,7 @@ gravity_DownloadBlocklistFromUrl() {
echo -e "${OVER} ${TICK} ${str} No changes detected" echo -e "${OVER} ${TICK} ${str} No changes detected"
success=true success=true
;; ;;
"000") echo -e "${OVER} ${CROSS} ${str} Connection Refused" ;;
"403") echo -e "${OVER} ${CROSS} ${str} Forbidden" ;; "403") echo -e "${OVER} ${CROSS} ${str} Forbidden" ;;
"404") echo -e "${OVER} ${CROSS} ${str} Not found" ;; "404") echo -e "${OVER} ${CROSS} ${str} Not found" ;;
"408") echo -e "${OVER} ${CROSS} ${str} Time-out" ;; "408") echo -e "${OVER} ${CROSS} ${str} Time-out" ;;
@@ -793,7 +789,7 @@ gravity_DownloadBlocklistFromUrl() {
"504") echo -e "${OVER} ${CROSS} ${str} Connection Timed Out (Gateway)" ;; "504") echo -e "${OVER} ${CROSS} ${str} Connection Timed Out (Gateway)" ;;
"521") echo -e "${OVER} ${CROSS} ${str} Web Server Is Down (Cloudflare)" ;; "521") echo -e "${OVER} ${CROSS} ${str} Web Server Is Down (Cloudflare)" ;;
"522") echo -e "${OVER} ${CROSS} ${str} Connection Timed Out (Cloudflare)" ;; "522") echo -e "${OVER} ${CROSS} ${str} Connection Timed Out (Cloudflare)" ;;
*) echo -e "${OVER} ${CROSS} ${str} Failure (exit_code=${COL_RED}${curlExitCode}${COL_NC} Msg: ${COL_CYAN}${curlErrorMsg}${COL_NC})" ;; *) echo -e "${OVER} ${CROSS} ${str} ${url} (${httpCode})" ;;
esac esac
;; ;;
esac esac
@@ -1134,7 +1130,7 @@ fi
if [[ "${forceDelete:-}" == true ]]; then if [[ "${forceDelete:-}" == true ]]; then
str="Deleting existing list cache" str="Deleting existing list cache"
echo -ne "${INFO} ${str}..." echo -ne " ${INFO} ${str}..."
rm "${listsCacheDir}/list.*" 2>/dev/null || true rm "${listsCacheDir}/list.*" 2>/dev/null || true
echo -e "${OVER} ${TICK} ${str}" echo -e "${OVER} ${TICK} ${str}"