1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-08-04 13:25:24 +00:00
Commit Graph

1599 Commits

Author SHA1 Message Date
Christian König
a9e3d3b728
Use --skipFTL flag also for pihole repair and checkout
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
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
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
24f32d48af
Fix pihole -q by setting PI_HOLE_SCRIPT_DIR in api.sh (#6284) 2025-07-10 10:51:20 -07: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
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
Dan Schaper
e1b05028a7
Revert "Use PID1 to determine which command to use when toggeling services" 2025-05-31 09:14:08 -07: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
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
137338e6a8
Use service wrappers in all scripts
Signed-off-by: Christian König <github@yubiuser.dev>
2025-05-27 21:23:56 +02:00
Dan Schaper
a04ed13d0a
Allow simple pihole api output, containing only the JSON payload (#6096) 2025-05-16 13:57:04 -07: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
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
3c6c3d3a15
Fix API logic in api.sh (#6193) 2025-05-11 08:43:12 -07: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
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
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
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
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
Adam Warner
195e65855d
Fix more shellcheck warnings (#6155) 2025-04-08 17:27:07 +01:00
Adam Warner
323dbbe5d9
Reduce code duplication in piholeLogFlush (#6148) 2025-04-08 12:44:30 +01: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
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
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
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
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
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
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
Michael Woolweaver
4efe4dfd4b
source with source not dot
Signed-off-by: Michael Woolweaver <michael@woolweaver.bid>
2025-04-02 14:21:45 -05: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
3f5c00919b
Remove WEB_CALL from COL_TABLE (#6062) 2025-03-10 06:14:47 +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
XhmikosR
45cb722e50
version.sh: fix typo in comment
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-03-06 21:40:17 +02: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
821c953216
Remove 'reconfigure' option (#5887) 2025-02-28 21:14:18 +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
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
Christian König
49cf5bb221
Remove 'reconfigure' option
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-06 21:57:05 +01:00