forked from Silverfish/proton-bridge
GODT-1451: Do not check for gnome keyring to allow other implementations of secret-service API. Thanks to @remgodow.
This commit is contained in:
@ -53,8 +53,8 @@ the user for a password.
|
|||||||
|
|
||||||
## Keychain
|
## Keychain
|
||||||
You need to have a keychain in order to run the ProtonMail Bridge. On Mac or
|
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
|
Windows, Bridge uses native credential managers. On Linux, use `secret-service` freedesktop.org API
|
||||||
[Gnome keyring](https://wiki.gnome.org/Projects/GnomeKeyring/)
|
(e.g. [Gnome keyring](https://wiki.gnome.org/Projects/GnomeKeyring/))
|
||||||
or
|
or
|
||||||
[pass](https://www.passwordstore.org/).
|
[pass](https://www.passwordstore.org/).
|
||||||
|
|
||||||
|
|||||||
@ -101,10 +101,10 @@ func (f *frontendCLI) notifyNeedUpgrade() {
|
|||||||
f.Println("Please download and install the newest version of application from", version.LandingPage)
|
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.
|
// Print in 80-column width.
|
||||||
f.Println("ProtonMail Bridge is not able to detect a supported password manager")
|
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.")
|
f.Println("and restart the application.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -870,7 +870,7 @@ QtObject {
|
|||||||
|
|
||||||
property Notification noKeychain: Notification {
|
property Notification noKeychain: Notification {
|
||||||
title: qsTr("No keychain available")
|
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
|
brief: title
|
||||||
icon: "./icons/ic-exclamation-circle-filled.svg"
|
icon: "./icons/ic-exclamation-circle-filled.svg"
|
||||||
type: Notification.NotificationType.Danger
|
type: Notification.NotificationType.Danger
|
||||||
|
|||||||
@ -29,26 +29,24 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
Pass = "pass-app"
|
Pass = "pass-app"
|
||||||
GnomeKeyring = "gnome-keyring"
|
SecretService = "secret-service"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() { // nolint[noinit]
|
func init() { // nolint[noinit]
|
||||||
Helpers = make(map[string]helperConstructor)
|
Helpers = make(map[string]helperConstructor)
|
||||||
|
|
||||||
|
Helpers[SecretService] = newSecretServiceHelper
|
||||||
|
|
||||||
if _, err := exec.LookPath("pass"); err == nil {
|
if _, err := exec.LookPath("pass"); err == nil {
|
||||||
Helpers[Pass] = newPassHelper
|
Helpers[Pass] = newPassHelper
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := exec.LookPath("gnome-keyring"); err == nil {
|
|
||||||
Helpers[GnomeKeyring] = newGnomeKeyringHelper
|
|
||||||
}
|
|
||||||
|
|
||||||
// If Pass is available, use it by default.
|
// 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("")) {
|
if _, ok := Helpers[Pass]; ok && isUsable(newPassHelper("")) {
|
||||||
defaultHelper = Pass
|
defaultHelper = Pass
|
||||||
} else if _, ok := Helpers[GnomeKeyring]; ok && isUsable(newGnomeKeyringHelper("")) {
|
} else if isUsable(newSecretServiceHelper("")) {
|
||||||
defaultHelper = GnomeKeyring
|
defaultHelper = SecretService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +54,7 @@ func newPassHelper(string) (credentials.Helper, error) {
|
|||||||
return &pass.Pass{}, nil
|
return &pass.Pass{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func newGnomeKeyringHelper(string) (credentials.Helper, error) {
|
func newSecretServiceHelper(string) (credentials.Helper, error) {
|
||||||
return &secretservice.Secretservice{}, nil
|
return &secretservice.Secretservice{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user