GODT-1451: Do not check for gnome keyring to allow other implementations of secret-service API. Thanks to @remgodow.

This commit is contained in:
Jakub 2022-01-10 16:45:07 +01:00 committed by Jakub Cuth
parent 63379001e3
commit c920c53243
4 changed files with 13 additions and 15 deletions

View File

@ -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/).

View File

@ -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.")
}

View File

@ -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

View File

@ -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
}