1
0
mirror of https://github.com/pi-hole/pi-hole.git synced 2025-09-20 17:11:17 +08:00
Commit Graph

614 Commits

Author SHA1 Message Date
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
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
ca1bab3c1b Fix more shellcheck warnings
Signed-off-by: Christian König <github@yubiuser.dev>
2025-04-07 10:52:57 +02:00
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
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
5afab5e96c Move list parsing entirely into FTL (#6105) 2025-04-05 20:15:16 +02:00
2477d6b184 Revert #6137 (#6146) 2025-04-04 23:28:51 +01:00
65b42c1c8f Ensure gravity_Cleanup() checks the correct directory (#6131) 2025-04-04 22:50:19 +02:00
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
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
4efe4dfd4b source with source not dot
Signed-off-by: Michael Woolweaver <michael@woolweaver.bid>
2025-04-02 14:21:45 -05:00
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
dec670a6d6 Move list parsing entirely into FTL
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-22 09:18:02 +01:00
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
edf336067a Fix gravity.sh -- Alpine / Docker specific issue (#6030) 2025-03-03 17:44:45 +00:00
df814ece91 Revert "Improve gravity on systems with low memory" 2025-03-03 09:00:17 +01:00
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
53e241f057 Improve gravity on systems with low memory (#5977) 2025-02-28 17:02:56 +01:00
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
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
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
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
9212a4a514 Decide if the content was changed *before* passing over to FTL (#5872) 2025-02-04 18:57:01 +01:00
8e298df1e8 Show only enabled domains/regex in the final gravity message (#5884) 2025-02-03 20:37:49 +01:00
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
94e772378e Merge branch 'development' into new/listsCacheDir
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-03 08:09:37 +01:00
7dbf408c26 Gravity: Use ETags (#5867) 2025-02-03 06:30:11 +01:00
7162be18e2 Remove curl -V temp variable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-02-02 20:57:13 +01:00
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
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
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
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
68b03e114c Merge branch 'development' into new/etags
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-29 19:24:31 +01:00
f50c696253 Use temp variable for curl -V output
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-29 19:19:01 +01:00
6e0b16ed1a Rename heisenbergCompensator -> modifiedOptions
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-29 19:17:04 +01:00
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
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
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
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
cc25ee940e Fix unreachable code
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-12 13:42:51 +01:00
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
579dc07046 Merge branch 'development' into tweak/gravity_backup
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-26 21:08:09 +01:00
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
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
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
633c971a44 Store failed gravity restoration status in message table
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-23 09:44:39 +01:00
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
fdf44355d2 Keep up to 10 database backups
Signed-off-by: DL6ER <dl6er@dl6er.de>
2024-11-16 12:08:27 +01:00
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
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