diff --git a/README.md b/README.md index 442b06ab..f560d3f3 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,8 @@ the user for a password. ## Keychain You need to have a keychain in order to run the ProtonMail Bridge. On Mac or -Windows, Bridge uses native credential managers. On Linux, use -[Gnome keyring](https://wiki.gnome.org/Projects/GnomeKeyring/) +Windows, Bridge uses native credential managers. On Linux, use `secret-service` freedesktop.org API +(e.g. [Gnome keyring](https://wiki.gnome.org/Projects/GnomeKeyring/)) or [pass](https://www.passwordstore.org/). diff --git a/internal/frontend/cli/utils.go b/internal/frontend/cli/utils.go index a9ba3193..3f10c52b 100644 --- a/internal/frontend/cli/utils.go +++ b/internal/frontend/cli/utils.go @@ -101,10 +101,10 @@ func (f *frontendCLI) notifyNeedUpgrade() { f.Println("Please download and install the newest version of application from", version.LandingPage) } -func (f *frontendCLI) notifyCredentialsError() { // nolint[unused] +func (f *frontendCLI) notifyCredentialsError() { // Print in 80-column width. f.Println("ProtonMail Bridge is not able to detect a supported password manager") - f.Println("(pass, gnome-keyring). Please install and set up a supported password manager") + f.Println("(secret-service or pass). Please install and set up a supported password manager") f.Println("and restart the application.") } diff --git a/internal/frontend/qml/Notifications/Notifications.qml b/internal/frontend/qml/Notifications/Notifications.qml index cb4051dc..8a5bc5be 100644 --- a/internal/frontend/qml/Notifications/Notifications.qml +++ b/internal/frontend/qml/Notifications/Notifications.qml @@ -870,7 +870,7 @@ QtObject { property Notification noKeychain: Notification { title: qsTr("No keychain available") - description: qsTr("Bridge is not able to detected a supported password manager (pass, gnome-keyring). Please install and setup supported password manager and restart the application.") + description: qsTr("Bridge is not able to detected a supported password manager (pass or secret-service). Please install and setup supported password manager and restart the application.") brief: title icon: "./icons/ic-exclamation-circle-filled.svg" type: Notification.NotificationType.Danger diff --git a/pkg/keychain/helper_linux.go b/pkg/keychain/helper_linux.go index c7e297a3..0dcb7f86 100644 --- a/pkg/keychain/helper_linux.go +++ b/pkg/keychain/helper_linux.go @@ -28,27 +28,25 @@ import ( ) const ( - Pass = "pass-app" - GnomeKeyring = "gnome-keyring" + Pass = "pass-app" + SecretService = "secret-service" ) func init() { // nolint[noinit] Helpers = make(map[string]helperConstructor) + Helpers[SecretService] = newSecretServiceHelper + if _, err := exec.LookPath("pass"); err == nil { Helpers[Pass] = newPassHelper } - if _, err := exec.LookPath("gnome-keyring"); err == nil { - Helpers[GnomeKeyring] = newGnomeKeyringHelper - } - // If Pass is available, use it by default. - // Otherwise, if GnomeKeyring is available, use it by default. + // Otherwise, if SecretService is available, use it by default. if _, ok := Helpers[Pass]; ok && isUsable(newPassHelper("")) { defaultHelper = Pass - } else if _, ok := Helpers[GnomeKeyring]; ok && isUsable(newGnomeKeyringHelper("")) { - defaultHelper = GnomeKeyring + } else if isUsable(newSecretServiceHelper("")) { + defaultHelper = SecretService } } @@ -56,7 +54,7 @@ func newPassHelper(string) (credentials.Helper, error) { return &pass.Pass{}, nil } -func newGnomeKeyringHelper(string) (credentials.Helper, error) { +func newSecretServiceHelper(string) (credentials.Helper, error) { return &secretservice.Secretservice{}, nil }