-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix/handle null id in json rpc responses and cpu load representation for openwrt widget #3576
Fix/handle null id in json rpc responses and cpu load representation for openwrt widget #3576
Conversation
I have no way to test or verify this and I dont know if anyone else has reported. @DanGRT ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found #3306 at least for the second part. The first seems a bit suspicious as youre saying without this fix the widget just doesnt work, but lets see if it causes any drama...
…0.9.2@5356c97 by renovate (#22920) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/gethomepage/homepage](https://togithub.com/gethomepage/homepage) | patch | `v0.9.1` -> `v0.9.2` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>gethomepage/homepage (ghcr.io/gethomepage/homepage)</summary> ### [`v0.9.2`](https://togithub.com/gethomepage/homepage/releases/tag/v0.9.2) [Compare Source](https://togithub.com/gethomepage/homepage/compare/v0.9.1...v0.9.2) #### What's Changed #### Security - This release addresses a vulnerability that could allow leakage of API keys from weather widgets, see https://github.com/gethomepage/homepage/security/advisories/GHSA-cjgf-vhj6-8cx4 . Thanks to Kwstubbs for reporting. #### App changes - Fix: caddy widget broken in v0.9.1 by [@​shamoon](https://togithub.com/shamoon) in [gethomepage/homepage#3579 - Fix: omada widget broken in v0.9.1 by [@​shamoon](https://togithub.com/shamoon) in [gethomepage/homepage#3587 - Fix/handle null id in json rpc responses and cpu load representation for openwrt widget by [@​LiranV](https://togithub.com/LiranV) in [gethomepage/homepage#3576 - Fix: wg-easy threshold not properly computed by [@​ConnerWithAnE](https://togithub.com/ConnerWithAnE) in [gethomepage/homepage#3574 - Enhancement: support multiple instance annotation for Kubernetes Automatic Service Discovery by [@​aldycool](https://togithub.com/aldycool) in [gethomepage/homepage#3590 - Fix: coinmarketcap widget dropdown not clickable by [@​henry40408](https://togithub.com/henry40408) in [gethomepage/homepage#3591 #### New Contributors - [@​LiranV](https://togithub.com/LiranV) made their first contribution in [gethomepage/homepage#3576 - [@​aldycool](https://togithub.com/aldycool) made their first contribution in [gethomepage/homepage#3590 **Full Changelog**: gethomepage/homepage@v0.9.1...v0.9.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTIuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5Mi4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbImF1dG9tZXJnZSIsInVwZGF0ZS9kb2NrZXIvZ2VuZXJhbC9ub24tbWFqb3IiXX0=-->
…v0.9.2 ) (#3790) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/gethomepage/homepage](https://togithub.com/gethomepage/homepage) | patch | `v0.9.1` -> `v0.9.2` | --- ### Release Notes <details> <summary>gethomepage/homepage (ghcr.io/gethomepage/homepage)</summary> ### [`v0.9.2`](https://togithub.com/gethomepage/homepage/releases/tag/v0.9.2) [Compare Source](https://togithub.com/gethomepage/homepage/compare/v0.9.1...v0.9.2) #### What's Changed #### Security - This release addresses a vulnerability that could allow leakage of API keys from weather widgets, see https://github.com/gethomepage/homepage/security/advisories/GHSA-cjgf-vhj6-8cx4 . Thanks to Kwstubbs for reporting. #### App changes - Fix: caddy widget broken in v0.9.1 by [@​shamoon](https://togithub.com/shamoon) in [gethomepage/homepage#3579 - Fix: omada widget broken in v0.9.1 by [@​shamoon](https://togithub.com/shamoon) in [gethomepage/homepage#3587 - Fix/handle null id in json rpc responses and cpu load representation for openwrt widget by [@​LiranV](https://togithub.com/LiranV) in [gethomepage/homepage#3576 - Fix: wg-easy threshold not properly computed by [@​ConnerWithAnE](https://togithub.com/ConnerWithAnE) in [gethomepage/homepage#3574 - Enhancement: support multiple instance annotation for Kubernetes Automatic Service Discovery by [@​aldycool](https://togithub.com/aldycool) in [gethomepage/homepage#3590 - Fix: coinmarketcap widget dropdown not clickable by [@​henry40408](https://togithub.com/henry40408) in [gethomepage/homepage#3591 #### New Contributors - [@​LiranV](https://togithub.com/LiranV) made their first contribution in [gethomepage/homepage#3576 - [@​aldycool](https://togithub.com/aldycool) made their first contribution in [gethomepage/homepage#3590 **Full Changelog**: gethomepage/homepage@v0.9.1...v0.9.2 </details> <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19--> Co-authored-by: repo-jeeves[bot] <106431701+repo-jeeves[bot]@users.noreply.github.com>
…785) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/gethomepage/homepage](https://togithub.com/gethomepage/homepage) | minor | `v0.8.13` -> `v0.9.2` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>gethomepage/homepage (ghcr.io/gethomepage/homepage)</summary> ### [`v0.9.2`](https://togithub.com/gethomepage/homepage/releases/tag/v0.9.2) [Compare Source](https://togithub.com/gethomepage/homepage/compare/v0.9.1...v0.9.2) #### What's Changed #### Security - This release addresses a vulnerability that could allow leakage of API keys from weather widgets. #### App changes - Fix: caddy widget broken in v0.9.1 by [@​shamoon](https://togithub.com/shamoon) in [gethomepage/homepage#3579 - Fix: omada widget broken in v0.9.1 by [@​shamoon](https://togithub.com/shamoon) in [gethomepage/homepage#3587 - Fix/handle null id in json rpc responses and cpu load representation for openwrt widget by [@​LiranV](https://togithub.com/LiranV) in [gethomepage/homepage#3576 - Fix: wg-easy threshold not properly computed by [@​ConnerWithAnE](https://togithub.com/ConnerWithAnE) in [gethomepage/homepage#3574 - Enhancement: support multiple instance annotation for Kubernetes Automatic Service Discovery by [@​aldycool](https://togithub.com/aldycool) in [gethomepage/homepage#3590 - Fix: coinmarketcap widget dropdown not clickable by [@​henry40408](https://togithub.com/henry40408) in [gethomepage/homepage#3591 #### New Contributors - [@​LiranV](https://togithub.com/LiranV) made their first contribution in [gethomepage/homepage#3576 - [@​aldycool](https://togithub.com/aldycool) made their first contribution in [gethomepage/homepage#3590 **Full Changelog**: gethomepage/homepage@v0.9.1...v0.9.2 ### [`v0.9.1`](https://togithub.com/gethomepage/homepage/releases/tag/v0.9.1) [Compare Source](https://togithub.com/gethomepage/homepage/compare/v0.8.13...v0.9.1) #### What's Changed *Note: version 0.9.0 contained a few issues and did not completely resolve the security issue, it has been removed and all users are recommended to upgrade to v0.9.1* ##### Security - This version resolves security vulnerabilities discovered in some integrations, see GHSA-24m5-7vjx-9x37. Thanks to kachakil-av for reporting. ##### Other Changes - Fix: calendar integration broken in v0.9.0 by [@​shamoon](https://togithub.com/shamoon) in [gethomepage/homepage#3565 - Fix: glances cpu metric broken in v0.9.0 by [@​shamoon](https://togithub.com/shamoon) in [gethomepage/homepage#3566 - Fix: handle ghostfolio v2.79.0 breaking API changes by [@​shamoon](https://togithub.com/shamoon) in [gethomepage/homepage#3471 - Fix: allow exclamation to open quicklaunch by [@​jesusmlopezf](https://togithub.com/jesusmlopezf) in [gethomepage/homepage#3475 - Feature: Wg-Easy Widget by [@​ConnerWithAnE](https://togithub.com/ConnerWithAnE) and [@​shamoon](https://togithub.com/shamoon) in [gethomepage/homepage#3476 - Change icon in the longhorn widget to use the same as resources by [@​nick-disiere](https://togithub.com/nick-disiere) in [gethomepage/homepage#3509 - Feature: SWAG dashboard widget by [@​quietsy](https://togithub.com/quietsy) and [@​shamoon](https://togithub.com/shamoon) in [gethomepage/homepage#3523 - Chore(deps): Bump crowdin/github-action from 1 to 2 by [@​dependabot](https://togithub.com/dependabot) in [gethomepage/homepage#3537 - Fix: remove comma in Caddy and EVCC widgets by [@​grimsi](https://togithub.com/grimsi) in [gethomepage/homepage#3551 - Enhancement: separate Internet search settings for quicklaunch by [@​vycdev](https://togithub.com/vycdev) and [@​shamoon](https://togithub.com/shamoon) in [gethomepage/homepage#3541 - Chore(deps-dev): Bump eslint-plugin-react from 7.34.1 to 7.34.2 by [@​dependabot](https://togithub.com/dependabot) in [gethomepage/homepage#3554 - Chore(deps-dev): Bump eslint-plugin-react-hooks from 4.6.0 to 4.6.2 by [@​dependabot](https://togithub.com/dependabot) in [gethomepage/homepage#3555 #### New Contributors - [@​jesusmlopezf](https://togithub.com/jesusmlopezf) made their first contribution in [gethomepage/homepage#3475 - [@​ConnerWithAnE](https://togithub.com/ConnerWithAnE) made their first contribution in [gethomepage/homepage#3476 - [@​nick-disiere](https://togithub.com/nick-disiere) made their first contribution in [gethomepage/homepage#3509 - [@​quietsy](https://togithub.com/quietsy) made their first contribution in [gethomepage/homepage#3523 - [@​vycdev](https://togithub.com/vycdev) made their first contribution in [gethomepage/homepage#3541 **Full Changelog**: gethomepage/homepage@v0.8.13...v0.9.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zODUuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5NC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL21pbm9yIl19-->
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns. See our contributing guidelines for more details. |
Proposed change
Issue:
I've configured the OpenWRT widget in my
homepage
container, but saw the following:Tested on:
v0.8.13
andmaster
23.05.0
The service configuration I've used:
Explanation:
The widget starts by issuing an unauthorized request to OpenWRT, which for some reason results with a response
id
that isnull
(according to the JSON-RPC 2.0 specification this is discouraged) and it seems to not play nice with the json-rpc-2.0 package)My first commit solves this issue by checking if the response
id
isnull
and setting it as1
instead.This solves the issue and the widget starts working:
Additional Fix:
After the widget started working I've noticed that the CPU Load number was "off" and didn't look like the standard UNIX load format expected by something like
uptime
.To solve this I've added the following calculation according to this:
After fixing CPU load representation:
![cpu-load-fix](https://private-user-images.githubusercontent.com/1328759/336264349-cc973582-b648-4b1e-8ebc-c98a2f58b08f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ5NjE2MjEsIm5iZiI6MTcyNDk2MTMyMSwicGF0aCI6Ii8xMzI4NzU5LzMzNjI2NDM0OS1jYzk3MzU4Mi1iNjQ4LTRiMWUtOGViYy1jOThhMmY1OGIwOGYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjlUMTk1NTIxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OWEwOGEyYzA5NDRlODZhNmRjODQ4YTA5NDc4MTRjNDhkOWMwOWQwOTBiMWNkYzBhZDQ2ZDkyNDEzMTgwNDIzMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.DKzTDHUc2H-erJdbX3EooU_jdcF7woj9hr3zFBFmUsI)
Type of change
Checklist: