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

ch-set PSK should accept base64 by default or demonstrate base64 example in help #716

Open
fastalan opened this issue Dec 19, 2024 · 1 comment

Comments

@fastalan
Copy link

The info command and the UI display the channel keys as base64, and therefore the PSK command should accept and assume base64 encoding from the user on the CLI. Currently the example on the cli doesn't explain how to set that. Intuitively a user is going to pass the key as its displayed to the command. Ideally, the command should assume this format and accept it without any prefix, if that is not possible we should demonstrate the example.

Info shows:
Channels:
Index 0: PRIMARY psk=secret { "psk": "X8QAlvQebtEkvrPf2vMilXNjfVDg6RtByJZRBCipxCY=", "moduleSettings": { "positionPrecision": 13, "isClientMuted": false }, "channelNum": 0, "name": "", "id": 0, "uplinkEnabled": false, "downlinkEnabled": false }

Current implementation expects to set;
meshtastic --ch-set psk "base64:X8QAlvQebtEkvrPf2vMilXNjfVDg6RtByJZRBCipxCY=" --ch-index 0

Implementation should accept:
meshtastic --ch-set psk X8QAlvQebtEkvrPf2vMilXNjfVDg6RtByJZRBCipxCY= --ch-index 0

Alternatively, the help should say:

--ch-set FIELD VALUE Set a channel parameter. To see channel settings available:'--ch-set all all --ch-index 0'. Can set the 'psk' using this command. To disable encryption on primary channel:'--ch-set
psk none --ch-index 0'. To set encryption with a new random key on second channel:'--ch-set psk random --ch-index 1'. To set encryption back to the default:'--ch-set psk default --ch-
index 0'. To set encryption with your own key: '--ch-set psk "base64:X8QAlvQebtEkvrPf2vMilXNjfVDg6RtByJZRBCipxCY=" --ch-index 0'.

@caveman99
Copy link
Member

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

No branches or pull requests

2 participants