-
Notifications
You must be signed in to change notification settings - Fork 157
Allows to fully disable using the system keychain. #898
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
Conversation
@samuel-w . This allows disabling keychains due to the many issues we have with them and some users don't want to use them at all. |
This feels like a workaround to the buggy code, and not an actual fix. I'll just remove kwallet. |
Not really. People have actually asked to provide this option. Even myself, I don't really use the macOS keychain and back it up. And on Linux often a keychain is installed, but people don't use it. |
703174a
to
0d95296
Compare
5866438
to
3ff85aa
Compare
3ff85aa
to
8efa560
Compare
src/vorta/utils.py
Outdated
@@ -344,7 +344,7 @@ def display_password_backend(encryption): | |||
# flake8: noqa E501 | |||
if encryption != 'none': | |||
keyring = VortaKeyring.get_keyring() | |||
return trans_late('utils', "Storing the password in your password manager.") if keyring.is_primary else trans_late( | |||
return trans_late('utils', "Storing the password in your password manager.") if keyring.is_system else trans_late( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keyring = VortaKeyring.get_keyring()
if not (encryption == 'none' or keyring.is_system):
return trans_late('utils', "Storing the password in your password manager.") if keyring.is_primary else trans_late(
'utils', 'Saving the password to disk. To store password more securely install a supported secret store such as KeepassXC')
else:
return ""
Otherwise it always shows as using password manager when system keychain disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. Will change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks convoluted. Moved this to the view where it's actually used. We have too many circular imports already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't move the backend, I'm reusing it in key management. Utils prevents circular imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I didn't see any other uses of display_password_backend()
. Which file do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Which one? Duplicating a few lines isn't an issue.
Next task I want to do is to make imports more hierachical. Many imports are only possible within functions because everything imports from everywhere. So e.g. I don't want models or utils to import too much. They should be at the bottom.
I may have fixed the "hanger" during macOS testing as well. According to the debugger it was stuck waiting for the BorgThread mutex. So I tried a few things there, like using the native Python mutex, which has a nicer API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind. Found display_password_backend()
in your PR. Will try to put that function into the keyring class instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to VortaKeyring().get_backend_warning()
We should break up the settings into subcategories, its getting long. |
e19ea28
to
60417fe
Compare
60417fe
to
28b2d9e
Compare
You notice any other issues? Else I merge it tomorrow to encourage some testing in the master branch. Also one more request to select the keychain. So giving the option to turn it off is probably just a first step. |
I also put back Coverage for macOS, since it didn't make a difference after all. 😅 |
Did a larger rewrite on how keyrings are selected. This avoids the chaotic if-else and just assigns a priority within each keyring. @samuel-w |
… on other desktop.
This PR tries to avoid common issues with system keychains that were reported:
To test:
$ pip install --force-reinstall git+https://github.com/m3nu/vorta.git@issue/make-keyring-optional
In Misc tab disable the setting "Store repository passwords in system keychain...". After that all repo passwords will be stored with Vorta only, independent of the system keychain.