Package Details: protonmail-bridge-nogui 2.1.3-1

Git Clone URL: https://aur.archlinux.org/protonmail-bridge-nogui.git (read-only, click to copy)
Package Base: protonmail-bridge-nogui
Description: Integrate ProtonMail paid account with any program that supports IMAP and SMTP
Upstream URL: https://github.com/ProtonMail/proton-bridge
Licenses: GPL3
Conflicts: protonmail-bridge, protonmail-bridge-bin
Submitter: kausban
Maintainer: kausban
Last Packager: kausban
Votes: 16
Popularity: 0.016182
First Submitted: 2020-04-17 09:58 (UTC)
Last Updated: 2022-05-01 13:23 (UTC)

Dependencies (6)

Required by (0)

Sources (2)

Pinned Comments

mclancy commented on 2020-06-15 16:35 (UTC)

hakayova and grimfrenzy: I managed to solve the issue of "no account found" by providing the correct PASSWORD_STORE_DIR to the systemd service.

In my case I provided: Environment="PASSWORD_STORE_DIR=/home/mclancy/.local/share/pass"

Hope this helps!

kausban commented on 2020-04-21 14:37 (UTC) (edited on 2020-04-21 14:37 (UTC) by kausban)

Minimal fork of https://aur.archlinux.org/packages/protonmail-bridge/

Compiled with 'nogui' option

Included is a user systemd service. Try: systemctl status --user bridge.service

  1. You can login and register accounts using the interactive cli: protonmail-bridge --cli
  2. Once you have everything configured and automated. You can enable and use bridge.service to run bridge in background.

The following is an alternative way to run the bridge in interactive cli mode encapsulated within a named screen session. Can be added to bridge.service

ExecStart=/usr/bin/screen -Dm -S bridgedaemon sh -c "sleep 5; protonmail-bridge -c"
ExecStop=/usr/bin/screen -X -S bridgedaemon quit

Latest Comments

dankcatlord commented on 2022-05-01 03:57 (UTC)

org.freedesktop.secrets should be added as an optional dependency as ProtonMail Bridge now supports any keyring that supports the Freedesktop secrets api.

thomaseizinger commented on 2021-12-12 04:42 (UTC)

I am seeing the following warning in my logs:

level=warning msg="Failed to add test credentials to keychain" error="Cannot create an item in a l ocked collection" helper="*secretservice.Secretservice"

It seems the systemd service is starting too early. I have GNOME configured for auto-login but still need to unlock the keychain on startup. Is it possible to modify the provided unit in a way that it only starts after the keychain is successfully unlocked?

th0rne commented on 2021-11-19 17:38 (UTC)

@kausban

"sudo rm -rf go/" did not help. However, using community/go, as you suggested, did help. I had core/gcc-go, and with that it didn't build.

kausban commented on 2021-11-17 11:11 (UTC)

@th0rne

I am able to build this on a clean chroot. Please try doing that if all else fails.

As for why you are seeing that build error - perhaps try cleaning your build directory or take a look at your go installation. I use community/go

th0rne commented on 2021-11-17 10:34 (UTC) (edited on 2021-11-17 10:35 (UTC) by th0rne)

It doesn't build for me:

go/pkg/mod/github.com/cronokirby/saferith@v0.31.0/arith_amd64.s:7:10: fatal error: textflag.h: No such file or directory
    7 | #include "textflag.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:89: build-nogui] Error 2

WebFreak commented on 2021-06-15 16:58 (UTC)

Works with PinePhone after adding 'aarch64' as supported architecture and adding make and pkgconf as makedepends

kausban commented on 2021-05-02 09:44 (UTC)

Why is it so that protonmail-bridge --cli cannot be executed if the service runs? @Spixmaster: Because the service runs an instance of protonmail-bridge and the program prevents multiple instances. Would be nice it returned an error message.

Spixmaster commented on 2021-05-02 05:24 (UTC)

Why is it so that protonmail-bridge --cli cannot be executed if the service runs?

ciocio.la commented on 2021-04-06 03:15 (UTC)

I got annoyed with bridge committing to my pass repo so I created a repo specifically for bridge by adding Environment="PASSWORD_STORE_DIR=/a/different/dir" to the unit file.

denisse commented on 2021-02-23 23:45 (UTC) (edited on 2021-02-24 00:02 (UTC) by denisse)

Hello, I'm experiencing this error after trying to add my account:

Adding account was unsuccessful: user is already connected

Has anyone else experienced this issue before?

Update: In case someone else has this issue I managed to overcome the issue by removing the previous password from gnome-keyring.

hakayova commented on 2020-06-20 03:57 (UTC)

