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

Securely store the password using the keyring crate #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rudi
Copy link
Contributor

@rudi rudi commented May 31, 2020

NOTE: In order to compile on (Ubuntu) Linux, I had to install libdbus-1-dev.
Tested on macOS, Windows, Ubuntu Linux.

  • Store a plain-text placeholder in config.json, with instructions on how to
    overwrite the stored password.

  • In case config.json contains a password value other than the placeholder,
    use that value, store it in the keyring at the end, and store the placeholder
    in config.json.

  • In case storing the password in keyring fails, store it in config.json as
    before.

NOTE: In order to compile on (Ubuntu) Linux, I had to install libdbus-1-dev.

- Store a plain-text placeholder in config.json, with instructions on how to
  overwrite the stored password.

- In case config.json contains a password value other than the placeholder,
  use that value, store it in the keyring at the end, and store the placeholder
  in config.json.

- In case storing the password in keyring fails, store it in config.json as
  before.
@rudi
Copy link
Contributor Author

rudi commented May 31, 2020

The Linux build is failing because libdbus-1-3 is not installed (see https://github.com/diwic/dbus-rs#requirements); I'll see if I can google a solution to that one.

- Broken by keyring’s requirement to have lidbdbus-1-3 installed on Linux.
@rudi
Copy link
Contributor Author

rudi commented May 31, 2020

With the latest commit, the build fails only on the raspberry pi, where -ldbus-1 doesn't find the dbus library even though it should be installed according to the build log. Since I don't have such a system available, it's hard to debug this right now.

@Riduidel
Copy link
Owner

Riduidel commented Oct 8, 2020

WOW This one is awesome!
I didn't know such a secure storage existed in a "portable" way.
As I use rrss2imap on my raspberry on a daily basis, I'll also take a look in order to have it working, because I find that really interesting.

@Riduidel
Copy link
Owner

Damn, there are conflicts! Can you please do the merge sacrifice ?
Anyway, I'm taking a look at docs regarding keyring, DBus, secrets service and all that stuff.
This article (https://rtfm.co.ua/en/what-is-linux-keyring-gnome-keyring-secret-service-and-d-bus/) is rather complete on that subject, and I hope it will drive me to a solution that may work on Raspbian.

@Riduidel
Copy link
Owner

ok, all this relies upon the presence of libdbus, as far as I understand.
Hopefully, it is possible to instal it : https://raspberrypi.stackexchange.com/a/100460
Can you update the github action script to install these dependencies on raspbian ?

@rudi
Copy link
Contributor Author

rudi commented Oct 16, 2020

ok, all this relies upon the presence of libdbus, as far as I understand.
Hopefully, it is possible to instal it : https://raspberrypi.stackexchange.com/a/100460
Can you update the github action script to install these dependencies on raspbian ?

libdbus-1-3 and libdbus-1-dev should already be installed on all Linux test systems, as per the changes in .github/workflows/on_push.yml.

Sadly, the linker still fails on raspberry pi with the message
note: /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: cannot find -ldbus-1

@Riduidel
Copy link
Owner

Can you add a apt list | grep libdbus-1 step to the linux targets ? We will be able to make sure the libdbus-1-dev library is correctly installed. Thanks anyway for your commitment to make my poor script better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants