From c2150537646405c37aa2cdf1193c434331ba9c71 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Tue, 18 Feb 2025 21:06:15 +0100 Subject: [PATCH] Add note about authentication Signed-off-by: yubiuser --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 839b538..3dad3b6 100644 --- a/README.md +++ b/README.md @@ -9,17 +9,21 @@ PADD (formerly Chronometer2) is a more expansive version of the original chronom ## Setup PADD - Get a copy of PADD by running: + ```bash cd ~ wget -O padd.sh https://install.padd.sh ``` + or + ```bash cd ~ curl -sSL https://install.padd.sh -o padd.sh ``` - Make PADD executable by running + ```bash sudo chmod +x padd.sh ``` @@ -29,33 +33,54 @@ PADD (formerly Chronometer2) is a more expansive version of the original chronom ### PADD on Pi-hole machine - Just run + ```bash ./padd.sh ``` ### PADD from other machine + 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 -- without 2FA enabled ```bash - ./padd.sh --server --secret + ./padd.sh --server + ``` + +### Authentication + +Pi-hole v6 uses a completely new API with a new authentication mechanism + +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_password). +For details see [https://github.com/pi-hole/FTL/pull/1999](https://github.com/pi-hole/FTL/pull/1999) + +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 + +- password only + + ```bash + ./padd.sh --secret ``` - with 2FA enabled + ```bash - ./padd.sh --server --secret --2fa <2fa> + ./padd.sh --secret --2fa <2fa> ``` ### PADD with Pi-hole in a Docker Container + - 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: + ```bash docker exec -it padd [padd_options] ``` ### PADD on PiTFT screen + _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)_ - Set PADD to auto run on the PiTFT screen by adding the following to the end of `~/.bashrc`: + ```bash # Run PADD # If we’re on the PiTFT screen (ssh is xterm) @@ -69,6 +94,7 @@ _Instructions for how to setup PiTFT screen can be found [here](https://learn.ad ``` One line version + ```bash cd ~ ; echo "if [ \"\$TERM\" == \"linux\" ] ; then\n while :\n do\n ./padd.sh\n sleep 1\n done\nfi" | tee ~/.bashrc -a ``` @@ -76,8 +102,11 @@ _Instructions for how to setup PiTFT screen can be found [here](https://learn.ad - Reboot your Pi-Hole by running `sudo reboot`. PADD should now run on PiTFT Screen when your Pi-Hole has completed booting. #### (Optional) Put the PiTFT Display to Sleep at Night -_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__.)_ + +_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**.)_ + - To do so, edit cron as root (`sudo crontab -e`) and add the following: + ```bash # PiTFT+ SLEEPY TIME # Turn off the PiTFT+ at midnight @@ -87,31 +116,40 @@ _If you don't want your PiTFT on all night when you are asleep, you can put it t ``` ## Updating PADD + - 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 ``` + or + ```bash cd ~ curl -sSL https://install.padd.sh -o padd.sh ``` ## Sizes + PADD will display on screens that anywhere from 20x10 characters to over 80x26 characters. As your screen gets smaller, you’ll be presented with less information… however, you’ll always get the most important details: + - The status of your Pi-hole (is it online, in need of an update?), - How many ads have been blocked, - Your hostname and IP, and - Your CPU’s current load. It will also run in the following modes (shown further below): + - Pico: 20x10 characters - Nano: 24x12 characters - Micro: 30x16 characters @@ -122,12 +160,15 @@ It will also run in the following modes (shown further below): - Mega: 80x26 characters ### Sizing Your PADD -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. + +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. If you want to change how PADD displays on a small display attached to your Raspberry Pi, use + ```bash sudo dpkg-reconfigure console-setup ``` + to configure your font settings to an ideal size for you. 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.