-
Notifications
You must be signed in to change notification settings - Fork 7
feat: initial pass at a Protonmail Bridge doc #15
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
Draft
JoshStrobl
wants to merge
1
commit into
venhoai:main
Choose a base branch
from
JoshStrobl:feature/protonmail-bridge-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| DOCKER_CONFIG=/var/lib/venho-user/protonmail-bridge | ||
| COMPOSE_FILE=/var/lib/venho-user/protonmail-bridge/compose.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # Setting up Protonmail Bridge on the Jolla Mind2 | ||
|
|
||
| This guide will walk you through setting up Protonmail Bridge on the Jolla Mind2. Specifically, we will use the [shenxn/protonmail-bridge-docker](https://github.com/shenxn/protonmail-bridge-docker) image and running it with nerdctl / nerdctl compose, similar to how Venho.AI's environment runs on top of the Mind2. | ||
|
|
||
| This ensures we can more easily update the software, isolate its operations to the container, and if desired lock it down to limit networking. While the later is possible, it is not _currently_ covered in this guide and it will default to using the bridge network, therefore similar to the Venho UI your bridge **will be exposed to the network**. Be smart and be safe. | ||
|
|
||
| This guide will assume you have enabled developer mode on your Mind2. If you have not, see [this](https://docs.sailfishos.org/Support/Help_Articles/Enabling_Developer_Mode/) Sailfish OS guide. If you are accessing it remotely, be sure you have enabled remote connection and set a secure password for device access. Developer mode at the very least is required during setup, remote connection is optional (if you are not using the Terminal from the Mind2) and can be safely turned off after this setup. | ||
|
|
||
| ## Preparation | ||
|
|
||
| We will be stuff any configuration into a dedicated directory for our service, so let's set that up now. | ||
|
|
||
| ``` | ||
| devel-su | ||
| mkdir -p /var/lib/venho-user/protonmail-bridge | ||
| ``` | ||
|
|
||
| ## Files | ||
|
|
||
| ### Compose file | ||
|
|
||
| Our `compose.yml` file is responsible for knowing what image to pull from an image registry (default is Docker Hub), which ports to expose, default volumes to create, and more. This `compose.yml` is used by `nerdctl` which in turn is used by our `systemd` service unit. | ||
|
|
||
| The source `docker-compose.yml` can be found [here](https://github.com/shenxn/protonmail-bridge-docker/blob/master/docker-compose.yml). However, we will need to tweak ours to pull down ARM builds (which are available with the `build` tag) | ||
|
|
||
| Pull this file down via the following command: | ||
|
|
||
| ``` | ||
| curl https://raw.githubusercontent.com/venhoai/jolla-mind2/refs/heads/main/docs/protonmail-bridge/compose.yml -o /var/lib/venho-user/protonmail-bridge/compose.yml | ||
| ``` | ||
|
|
||
| ### Env | ||
|
|
||
| We will now pull down a basic env file that will be used to indicate where our configuration and compose file are. | ||
|
|
||
| ``` | ||
| curl https://raw.githubusercontent.com/venhoai/jolla-mind2/refs/heads/main/docs/protonmail-bridge/00-default.env -o /var/lib/venho-user/protonmail-bridge/00-default.env | ||
| ``` | ||
|
|
||
| ### systemd Service Unit | ||
|
|
||
| **Important:** Do **not** enable this systemd unit until the end of the guide (we have a separate section on it). | ||
|
|
||
| ``` | ||
| curl https://raw.githubusercontent.com/venhoai/jolla-mind2/refs/heads/main/docs/protonmail-bridge/protonmail-bridge.service -o /etc/systemd/system/protonmail-bridge.service | ||
| ``` | ||
|
|
||
| ## First Run | ||
|
|
||
| While still in `devel-su`, run the following to do a first run of Protonmail Bridge. Per the [upstream docs](https://github.com/shenxn/protonmail-bridge-docker?tab=readme-ov-file#initialization): | ||
|
|
||
| > Wait for the bridge to startup, then you will see a prompt appear for [Proton Mail Bridge interactive shell](https://proton.me/support/bridge-cli-guide). Use the `login` command and follow the instructions to add your account into the bridge. Then use `info` to see the configuration information (username and password). After that, use `exit` to exit the bridge. You may need `CTRL+C` to exit the docker entirely. | ||
|
|
||
| Furthermore, you may want to let it fully sync before stopping the container, just to be safe. | ||
|
|
||
| ``` | ||
| nerdctl compose --env-file /var/lib/venho-user/protonmail-bridge/00-default.env --file /var/lib/venho-user/protonmail-bridge/compose.yml run protonmail-bridge init | ||
| ``` | ||
|
|
||
| Once the init is done, type `info` and copy the settings somewhere (you'll need these for adding it to Venho) | ||
|
|
||
| ## Enable service startup | ||
|
|
||
| Now, let's enable and start the systemd service: | ||
|
|
||
| ``` | ||
| systemctl enable --now protonmail-bridge.service | ||
| ``` | ||
|
|
||
| You can validate the container is running successfully with: `systemctl status protonmail-bridge` | ||
|
|
||
| ## Exiting devel-su | ||
|
|
||
| Type `exit` to leave su mode. | ||
|
|
||
| ## Adding to Venho | ||
|
|
||
| Go to the Messaging Center and add an account. | ||
|
|
||
| - For E-Mail Address, Username and Password (both IMAP and SMTP) put the `username` defined from the `info` of ProtonMail Bridge. | ||
| - For Hostname (both IMAP and SMTP): `localhost.localdomain` | ||
| - IMAP Port: `1143` | ||
| - Password (both IMAP and SMTP): `password` defined from `info` of ProtonMail Bridge | ||
| - SMTP Port: `1025` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| services: | ||
| protonmail-bridge: | ||
| image: shenxn/protonmail-bridge:build | ||
| ports: | ||
| - 1025:1025/tcp | ||
| - 1143:1143/tcp | ||
| restart: unless-stopped | ||
| volumes: | ||
| - protonmail:/root | ||
| volumes: | ||
| protonmail: | ||
| name: protonmail |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| [Unit] | ||
| Description=Protonmail Bridge | ||
| Requires=containerd.service | ||
| After=containerd.service | ||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| RemainAfterExit=true | ||
|
|
||
| WorkingDirectory=/var/lib/venho-user/protonmail-bridge/ | ||
| EnvironmentFile=/var/lib/venho-user/protonmail-bridge/*.env | ||
|
|
||
| ExecStart=/usr/bin/nerdctl compose start | ||
| ExecStop=/usr/bin/nerdctl compose stop | ||
|
|
||
| # Bringing down the containers may take some | ||
| TimeoutStopSec=60s | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JoshStrobl I seem to be getting an error when running this step
FATA[0000] Non-string key at top level: 404Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because the guide is based on the files being in the repo, so you pulled down files which didn't exist so in all likelihood the content is the non-200 status code. They're not in the repo since it's still a draft (haven't marked it for review) and not merged, mailbox setup with the bridge hasn't worked in my experience (including after some IMAP changes in latest release), so until that's the case I'm not marking ready for review.