mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-25 07:33:43 +00:00
Always assume that the web interface will be installed.
We could revist this again in future if we decide that there should still be a choice to install the interface or not Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
cd17040f95
commit
0e8f285f4f
8 changed files with 71 additions and 167 deletions
|
@ -61,12 +61,11 @@ checkout() {
|
||||||
echo -e " Please re-run install script from https://github.com/pi-hole/pi-hole${COL_NC}"
|
echo -e " Please re-run install script from https://github.com/pi-hole/pi-hole${COL_NC}"
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
if [[ "${INSTALL_WEB_INTERFACE}" == "true" ]]; then
|
|
||||||
if ! is_repo "${webInterfaceDir}" ; then
|
if ! is_repo "${webInterfaceDir}" ; then
|
||||||
echo -e " ${COL_LIGHT_RED}Error: Web Admin repo is missing from system!"
|
echo -e " ${COL_LIGHT_RED}Error: Web Admin repo is missing from system!"
|
||||||
echo -e " Please re-run install script from https://github.com/pi-hole/pi-hole${COL_NC}"
|
echo -e " Please re-run install script from https://github.com/pi-hole/pi-hole${COL_NC}"
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${1}" ]]; then
|
if [[ -z "${1}" ]]; then
|
||||||
|
@ -85,11 +84,9 @@ checkout() {
|
||||||
echo ""
|
echo ""
|
||||||
echo -e " ${INFO} Pi-hole Core"
|
echo -e " ${INFO} Pi-hole Core"
|
||||||
fetch_checkout_pull_branch "${PI_HOLE_FILES_DIR}" "development" || { echo " ${CROSS} Unable to pull Core development branch"; exit 1; }
|
fetch_checkout_pull_branch "${PI_HOLE_FILES_DIR}" "development" || { echo " ${CROSS} Unable to pull Core development branch"; exit 1; }
|
||||||
if [[ "${INSTALL_WEB_INTERFACE}" == "true" ]]; then
|
echo ""
|
||||||
echo ""
|
echo -e " ${INFO} Web interface"
|
||||||
echo -e " ${INFO} Web interface"
|
fetch_checkout_pull_branch "${webInterfaceDir}" "devel" || { echo " ${CROSS} Unable to pull Web development branch"; exit 1; }
|
||||||
fetch_checkout_pull_branch "${webInterfaceDir}" "devel" || { echo " ${CROSS} Unable to pull Web development branch"; exit 1; }
|
|
||||||
fi
|
|
||||||
#echo -e " ${TICK} Pi-hole Core"
|
#echo -e " ${TICK} Pi-hole Core"
|
||||||
|
|
||||||
local path
|
local path
|
||||||
|
@ -101,10 +98,8 @@ checkout() {
|
||||||
echo -e " ${INFO} Shortcut \"master\" detected - checking out master branches..."
|
echo -e " ${INFO} Shortcut \"master\" detected - checking out master branches..."
|
||||||
echo -e " ${INFO} Pi-hole core"
|
echo -e " ${INFO} Pi-hole core"
|
||||||
fetch_checkout_pull_branch "${PI_HOLE_FILES_DIR}" "master" || { echo " ${CROSS} Unable to pull Core master branch"; exit 1; }
|
fetch_checkout_pull_branch "${PI_HOLE_FILES_DIR}" "master" || { echo " ${CROSS} Unable to pull Core master branch"; exit 1; }
|
||||||
if [[ ${INSTALL_WEB_INTERFACE} == "true" ]]; then
|
echo -e " ${INFO} Web interface"
|
||||||
echo -e " ${INFO} Web interface"
|
fetch_checkout_pull_branch "${webInterfaceDir}" "master" || { echo " ${CROSS} Unable to pull Web master branch"; exit 1; }
|
||||||
fetch_checkout_pull_branch "${webInterfaceDir}" "master" || { echo " ${CROSS} Unable to pull Web master branch"; exit 1; }
|
|
||||||
fi
|
|
||||||
#echo -e " ${TICK} Web Interface"
|
#echo -e " ${TICK} Web Interface"
|
||||||
local path
|
local path
|
||||||
path="master/${binary}"
|
path="master/${binary}"
|
||||||
|
@ -137,7 +132,7 @@ checkout() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
checkout_pull_branch "${PI_HOLE_FILES_DIR}" "${2}"
|
checkout_pull_branch "${PI_HOLE_FILES_DIR}" "${2}"
|
||||||
elif [[ "${1}" == "web" ]] && [[ "${INSTALL_WEB_INTERFACE}" == "true" ]] ; then
|
elif [[ "${1}" == "web" ]] ; then
|
||||||
str="Fetching branches from ${webInterfaceGitUrl}"
|
str="Fetching branches from ${webInterfaceGitUrl}"
|
||||||
echo -ne " ${INFO} $str"
|
echo -ne " ${INFO} $str"
|
||||||
if ! fully_fetch_repo "${webInterfaceDir}" ; then
|
if ! fully_fetch_repo "${webInterfaceDir}" ; then
|
||||||
|
|
|
@ -291,17 +291,10 @@ compare_local_version_to_git_version() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# There is no git directory so check if the web interface was disabled
|
# Return an error message
|
||||||
local setup_vars_web_interface
|
log_write "${COL_RED}Directory ${git_dir} doesn't exist${COL_NC}"
|
||||||
setup_vars_web_interface=$(< ${PIHOLE_SETUP_VARS_FILE} grep ^INSTALL_WEB_INTERFACE | cut -d '=' -f2)
|
# and exit with a non zero code
|
||||||
if [[ "${pihole_component}" == "Web" ]] && [[ "${setup_vars_web_interface}" == "false" ]]; then
|
return 1
|
||||||
log_write "${INFO} ${pihole_component}: Disabled in setupVars.conf via INSTALL_WEB_INTERFACE=false"
|
|
||||||
else
|
|
||||||
# Return an error message
|
|
||||||
log_write "${COL_RED}Directory ${git_dir} doesn't exist${COL_NC}"
|
|
||||||
# and exit with a non zero code
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,20 +128,18 @@ main() {
|
||||||
echo -e " ${INFO} Pi-hole Core:\\t${COL_LIGHT_GREEN}up to date${COL_NC}"
|
echo -e " ${INFO} Pi-hole Core:\\t${COL_LIGHT_GREEN}up to date${COL_NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
|
if ! is_repo "${ADMIN_INTERFACE_DIR}" ; then
|
||||||
if ! is_repo "${ADMIN_INTERFACE_DIR}" ; then
|
echo -e "\\n ${COL_LIGHT_RED}Error: Web Admin repo is missing from system!"
|
||||||
echo -e "\\n ${COL_LIGHT_RED}Error: Web Admin repo is missing from system!"
|
echo -e " Please re-run install script from https://pi-hole.net${COL_NC}"
|
||||||
echo -e " Please re-run install script from https://pi-hole.net${COL_NC}"
|
exit 1;
|
||||||
exit 1;
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if GitCheckUpdateAvail "${ADMIN_INTERFACE_DIR}" ; then
|
if GitCheckUpdateAvail "${ADMIN_INTERFACE_DIR}" ; then
|
||||||
web_update=true
|
web_update=true
|
||||||
echo -e " ${INFO} Web Interface:\\t${COL_YELLOW}update available${COL_NC}"
|
echo -e " ${INFO} Web Interface:\\t${COL_YELLOW}update available${COL_NC}"
|
||||||
else
|
else
|
||||||
web_update=false
|
web_update=false
|
||||||
echo -e " ${INFO} Web Interface:\\t${COL_LIGHT_GREEN}up to date${COL_NC}"
|
echo -e " ${INFO} Web Interface:\\t${COL_LIGHT_GREEN}up to date${COL_NC}"
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local funcOutput
|
local funcOutput
|
||||||
|
|
|
@ -34,10 +34,6 @@ function get_remote_hash(){
|
||||||
git ls-remote "https://github.com/pi-hole/${1}" --tags "${2}" | awk '{print substr($0, 0,8);}' || return 1
|
git ls-remote "https://github.com/pi-hole/${1}" --tags "${2}" | awk '{print substr($0, 0,8);}' || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Source the setupvars config file
|
|
||||||
# shellcheck disable=SC1091
|
|
||||||
. /etc/pihole/setupVars.conf
|
|
||||||
|
|
||||||
# Source the utils file for addOrEditKeyValPair()
|
# Source the utils file for addOrEditKeyValPair()
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
. /opt/pihole/utils.sh
|
. /opt/pihole/utils.sh
|
||||||
|
@ -86,24 +82,20 @@ addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_CORE_HASH" "${GITHUB_CORE_HASH}"
|
||||||
|
|
||||||
# get Web versions
|
# get Web versions
|
||||||
|
|
||||||
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
|
WEB_VERSION="$(get_local_version /var/www/html/admin)"
|
||||||
|
addOrEditKeyValPair "${VERSION_FILE}" "WEB_VERSION" "${WEB_VERSION}"
|
||||||
|
|
||||||
WEB_VERSION="$(get_local_version /var/www/html/admin)"
|
WEB_BRANCH="$(get_local_branch /var/www/html/admin)"
|
||||||
addOrEditKeyValPair "${VERSION_FILE}" "WEB_VERSION" "${WEB_VERSION}"
|
addOrEditKeyValPair "${VERSION_FILE}" "WEB_BRANCH" "${WEB_BRANCH}"
|
||||||
|
|
||||||
WEB_BRANCH="$(get_local_branch /var/www/html/admin)"
|
WEB_HASH="$(get_local_hash /var/www/html/admin)"
|
||||||
addOrEditKeyValPair "${VERSION_FILE}" "WEB_BRANCH" "${WEB_BRANCH}"
|
addOrEditKeyValPair "${VERSION_FILE}" "WEB_HASH" "${WEB_HASH}"
|
||||||
|
|
||||||
WEB_HASH="$(get_local_hash /var/www/html/admin)"
|
GITHUB_WEB_VERSION="$(get_remote_version AdminLTE)"
|
||||||
addOrEditKeyValPair "${VERSION_FILE}" "WEB_HASH" "${WEB_HASH}"
|
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_WEB_VERSION" "${GITHUB_WEB_VERSION}"
|
||||||
|
|
||||||
GITHUB_WEB_VERSION="$(get_remote_version AdminLTE)"
|
GITHUB_WEB_HASH="$(get_remote_hash AdminLTE "${WEB_BRANCH}")"
|
||||||
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_WEB_VERSION" "${GITHUB_WEB_VERSION}"
|
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_WEB_HASH" "${GITHUB_WEB_HASH}"
|
||||||
|
|
||||||
GITHUB_WEB_HASH="$(get_remote_hash AdminLTE "${WEB_BRANCH}")"
|
|
||||||
addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_WEB_HASH" "${GITHUB_WEB_HASH}"
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
# get FTL versions
|
# get FTL versions
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,6 @@
|
||||||
# This file is copyright under the latest version of the EUPL.
|
# This file is copyright under the latest version of the EUPL.
|
||||||
# Please see LICENSE file for your rights under this license.
|
# Please see LICENSE file for your rights under this license.
|
||||||
|
|
||||||
# Source the setupvars config file
|
|
||||||
# shellcheck disable=SC1091
|
|
||||||
. /etc/pihole/setupVars.conf
|
|
||||||
|
|
||||||
# Source the versions file poupulated by updatechecker.sh
|
# Source the versions file poupulated by updatechecker.sh
|
||||||
cachedVersions="/etc/pihole/versions"
|
cachedVersions="/etc/pihole/versions"
|
||||||
|
|
||||||
|
@ -28,7 +24,7 @@ fi
|
||||||
getLocalVersion() {
|
getLocalVersion() {
|
||||||
case ${1} in
|
case ${1} in
|
||||||
"Pi-hole" ) echo "${CORE_VERSION:=N/A}";;
|
"Pi-hole" ) echo "${CORE_VERSION:=N/A}";;
|
||||||
"AdminLTE" ) [ "${INSTALL_WEB_INTERFACE}" = true ] && echo "${WEB_VERSION:=N/A}";;
|
"AdminLTE" ) echo "${WEB_VERSION:=N/A}";;
|
||||||
"FTL" ) echo "${FTL_VERSION:=N/A}";;
|
"FTL" ) echo "${FTL_VERSION:=N/A}";;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
@ -36,7 +32,7 @@ getLocalVersion() {
|
||||||
getLocalHash() {
|
getLocalHash() {
|
||||||
case ${1} in
|
case ${1} in
|
||||||
"Pi-hole" ) echo "${CORE_HASH:=N/A}";;
|
"Pi-hole" ) echo "${CORE_HASH:=N/A}";;
|
||||||
"AdminLTE" ) [ "${INSTALL_WEB_INTERFACE}" = true ] && echo "${WEB_HASH:=N/A}";;
|
"AdminLTE" ) echo "${WEB_HASH:=N/A}";;
|
||||||
"FTL" ) echo "${FTL_HASH:=N/A}";;
|
"FTL" ) echo "${FTL_HASH:=N/A}";;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
@ -44,7 +40,7 @@ getLocalHash() {
|
||||||
getRemoteHash(){
|
getRemoteHash(){
|
||||||
case ${1} in
|
case ${1} in
|
||||||
"Pi-hole" ) echo "${GITHUB_CORE_HASH:=N/A}";;
|
"Pi-hole" ) echo "${GITHUB_CORE_HASH:=N/A}";;
|
||||||
"AdminLTE" ) [ "${INSTALL_WEB_INTERFACE}" = true ] && echo "${GITHUB_WEB_HASH:=N/A}";;
|
"AdminLTE" ) echo "${GITHUB_WEB_HASH:=N/A}";;
|
||||||
"FTL" ) echo "${GITHUB_FTL_HASH:=N/A}";;
|
"FTL" ) echo "${GITHUB_FTL_HASH:=N/A}";;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
@ -52,7 +48,7 @@ getRemoteHash(){
|
||||||
getRemoteVersion(){
|
getRemoteVersion(){
|
||||||
case ${1} in
|
case ${1} in
|
||||||
"Pi-hole" ) echo "${GITHUB_CORE_VERSION:=N/A}";;
|
"Pi-hole" ) echo "${GITHUB_CORE_VERSION:=N/A}";;
|
||||||
"AdminLTE" ) [ "${INSTALL_WEB_INTERFACE}" = true ] && echo "${GITHUB_WEB_VERSION:=N/A}";;
|
"AdminLTE" ) echo "${GITHUB_WEB_VERSION:=N/A}";;
|
||||||
"FTL" ) echo "${GITHUB_FTL_VERSION:=N/A}";;
|
"FTL" ) echo "${GITHUB_FTL_VERSION:=N/A}";;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
@ -60,16 +56,12 @@ getRemoteVersion(){
|
||||||
getLocalBranch(){
|
getLocalBranch(){
|
||||||
case ${1} in
|
case ${1} in
|
||||||
"Pi-hole" ) echo "${CORE_BRANCH:=N/A}";;
|
"Pi-hole" ) echo "${CORE_BRANCH:=N/A}";;
|
||||||
"AdminLTE" ) [ "${INSTALL_WEB_INTERFACE}" = true ] && echo "${WEB_BRANCH:=N/A}";;
|
"AdminLTE" ) echo "${WEB_BRANCH:=N/A}";;
|
||||||
"FTL" ) echo "${FTL_BRANCH:=N/A}";;
|
"FTL" ) echo "${FTL_BRANCH:=N/A}";;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
versionOutput() {
|
versionOutput() {
|
||||||
if [ "$1" = "AdminLTE" ] && [ "${INSTALL_WEB_INTERFACE}" != true ]; then
|
|
||||||
echo " WebAdmin not installed"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ "$2" = "-c" ] || [ "$2" = "--current" ] || [ -z "$2" ] && current=$(getLocalVersion "${1}") && branch=$(getLocalBranch "${1}")
|
[ "$2" = "-c" ] || [ "$2" = "--current" ] || [ -z "$2" ] && current=$(getLocalVersion "${1}") && branch=$(getLocalBranch "${1}")
|
||||||
[ "$2" = "-l" ] || [ "$2" = "--latest" ] || [ -z "$2" ] && latest=$(getRemoteVersion "${1}")
|
[ "$2" = "-l" ] || [ "$2" = "--latest" ] || [ -z "$2" ] && latest=$(getRemoteVersion "${1}")
|
||||||
|
@ -115,11 +107,7 @@ errorOutput() {
|
||||||
|
|
||||||
defaultOutput() {
|
defaultOutput() {
|
||||||
versionOutput "Pi-hole" "$@"
|
versionOutput "Pi-hole" "$@"
|
||||||
|
versionOutput "AdminLTE" "$@"
|
||||||
if [ "${INSTALL_WEB_INTERFACE}" = true ]; then
|
|
||||||
versionOutput "AdminLTE" "$@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
versionOutput "FTL" "$@"
|
versionOutput "FTL" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,6 @@ IPV4_ADDRESS=${IPV4_ADDRESS}
|
||||||
IPV6_ADDRESS=${IPV6_ADDRESS}
|
IPV6_ADDRESS=${IPV6_ADDRESS}
|
||||||
# Give settings their default values. These may be changed by prompts later in the script.
|
# Give settings their default values. These may be changed by prompts later in the script.
|
||||||
QUERY_LOGGING=true
|
QUERY_LOGGING=true
|
||||||
INSTALL_WEB_INTERFACE=true
|
|
||||||
WEBPORT=8080
|
WEBPORT=8080
|
||||||
PRIVACY_LEVEL=0
|
PRIVACY_LEVEL=0
|
||||||
CACHE_SIZE=10000
|
CACHE_SIZE=10000
|
||||||
|
@ -1048,44 +1047,6 @@ setPrivacyLevel() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to ask the user if they want to install the dashboard
|
|
||||||
setAdminFlag() {
|
|
||||||
# Similar to the logging function, ask what the user wants
|
|
||||||
dialog --no-shadow --keep-tite \
|
|
||||||
--backtitle "Pihole Installation" \
|
|
||||||
--title "Admin Web Interface" \
|
|
||||||
--yesno "\\n\\nDo you want to install the Admin Web Interface?" \
|
|
||||||
"${r}" "${c}" && result=0 || result=$?
|
|
||||||
|
|
||||||
case ${result} in
|
|
||||||
"${DIALOG_OK}")
|
|
||||||
# If they chose yes,
|
|
||||||
printf " %b Installing Admin Web Interface\\n" "${INFO}"
|
|
||||||
# Set the flag to install the web interface
|
|
||||||
INSTALL_WEB_INTERFACE=true
|
|
||||||
|
|
||||||
# Web port TODO: Below whiptail copy pasted from a previous go at this. needs converting to dialog
|
|
||||||
# Ask for the IPv4 address
|
|
||||||
WEBPORT=$(whiptail --backtitle "Setting web interface port" --title "Web Port" --inputbox "By default, pihole-FTL listens for http traffic on port 8080. If you wish to change the port, you may do so now. You can also do it later by editing /etc/pihole/pihole-FTL.conf" "${r}" "${c}" "${WEBPORT}" 3>&1 1>&2 2>&3) || \
|
|
||||||
# Canceling IPv4 settings window
|
|
||||||
{ echo -e " ${COL_LIGHT_RED}Cancel was selected, exiting installer${COL_NC}"; exit 1; }
|
|
||||||
printf " %b The Web interface will be accessible on port: %s\\n" "${INFO}" "${WEBPORT}"
|
|
||||||
|
|
||||||
;;
|
|
||||||
"${DIALOG_CANCEL}")
|
|
||||||
# If they chose no,
|
|
||||||
printf " %b Not installing Admin Web Interface\\n" "${INFO}"
|
|
||||||
# Set the flag to not install the web interface
|
|
||||||
INSTALL_WEB_INTERFACE=false
|
|
||||||
;;
|
|
||||||
"${DIALOG_ESC}")
|
|
||||||
# User pressed <ESC>
|
|
||||||
printf " %b Escape pressed, exiting installer at Admin Web Interface choice.%b\\n" "${COL_LIGHT_RED}" "${COL_NC}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# A function to display a list of example blocklists for users to select
|
# A function to display a list of example blocklists for users to select
|
||||||
chooseBlocklists() {
|
chooseBlocklists() {
|
||||||
# Back up any existing adlist file, on the off chance that it exists. Useful in case of a reconfigure.
|
# Back up any existing adlist file, on the off chance that it exists. Useful in case of a reconfigure.
|
||||||
|
@ -1613,7 +1574,6 @@ finalExports() {
|
||||||
addOrEditKeyValPair "${setupVars}" "PIHOLE_DNS_1" "${PIHOLE_DNS_1}"
|
addOrEditKeyValPair "${setupVars}" "PIHOLE_DNS_1" "${PIHOLE_DNS_1}"
|
||||||
addOrEditKeyValPair "${setupVars}" "PIHOLE_DNS_2" "${PIHOLE_DNS_2}"
|
addOrEditKeyValPair "${setupVars}" "PIHOLE_DNS_2" "${PIHOLE_DNS_2}"
|
||||||
addOrEditKeyValPair "${setupVars}" "QUERY_LOGGING" "${QUERY_LOGGING}"
|
addOrEditKeyValPair "${setupVars}" "QUERY_LOGGING" "${QUERY_LOGGING}"
|
||||||
addOrEditKeyValPair "${setupVars}" "INSTALL_WEB_INTERFACE" "${INSTALL_WEB_INTERFACE}"
|
|
||||||
addOrEditKeyValPair "${setupVars}" "CACHE_SIZE" "${CACHE_SIZE}"
|
addOrEditKeyValPair "${setupVars}" "CACHE_SIZE" "${CACHE_SIZE}"
|
||||||
addOrEditKeyValPair "${setupVars}" "DNS_FQDN_REQUIRED" "${DNS_FQDN_REQUIRED:-true}"
|
addOrEditKeyValPair "${setupVars}" "DNS_FQDN_REQUIRED" "${DNS_FQDN_REQUIRED:-true}"
|
||||||
addOrEditKeyValPair "${setupVars}" "DNS_BOGUS_PRIV" "${DNS_BOGUS_PRIV:-true}"
|
addOrEditKeyValPair "${setupVars}" "DNS_BOGUS_PRIV" "${DNS_BOGUS_PRIV:-true}"
|
||||||
|
@ -1775,11 +1735,10 @@ displayFinalMessage() {
|
||||||
# Else, inform the user that there is no set password.
|
# Else, inform the user that there is no set password.
|
||||||
pwstring="NOT SET"
|
pwstring="NOT SET"
|
||||||
fi
|
fi
|
||||||
# If the user wants to install the dashboard,
|
|
||||||
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
|
# Store a message in a variable and display it
|
||||||
# Store a message in a variable and display it
|
additional="View the web interface at http://pi.hole/admin:${WEBPORT} or http://${IPV4_ADDRESS%/*}:${WEBPORT}/admin\\n\\nYour Admin Webpage login password is ${pwstring}"
|
||||||
additional="View the web interface at http://pi.hole/admin:${WEBPORT} or http://${IPV4_ADDRESS%/*}:${WEBPORT}/admin\\n\\nYour Admin Webpage login password is ${pwstring}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Final completion message to user
|
# Final completion message to user
|
||||||
dialog --no-shadow --keep-tite \
|
dialog --no-shadow --keep-tite \
|
||||||
|
@ -1928,14 +1887,11 @@ clone_or_update_repos() {
|
||||||
{ printf " %b Unable to reset %s, exiting installer%b\\n" "${COL_LIGHT_RED}" "${PI_HOLE_LOCAL_REPO}" "${COL_NC}"; \
|
{ printf " %b Unable to reset %s, exiting installer%b\\n" "${COL_LIGHT_RED}" "${PI_HOLE_LOCAL_REPO}" "${COL_NC}"; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
}
|
}
|
||||||
# If the Web interface was installed,
|
# Reset the Web repo
|
||||||
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
|
resetRepo ${webInterfaceDir} || \
|
||||||
# reset it's repo
|
{ printf " %b Unable to reset %s, exiting installer%b\\n" "${COL_LIGHT_RED}" "${webInterfaceDir}" "${COL_NC}"; \
|
||||||
resetRepo ${webInterfaceDir} || \
|
exit 1; \
|
||||||
{ printf " %b Unable to reset %s, exiting installer%b\\n" "${COL_LIGHT_RED}" "${webInterfaceDir}" "${COL_NC}"; \
|
}
|
||||||
exit 1; \
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
# Otherwise, a repair is happening
|
# Otherwise, a repair is happening
|
||||||
else
|
else
|
||||||
# so get git files for Core
|
# so get git files for Core
|
||||||
|
@ -1943,14 +1899,11 @@ clone_or_update_repos() {
|
||||||
{ printf " %b Unable to clone %s into %s, unable to continue%b\\n" "${COL_LIGHT_RED}" "${piholeGitUrl}" "${PI_HOLE_LOCAL_REPO}" "${COL_NC}"; \
|
{ printf " %b Unable to clone %s into %s, unable to continue%b\\n" "${COL_LIGHT_RED}" "${piholeGitUrl}" "${PI_HOLE_LOCAL_REPO}" "${COL_NC}"; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
}
|
}
|
||||||
# If the Web interface was installed,
|
# get the Web git files
|
||||||
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
|
getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl} || \
|
||||||
# get the Web git files
|
{ printf " %b Unable to clone %s into ${webInterfaceDir}, exiting installer%b\\n" "${COL_LIGHT_RED}" "${webInterfaceGitUrl}" "${COL_NC}"; \
|
||||||
getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl} || \
|
exit 1; \
|
||||||
{ printf " %b Unable to clone %s into ${webInterfaceDir}, exiting installer%b\\n" "${COL_LIGHT_RED}" "${webInterfaceGitUrl}" "${COL_NC}"; \
|
}
|
||||||
exit 1; \
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2253,7 +2206,7 @@ main() {
|
||||||
# when run via curl piping
|
# when run via curl piping
|
||||||
if [[ "$0" == "bash" ]]; then
|
if [[ "$0" == "bash" ]]; then
|
||||||
# Download the install script and run it with admin rights
|
# Download the install script and run it with admin rights
|
||||||
exec curl -sSL https://raw.githubusercontent.com/pi-hole/pi-hole/master/automated%20install/basic-install.sh | sudo bash "$@"
|
exec curl -sSL https://install.pi-hole.net | sudo bash "$@"
|
||||||
else
|
else
|
||||||
# when run via calling local bash script
|
# when run via calling local bash script
|
||||||
exec sudo bash "$0" "$@"
|
exec sudo bash "$0" "$@"
|
||||||
|
@ -2319,8 +2272,6 @@ main() {
|
||||||
setDNS
|
setDNS
|
||||||
# Give the user a choice of blocklists to include in their install. Or not.
|
# Give the user a choice of blocklists to include in their install. Or not.
|
||||||
chooseBlocklists
|
chooseBlocklists
|
||||||
# Let the user decide if they want the web interface to be installed automatically
|
|
||||||
setAdminFlag
|
|
||||||
# Let the user decide if they want query logging enabled...
|
# Let the user decide if they want query logging enabled...
|
||||||
setLogging
|
setLogging
|
||||||
# Let the user decide the FTL privacy level
|
# Let the user decide the FTL privacy level
|
||||||
|
@ -2373,17 +2324,13 @@ main() {
|
||||||
# Copy the temp log file into final log location for storage
|
# Copy the temp log file into final log location for storage
|
||||||
copy_to_install_log
|
copy_to_install_log
|
||||||
|
|
||||||
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
|
# Add password to web UI if there is none
|
||||||
# Add password to web UI if there is none
|
pw=""
|
||||||
pw=""
|
# If no password is set,
|
||||||
# If no password is set,
|
if [[ $(pihole-FTL --config webserver.api.pwhash) == "${pw}" ]] ; then
|
||||||
if [[ $(grep 'WEBPASSWORD' -c "${setupVars}") == 0 ]] ; then
|
# generate a random password
|
||||||
# generate a random password
|
pw=$(tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 8)
|
||||||
pw=$(tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 8)
|
pihole -a -p "${pw}"
|
||||||
# shellcheck disable=SC1091
|
|
||||||
. /opt/pihole/webpage.sh
|
|
||||||
echo "WEBPASSWORD=$(HashPassword "${pw}")" >> "${setupVars}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for and disable systemd-resolved-DNSStubListener before reloading resolved
|
# Check for and disable systemd-resolved-DNSStubListener before reloading resolved
|
||||||
|
@ -2441,21 +2388,17 @@ main() {
|
||||||
displayFinalMessage "${pw}"
|
displayFinalMessage "${pw}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If the Web interface was installed,
|
# If there is a password
|
||||||
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
|
if (( ${#pw} > 0 )) ; then
|
||||||
# If there is a password,
|
# display the password
|
||||||
if (( ${#pw} > 0 )) ; then
|
printf " %b Web Interface password: %b%s%b\\n" "${INFO}" "${COL_LIGHT_GREEN}" "${pw}" "${COL_NC}"
|
||||||
# display the password
|
printf " %b This can be changed using 'pihole -a -p'\\n\\n" "${INFO}"
|
||||||
printf " %b Web Interface password: %b%s%b\\n" "${INFO}" "${COL_LIGHT_GREEN}" "${pw}" "${COL_NC}"
|
|
||||||
printf " %b This can be changed using 'pihole -a -p'\\n\\n" "${INFO}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${useUpdateVars}" == false ]]; then
|
if [[ "${useUpdateVars}" == false ]]; then
|
||||||
# If the Web interface was installed,
|
# If the Web interface was installed,
|
||||||
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
|
printf " %b View the web interface at http://pi.hole:${WEBPORT}/admin or http://%s/admin\\n\\n" "${INFO}" "${IPV4_ADDRESS%/*}:${WEBPORT}"
|
||||||
printf " %b View the web interface at http://pi.hole:${WEBPORT}/admin or http://%s/admin\\n\\n" "${INFO}" "${IPV4_ADDRESS%/*}:${WEBPORT}"
|
|
||||||
fi
|
|
||||||
# Explain to the user how to use Pi-hole as their DNS server
|
# Explain to the user how to use Pi-hole as their DNS server
|
||||||
printf " %b You may now configure your devices to use the Pi-hole as their DNS server\\n" "${INFO}"
|
printf " %b You may now configure your devices to use the Pi-hole as their DNS server\\n" "${INFO}"
|
||||||
[[ -n "${IPV4_ADDRESS%/*}" ]] && printf " %b Pi-hole DNS (IPv4): %s\\n" "${INFO}" "${IPV4_ADDRESS%/*}"
|
[[ -n "${IPV4_ADDRESS%/*}" ]] && printf " %b Pi-hole DNS (IPv4): %s\\n" "${INFO}" "${IPV4_ADDRESS%/*}"
|
||||||
|
|
|
@ -46,10 +46,6 @@ package_manager_detect
|
||||||
|
|
||||||
# Uninstall packages used by the Pi-hole
|
# Uninstall packages used by the Pi-hole
|
||||||
DEPS=("${INSTALLER_DEPS[@]}" "${PIHOLE_DEPS[@]}" "${OS_CHECK_DEPS[@]}")
|
DEPS=("${INSTALLER_DEPS[@]}" "${PIHOLE_DEPS[@]}" "${OS_CHECK_DEPS[@]}")
|
||||||
if [[ "${INSTALL_WEB_SERVER}" == true ]]; then
|
|
||||||
# Install the Web dependencies
|
|
||||||
DEPS+=("${PIHOLE_WEB_DEPS[@]}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Compatibility
|
# Compatibility
|
||||||
if [ -x "$(command -v apt-get)" ]; then
|
if [ -x "$(command -v apt-get)" ]; then
|
||||||
|
|
|
@ -120,7 +120,6 @@ def test_installPihole_fresh_install_readableFiles(host):
|
||||||
setup_var_file = "cat <<EOF> /etc/pihole/setupVars.conf\n"
|
setup_var_file = "cat <<EOF> /etc/pihole/setupVars.conf\n"
|
||||||
for k, v in SETUPVARS.items():
|
for k, v in SETUPVARS.items():
|
||||||
setup_var_file += "{}={}\n".format(k, v)
|
setup_var_file += "{}={}\n".format(k, v)
|
||||||
setup_var_file += "INSTALL_WEB_INTERFACE=true\n"
|
|
||||||
setup_var_file += "EOF\n"
|
setup_var_file += "EOF\n"
|
||||||
host.run(setup_var_file)
|
host.run(setup_var_file)
|
||||||
install = host.run(
|
install = host.run(
|
||||||
|
|
Loading…
Reference in a new issue