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 v4.0.0 #373

Merged
merged 144 commits into from
Feb 24, 2025
Merged
Changes from 1 commit
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
dbe726d
Add FTL communication
yubiuser Jul 2, 2022
8916cb2
Improve exit routines
yubiuser Jul 2, 2022
55ade42
Add TestAPIAvailability()
yubiuser Jul 17, 2022
cea974e
Use API for GetSummaryInformation
yubiuser Jul 17, 2022
0df566a
Use API for GetSystemInformation
yubiuser Jul 17, 2022
67184b7
Use API for GetNetworkInformation
yubiuser Jul 18, 2022
f92afc7
Use API for GetVersionInformation
yubiuser Jul 18, 2022
7531a1a
Remove CheckConnectivity
yubiuser Jul 18, 2022
cc9a9f8
Set DHCP_ROUTER via API, turn cursor back on when exiting
yubiuser Jul 18, 2022
0e00879
Make OutputJSON compatible with FTLv6
yubiuser Jul 18, 2022
bb6f8b3
Remove commas between component's version
yubiuser Jul 18, 2022
afd573e
Rebase on development including new VersionConverter()
yubiuser Jul 19, 2022
2096d3b
Don't allow $validSession to be empty
yubiuser Jan 6, 2023
699e0bd
Merge branch 'development' into PADD_FTLv6
yubiuser Jan 14, 2023
a726df6
Mix merge mess
yubiuser Jan 14, 2023
70e33c1
Adjust to current FTL endpoints
yubiuser Jan 14, 2023
1a23a9c
Mask user password during input
yubiuser Jan 16, 2023
d3a209e
Format memory_percentage
yubiuser Jan 16, 2023
b1a2fb3
Merge branch 'development' into PADD_FTLv6
yubiuser Jan 16, 2023
e0f78cf
Adjust for changed API endpoint
yubiuser Jan 19, 2023
4926363
Merge branch 'development' into PADD_FTLv6
yubiuser Jan 19, 2023
7c6efb1
Use 127.0.0.1 instead of pi.hole as default address
yubiuser Jan 20, 2023
9acad77
Adjust FTL endpoints
yubiuser Jan 22, 2023
9eb478a
Handle connection loss and re-authentication
yubiuser Jan 22, 2023
a59ca55
Merge branch 'development' into PADD_FTLv6
yubiuser Mar 12, 2023
ed2de78
Adjust endoints
yubiuser Mar 12, 2023
94032c9
Account for cpu_temp_sensor returning null
yubiuser Mar 13, 2023
70977ee
Merge branch 'development' into PADD_FTLv6
yubiuser Apr 7, 2023
b178446
Show a running PADD as "PADD v4.0.0" instead of "curl/7.81.0" on the …
DL6ER May 24, 2023
b28c112
Merge branch 'development' into PADD_FTLv6
yubiuser May 27, 2023
716897b
Switch to the proven memory-hard password-hashing alogorithm BALLOON
DL6ER May 30, 2023
b68de2b
Merge branch 'development' into PADD_FTLv6
yubiuser Jul 31, 2023
57b102c
Change default API port to 80
yubiuser Jul 31, 2023
36257d1
Add on the help text the missing dash for xoff and yoff options
rdwebdesign Jul 31, 2023
794d7b0
Fix spellcheck and a few spaces
rdwebdesign Jul 31, 2023
9b8dc56
Fix the missing dash for some options on the help text (#361)
yubiuser Aug 1, 2023
4a69af0
When running locally derive port from FTL itself
yubiuser Aug 2, 2023
b67b0fb
Remove space
yubiuser Aug 2, 2023
c6e8f07
When running locally derive port from FTL itself (#362)
yubiuser Aug 2, 2023
d221947
Merge branch 'development' into PADD_FTLv6
yubiuser Sep 10, 2023
2bed00c
Merge branch 'development' into PADD_FTLv6
yubiuser Sep 24, 2023
59ccde4
Sync master back into development (#372)
yubiuser Sep 25, 2023
13dbce3
Bump actions/checkout from 4.1.0 to 4.1.1
dependabot[bot] Oct 21, 2023
31dd636
Bump actions/checkout from 4.1.0 to 4.1.1 (#374)
yubiuser Oct 21, 2023
9aee138
Use CHAOS TXT to connect to FTL's API
yubiuser Dec 2, 2023
1b243f4
Adjust endpoints
yubiuser Dec 2, 2023
b1dc435
Merge branch 'development' into PADD_FTLv6
yubiuser Dec 2, 2023
a41dcd0
Cover --server localhost case
yubiuser Dec 5, 2023
266a711
Improve error handling
yubiuser Dec 5, 2023
552ece2
Bump actions/stale from 8.0.0 to 9.0.0
dependabot[bot] Dec 9, 2023
2e4c461
Bump actions/stale from 8.0.0 to 9.0.0 (#377)
yubiuser Dec 9, 2023
353c003
The correct key is config.dns.revServer.active
DL6ER Jan 7, 2024
c835824
The correct key is config.dns.revServer.active (#378)
yubiuser Jan 7, 2024
2455fff
moveXOffset
yubiuser Jan 7, 2024
ec305e6
Return N/A in case FTL can't figure out the device model
yubiuser Jan 7, 2024
ec5a26a
Deleting a session successfully returns 204
yubiuser Jan 7, 2024
b625aca
Use CHAOS TXT record to construct FTL's API URL (#376)
yubiuser Jan 7, 2024
79ca42e
Status 200 is gone
yubiuser Jan 7, 2024
d58149d
Nicer output if no session needed to be deleted
yubiuser Jan 7, 2024
50f359d
Deleting a session successfully returns 204 (#379)
yubiuser Jan 11, 2024
5f8d24f
Bump eps1lon/actions-label-merge-conflict from 2.1.0 to 3.0.0
dependabot[bot] Mar 30, 2024
fd07d36
Bump eps1lon/actions-label-merge-conflict from 2.1.0 to 3.0.0 (#383)
PromoFaux Apr 18, 2024
06c76ff
Bump actions/checkout from 4.1.1 to 4.1.3
dependabot[bot] Apr 20, 2024
ae766fb
Bump actions/checkout from 4.1.3 to 4.1.4
dependabot[bot] Apr 27, 2024
e9cc3a5
Bump actions/checkout from 4.1.3 to 4.1.4 (#386)
yubiuser Apr 27, 2024
b950a99
Bump eps1lon/actions-label-merge-conflict from 3.0.0 to 3.0.1
dependabot[bot] May 11, 2024
a87bc05
Bump eps1lon/actions-label-merge-conflict from 3.0.0 to 3.0.1 (#388)
yubiuser May 11, 2024
29ce039
Bump actions/checkout from 4.1.4 to 4.1.5
dependabot[bot] May 11, 2024
eb6ead5
Bump actions/checkout from 4.1.4 to 4.1.5 (#387)
yubiuser May 11, 2024
d627197
Bump actions/checkout from 4.1.5 to 4.1.6
dependabot[bot] May 18, 2024
0f3bdd9
Bump actions/checkout from 4.1.5 to 4.1.6 (#389)
yubiuser May 22, 2024
ebfaf8e
Bump eps1lon/actions-label-merge-conflict from 3.0.1 to 3.0.2
dependabot[bot] Jun 1, 2024
0233214
Bump eps1lon/actions-label-merge-conflict from 3.0.1 to 3.0.2 (#390)
yubiuser Jun 1, 2024
b5bfe71
Bump actions/checkout from 4.1.6 to 4.1.7
dependabot[bot] Jun 15, 2024
f5e8cd9
Bump actions/checkout from 4.1.6 to 4.1.7 (#391)
yubiuser Jun 15, 2024
8b8e219
Rename API functions for consistency with core code
DL6ER Jun 19, 2024
8316033
Try to use the CLI password for logins (if enabled and readable by th…
DL6ER Jun 19, 2024
770ce44
Fix old spelling issue
DL6ER Jun 22, 2024
a0054e8
Try to use the CLI password for logins (#392)
DL6ER Jun 30, 2024
7f3d46f
Exit bump workflow early if latest tag is empty
yubiuser Jul 3, 2024
8489c24
Exit bump workflow early if latest tag is empty (#394)
yubiuser Jul 3, 2024
11723bc
Modify PADD to comply with the changes in FTL on the same branch
DL6ER Jul 14, 2024
c7f7608
Fix editorconfig errors even if not introduced by the PR at hand
DL6ER Jul 14, 2024
c1adc4a
DHCP is a top level config object
yubiuser Jul 14, 2024
19808bf
Fix idention style
yubiuser Jul 14, 2024
aeb2a72
Fix/dhcp (#396)
yubiuser Jul 15, 2024
d1707e5
Check for required dependencies on startup
yubiuser Jul 18, 2024
f918bff
No need to check for wget in update routine as we check for curl duri…
yubiuser Jul 18, 2024
ef97d5b
Fallback: If there is no default IPv6 gateway, use the default IPv4 g…
DL6ER Jul 22, 2024
5d9090c
Check for curl and jq dependencies (#398)
yubiuser Jul 23, 2024
b719987
Modify PADD to comply with the changes in FTL on the same branch (#395)
DL6ER Jul 23, 2024
5559796
Use new FTL api/padd endpoint for querying the data
DL6ER Aug 5, 2024
113ef44
Use jq only once for parsing the entire payload after querying the API
DL6ER Aug 7, 2024
1310ea8
Redefine jq's paths() as its built-in function skips all pais with va…
DL6ER Aug 7, 2024
f1c3382
Using `paths(scalars | true)` to return `null` and `false` values.
rdwebdesign Aug 8, 2024
285f387
Rename functions to clarify their use
yubiuser Aug 9, 2024
d8c6f33
Re add necessary 2>/dev/null
yubiuser Aug 9, 2024
e18403b
Suppress curl errors
yubiuser Aug 9, 2024
573d36f
padd_data is a global variable
yubiuser Aug 9, 2024
ed3143f
Propagate API response errors upstream
yubiuser Aug 9, 2024
97006b0
Fix --version command
yubiuser Aug 9, 2024
51fde8a
Skip all the processing if FTL is down
yubiuser Aug 9, 2024
09e3396
Set --connect-timeout for curl connections
yubiuser Aug 9, 2024
0440ade
Require all API data after connection is re-established
yubiuser Aug 9, 2024
9e7d6c8
Use FTL's taildored `/padd` endpoint to reduce the number of API call…
yubiuser Aug 12, 2024
e7f4989
Merge branch 'development' into PADD_FTLv6
PromoFaux Sep 2, 2024
4a34c23
Make PADD compatible with FTLv6 (#247)
yubiuser Sep 2, 2024
9bfb338
Fix CPU load
yubiuser Sep 26, 2024
2066fc4
Fix CPU load (#404)
yubiuser Sep 27, 2024
f7c88ee
Bump actions/checkout from 4.1.7 to 4.2.0
dependabot[bot] Sep 28, 2024
85f9b90
Bump actions/checkout from 4.1.7 to 4.2.0 (#405)
yubiuser Sep 28, 2024
384af25
Bump actions/checkout from 4.2.0 to 4.2.1
dependabot[bot] Oct 12, 2024
1e28893
Bump actions/checkout from 4.2.0 to 4.2.1 (#406)
yubiuser Oct 12, 2024
8bcf9f4
Bump actions/checkout from 4.2.1 to 4.2.2
dependabot[bot] Oct 26, 2024
020c13f
Bump actions/checkout from 4.2.1 to 4.2.2 (#407)
yubiuser Oct 26, 2024
689e602
Speedup response handling
yubiuser Dec 22, 2024
b0a4b82
Speedup response handling (#408)
yubiuser Dec 23, 2024
b734870
Bump eps1lon/actions-label-merge-conflict from 3.0.2 to 3.0.3
dependabot[bot] Jan 11, 2025
5629b01
Bump eps1lon/actions-label-merge-conflict from 3.0.2 to 3.0.3 (#409)
yubiuser Jan 11, 2025
ab940d0
Bump actions/stale from 9.0.0 to 9.1.0
dependabot[bot] Jan 25, 2025
9b94e4b
Bump actions/stale from 9.0.0 to 9.1.0 (#410)
yubiuser Jan 26, 2025
8e2a93c
Change the color for some disabled elements to avoid confusion
rdwebdesign Feb 12, 2025
74b3670
Also use a new blue box to represent disabled items
rdwebdesign Feb 12, 2025
9b6b051
Tweak disabled color (#411)
yubiuser Feb 12, 2025
7d1a0b0
Improve DHCP and IPv6 info
yubiuser Feb 12, 2025
e54e703
Fix startup sequence on mini
yubiuser Feb 12, 2025
d7517af
Clear the screen once on startup
yubiuser Feb 12, 2025
d1b9372
Disabled IPv6 is not an error
yubiuser Feb 12, 2025
f2e3f7d
Improve DHCP and IPv6 info (#412)
yubiuser Feb 13, 2025
64e4927
remove duplicate text at end of line in DisplayHelp()
mwoolweaver Feb 13, 2025
ca33114
remove duplicate text at end of line in DisplayHelp() (#413)
yubiuser Feb 13, 2025
fd778f4
move Wiki to README.md
mwoolweaver Feb 15, 2025
1f78753
Move wiki to readme (#419)
yubiuser Feb 17, 2025
c215053
Add note about authentication
yubiuser Feb 18, 2025
8942248
Add note about authentication (#420)
yubiuser Feb 18, 2025
3df1854
Add 2FA
yubiuser Feb 13, 2025
f697f99
If a CLI password is found, 2FA can be skipped
yubiuser Feb 15, 2025
a0833ee
Add hint to skip 2FA in case the app password was used
yubiuser Feb 16, 2025
a35806c
Correct location of the cli password file
yubiuser Feb 18, 2025
a133415
Add 2FA support (#416)
yubiuser Feb 23, 2025
a0df3ff
Fix IPv4 address indicator
yubiuser Feb 23, 2025
57b3ff8
Only exit for small screen sizes during startup
yubiuser Feb 23, 2025
b00933f
Fix IPv4 address indicator (#422)
yubiuser Feb 24, 2025
f92959c
Only exit for small screen sizes during startup (#423)
yubiuser Feb 24, 2025
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
Prev Previous commit
Next Next commit
Use API for GetVersionInformation
Signed-off-by: Christian König <ckoenig@posteo.de>
  • Loading branch information
yubiuser committed Jul 19, 2022
commit f92afc742912061b32fe24277cece21b0198e858
128 changes: 67 additions & 61 deletions padd.sh
Original file line number Diff line number Diff line change
@@ -543,77 +543,83 @@ GetPiholeInformation() {
}

GetVersionInformation() {
# Check if version status has been saved
core_version=$(pihole -v -p | awk '{print $4}' | tr -d '[:alpha:]')
core_version_latest=$(pihole -v -p | awk '{print $(NF)}' | tr -d ')')

# if core_version is something else then x.xx or x.xx.xxx set it to N/A
if ! echo "${core_version}" | grep -qE '^[0-9]+([.][0-9]+){1,2}$' || [ "${core_version_latest}" = "ERROR" ]; then
core_version="N/A"
core_version_heatmap=${yellow_text}
else
# remove the leading "v" from core_version_latest
core_version_latest=$(echo "${core_version_latest}" | tr -d '\r\n[:alpha:]')
# is core up-to-date?
if [ "${core_version}" != "${core_version_latest}" ]; then
out_of_date_flag="true"
core_version_heatmap=${red_text}

versions_raw=$(GetFTLData "/version")

# Check if core version
core_branch="$(echo "${versions_raw}" | jq --raw-output .core.branch)"
core_version=$(echo "${versions_raw}" | jq --raw-output .core.tag | tr -d '[:alpha:]' | awk -F '-' '{printf $1}')
core_version_latest=$(pihole -v -p | awk '{print $(NF)}' | tr -d ')')

# if core_version is something else then x.xx or x.xx.xxx or branch not master set it to N/A
if ! echo "${core_version}" | grep -qE '^[0-9]+([.][0-9]+){1,2}$' || [ ! "${core_branch}" = "master" ]; then
core_version="N/A"
core_version_heatmap=${yellow_text}
else
core_version_heatmap=${green_text}
# remove the leading "v" from core_version_latest
core_version_latest=$(echo "${core_version_latest}" | tr -d '\r\n[:alpha:]')
# is core up-to-date?
if [ "${core_version}" != "${core_version_latest}" ]; then
out_of_date_flag="true"
core_version_heatmap=${red_text}
else
core_version_heatmap=${green_text}
fi
# add leading "v" to version number
core_version="v${core_version}"
fi
# add leading "v" to version number
core_version="v${core_version}"
fi

# Gather web version information...
if [ "$INSTALL_WEB_INTERFACE" = true ]; then
web_version=$(pihole -v -a | awk '{print $4}' | tr -d '[:alpha:]')
web_version_latest=$(pihole -v -a | awk '{print $(NF)}' | tr -d ')')
# Gather web version information...
if [ "$INSTALL_WEB_INTERFACE" = true ]; then
web_branch="$(echo "${versions_raw}" | jq --raw-output .web.branch)"
web_version=$(echo "${versions_raw}" | jq --raw-output .web.tag | tr -d '[:alpha:]' | awk -F '-' '{printf $1}')
web_version_latest=$(pihole -v -a | awk '{print $(NF)}' | tr -d ')')

# if web_version is something else then x.xx or x.xx.xxx set it to N/A
if ! echo "${web_version}" | grep -qE '^[0-9]+([.][0-9]+){1,2}$' || [ "${web_version_latest}" = "ERROR" ]; then
web_version="N/A"
web_version_heatmap=${yellow_text}
# if web_version is something else then x.xx or x.xx.xxx or branch not master set it to N/A
if ! echo "${web_version}" | grep -qE '^[0-9]+([.][0-9]+){1,2}$' || [ ! "${web_branch}" = "master" ]; then
web_version="N/A"
web_version_heatmap=${yellow_text}
else
# remove the leading "v" from web_version_latest
web_version_latest=$(echo "${web_version_latest}" | tr -d '\r\n[:alpha:]')
# is web up-to-date?
if [ "${web_version}" != "${web_version_latest}" ]; then
out_of_date_flag="true"
web_version_heatmap=${red_text}
else
web_version_heatmap=${green_text}
fi
# add leading "v" to version number
web_version="v${web_version}"
fi
else
# remove the leading "v" from web_version_latest
web_version_latest=$(echo "${web_version_latest}" | tr -d '\r\n[:alpha:]')
# is web up-to-date?
if [ "${web_version}" != "${web_version_latest}" ]; then
out_of_date_flag="true"
web_version_heatmap=${red_text}
else
web_version_heatmap=${green_text}
fi
# add leading "v" to version number
web_version="v${web_version}"
# Web interface not installed
web_version="N/A"
web_version_heatmap=${yellow_text}
fi
else
# Web interface not installed
web_version="N/A"
web_version_heatmap=${yellow_text}
fi

# Gather FTL version information...
ftl_version=$(pihole -v -f | awk '{print $4}' | tr -d '[:alpha:]')
ftl_version_latest=$(pihole -v -f | awk '{print $(NF)}' | tr -d ')')
# Gather FTL version information...
ftl_branch="$(echo "${versions_raw}" | jq --raw-output .ftl.branch)"
ftl_version=$(echo "${versions_raw}" | jq --raw-output .ftl.tag | tr -d '[:alpha:]' | awk -F '-' '{printf $1}')
ftl_version_latest=$(pihole -v -f | awk '{print $(NF)}' | tr -d ')')

# if ftl_version is something else then x.xx or x.xx.xxx set it to N/A
if ! echo "${ftl_version}" | grep -qE '^[0-9]+([.][0-9]+){1,2}$' || [ "${ftl_version_latest}" = "ERROR" ]; then
ftl_version="N/A"
ftl_version_heatmap=${yellow_text}
else
# remove the leading "v" from ftl_version_latest
ftl_version_latest=$(echo "${ftl_version_latest}" | tr -d '\r\n[:alpha:]')
# is ftl up-to-date?
if [ "${ftl_version}" != "${ftl_version_latest}" ]; then
out_of_date_flag="true"
ftl_version_heatmap=${red_text}
# if ftl_version is something else then x.xx or x.xx.xxx or branch not master set it to N/A
if ! echo "${ftl_version}" | grep -qE '^[0-9]+([.][0-9]+){1,2}$' || [ ! "${ftl_branch}" = "master" ]; then
ftl_version="N/A"
ftl_version_heatmap=${yellow_text}
else
ftl_version_heatmap=${green_text}
# remove the leading "v" from ftl_version_latest
ftl_version_latest=$(echo "${ftl_version_latest}" | tr -d '\r\n[:alpha:]')
# is ftl up-to-date?
if [ "${ftl_version}" != "${ftl_version_latest}" ]; then
out_of_date_flag="true"
ftl_version_heatmap=${red_text}
else
ftl_version_heatmap=${green_text}
fi
# add leading "v" to version number
ftl_version="v${ftl_version}"
fi
# add leading "v" to version number
ftl_version="v${ftl_version}"
fi

# PADD version information...
padd_version_latest="$(curl --silent https://api.github.com/repos/pi-hole/PADD/releases/latest | grep '"tag_name":' | awk -F \" '{print $4}')"