@kausban: I added the export statement in $HOME/.bashrc since there is no .bashenv file in that directory. Moreover, there are many similar export statements about other environmental variables in that file. Unfortunately it didn't change the behavior.

kausban commented on 2020-06-19 07:42 (UTC)

@hakayova: Have you tried adding the environment variable to your profile/env file? For example I have "export PASSWORD_STORE_DIR=/pathto/password-store" in "$HOME/.zshenv".

hakayova commented on 2020-06-18 16:14 (UTC) (edited on 2020-06-18 21:17 (UTC) by hakayova)

Thank you mclancy for your suggestion. I tried adding the Environment statement under Service section of bridge.service pointing to the root of password store (/home/hakayova/.password-store in my case) but unfortunately it didn't change the behavior. I still need to restart the service to be able to start using the bridge after a reboot. $ systemctl --user restart bridge.service

kausban commented on 2020-06-15 19:12 (UTC)

Thanks for posting a solution. I guess, I couldn't recreate the problem since I have that environment variable set in my *env/profile file.

I have pinned your comment for future readers. ;)

mclancy commented on 2020-06-15 16:35 (UTC)

hakayova and grimfrenzy: I managed to solve the issue of "no account found" by providing the correct PASSWORD_STORE_DIR to the systemd service.

In my case I provided: Environment="PASSWORD_STORE_DIR=/home/mclancy/.local/share/pass"

Hope this helps!

sommerfeld commented on 2020-05-26 15:21 (UTC)

@kausban, a manual reinstall with -Rs and -Syu fixed it.

Probably some bad cache either from makepkg or yay. I know it wasn't a one-off because that happened in 3 different arch systems that I manage.

Probably a yay issue, the latest change to pkgver induced some kind of buggy non-standard behavior.

kausban commented on 2020-05-25 23:43 (UTC)

sommerfeld: Thanks for reporting your issue. I had only tried the build using makepkg. I just tried yay -Syu and I am unable to replicate your experience or the bug.

Can you try doing a clean build again?

I changed pkgver, so that this package pulls the newest release on the proton-bridge github page. Previously it was building off the git master branch.

sommerfeld commented on 2020-05-25 21:12 (UTC)

I don't understand why, but it seems like your recent change to how pkgver is done in 155147d2a09d commit broke version checking:

-pkgver=1.2.7
+
+_pkgver=1.2.7
+_rev="live.1"
+_srcver="$_pkgver"-"$_rev"
+_srcname=proton-bridge-"$_srcver"
+
+pkgver="$_pkgver"."$_rev"

When upgrading with yay -Syu, this package will be reinstalled every time I use that command.

The curious part is this one:

Package (1)              Old Version     New Version     Net Change

protonmail-bridge-nogui  1.2.7.live.1-3  1.2.7.live.1-3    0.00 MiB

It seems that the pkgver is being correctly generated but for some reason there seems to be a mismatch on a lower level. Is this a makepkg bug? A yay bug? Or is there something truly wrong with the latest PKGBUILD commit?

Anyway, can pkgver be reverted back to the previous non buggy format?

kausban commented on 2020-05-15 23:38 (UTC)

I use pass as well and i get the prompt for my gpg passphrase when I start the bridge.service as user.

I will try debug this over the weekend to see if I can recreate what you are seeing. Alternatively, consider using the alternative method to run in the bridge in its interactive mode within a screen session as mentioned in the pinned comment.

grimfrenzy commented on 2020-05-15 18:39 (UTC)

Little bit of an update to the previous comment.

I'm using pass as my password manager and a dialog will pop up requesting my password when an application tries to use it. This works as expected when I'm launching protonmail-bridge directly (with -c or --noninteractive flags) but never appears anywhere I can see when I use the user service.

So I can get the same behavior (no user found and no reported error) by not unlocking my pass store. I think the issue is providing pass access to the bridge service.

grimfrenzy commented on 2020-05-15 18:16 (UTC)

I'm having a similar issue to @hakayova. When using the bridge.service mbsync reports that my email address cannot be found. If I run 'protonmail-bridge -c' or 'protonmail-bridge --noninteractive' directly from the shell then mail is retrieved and sent as usual.

This seems to be consistent as far as I can tell. If I stop the bridge.service and launch the protonmail-bridge from the shell -- it works. If I kill protonmail-bridge and start the bridge.service again -- it doesn't.

My understanding of systemd falls short of suggesting what the difference would be between a service file launched application and one launched manually here. Any ideas on troubleshooting this?

hakayova commented on 2020-04-26 22:17 (UTC) (edited on 2020-04-26 22:19 (UTC) by hakayova)

