Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PADD v3.11.0 #338

Merged
merged 27 commits into from
May 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ee9ae59
Sync master back into development (#337)
yubiuser Jan 20, 2023
d58f0ab
Bump actions/checkout from 3.2.0 to 3.3.0
dependabot[bot] Feb 25, 2023
60202a7
Bump actions/checkout from 3.2.0 to 3.3.0 (#342)
yubiuser Feb 25, 2023
23646dd
Add version function to PADD
yubiuser Mar 11, 2023
64b9519
Add version info to help output
yubiuser Mar 11, 2023
25dfae7
Add version function to PADD (#344)
yubiuser Mar 12, 2023
1ff7c44
Check next temp sensor if current returned empty
yubiuser Feb 22, 2023
05cfda1
Silencing the error message
rdwebdesign Feb 22, 2023
be36a22
Reset ftl_version_heatmap after use
yubiuser Mar 12, 2023
acfc26a
Bump actions/checkout from 3.3.0 to 3.4.0
dependabot[bot] Mar 18, 2023
49f9702
Bump actions/checkout from 3.3.0 to 3.4.0 (#346)
yubiuser Mar 18, 2023
73a86c1
Bump actions/stale from 7.0.0 to 8.0.0
dependabot[bot] Mar 25, 2023
959681e
Bump actions/checkout from 3.4.0 to 3.5.0
dependabot[bot] Mar 25, 2023
d65d355
Bump actions/stale from 7.0.0 to 8.0.0 (#347)
yubiuser Mar 26, 2023
f58d2b6
Bump actions/checkout from 3.4.0 to 3.5.0 (#348)
yubiuser Mar 26, 2023
1778193
Reset ftl_version_heatmap after use (#345)
yubiuser Apr 7, 2023
95e6b2d
Fix empty temp sensor files (#341)
yubiuser Apr 7, 2023
5831d2c
Bump actions/checkout from 3.5.0 to 3.5.2
dependabot[bot] Apr 15, 2023
5f9ab06
Bump actions/checkout from 3.5.0 to 3.5.2 (#351)
yubiuser Apr 15, 2023
15a1762
Add update option
strangelookingnerd Apr 15, 2023
2f98812
Trigger stale workflow on issue comments to remove stale label immedi…
yubiuser Apr 15, 2023
2ab9842
Run seperate job to trigger removal on comments
yubiuser Apr 16, 2023
592e7e7
Use env variable
yubiuser Apr 17, 2023
e7ac674
Trigger stale workflow on issue comments to remove stale label immedi…
PromoFaux May 27, 2023
4c14bfc
Add update option (#352)
yubiuser May 27, 2023
c402d77
Bump version to v3.11.0
pralor-bot May 27, 2023
09a28ab
Bump version to v3.11.0 (#353)
yubiuser May 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
-
name: Checkout repository
uses: actions/checkout@v3.3.0
uses: actions/checkout@v3.5.2
-
name: Spell-Checking
uses: codespell-project/actions-codespell@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/editorconfig-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
name: editorconfig-checker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.3.0
- uses: actions/checkout@v3.5.2
- uses: editorconfig-checker/action-editorconfig-checker@main # current tag v1.0.0 is really out-of-date
- run: editorconfig-checker
28 changes: 24 additions & 4 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,44 @@ name: Mark stale issues

on:
schedule:
- cron: "0 8 * * *"
- cron: '0 8 * * *'
workflow_dispatch:
issue_comment:

env:
stale_label: stale

jobs:
stale:
stale_action:
if: github.event_name != 'issue_comment'
runs-on: ubuntu-latest
permissions:
issues: write

steps:
- uses: actions/stale@v7.0.0
- uses: actions/stale@v8.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
days-before-close: 5
stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days."
stale-issue-label: "stale"
stale-issue-label: $stale_label
exempt-issue-labels: "Bug, WIP, Fixed In Next Release, Internal, Never Stale"
exempt-all-issue-assignees: true
operations-per-run: 300
close-issue-reason: "not_planned"

remove_stale: # trigger "stale" removal immediately when stale issues are commented on
if: github.event_name == 'issue_comment'
permissions:
contents: read # for actions/checkout
issues: write # to edit issues label
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.4.0
- name: Remove 'stale' label
run: gh issue edit ${{ github.event.issue.number }} --remove-label $stale_label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion .github/workflows/stale_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/stale@v7.0.0
- uses: actions/stale@v8.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Do not automatically mark PR/issue as stale
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-back-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Syncing branches
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@v3.5.2
- name: Opening pull request
run: gh pr create -B development -H master --title 'Sync master back into development' --body 'Created by Github action' --label 'Internal'
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
echo "latest_tag=$LATEST_TAG" >> $GITHUB_ENV

- name: Checkout code
uses: actions/checkout@v3.2.0
uses: actions/checkout@v3.5.2
with:
ref: 'development'

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ cd ~ ; echo "if [ \"\$TERM\" == \"linux\" ] ; then\n while :\n do\n ./padd.
- Reboot your Pi-Hole by running `sudo reboot`. PADD should now run when your Pi-Hole has completed booting.

## Updating PADD
- Just run the same commands you used to install
- Simply run

```bash
./padd.sh -u
```

- or run the same commands you used to install

```bash
cd ~
wget -O padd.sh https://install.padd.sh
Expand Down
85 changes: 77 additions & 8 deletions padd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export LC_NUMERIC=C
############################################ VARIABLES #############################################

# VERSION
padd_version="v3.10.1"
padd_version="v3.11.0"

# LastChecks
LastCheckVersionInformation=$(date +%s)
Expand Down Expand Up @@ -162,12 +162,15 @@ GetSystemInformation() {

# CPU temperature
if [ -d "/sys/devices/platform/coretemp.0/hwmon/" ]; then
cpu=$(cat "$(find /sys/devices/platform/coretemp.0/hwmon/ -maxdepth 2 -name "temp1_input" 2>/dev/null | head -1)")
elif [ -f /sys/class/thermal/thermal_zone0/temp ]; then
cpu=$(cat "$(find /sys/devices/platform/coretemp.0/hwmon/ -maxdepth 2 -name "temp1_input" 2>/dev/null | head -1)" 2>/dev/null)
fi
if [ -z "${cpu}" ] && [ -f /sys/class/thermal/thermal_zone0/temp ]; then
cpu=$(cat /sys/class/thermal/thermal_zone0/temp)
elif [ -f /sys/class/hwmon/hwmon0/temp1_input ]; then
fi
if [ -z "${cpu}" ] && [ -f /sys/class/hwmon/hwmon0/temp1_input ]; then
cpu=$(cat /sys/class/hwmon/hwmon0/temp1_input)
else
fi
if [ -z "${cpu}" ]; then
cpu=0
fi

Expand Down Expand Up @@ -722,7 +725,7 @@ PrintLogo() {
if [ -n "${DOCKER_VERSION}" ]; then
version_info="Docker ${docker_version_heatmap}${DOCKER_VERSION}${reset_text}"
else
version_info="Pi-hole® ${core_version_heatmap}${CORE_VERSION}${reset_text}, Web ${web_version_heatmap}${WEB_VERSION}${reset_text}, FTL ${ftl_version_heatmap}${FTL_VERSION}"
version_info="Pi-hole® ${core_version_heatmap}${CORE_VERSION}${reset_text}, Web ${web_version_heatmap}${WEB_VERSION}${reset_text}, FTL ${ftl_version_heatmap}${FTL_VERSION}${reset_text}"
fi

# Screen size checks
Expand Down Expand Up @@ -755,7 +758,7 @@ PrintDashboard() {
if [ -n "${DOCKER_VERSION}" ]; then
version_info="Docker ${docker_version_heatmap}${DOCKER_VERSION}${reset_text}"
else
version_info="Pi-hole® ${core_version_heatmap}${CORE_VERSION}${reset_text}, Web ${web_version_heatmap}${WEB_VERSION}${reset_text}, FTL ${ftl_version_heatmap}${FTL_VERSION}"
version_info="Pi-hole® ${core_version_heatmap}${CORE_VERSION}${reset_text}, Web ${web_version_heatmap}${WEB_VERSION}${reset_text}, FTL ${ftl_version_heatmap}${FTL_VERSION}${reset_text}"
fi
# Move cursor to (0,0).
printf '\e[H'
Expand Down Expand Up @@ -1195,6 +1198,23 @@ OutputJSON() {
echo "{\"domains_being_blocked\":${domains_being_blocked_raw},\"dns_queries_today\":${dns_queries_today_raw},\"ads_blocked_today\":${ads_blocked_today_raw},\"ads_percentage_today\":${ads_percentage_today_raw},\"clients\": ${clients}}"
}

ShowVersion() {
# source version file to check if $DOCKER_VERSION is set
. /etc/pihole/versions
GetPADDInformation
if [ -z "${padd_version_latest}" ]; then
padd_version_latest="N/A"
fi
if [ -n "${DOCKER_VERSION}" ]; then
# Check for latest Docker version
GetVersionInformation
printf "%s${clear_line}\n" " PADD version is ${padd_version} as part of Docker ${docker_version_heatmap}${DOCKER_VERSION}${reset_text} (Latest Docker: ${GITHUB_DOCKER_VERSION})"
version_info="Docker ${docker_version_heatmap}${DOCKER_VERSION}${reset_text}"
else
printf "%s${clear_line}\n" " PADD version is ${padd_version_heatmap}${padd_version}${reset_text} (Latest: ${padd_version_latest})"
fi
}

StartupRoutine(){
# Get config variables
. /etc/pihole/setupVars.conf
Expand Down Expand Up @@ -1370,6 +1390,52 @@ NormalPADD() {
done
}

Update() {
# source version file to check if $DOCKER_VERSION is set
. /etc/pihole/versions

if [ -n "${DOCKER_VERSION}" ]; then
echo "${check_box_info} Update is not supported for Docker"
exit 1
fi

GetPADDInformation

if [ "${padd_out_of_date_flag}" = "true" ]; then
echo "${check_box_info} Updating PADD from ${padd_version} to ${padd_version_latest}"

padd_script_path=$(realpath "$0")

if which wget > /dev/null 2>&1; then
echo "${check_box_info} Downloading PADD update via wget ..."
if wget -qO "${padd_script_path}" https://install.padd.sh > /dev/null 2>&1; then
echo "${check_box_good} ... done. Restart PADD for the update to take effect"
else
echo "${check_box_bad} Cannot download PADD update via wget"
echo "${check_box_info} Go to https://install.padd.sh to download the update manually"
exit 1
fi
elif which curl > /dev/null 2>&1; then
echo "${check_box_info} Downloading PADD update via curl ..."
if curl -sSL https://install.padd.sh -o "${padd_script_path}" > /dev/null 2>&1; then
echo "${check_box_good} ... done. Restart PADD for the update to take effect"
else
echo "${check_box_bad} Cannot download PADD update via curl"
echo "${check_box_info} Go to https://install.padd.sh to download the update manually"
exit 1
fi
else
echo "${check_box_bad} Cannot download, neither wget nor curl are available"
echo "${check_box_info} Go to https://install.padd.sh to download the update manually"
exit 1
fi
else
echo "${check_box_good} You are already using the latest PADD version ${padd_version}"
fi

exit 0
}

DisplayHelp() {
cat << EOM

Expand All @@ -1381,10 +1447,11 @@ DisplayHelp() {
::: -xoff [num] set the x-offset, reference is the upper left corner, disables auto-centering
::: -yoff [num] set the y-offset, reference is the upper left corner, disables auto-centering
::: -j, --json output stats as JSON formatted string and exit
::: -u, --update update to the latest version
::: -v, --version show PADD version info
::: -h, --help display this help text

EOM
exit 0
}

CleanExit(){
Expand Down Expand Up @@ -1448,7 +1515,9 @@ main(){
while [ "$#" -gt 0 ]; do
case "$1" in
"-j" | "--json" ) OutputJSON; exit 0;;
"-u" | "--update" ) Update;;
"-h" | "--help" ) DisplayHelp; exit 0;;
"-v" | "--version" ) ShowVersion; exit 0;;
"-xoff" ) xOffset="$2"; xOffOrig="$2"; shift;;
"-yoff" ) yOffset="$2"; yOffOrig="$2"; shift;;
* ) DisplayHelp; exit 1;;
Expand Down