DietPi-Config - Unable to clear proxy username/password
Creating a bug report/issue
- [X] I have searched the existing open and closed issues
Required Information
- DietPi version | G_DIETPI_VERSION_CORE=9 | G_DIETPI_VERSION_SUB=7 | G_DIETPI_VERSION_RC=1 | G_GITBRANCH='master' | G_GITOWNER='MichaIng'
- Distro version | bookworm
- Kernel version |
Linux DietPi 6.1.0-23-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15) x86_64 GNU/Linux - SBC model | Native PC (x86_64)
- Power supply used | 12V
- SD card used | SSD M2 16Go
Additional Information (if applicable)
- Software title | dietpi-config
- Can this issue be replicated on a fresh installation of DietPi? Yes
Steps to reproduce
- launch dietpi-config
- select option "7 : Network Options: Adapters"
- select option "Proxy"
- select option "Username", enter anything, "toto" for example and validate with "Ok"
- re-select option "Username", clear the entered value and validate with "Ok"
- 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"
- same behavior for the "Password" option
Expected behaviour
- as the "Leave blank if not required" mentions, it should be possible to empty the previously entered values in "Username" and "Password"
Actual behaviour
- it is currently not possible to clear previously entered values in "Username" and "Password"
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.
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
Wow, what a responsiveness! 😮
Thank you very much! I'll try to test this tomorrow and get back to you.
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.