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>
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>
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>
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>
FTL correctly creates the cert and especially private key with 0600 mode. But the prestart scripts changes it to 0660.
After removing the dedicated webserver from Pi-hole setups, the pihole group has no purpose anymore, and files should not be writable to any other user than pihole itself, and the private TLS key not reasable to anyone else either.
Additionally, this commit consolidates the chmod calls, applying 0755 to all directories and 0640 to all files, but the TLS key and cert.
Signed-off-by: MichaIng <micha@dietpi.com>