Thanks for the updates @kausban! With the new systemd bridge service that doesn't use screen, I still have a problem after rebooting. At the first attempt to sync with protonmail, mbsync complains that the account myemail@protonmail.com cannot be found (for obvious reasons, I didn't post my actual email address here). I believe this is not a pass-related problem anymore, which I fixed, because if I read the error message right, protonmail-bridge is complaining that the email account cannot be found. What I need to do to make it work is as follows: Check status of bridge.service -- $systemctl --user status bridge.service, which reveals that the service is active Stop bridge.service -- $systemctl --user stop bridge.service Check account -- $protonmail-bridge -c, then >>info, which shows that the account is actually there with the right password and everything. Start bridge.service -- $systemctl --user start bridge.service After this seemingly unnecessary ritual, mbsync can login and sync with my protonmail account.

I wonder if the service is launched before it can read the protonmail credentials from pass somehow. Thank you again for troubleshooting this with me.

kausban commented on 2020-04-21 14:37 (UTC) (edited on 2020-04-21 14:37 (UTC) by kausban)

Minimal fork of https://aur.archlinux.org/packages/protonmail-bridge/

Compiled with 'nogui' option

Included is a user systemd service. Try: systemctl status --user bridge.service

  1. You can login and register accounts using the interactive cli: protonmail-bridge --cli
  2. Once you have everything configured and automated. You can enable and use bridge.service to run bridge in background.

The following is an alternative way to run the bridge in interactive cli mode encapsulated within a named screen session. Can be added to bridge.service

ExecStart=/usr/bin/screen -Dm -S bridgedaemon sh -c "sleep 5; protonmail-bridge -c"
ExecStop=/usr/bin/screen -X -S bridgedaemon quit

kausban commented on 2020-04-20 16:48 (UTC)

hakayova: this is not necessarily related to how I have packaged the bridge application. Is your password manager configured correctly? I propose you check your configuration perhaps even by using the protonmail-bridge application with GUI.

When I boot-up/start the bridge service/application pass is used to restore the login credentials and I am prompted for my pgp passphrase to decrypt the password store.

For gnome keyring, it should be something similar - a prompt for keyring unlock when you login.

hakayova commented on 2020-04-20 16:04 (UTC)

Thank you again @kausban. This is the problem I am getting into by using this package so far:

After I reboot the system, the account I set up gets disconnected. When I connect to the screen that runs the service (screen -R -S bridgedaemon) and give the command "login con 'account name'" to reconnect to my account, it works but it always generates a new password for the local server. This is quite annoying. How can I retain my settings. including the password for the local server?

kausban commented on 2020-04-17 23:13 (UTC)

@hakayova: I left some hints in the PKGBUILD for this. bridge cli is running interactively within a screen session. You can access it: screen -R -S bridgedaemon

Then just use the info command or help to see other options.

hakayova commented on 2020-04-17 22:26 (UTC)

A big thank you @kausban for providing this package and your guidance in the previous thread to help explain how it works! I set it up and it works like a charm. I do have one probably silly question. In the past, when protonmail bridge was upgraded, not every time but occasionally it would change the server passwords for IMAP and SMTP randomly. If this happens again, what would be the way/cli option to visualize those passwords to manually update the pass settings?

grunch commented on 2020-04-17 17:04 (UTC) (edited on 2020-04-17 17:05 (UTC) by grunch)

Arrgh! Thank you @kausban for clarifying! I apologize for not studying the package more before posting my (redundant and possibly misleading) message.

Thanks for your awesome work on this!

kausban commented on 2020-04-17 14:33 (UTC) (edited on 2020-04-17 14:43 (UTC) by kausban)

@grunch:

  1. You do not need to log in using the GUI instance. The interactive cli instance can be used to do the same (protonmail-bridge --cli).

  2. Credentials will be stored in pass or gnome keyring (I haven't tested it myself). Pass doesn't need any GUI to work.

  3. Please see bridge.service. A user service file that is included in this package precisely for use such as you describe.

  4. With this package. I do not copy in the QT library files with this package since it is not meant to be used with the GUI at all.

grunch commented on 2020-04-17 14:28 (UTC)

I have successfully built the proton-bridge package from the Github sources. I also started the app as a systemd "user" service. My unit file is at https://pastebin.com/Y3aUQ9mt

Two caveats: the source comes with its own copy of the QT libraries, and running it this way assumes you have previously logged in using a GUI instance of the bridge, so your credentials are stored in GNOME Keys (aka seahorse) or pass.

I wonder if such a unit file could be added to the package for people who want to run the bridge as a user service.