-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Can't sync with project keys that aren't 64 characters or a valid hex string. #440
Comments
Related to mapeo-config-amarakaeri/issues/5 |
I agree that sync errors due to issues with project keys leads to a bad user experience. I think the PR to show the error to the user is really helpful. I'm wary about writing code to accept different lengths of project key, since that will require changes to the code that uses it for encryption, and if it is shorter then it introduces a security risk because of lack of entropy. We do need to address project keys and how they are created and managed. I think ideally they are created internally by Mapeo and the user never sees them. As a short term measure I added a quick fix to I also added a command to generate a project key, which you can run with: npx mapeo-settings-builder generate-key It will output a random project key (note this currently runs very slowly sometimes due to large files being downloaded). To update existing config to use the latest npm install mapeo-settings-builder@latest |
Thanks for this @gmaclennan! I'm going to update the User Guide on how to use this tool with your notes here, at https://docs.mapeo.app. Let's make sure to continue keeping this up to date! It can be a really useful resource and having everyone's help to update it will make new user's life easier and help scale mapeo to the 1,000 projects it wants to see!
Just checked in with @noffle, and hyperswarm does require a 32 byte buffer for encryption purpses, but that's the only place. She noted that it would be possible to create shorter project keys and then expand those project keys into 32 byte buffers for encryption purposes using hashing, but that would be a breaking protocol change. |
Describe the bug
If your project key is malformed somehow, Mapeo will fail to find other devices.
Can you do the same thing twice?
Expected behavior
Project keys don't have to be a certain length, it should sync with any device that has the same key no matter what the key is.
Is it necessary that project keys have to be this particular length? This is arbitrary and puts up an unnecessary barrier to adoption.
For security once we have mapeo web, ideally all project keys will be at least a certain number of characters long, but there is no necessity for it to be exactly 64 characters.
Screenshots
I opened a pull request that updates the errors for fatal mapeo core errors so that Mapeo will tell the user that something is wrong at least.
Mapeo Version:
Mapeo Core v8, affecting all Mapeo Mobile and Mapeo Desktop versions for the past couple of years.
The text was updated successfully, but these errors were encountered: