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

Add input validation on the values updated in the web interface. #135

Merged
merged 3 commits into from
Apr 2, 2024

Conversation

dpkingston
Copy link
Contributor

Failure to do this risks crashing the code on the int() or float() casts. Its also possible for an invalid value to be written which if the user saves the configuration which will prevent the web interface program from starting again so the invalid configuration variable can't be fixed with the GUI.
How to reproduce:

  1. Start with a working configuration
  2. Erase the contents of the ant_spacing_meters field or just enter a non-number 3) Push save configuration
    The only way to recover is to use shell access and fix or replace the krakensdr_doa/_ui/settings.json file.

Failure to do this risks crashing the code on the int() or float()
casts.  Its also possible for an invalid value to be written which
if the user saves the configuration which will prevent the web interface
program from starting again so the invalid configuration variable can't
be fixed with the GUI.
How to reproduce:
1) Start with a working configuration
2) Erase the contents of the ant_spacing_meters field or just enter a non-number
3) Push save configuration
The only way to recover is to use shell access and fix or replace the
krakensdr_doa/_ui/settings.json file.
@dpkingston
Copy link
Contributor Author

I just updated my Kraken to V1.8 and it seems much more stable, even without my changes. I believe the image I used back in January looks like its based on V1.7 or thereabouts. Are there changes in V1.8 that would explain it tolerating invalid input better?

@krakenrf krakenrf merged commit 7a35ca3 into krakenrf:main Apr 2, 2024
2 checks passed
@krakenrf
Copy link
Owner

krakenrf commented Apr 2, 2024

Thanks for the PR. n 1.8 a few sanitization checks were added on the UI side, but it can't stop an empty null value that has been entered. Your PR appears to fix that condition so I've merged it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants