Compare commits
3 Commits
ec8df55f0d
...
tweak/6380
| Author | SHA1 | Date | |
|---|---|---|---|
| fbb3798dc2 | |||
|
|
a393dd83f3 | ||
|
|
5ed52554d7 |
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
@@ -29,12 +29,12 @@ jobs:
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
-
|
||||
name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e #v4.32.4
|
||||
uses: github/codeql-action/init@9e907b5e64f6b83e7804b09294d44122997950d6 #v4.32.3
|
||||
with:
|
||||
languages: 'python'
|
||||
-
|
||||
name: Autobuild
|
||||
uses: github/codeql-action/autobuild@89a39a4e59826350b863aa6b6252a07ad50cf83e #v4.32.4
|
||||
uses: github/codeql-action/autobuild@9e907b5e64f6b83e7804b09294d44122997950d6 #v4.32.3
|
||||
-
|
||||
name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e #v4.32.4
|
||||
uses: github/codeql-action/analyze@9e907b5e64f6b83e7804b09294d44122997950d6 #v4.32.3
|
||||
|
||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
issues: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f #v10.2.0
|
||||
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d #v10.1.1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-stale: 30
|
||||
|
||||
2
.github/workflows/stale_pr.yml
vendored
2
.github/workflows/stale_pr.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f #v10.2.0
|
||||
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d #v10.1.1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Do not automatically mark PR/issue as stale
|
||||
|
||||
@@ -10,32 +10,32 @@
|
||||
|
||||
function get_local_branch() {
|
||||
# Return active branch
|
||||
cd "${1}" 2>/dev/null || { echo "null"; return; }
|
||||
git rev-parse --abbrev-ref HEAD || echo "null"
|
||||
cd "${1}" 2>/dev/null || return 1
|
||||
git rev-parse --abbrev-ref HEAD || return 1
|
||||
}
|
||||
|
||||
function get_local_version() {
|
||||
# Return active version
|
||||
cd "${1}" 2>/dev/null || { echo "null"; return; }
|
||||
git describe --tags --always 2>/dev/null || echo "null"
|
||||
cd "${1}" 2>/dev/null || return 1
|
||||
git describe --tags --always 2>/dev/null || return 1
|
||||
}
|
||||
|
||||
function get_local_hash() {
|
||||
cd "${1}" 2>/dev/null || { echo "null"; return; }
|
||||
git rev-parse --short=8 HEAD || echo "null"
|
||||
cd "${1}" 2>/dev/null || return 1
|
||||
git rev-parse --short=8 HEAD || return 1
|
||||
}
|
||||
|
||||
function get_remote_version() {
|
||||
# if ${2} is = "master" we need to use the "latest" endpoint, otherwise, we simply return null
|
||||
if [[ "${2}" == "master" ]]; then
|
||||
curl -s "https://api.github.com/repos/pi-hole/${1}/releases/latest" 2>/dev/null | jq --raw-output .tag_name || echo "null"
|
||||
curl -s "https://api.github.com/repos/pi-hole/${1}/releases/latest" 2>/dev/null | jq --raw-output .tag_name || return 1
|
||||
else
|
||||
echo "null"
|
||||
fi
|
||||
}
|
||||
|
||||
function get_remote_hash() {
|
||||
git ls-remote "https://github.com/pi-hole/${1}" --tags "${2}" | awk '{print substr($0, 1,8);}' || echo "null"
|
||||
git ls-remote "https://github.com/pi-hole/${1}" --tags "${2}" | awk '{print substr($0, 1,8);}' || return 1
|
||||
}
|
||||
|
||||
# Source the utils file for addOrEditKeyValPair()
|
||||
|
||||
@@ -13,23 +13,14 @@ cachedVersions="/etc/pihole/versions"
|
||||
|
||||
if [ -f ${cachedVersions} ]; then
|
||||
# shellcheck source=/dev/null
|
||||
. "${cachedVersions}"
|
||||
. "$cachedVersions"
|
||||
else
|
||||
echo "Could not find /etc/pihole/versions. Running update now."
|
||||
pihole updatechecker
|
||||
# shellcheck source=/dev/null
|
||||
. "${cachedVersions}"
|
||||
. "$cachedVersions"
|
||||
fi
|
||||
|
||||
# Convert "null" or empty values to "N/A" for display
|
||||
normalize_version() {
|
||||
if [ -z "${1}" ] || [ "${1}" = "null" ]; then
|
||||
echo "N/A"
|
||||
else
|
||||
echo "${1}"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
local details
|
||||
details=false
|
||||
@@ -42,21 +33,21 @@ main() {
|
||||
|
||||
if [ "${details}" = true ]; then
|
||||
echo "Core"
|
||||
echo " Version is $(normalize_version "${CORE_VERSION}") (Latest: $(normalize_version "${GITHUB_CORE_VERSION}"))"
|
||||
echo " Branch is $(normalize_version "${CORE_BRANCH}")"
|
||||
echo " Hash is $(normalize_version "${CORE_HASH}") (Latest: $(normalize_version "${GITHUB_CORE_HASH}"))"
|
||||
echo " Version is ${CORE_VERSION:=N/A} (Latest: ${GITHUB_CORE_VERSION:=N/A})"
|
||||
echo " Branch is ${CORE_BRANCH:=N/A}"
|
||||
echo " Hash is ${CORE_HASH:=N/A} (Latest: ${GITHUB_CORE_HASH:=N/A})"
|
||||
echo "Web"
|
||||
echo " Version is $(normalize_version "${WEB_VERSION}") (Latest: $(normalize_version "${GITHUB_WEB_VERSION}"))"
|
||||
echo " Branch is $(normalize_version "${WEB_BRANCH}")"
|
||||
echo " Hash is $(normalize_version "${WEB_HASH}") (Latest: $(normalize_version "${GITHUB_WEB_HASH}"))"
|
||||
echo " Version is ${WEB_VERSION:=N/A} (Latest: ${GITHUB_WEB_VERSION:=N/A})"
|
||||
echo " Branch is ${WEB_BRANCH:=N/A}"
|
||||
echo " Hash is ${WEB_HASH:=N/A} (Latest: ${GITHUB_WEB_HASH:=N/A})"
|
||||
echo "FTL"
|
||||
echo " Version is $(normalize_version "${FTL_VERSION}") (Latest: $(normalize_version "${GITHUB_FTL_VERSION}"))"
|
||||
echo " Branch is $(normalize_version "${FTL_BRANCH}")"
|
||||
echo " Hash is $(normalize_version "${FTL_HASH}") (Latest: $(normalize_version "${GITHUB_FTL_HASH}"))"
|
||||
echo " Version is ${FTL_VERSION:=N/A} (Latest: ${GITHUB_FTL_VERSION:=N/A})"
|
||||
echo " Branch is ${FTL_BRANCH:=N/A}"
|
||||
echo " Hash is ${FTL_HASH:=N/A} (Latest: ${GITHUB_FTL_HASH:=N/A})"
|
||||
else
|
||||
echo "Core version is $(normalize_version "${CORE_VERSION}") (Latest: $(normalize_version "${GITHUB_CORE_VERSION}"))"
|
||||
echo "Web version is $(normalize_version "${WEB_VERSION}") (Latest: $(normalize_version "${GITHUB_WEB_VERSION}"))"
|
||||
echo "FTL version is $(normalize_version "${FTL_VERSION}") (Latest: $(normalize_version "${GITHUB_FTL_VERSION}"))"
|
||||
echo "Core version is ${CORE_VERSION:=N/A} (Latest: ${GITHUB_CORE_VERSION:=N/A})"
|
||||
echo "Web version is ${WEB_VERSION:=N/A} (Latest: ${GITHUB_WEB_VERSION:=N/A})"
|
||||
echo "FTL version is ${FTL_VERSION:=N/A} (Latest: ${GITHUB_FTL_VERSION:=N/A})"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -196,6 +196,17 @@ for var in "$@"; do
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "${runUnattended}" == true ]]; then
|
||||
# In order to run an unattended setup, a pre-seeded /etc/pihole/pihole.toml must exist
|
||||
if [[ ! -f "${PI_HOLE_CONFIG_DIR}/pihole.toml" ]]; then
|
||||
printf " %b Error: \"%s\" not found. Cannot run unattended setup\\n" "${CROSS}" "${PI_HOLE_CONFIG_DIR}/pihole.toml"
|
||||
exit 1
|
||||
fi
|
||||
printf " %b Performing unattended setup, no dialogs will be displayed\\n" "${INFO}"
|
||||
# also disable debconf-apt-progress dialogs
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
fi
|
||||
|
||||
# If the color table file exists,
|
||||
if [[ -f "${coltable}" ]]; then
|
||||
# source it
|
||||
@@ -2330,15 +2341,6 @@ main() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${fresh_install}" == false ]]; then
|
||||
# if it's running unattended,
|
||||
if [[ "${runUnattended}" == true ]]; then
|
||||
printf " %b Performing unattended setup, no dialogs will be displayed\\n" "${INFO}"
|
||||
# also disable debconf-apt-progress dialogs
|
||||
export DEBIAN_FRONTEND="noninteractive"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${fresh_install}" == true ]]; then
|
||||
# Display welcome dialogs
|
||||
welcomeDialogs
|
||||
|
||||
Reference in New Issue
Block a user