Skip to content

Commit 48291ad

Browse files
authored
PADD v4.0.0 (#373)
2 parents fb92108 + f92959c commit 48291ad

9 files changed

+1121
-639
lines changed

.github/workflows/codespell.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
steps:
1111
-
1212
name: Checkout repository
13-
uses: actions/checkout@v4.1.0
13+
uses: actions/checkout@v4.2.2
1414
-
1515
name: Spell-Checking
1616
uses: codespell-project/actions-codespell@master

.github/workflows/editorconfig-checker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
name: editorconfig-checker
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4.1.0
12+
- uses: actions/checkout@v4.2.2
1313
- uses: editorconfig-checker/action-editorconfig-checker@main # current tag v1.0.0 is really out-of-date
1414
- run: editorconfig-checker

.github/workflows/merge-conflict.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Check if PRs are have merge conflicts
16-
uses: eps1lon/actions-label-merge-conflict@v2.1.0
16+
uses: eps1lon/actions-label-merge-conflict@v3.0.3
1717
with:
1818
dirtyLabel: "Merge Conflict"
1919
repoToken: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/stale.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
issues: write
1818

1919
steps:
20-
- uses: actions/stale@v8.0.0
20+
- uses: actions/stale@v9.1.0
2121
with:
2222
repo-token: ${{ secrets.GITHUB_TOKEN }}
2323
days-before-stale: 30
@@ -40,7 +40,7 @@ jobs:
4040
runs-on: ubuntu-latest
4141
steps:
4242
- name: Checkout
43-
uses: actions/checkout@v4.1.0
43+
uses: actions/checkout@v4.2.2
4444
- name: Remove 'stale' label
4545
run: gh issue edit ${{ github.event.issue.number }} --remove-label ${{ env.stale_label }}
4646
env:

.github/workflows/stale_pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
pull-requests: write
1818

1919
steps:
20-
- uses: actions/stale@v8.0.0
20+
- uses: actions/stale@v9.1.0
2121
with:
2222
repo-token: ${{ secrets.GITHUB_TOKEN }}
2323
# Do not automatically mark PR/issue as stale

.github/workflows/sync-back-to-dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Syncing branches
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v4.1.0
14+
uses: actions/checkout@v4.2.2
1515
- name: Opening pull request
1616
run: gh pr create -B development -H master --title 'Sync master back into development' --body 'Created by Github action' --label 'Internal'
1717
env:

.github/workflows/version_bump.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ jobs:
1717
LATEST_TAG=$(gh -R $REPO release list -L 1 | awk '{printf $3}')
1818
echo "Latest version tag for releases in $REPO is $LATEST_TAG"
1919
echo "latest_tag=$LATEST_TAG" >> $GITHUB_ENV
20+
[[ -z ${LATEST_TAG} ]] && echo "Error: LATEST_TAG is empty, aborting" && exit 1
2021
2122
- name: Checkout code
22-
uses: actions/checkout@v4.1.0
23+
uses: actions/checkout@v4.2.2
2324
with:
2425
ref: 'development'
2526

README.md

+148-44
Original file line numberDiff line numberDiff line change
@@ -7,68 +7,172 @@ PADD (formerly Chronometer2) is a more expansive version of the original chronom
77
***Note:** PADD has been adopted by the Pi-hole team, thanks to JPMCK for creating this helpful tool!
88

99
## Setup PADD
10-
*More in-depth information about setting up PADD can be found in this repo’s [wiki](https://github.com/pi-hole/PADD/wiki/Setup).*
1110

1211
- Get a copy of PADD by running:
1312

14-
```bash
15-
cd ~
16-
wget -O padd.sh https://install.padd.sh
17-
```
18-
or
19-
```bash
20-
cd ~
21-
curl -sSL https://install.padd.sh -o padd.sh
22-
```
13+
```bash
14+
cd ~
15+
wget -O padd.sh https://install.padd.sh
16+
```
17+
18+
or
19+
20+
```bash
21+
cd ~
22+
curl -sSL https://install.padd.sh -o padd.sh
23+
```
2324

2425
- Make PADD executable by running
2526

26-
```bash
27-
sudo chmod +x padd.sh
28-
```
27+
```bash
28+
sudo chmod +x padd.sh
29+
```
2930

30-
- Set PADD to auto run by adding the following to the end of `~/.bashrc`:
31+
## Using PADD
3132

32-
```bash
33-
# Run PADD
34-
# If we’re on the PiTFT screen (ssh is xterm)
35-
if [ "$TERM" == "linux" ] ; then
36-
while :
37-
do
38-
./padd.sh
39-
sleep 1
40-
done
41-
fi
42-
```
33+
### PADD on Pi-hole machine
4334

44-
One line version
35+
- Just run
4536

46-
```bash
47-
cd ~ ; echo "if [ \"\$TERM\" == \"linux\" ] ; then\n while :\n do\n ./padd.sh\n sleep 1\n done\nfi" | tee ~/.bashrc -a
48-
```
37+
```bash
38+
./padd.sh
39+
```
40+
41+
### PADD from other machine
42+
43+
With PADD v4.0.0 and Pi-hole v6 it is also possible to run PADD from a machine that is not running Pi-hole
44+
45+
```bash
46+
./padd.sh --server <DOMAIN|IP>
47+
```
48+
49+
### Authentication
50+
51+
Pi-hole v6 uses a completely new API with a new authentication mechanism
52+
53+
If you run PADD on the same machine as Pi-hole, it's possible to bypass authentication when your local user is member of the `pihole` group (specifically, if you can access `/etc/pihole/cli_pw).
54+
For details see [https://github.com/pi-hole/FTL/pull/1999](https://github.com/pi-hole/FTL/pull/1999)
55+
56+
If this is not the case, PADD will ask you for your password and (if configured) your two factor authentication token. You can also pass those as arguments
57+
58+
- password only
59+
60+
```bash
61+
./padd.sh --secret <password>
62+
```
63+
64+
- with 2FA enabled
65+
66+
```bash
67+
./padd.sh --secret <password> --2fa <2fa>
68+
```
69+
70+
### PADD with Pi-hole in a Docker Container
71+
72+
- If you're running Pi-hole in the official Docker Container, `padd.sh` is pre-installed and named `padd`. It can be used with the following command:
73+
74+
```bash
75+
docker exec -it <container_name> padd [padd_options]
76+
```
77+
78+
### PADD on PiTFT screen
79+
80+
_Instructions for how to setup PiTFT screen can be found [here](https://learn.adafruit.com/adafruit-pitft-3-dot-5-touch-screen-for-raspberry-pi/easy-install-2)_
81+
82+
- Set PADD to auto run on the PiTFT screen by adding the following to the end of `~/.bashrc`:
4983

50-
- Reboot your Pi-Hole by running `sudo reboot`. PADD should now run when your Pi-Hole has completed booting.
84+
```bash
85+
# Run PADD
86+
# If we’re on the PiTFT screen (ssh is xterm)
87+
if [ "$TERM" == "linux" ] ; then
88+
while :
89+
do
90+
./padd.sh
91+
sleep 1
92+
done
93+
fi
94+
```
95+
96+
One line version
97+
98+
```bash
99+
cd ~ ; echo "if [ \"\$TERM\" == \"linux\" ] ; then\n while :\n do\n ./padd.sh\n sleep 1\n done\nfi" | tee ~/.bashrc -a
100+
```
101+
102+
- Reboot your Pi-Hole by running `sudo reboot`. PADD should now run on PiTFT Screen when your Pi-Hole has completed booting.
103+
104+
#### (Optional) Put the PiTFT Display to Sleep at Night
105+
106+
_If you don't want your PiTFT on all night when you are asleep, you can put it to sleep! (Note: **these instructions only apply to a PiTFT**.)_
107+
108+
- To do so, edit cron as root (`sudo crontab -e`) and add the following:
109+
110+
```bash
111+
# PiTFT+ SLEEPY TIME
112+
# Turn off the PiTFT+ at midnight
113+
00 00 * * * sh -c 'echo "0" > /sys/class/backlight/soc\:backlight/brightness'
114+
# Turn on the PiTFT+ at 8:00 am
115+
00 08 * * * sh -c 'echo "1" > /sys/class/backlight/soc\:backlight/brightness'
116+
```
51117

52118
## Updating PADD
119+
53120
- Simply run
54121

55-
```bash
56-
./padd.sh -u
57-
```
122+
```bash
123+
./padd.sh -u
124+
```
58125

59126
- or run the same commands you used to install
60127

61-
```bash
62-
cd ~
63-
wget -O padd.sh https://install.padd.sh
64-
```
65-
```bash
66-
cd ~
67-
curl -sSL https://install.padd.sh -o padd.sh
68-
```
128+
```bash
129+
cd ~
130+
wget -O padd.sh https://install.padd.sh
131+
```
132+
133+
or
134+
135+
```bash
136+
cd ~
137+
curl -sSL https://install.padd.sh -o padd.sh
138+
```
139+
140+
## Sizes
141+
142+
PADD will display on screens that anywhere from 20x10 characters to over 80x26 characters.
143+
144+
As your screen gets smaller, you’ll be presented with less information… however, you’ll always get the most important details:
145+
146+
- The status of your Pi-hole (is it online, in need of an update?),
147+
- How many ads have been blocked,
148+
- Your hostname and IP, and
149+
- Your CPU’s current load.
150+
151+
It will also run in the following modes (shown further below):
152+
153+
- Pico: 20x10 characters
154+
- Nano: 24x12 characters
155+
- Micro: 30x16 characters
156+
- Mini: 40x18 characters
157+
- Tiny: 53x20 characters
158+
- Slim: 60x21 characters
159+
- Regular: 60x22 characters (takes up the entire screen on a 3.5" Adafruit PiTFT using the Terminal font at 8x14.)
160+
- Mega: 80x26 characters
161+
162+
### Sizing Your PADD
163+
164+
How PADD will display on your screen depends on the size of the screen in _characters_, not _pixels_! PADD doesn’t care if it is running on a 5k Retina display on your $5,000 iMac Pro or on a $5 display you bought on eBay.
165+
166+
If you want to change how PADD displays on a small display attached to your Raspberry Pi, use
69167

70-
## Running Pi-hole in a Docker Container
71-
If you're running Pi-hole in the official Docker Container, `padd.sh` is pre-installed and named `padd`. It can be used with the following command:
72168
```bash
73-
docker exec -it <container_name> padd [padd_options]
169+
sudo dpkg-reconfigure console-setup
74170
```
171+
172+
to configure your font settings to an ideal size for you.
173+
174+
If you want to change how PADD displays through a terminal emulator (PuTTY, Terminal.app, iTerm2, etc.), resize your window or play with font sizes in your app of choice.
175+
176+
### The Sizes
177+
178+
![PADD Sizes GIF](https://github.com/pi-hole/graphics/blob/master/PADD/PADDsizes.gif)

0 commit comments

Comments
 (0)