MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.9k stars 499 forks source link

DietPi-Config - Unable to clear proxy username/password #7211

Closed dipisoft closed 1 month ago

dipisoft commented 2 months ago

Creating a bug report/issue

Required Information

Additional Information (if applicable)

Steps to reproduce

  1. launch dietpi-config
  2. select option "7 : Network Options: Adapters"
  3. select option "Proxy"
  4. select option "Username", enter anything, "toto" for example and validate with "Ok"
  5. re-select option "Username", clear the entered value and validate with "Ok"
  6. the "[FAILED] An input value was not entered, please try again..." error message appears, despite the presence of the mention "Leave blank if not required"
  7. same behavior for the "Password" option

Expected behaviour

Actual behaviour

MichaIng commented 2 months ago

Thanks for reporting. At some point we added a condition to our inputbox function to require some input, which we previously handled around the function call in various cases. We missed to adjust the call in this case.

For now, you can either adjust CONFIG_PROXY_USERNAME and CONFIG_PROXY_PASSWORD and re-apply settings by opening that menu and just select "Ok", or you edit the actual login script which applies the proxy settings: /etc/bashrc.d/dietpi-proxy.sh

I'll implement proper handling for variable inputbox conditions now.

MichaIng commented 2 months ago

This should solve it: https://github.com/MichaIng/DietPi/commit/f7096ee If you want to test, you can switch to dev branch this way:

G_DEV_BRANCH dev

And to revert

G_DEV_BRANCH master
dipisoft commented 2 months ago

Wow, what a responsiveness! 😮

Thank you very much! I'll try to test this tomorrow and get back to you.

dipisoft commented 2 months ago

Tested and it works, except in one particular case: if the content of the field started with space(s) then emptying the field is not taken into account. You have to operate in two steps: remove the space(s), validate, re-edit the field to remove the rest of the characters, validate. Only then will the field be truly emptied.