Compare commits

...

18 Commits

Author SHA1 Message Date
ba712516ff Other: Bridge Millau 2.2.0 2022-05-18 13:05:54 +02:00
865ac44037 GODT-1508: Splash screen for rebranding.
* Use old keychain until manual update.
* Improve desktop files migration for windows and linux.
* Revert, need admin rights to change desktop and start menu files.
2022-05-18 11:25:48 +02:00
7d41062ae9 GODT-1542: Update login screen for rebranding. 2022-05-18 11:23:43 +02:00
f3c69faf8b GODT-1260: Renaming
* Renaming GUI, CLI, no-impact config.
* License header and documentation rebranding.
* Rename app title and vendor. Impact: manual install
* Migrating mac keychain and launch on startup.
* Fix linter and linter renaming
2022-05-18 11:23:38 +02:00
e353dc554d GODT-1502: Rebranding: color and radius. 2022-05-18 11:19:33 +02:00
415d08b411 GODT-1549: Add notification when address list changes. 2022-05-18 11:17:03 +02:00
62499a5630 Other: update dependencies 2022-05-18 11:06:24 +02:00
d6d7ea592e GODT-1560: Dependecy licenses update and link. 2022-05-18 10:54:16 +02:00
5033e9718c GODT-1543: Using one buffered event for off and on connection 2022-05-17 15:25:19 +02:00
16f9dc43cb GODT-1534: Reset address when leaving split mode. 2022-05-17 08:35:49 +00:00
b8f27cc7d2 GODT-1550: Update dependencies 2022-05-16 09:23:16 +00:00
6b10da524c GODT-1545 GODT-1521: Change wording and enable release notes link. 2022-04-13 14:22:57 +02:00
51eb2c42cd Other: Bridge London 2.1.3 2022-04-08 07:34:19 +02:00
c94d839fbb Other: debug mac CI 2022-04-07 16:04:23 +00:00
de586e5f12 GODT-1527: Change bug report description. 2022-04-07 16:04:23 +00:00
c32a106898 GODT-1525: Add keybase/go-keychain/secretservice as new keychain helper. 2022-04-06 11:49:27 +00:00
5b20b6a3d0 GODT-1537: Manual in-app update mechanism. 2022-04-04 11:54:34 +02:00
3b07121f08 Other: temporary disable mac build 2022-03-30 14:45:51 +02:00
561 changed files with 7986 additions and 3864 deletions

View File

@ -43,6 +43,10 @@ lint:
stage: test stage: test
only: only:
- branches - branches
before_script:
- mkdir -p .cache/bin
- export PATH=$(pwd)/.cache/bin:$PATH
- export GOPATH="$CI_PROJECT_DIR/.cache"
script: script:
- env GOMAXPROCS=$(( ${CI_TAG_CPU} / 2 )) make lint - env GOMAXPROCS=$(( ${CI_TAG_CPU} / 2 )) make lint
tags: tags:
@ -147,8 +151,6 @@ build-linux-qa:
.build-darwin-base: .build-darwin-base:
extends: .build-base extends: .build-base
before_script: before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- export PATH=/usr/local/bin:$PATH - export PATH=/usr/local/bin:$PATH
- export PATH=/usr/local/opt/git/bin:$PATH - export PATH=/usr/local/opt/git/bin:$PATH
- export PATH=/usr/local/opt/make/libexec/gnubin:$PATH - export PATH=/usr/local/opt/make/libexec/gnubin:$PATH

0
.gitmodules vendored
View File

View File

@ -56,7 +56,6 @@ linters:
- godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false] - godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false]
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true] - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true]
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports [fast: true, auto-fix: true] - goimports # Goimports does everything that gofmt does. Additionally it checks unused imports [fast: true, auto-fix: true]
- golint # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes [fast: true, auto-fix: false]
- gosec # Inspects source code for security problems [fast: true, auto-fix: false] - gosec # Inspects source code for security problems [fast: true, auto-fix: false]
- misspell # Finds commonly misspelled English words in comments [fast: true, auto-fix: true] - misspell # Finds commonly misspelled English words in comments [fast: true, auto-fix: true]
- nakedret # Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false] - nakedret # Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false]

View File

@ -1,4 +1,4 @@
# Building ProtonMail Bridge and Import-Export app # Building Proton Mail Bridge and Import-Export app
## Prerequisites ## Prerequisites
* 64-bit AMD OS: * 64-bit AMD OS:

View File

@ -2,8 +2,7 @@
By making a contribution to this project: By making a contribution to this project:
1. I assign any and all copyright related to the contribution to 1. I assign any and all copyright related to the contribution to Proton AG;
Proton Technologies AG;
2. I certify that the contribution was created in whole by me; 2. I certify that the contribution was created in whole by me;
3. I understand and agree that this project and the contribution are public 3. I understand and agree that this project and the contribution are public
and that a record of the contribution (including all personal information I and that a record of the contribution (including all personal information I

View File

@ -1,72 +1,93 @@
# Copying # Copying
Copyright (c) 2020 Proton Technologies AG Copyright (c) 2022 Proton AG
ProtonMail Bridge is free software: you can redistribute it and/or modify it Proton Mail Bridge is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any Software Foundation, either version 3 of the License, or (at your option) any
later version. later version.
ProtonMail Bridge is distributed in the hope that it will be useful, but WITHOUT ANY Proton Mail Bridge is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details. PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with You should have received a copy of the GNU General Public License along with
ProtonMail Bridge. If not, see https://www.gnu.org/licenses. Proton Mail Bridge. If not, see https://www.gnu.org/licenses.
# Dependencies # Dependencies
ProtonMail Bridge app includes the following libraries from Proton Technologies AG: Proton Mail Bridge includes the following 3rd party software:
* [GopenPGP library](https://gopenpgp.org/) | The [MIT License](https://github.com/ProtonMail/gopenpgp/blob/master/LICENSE).
ProtonMail Bridge includes the following 3rd party software:
* [The Go Project libraries](https://golang.org/project/) | Available under [BSD license](https://golang.org/LICENSE) * [The Go Project libraries](https://golang.org/project/) | Available under [BSD license](https://golang.org/LICENSE)
* [Qt Go binding](https://github.com/therecipe/qt) | Available under [LGPLv3 license](https://github.com/therecipe/qt/blob/master/LICENSE)
* [Qt](https://www.qt.io/) | Available under [multiple licences](https://www.qt.io/licensing) * [Qt](https://www.qt.io/) | Available under [multiple licences](https://www.qt.io/licensing)
* [Font Awesome 4.7.0](https://fontawesome.com/v4.7.0/) | Available under [multiple licenses](https://fontawesome.com/v4.7.0/license/)
* [notificator](https://github.com/0xAX/notificator) | Available under [license](https://github.com/0xAX/notificator/blob/master/LICENSE) <!-- START AUTOGEN -->
* [ishell](https://github.com/abiosoft/ishell) | Available under [license](https://github.com/abiosoft/ishell/blob/master/LICENSE) * [docker-credential-helpers](https://github.com/docker/docker-credential-helpers) available under [license](https://github.com/docker/docker-credential-helpers/blob/master/LICENSE)
* [readline](https://github.com/abiosoft/readline) | Available under [license](https://github.com/abiosoft/readline/blob/master/LICENSE) * [go-imap](https://github.com/emersion/go-imap) available under [license](https://github.com/emersion/go-imap/blob/master/LICENSE)
* [singleinstance](https://github.com/allan-simon/go-singleinstance) | Available under [license](https://github.com/allan-simon/go-singleinstance/blob/master/LICENSE) * [bcrypt](https://github.com/jameskeane/bcrypt) available under [license](https://github.com/jameskeane/bcrypt/blob/master/LICENSE)
* [cascadia](https://github.com/andybalholm/cascadia) | Available under [license](https://github.com/andybalholm/cascadia/blob/master/LICENSE) * [notificator](https://github.com/0xAX/notificator) available under [license](https://github.com/0xAX/notificator/blob/master/LICENSE)
* [gocertifi](https://github.com/certifi/gocertifi) | Available under [license](https://github.com/certifi/gocertifi/blob/master/LICENSE) * [semver](https://github.com/Masterminds/semver/v3) available under [license](https://github.com/Masterminds/semver/v3/blob/master/LICENSE)
* [logex](https://github.com/chzyer/logex) | Available under [license](https://github.com/chzyer/logex/blob/master/LICENSE) * [go-autostart](https://github.com/ProtonMail/go-autostart) available under [license](https://github.com/ProtonMail/go-autostart/blob/master/LICENSE)
* [test](https://github.com/chzyer/test) | Available under [license](https://github.com/chzyer/test/blob/master/LICENSE) * [go-crypto](https://github.com/ProtonMail/go-crypto) available under [license](https://github.com/ProtonMail/go-crypto/blob/master/LICENSE)
* [godog](https://github.com/cucumber/godog) | Available under [license](https://github.com/cucumber/godog/blob/master/LICENSE) * [go-imap-id](https://github.com/ProtonMail/go-imap-id) available under [license](https://github.com/ProtonMail/go-imap-id/blob/master/LICENSE)
* [wincred](https://github.com/danieljoos/wincred) | Available under [license](https://github.com/danieljoos/wincred/blob/master/LICENSE) * [go-rfc5322](https://github.com/ProtonMail/go-rfc5322) available under [license](https://github.com/ProtonMail/go-rfc5322/blob/master/LICENSE)
* [credential-helpers](https://github.com/docker/docker-credential-helpers) | Available under [license](https://github.com/docker/docker-credential-helpers/blob/master/LICENSE) * [go-srp](https://github.com/ProtonMail/go-srp) available under [license](https://github.com/ProtonMail/go-srp/blob/master/LICENSE)
* [imap](https://github.com/emersion/go-imap) | Available under [license](https://github.com/emersion/go-imap/blob/master/LICENSE) * [go-vcard](https://github.com/ProtonMail/go-vcard) available under [license](https://github.com/ProtonMail/go-vcard/blob/master/LICENSE)
* [imap-appendlimit](https://github.com/emersion/go-imap-appendlimit) | Available under [license](https://github.com/emersion/go-imap-appendlimit/blob/master/LICENSE) * [gopenpgp](https://github.com/ProtonMail/gopenpgp/v2) available under [license](https://github.com/ProtonMail/gopenpgp/v2/blob/master/LICENSE)
* [imap-idle](https://github.com/emersion/go-imap-idle) | Available under [license](https://github.com/emersion/go-imap-idle/blob/master/LICENSE) * [goquery](https://github.com/PuerkitoBio/goquery) available under [license](https://github.com/PuerkitoBio/goquery/blob/master/LICENSE)
* [imap-quota](https://github.com/emersion/go-imap-quota) | Available under [license](https://github.com/emersion/go-imap-quota/blob/master/LICENSE) * [ishell](https://github.com/abiosoft/ishell) available under [license](https://github.com/abiosoft/ishell/blob/master/LICENSE)
* [sasl](https://github.com/emersion/go-sasl) | Available under [license](https://github.com/emersion/go-sasl/blob/master/LICENSE) * [readline](https://github.com/abiosoft/readline) available under [license](https://github.com/abiosoft/readline/blob/master/LICENSE)
* [smtp](https://github.com/emersion/go-smtp) | Available under [license](https://github.com/emersion/go-smtp/blob/master/LICENSE) * [go-singleinstance](https://github.com/allan-simon/go-singleinstance) available under [license](https://github.com/allan-simon/go-singleinstance/blob/master/LICENSE)
* [textwrapper](https://github.com/emersion/go-textwrapper) | Available under [license](https://github.com/emersion/go-textwrapper/blob/master/LICENSE) * [logex](https://github.com/chzyer/logex) available under [license](https://github.com/chzyer/logex/blob/master/LICENSE)
* [vcard](https://github.com/emersion/go-vcard) | Available under [license](https://github.com/emersion/go-vcard/blob/master/LICENSE) * [test](https://github.com/chzyer/test) available under [license](https://github.com/chzyer/test/blob/master/LICENSE)
* [color](https://github.com/fatih/color) | Available under [license](https://github.com/fatih/color/blob/master/LICENSE.md) * [godog](https://github.com/cucumber/godog) available under [license](https://github.com/cucumber/godog/blob/master/LICENSE)
* [shlex](https://github.com/flynn-archive/go-shlex) | Available under [license](https://github.com/flynn-archive/go-shlex/blob/master/COPYING) * [messages-go](https://github.com/cucumber/messages-go/v16) available under [license](https://github.com/cucumber/messages-go/v16/blob/master/LICENSE)
* [raven](https://github.com/getsentry/raven-go) | Available under [license](https://github.com/getsentry/raven-go/blob/master/LICENSE) * [go-sysinfo](https://github.com/elastic/go-sysinfo) available under [license](https://github.com/elastic/go-sysinfo/blob/master/LICENSE)
* [resty](https://github.com/go-resty/resty) | Available under [license](https://github.com/go-resty/resty/blob/master/LICENSE) * [go-windows](https://github.com/elastic/go-windows) available under [license](https://github.com/elastic/go-windows/blob/master/LICENSE)
* [mock](https://github.com/golang/mock) | Available under [license](https://github.com/golang/mock/blob/master/LICENSE) * [go-imap-appendlimit](https://github.com/emersion/go-imap-appendlimit) available under [license](https://github.com/emersion/go-imap-appendlimit/blob/master/LICENSE)
* [cmp](https://github.com/google/go-cmp) | Available under [license](https://github.com/google/go-cmp/blob/master/LICENSE) * [go-imap-move](https://github.com/emersion/go-imap-move) available under [license](https://github.com/emersion/go-imap-move/blob/master/LICENSE)
* [gopherjs](https://github.com/gopherjs/gopherjs) | Available under [license](https://github.com/gopherjs/gopherjs/blob/master/LICENSE) * [go-imap-quota](https://github.com/emersion/go-imap-quota) available under [license](https://github.com/emersion/go-imap-quota/blob/master/LICENSE)
* [multierror](https://github.com/hashicorp/go-multierror) | Available under [license](https://github.com/hashicorp/go-multierror/blob/master/LICENSE) * [go-imap-unselect](https://github.com/emersion/go-imap-unselect) available under [license](https://github.com/emersion/go-imap-unselect/blob/master/LICENSE)
* [bcrypt](https://github.com/jameskeane/bcrypt) | Available under [license](https://github.com/jameskeane/bcrypt/blob/master/LICENSE) * [go-message](https://github.com/emersion/go-message) available under [license](https://github.com/emersion/go-message/blob/master/LICENSE)
* [html2text](https://github.com/jaytaylor/html2text) | Available under [license](https://github.com/jaytaylor/html2text/blob/master/LICENSE) * [go-sasl](https://github.com/emersion/go-sasl) available under [license](https://github.com/emersion/go-sasl/blob/master/LICENSE)
* [enmime](https://github.com/jhillyerd/enmime) | Available under [license](https://github.com/jhillyerd/enmime/blob/master/LICENSE) * [go-smtp](https://github.com/emersion/go-smtp) available under [license](https://github.com/emersion/go-smtp/blob/master/LICENSE)
* [osext](https://github.com/kardianos/osext) | Available under [license](https://github.com/kardianos/osext/blob/master/LICENSE) * [go-textwrapper](https://github.com/emersion/go-textwrapper) available under [license](https://github.com/emersion/go-textwrapper/blob/master/LICENSE)
* [keychain](https://github.com/keybase/go-keychain) | Available under [license](https://github.com/keybase/go-keychain/blob/master/LICENSE) * [go-vcard](https://github.com/emersion/go-vcard) available under [license](https://github.com/emersion/go-vcard/blob/master/LICENSE)
* [aurora](https://github.com/logrusorgru/aurora) | Available under [license](https://github.com/logrusorgru/aurora/blob/master/LICENSE) * [color](https://github.com/fatih/color) available under [license](https://github.com/fatih/color/blob/master/LICENSE)
* [dns](https://github.com/miekg/dns) | Available under [license](https://github.com/miekg/dns/blob/master/LICENSE) * [go-shlex](https://github.com/flynn-archive/go-shlex) available under [license](https://github.com/flynn-archive/go-shlex/blob/master/LICENSE)
* [uuid](https://github.com/myesui/uuid) | Available under [license](https://github.com/myesui/uuid/blob/master/LICENSE) * [sentry-go](https://github.com/getsentry/sentry-go) available under [license](https://github.com/getsentry/sentry-go/blob/master/LICENSE)
* [jsondiff](https://github.com/nsf/jsondiff) | Available under [license](https://github.com/nsf/jsondiff/blob/master/LICENSE) * [resty](https://github.com/go-resty/resty/v2) available under [license](https://github.com/go-resty/resty/v2/blob/master/LICENSE)
* [logrus](https://github.com/sirupsen/logrus) | Available under [license](https://github.com/sirupsen/logrus/blob/master/LICENSE) * [dbus](https://github.com/godbus/dbus) available under [license](https://github.com/godbus/dbus/blob/master/LICENSE)
* [golang](https://github.com/skratchdot/open-golang) | Available under [license](https://github.com/skratchdot/open-golang/blob/master/LICENSE) * [mock](https://github.com/golang/mock) available under [license](https://github.com/golang/mock/blob/master/LICENSE)
* [testify](https://github.com/stretchr/testify) | Available under [license](https://github.com/stretchr/testify/blob/master/LICENSE) * [go-cmp](https://github.com/google/go-cmp) available under [license](https://github.com/google/go-cmp/blob/master/LICENSE)
* [uuid](https://github.com/twinj/uuid) | Available under [license](https://github.com/twinj/uuid/blob/master/LICENSE) * [uuid](https://github.com/google/uuid) available under [license](https://github.com/google/uuid/blob/master/LICENSE)
* [cli](https://github.com/urfave/cli) | Available under [license](https://github.com/urfave/cli/blob/master/LICENSE) * [go-multierror](https://github.com/hashicorp/go-multierror) available under [license](https://github.com/hashicorp/go-multierror/blob/master/LICENSE)
* [html2text](https://github.com/jaytaylor/html2text) available under [license](https://github.com/jaytaylor/html2text/blob/master/LICENSE)
* [BBolt](https://pkg.go.dev/go.etcd.io/bbolt/?tab=doc) | Available under [license](https://pkg.go.dev/go.etcd.io/bbolt?tab=licenses#LICENSE) * [go-keychain](https://github.com/keybase/go-keychain) available under [license](https://github.com/keybase/go-keychain/blob/master/LICENSE)
* [testify.v1](https://gopkg.in/stretchr/testify.v1) | Available under [license](https://github.com/stretchr/testify/blob/master/LICENSE) * [text](https://github.com/kr/text) available under [license](https://github.com/kr/text/blob/master/LICENSE)
* [aurora](https://github.com/logrusorgru/aurora) available under [license](https://github.com/logrusorgru/aurora/blob/master/LICENSE)
* [go-runewidth](https://github.com/mattn/go-runewidth) available under [license](https://github.com/mattn/go-runewidth/blob/master/LICENSE)
* [dns](https://github.com/miekg/dns) available under [license](https://github.com/miekg/dns/blob/master/LICENSE)
* [pretty](https://github.com/niemeyer/pretty) available under [license](https://github.com/niemeyer/pretty/blob/master/LICENSE)
* [jsondiff](https://github.com/nsf/jsondiff) available under [license](https://github.com/nsf/jsondiff/blob/master/LICENSE)
* [tablewriter](https://github.com/olekukonko/tablewriter) available under [license](https://github.com/olekukonko/tablewriter/blob/master/LICENSE)
* [errors](https://github.com/pkg/errors) available under [license](https://github.com/pkg/errors/blob/master/LICENSE)
* [procfs](https://github.com/prometheus/procfs) available under [license](https://github.com/prometheus/procfs/blob/master/LICENSE)
* [du](https://github.com/ricochet2200/go-disk-usage/du) available under [license](https://github.com/ricochet2200/go-disk-usage/du/blob/master/LICENSE)
* [logrus](https://github.com/sirupsen/logrus) available under [license](https://github.com/sirupsen/logrus/blob/master/LICENSE)
* [bom](https://github.com/ssor/bom) available under [license](https://github.com/ssor/bom/blob/master/LICENSE)
* [testify](https://github.com/stretchr/testify) available under [license](https://github.com/stretchr/testify/blob/master/LICENSE)
* [qt](https://github.com/therecipe/qt) available under [license](https://github.com/therecipe/qt/blob/master/LICENSE)
* [cli](https://github.com/urfave/cli/v2) available under [license](https://github.com/urfave/cli/v2/blob/master/LICENSE)
* [msgpack](https://github.com/vmihailenco/msgpack/v5) available under [license](https://github.com/vmihailenco/msgpack/v5/blob/master/LICENSE)
* [bbolt](https://go.etcd.io/bbolt) available under [license](https://github.com/etcd-io/bbolt/blob/master/LICENSE)
* [crypto](https://golang.org/x/crypto) available under [license](https://cs.opensource.google/go/x/crypto/+/master:LICENSE)
* [net](https://golang.org/x/net) available under [license](https://cs.opensource.google/go/x/net/+/master:LICENSE)
* [sys](https://golang.org/x/sys) available under [license](https://cs.opensource.google/go/x/sys/+/master:LICENSE)
* [text](https://golang.org/x/text) available under [license](https://cs.opensource.google/go/x/text/+/master:LICENSE)
* [plist](https://howett.net/plist) available under [license](https://github.com/DHowett/go-plist/blob/main/LICENSE)
* [docker-credential-helpers](https://github.com/ProtonMail/docker-credential-helpers) available under [license](https://github.com/ProtonMail/docker-credential-helpers/blob/master/LICENSE)
* [go-imap](https://github.com/ProtonMail/go-imap) available under [license](https://github.com/ProtonMail/go-imap/blob/master/LICENSE)
* [go-message](https://github.com/ProtonMail/go-message) available under [license](https://github.com/ProtonMail/go-message/blob/master/LICENSE)
* [bcrypt](https://github.com/ProtonMail/bcrypt) available under [license](https://github.com/ProtonMail/bcrypt/blob/master/LICENSE)
* [go-keychain](https://github.com/cuthix/go-keychain) available under [license](https://github.com/cuthix/go-keychain/blob/master/LICENSE)
<!-- END AUTOGEN -->

View File

@ -1,19 +1,51 @@
# ProtonMail Bridge and Import-Export app Changelog # Proton Mail Bridge and Import-Export app Changelog
Changelog [format](http://keepachangelog.com/en/1.0.0/) Changelog [format](http://keepachangelog.com/en/1.0.0/)
## [Bridge 2.2.0] Millau
### Added
* Rebranding:
* GODT-1508: Splash screen for rebranding.
* GODT-1542: Update login screen for rebranding.
* GODT-1260: Renaming.
* GODT-1502: Rebranding: color and radius.
* GODT-1549: Add notification when address list changes.
* GODT-1560: Dependecy licenses update and link.
### Changed
* GODT-1543: Using one buffered event for off and on connection.
* GODT-1550: Update dependencies.
* GODT-1545 GODT-1521: Change wording and enable release notes link.
### Fixed
* GODT-1534: Reset address when leaving split mode.
## [Bridge 2.1.3] London
### Added
GODT-1525: Add keybase/go-keychain/secretservice as new keychain helper.
### Changed
GODT-1527: Change bug report description.
### Fixed
GODT-1537: Manual in-app update mechanism.
## [Bridge 2.1.2] London ## [Bridge 2.1.2] London
## Added ### Added
* GODT-1522: Rebuild macOS keychain notification. * GODT-1522: Rebuild macOS keychain notification.
* GODT-1437 Add new proxy provider (Quad9 with port). * GODT-1437 Add new proxy provider (Quad9 with port).
* GODT-1516: Return notification on missing keychain. * GODT-1516: Return notification on missing keychain.
## Changed ### Changed
* GODT-1451: Do not check for gnome keyring to allow other implementations of secret-service API. Thanks to @remgodow. * GODT-1451: Do not check for gnome keyring to allow other implementations of secret-service API. Thanks to @remgodow.
* GODT-1516 GODT-1451: KeepassXC is crashing on start. We need to block it until it's fixed. * GODT-1516 GODT-1451: KeepassXC is crashing on start. We need to block it until it's fixed.
## Fixed ### Fixed
* GODT-1524: Logout issues with macOS. * GODT-1524: Logout issues with macOS.
* GODT-1503 GODT-1492: Improve email validation and username in bug report. * GODT-1503 GODT-1492: Improve email validation and username in bug report.
* GODT-1507: Enable autostart after Qt setup. * GODT-1507: Enable autostart after Qt setup.
@ -22,7 +54,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
## [Bridge 2.1.1] London ## [Bridge 2.1.1] London
## Added ### Added
* GODT-1376: Add first userID to sentry scope. * GODT-1376: Add first userID to sentry scope.
* GODT-1375: Add host architecture to sentry reports. * GODT-1375: Add host architecture to sentry reports.
* GODT-1364: Add windows CI machine for tests, and build. * GODT-1364: Add windows CI machine for tests, and build.
@ -44,7 +76,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
* GODT-1483: Correct scope in sentry report. * GODT-1483: Correct scope in sentry report.
* GODT-1477: Change CoD wording. * GODT-1477: Change CoD wording.
## Added ### Added
* GODT-1478: Add GUI settings for keychain selection. * GODT-1478: Add GUI settings for keychain selection.
* Other: Change copyright year. * Other: Change copyright year.
* GODT-1329: Dark mode, with autodetect. * GODT-1329: Dark mode, with autodetect.
@ -58,7 +90,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
## [Bridge 2.0.0] Kwai ## [Bridge 2.0.0] Kwai
## Added ### Added
* GODT-22: New GUI style and improved UX: * GODT-22: New GUI style and improved UX:
* GODT-1168 GODT-1169 Qml artifacts for preview. * GODT-1168 GODT-1169 Qml artifacts for preview.
* GODT-1177: Remove Import-Export from repo. * GODT-1177: Remove Import-Export from repo.
@ -129,7 +161,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
* GODT-1158: Store full messages bodies on disk. * GODT-1158: Store full messages bodies on disk.
* GODT-1433 Adding first integration test for drafts. * GODT-1433 Adding first integration test for drafts.
## Changed ### Changed
* GODT-1438: Turn off SW OpenGL on windows and add debug info about graphic renderer. * GODT-1438: Turn off SW OpenGL on windows and add debug info about graphic renderer.
* GODT-1425: Factory reset enables launch on startup. * GODT-1425: Factory reset enables launch on startup.
* GODT-1433 Message.Type is deprecated, use Flags instead. * GODT-1433 Message.Type is deprecated, use Flags instead.

View File

@ -10,7 +10,7 @@ TARGET_OS?=${GOOS}
.PHONY: build build-nogui build-launcher versioner hasher .PHONY: build build-nogui build-launcher versioner hasher
# Keep version hardcoded so app build works also without Git repository. # Keep version hardcoded so app build works also without Git repository.
BRIDGE_APP_VERSION?=2.1.2+git BRIDGE_APP_VERSION?=2.2.0+git
APP_VERSION:=${BRIDGE_APP_VERSION} APP_VERSION:=${BRIDGE_APP_VERSION}
SRC_ICO:=logo.ico SRC_ICO:=logo.ico
SRC_ICNS:=Bridge.icns SRC_ICNS:=Bridge.icns
@ -85,7 +85,7 @@ hasher:
${TGZ_TARGET}: ${DEPLOY_DIR}/${TARGET_OS} ${TGZ_TARGET}: ${DEPLOY_DIR}/${TARGET_OS}
rm -f $@ rm -f $@
cd ${DEPLOY_DIR}/${TARGET_OS} && tar czf ../../../../$@ . cd ${DEPLOY_DIR}/${TARGET_OS} && tar -czvf ../../../../$@ .
${DEPLOY_DIR}/linux: ${EXE_TARGET} ${DEPLOY_DIR}/linux: ${EXE_TARGET}
cp -pf ./internal/frontend/share/${SRC_SVG} ${DEPLOY_DIR}/linux/logo.svg cp -pf ./internal/frontend/share/${SRC_SVG} ${DEPLOY_DIR}/linux/logo.svg
@ -235,11 +235,14 @@ mocks:
mockgen --package mocks github.com/ProtonMail/proton-bridge/pkg/pmapi Client,Manager > pkg/pmapi/mocks/mocks.go mockgen --package mocks github.com/ProtonMail/proton-bridge/pkg/pmapi Client,Manager > pkg/pmapi/mocks/mocks.go
mockgen --package mocks github.com/ProtonMail/proton-bridge/pkg/message Fetcher > pkg/message/mocks/mocks.go mockgen --package mocks github.com/ProtonMail/proton-bridge/pkg/message Fetcher > pkg/message/mocks/mocks.go
lint: gofiles lint-golang lint-license lint-changelog lint: gofiles lint-golang lint-license lint-dependencies lint-changelog
lint-license: lint-license:
./utils/missing_license.sh check ./utils/missing_license.sh check
lint-dependencies:
./utils/dependency_license.sh check
lint-changelog: lint-changelog:
./utils/changelog_linter.sh Changelog.md ./utils/changelog_linter.sh Changelog.md

View File

@ -1,22 +1,22 @@
# ProtonMail Bridge and Import Export app # Proton Mail Bridge and Import Export app
Copyright (c) 2020 Proton Technologies AG Copyright (c) 2022 Proton AG
This repository holds the ProtonMail Bridge and the ProtonMail Import-Export applications. This repository holds the Proton Mail Bridge and the Proton Mail Import-Export applications.
For a detailed build information see [BUILDS](./BUILDS.md). For a detailed build information see [BUILDS](./BUILDS.md).
The license can be found in [LICENSE](./LICENSE) file, for more licensing information see [COPYING_NOTES](./COPYING_NOTES.md). The license can be found in [LICENSE](./LICENSE) file, for more licensing information see [COPYING_NOTES](./COPYING_NOTES.md).
For contribution policy see [CONTRIBUTING](./CONTRIBUTING.md). For contribution policy see [CONTRIBUTING](./CONTRIBUTING.md).
## Description Bridge ## Description Bridge
ProtonMail Bridge for e-mail clients. Proton Mail Bridge for e-mail clients.
When launched, Bridge will initialize local IMAP/SMTP servers and render When launched, Bridge will initialize local IMAP/SMTP servers and render
its GUI. its GUI.
To configure an e-mail client, firstly log in using your ProtonMail credentials. To configure an e-mail client, firstly log in using your Proton Mail credentials.
Open your e-mail client and add a new account using the settings which are Open your e-mail client and add a new account using the settings which are
located in the Bridge GUI. The client will only be able to sync with located in the Bridge GUI. The client will only be able to sync with
your ProtonMail account when the Bridge is running, thus the option your Proton Mail account when the Bridge is running, thus the option
to start Bridge on startup is enabled by default. to start Bridge on startup is enabled by default.
When the main window is closed, Bridge will continue to run in the When the main window is closed, Bridge will continue to run in the
@ -25,9 +25,9 @@ background.
More details [on the public website](https://protonmail.com/bridge). More details [on the public website](https://protonmail.com/bridge).
## Description Import-Export app ## Description Import-Export app
ProtonMail Import-Export app for importing and exporting messages. Proton Mail Import-Export app for importing and exporting messages.
To transfer messages, firstly log in using your ProtonMail credentials. To transfer messages, firstly log in using your Proton Mail credentials.
For import, expand your account, and pick the address to which to import For import, expand your account, and pick the address to which to import
messages from IMAP server or local EML or MBOX files. For export, pick messages from IMAP server or local EML or MBOX files. For export, pick
the whole account or only a specific address. Then, in both cases, the whole account or only a specific address. Then, in both cases,
@ -40,9 +40,9 @@ More details [on the public website](https://protonmail.com/import-export).
The Import-Export app is developed in separate branch `master-ie`. The Import-Export app is developed in separate branch `master-ie`.
## Launchers ## Launchers
Launchers are binaries used to run the ProtonMail Bridge or Import-Export apps. Launchers are binaries used to run the Proton Mail Bridge or Import-Export apps.
Official distributions of the ProtonMail Bridge and Import-Export apps contain Official distributions of the Proton Mail Bridge and Import-Export apps contain
both a launcher and the app itself. The launcher is installed in a protected both a launcher and the app itself. The launcher is installed in a protected
area of the system (i.e. an area accessible only with admin privileges) and is area of the system (i.e. an area accessible only with admin privileges) and is
used to run the app. The launcher ensures that nobody tampered with the app's used to run the app. The launcher ensures that nobody tampered with the app's
@ -52,7 +52,7 @@ feature enables the app to securely update itself automatically without asking
the user for a password. 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 Proton Mail Bridge. On Mac or
Windows, Bridge uses native credential managers. On Linux, use `secret-service` freedesktop.org API Windows, Bridge uses native credential managers. On Linux, use `secret-service` freedesktop.org API
(e.g. [Gnome keyring](https://wiki.gnome.org/Projects/GnomeKeyring/)) (e.g. [Gnome keyring](https://wiki.gnome.org/Projects/GnomeKeyring/))
or or

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package main package main
@ -43,8 +43,8 @@ import (
) )
const ( const (
appName = "ProtonMail Bridge" appName = "Proton Mail Bridge"
appUsage = "ProtonMail IMAP and SMTP Bridge" appUsage = "Proton Mail IMAP and SMTP Bridge"
configName = "bridge" configName = "bridge"
updateURLName = "bridge" updateURLName = "bridge"
keychainName = "bridge" keychainName = "bridge"

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package main package main
@ -39,12 +39,12 @@ import (
) )
const ( const (
appName = "ProtonMail Launcher" appName = "Proton Mail Launcher"
configName = "bridge" configName = "bridge"
exeName = "proton-bridge" exeName = "proton-bridge"
) )
func main() { // nolint[funlen] func main() { //nolint:funlen
reporter := sentry.NewReporter(appName, constants.Version, useragent.New()) reporter := sentry.NewReporter(appName, constants.Version, useragent.New())
crashHandler := crash.NewHandler(reporter.ReportException) crashHandler := crash.NewHandler(reporter.ReportException)
@ -98,7 +98,7 @@ func main() { // nolint[funlen]
logrus.WithError(err).Fatal("Failed to determine path to launcher") logrus.WithError(err).Fatal("Failed to determine path to launcher")
} }
cmd := exec.Command(exe, appendLauncherPath(launcher, os.Args[1:])...) // nolint[gosec] cmd := exec.Command(exe, appendLauncherPath(launcher, os.Args[1:])...) //nolint:gosec
cmd.Stdin = os.Stdin cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout

View File

@ -1,8 +1,8 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Version=1.1 Version=1.1
Name=ProtonMail Bridge Name=Proton Mail Bridge
GenericName=ProtonMail Bridge for Linux GenericName=Proton Mail Bridge for Linux
Comment=The Bridge is an application that runs on your computer in the background and seamlessly encrypts and decrypts your mail as it enters and leaves your computer. Comment=The Bridge is an application that runs on your computer in the background and seamlessly encrypts and decrypts your mail as it enters and leaves your computer.
Icon=protonmail-bridge Icon=protonmail-bridge
Exec=protonmail-bridge Exec=protonmail-bridge

View File

@ -51,7 +51,7 @@ PMAPI directly.
graph TD graph TD
C["Client (e.g. Thunderbird)"] C["Client (e.g. Thunderbird)"]
PM[ProtonMail Server] PM[Proton Mail Server]
subgraph "Bridge app" subgraph "Bridge app"
subgraph "Bridge core" subgraph "Bridge core"

103
doc/updates.md Normal file
View File

@ -0,0 +1,103 @@
# Update mechanism of Bridge
There are mulitple options how to change version of application:
* Automatic in-app update
* Manual in-app update
* Manual install
In-app update ends with restarting bridge into new version. Automatic in-app
update is downloading, verifying and installing the new version immediatelly
without user confirmation. For manual in-app update user needs to confirm first.
Update is done from special update file published on website.
The manual installation requires user to download, verify and install manually
using installer for given OS.
The bridge is installed and executed differently for given OS:
* Windows and Linux apps are using launcher mechanism:
* There is system protected installation path which is created on first
install. It contains bridge exe and launcher exe. When users starts
bridge the launcher is executed first. It will check update path compare
version with installed one. The newer version then is then executed.
* Update mechanism means to replace files in update folder which is located
in user space.
* macOS app does not use launcher
* No launcher, only one executable
* In-App udpate replaces the bridge files in installation path directly
```mermaid
flowchart LR
subgraph Frontend
U[User requests<br>version check]
ManIns((Notify user about<br>manual install<br>is needed))
R((Notify user<br>about restart))
ManUp((Notify user about<br>manual update))
NF((Notify user about<br>force update))
ManUp -->|Install| InstFront[Install]
InstFront -->|Ok| R
InstFront -->|Error| ManIns
U --> CheckFront[Check online]
CheckFront -->|Ok| IAFront{Is new version<br>and applicable?}
CheckFront -->|Error| ManIns
IAFront -->|No| Latest((Notify user<br>has latest version))
IAFront -->|Yes| CanInstall{Can update?}
CanInstall -->|No| ManIns
CanInstall -->|Yes| NotifOrInstall{Is automatic<br>update enabled?}
NotifOrInstall -->|Manual| ManUp
end
subgraph Backend
W[Wait for next check]
W --> Check[Check online]
Check --> NV{Has new<br>version?}
Check -->|Error| W
NV -->|No new version| W
IA{Is install<br>applicable?}
NV -->|New version<br>available| IA
IA -->|Local rollout<br>not enough| W
IA -->|Yes| AU{Is automatic\nupdate enabled?}
AU -->|Yes| CanUp{Can update?}
CanUp -->|No| ManIns
CanUp -->|Yes| Ins[Install]
Ins -->|Error| ManIns
Ins -->|Ok| R
AU -->|No| ManUp
ManUp -->|Ignore| W
F[Force update]
F --> NF
end
ManIns --> Web[Open web page]
NF --> Web
ManUp --> Web
R --> Re[Restart]
NF --> Q[Quit bridge]
NotifOrInstall -->|Automatic| W
```
The non-trivial is to combine the update with setting change:
* turn off/on automatic in-app updates
* change from stable to beta or back
_TODO fill flow chart details_
We are not support downgrade functionality. Only some circumstances can lead to
downgrading the app version.
_TODO fill flow chart details_

7
go.mod
View File

@ -43,12 +43,13 @@ require (
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/getsentry/sentry-go v0.12.0 github.com/getsentry/sentry-go v0.12.0
github.com/go-resty/resty/v2 v2.6.0 github.com/go-resty/resty/v2 v2.6.0
github.com/godbus/dbus v4.1.0+incompatible
github.com/golang/mock v1.4.4 github.com/golang/mock v1.4.4
github.com/google/go-cmp v0.5.5 github.com/google/go-cmp v0.5.5
github.com/google/uuid v1.1.1 github.com/google/uuid v1.1.1
github.com/hashicorp/go-multierror v1.1.0 github.com/hashicorp/go-multierror v1.1.0
github.com/jaytaylor/html2text v0.0.0-20200412013138-3577fbdbcff7 github.com/jaytaylor/html2text v0.0.0-20200412013138-3577fbdbcff7
github.com/keybase/go-keychain v0.0.0-20211119201326-e02f34051621 github.com/keybase/go-keychain v0.0.0
github.com/kr/text v0.2.0 // indirect github.com/kr/text v0.2.0 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect
@ -68,7 +69,8 @@ require (
github.com/urfave/cli/v2 v2.2.0 github.com/urfave/cli/v2 v2.2.0
github.com/vmihailenco/msgpack/v5 v5.1.3 github.com/vmihailenco/msgpack/v5 v5.1.3
go.etcd.io/bbolt v1.3.6 go.etcd.io/bbolt v1.3.6
golang.org/x/net v0.0.0-20211008194852-3b03d305991f golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4
golang.org/x/sys v0.0.0-20220111092808-5a964db01320 golang.org/x/sys v0.0.0-20220111092808-5a964db01320
golang.org/x/text v0.3.7 golang.org/x/text v0.3.7
howett.net/plist v1.0.0 // indirect howett.net/plist v1.0.0 // indirect
@ -79,4 +81,5 @@ replace (
github.com/emersion/go-imap => github.com/ProtonMail/go-imap v0.0.0-20201228133358-4db68cea0cac github.com/emersion/go-imap => github.com/ProtonMail/go-imap v0.0.0-20201228133358-4db68cea0cac
github.com/emersion/go-message => github.com/ProtonMail/go-message v0.0.0-20210611055058-fabeff2ec753 github.com/emersion/go-message => github.com/ProtonMail/go-message v0.0.0-20210611055058-fabeff2ec753
github.com/jameskeane/bcrypt => github.com/ProtonMail/bcrypt v0.0.0-20210511135022-227b4adcab57 github.com/jameskeane/bcrypt => github.com/ProtonMail/bcrypt v0.0.0-20210511135022-227b4adcab57
github.com/keybase/go-keychain => github.com/cuthix/go-keychain v0.0.0-20220405075754-31e7cee908fe
) )

11
go.sum
View File

@ -102,6 +102,8 @@ github.com/cucumber/godog v0.12.1/go.mod h1:u6SD7IXC49dLpPN35kal0oYEjsXZWee4pW6T
github.com/cucumber/messages-go/v16 v16.0.0/go.mod h1:EJcyR5Mm5ZuDsKJnT2N9KRnBK30BGjtYotDKpwQ0v6g= github.com/cucumber/messages-go/v16 v16.0.0/go.mod h1:EJcyR5Mm5ZuDsKJnT2N9KRnBK30BGjtYotDKpwQ0v6g=
github.com/cucumber/messages-go/v16 v16.0.1 h1:fvkpwsLgnIm0qugftrw2YwNlio+ABe2Iu94Ap8GMYIY= github.com/cucumber/messages-go/v16 v16.0.1 h1:fvkpwsLgnIm0qugftrw2YwNlio+ABe2Iu94Ap8GMYIY=
github.com/cucumber/messages-go/v16 v16.0.1/go.mod h1:EJcyR5Mm5ZuDsKJnT2N9KRnBK30BGjtYotDKpwQ0v6g= github.com/cucumber/messages-go/v16 v16.0.1/go.mod h1:EJcyR5Mm5ZuDsKJnT2N9KRnBK30BGjtYotDKpwQ0v6g=
github.com/cuthix/go-keychain v0.0.0-20220405075754-31e7cee908fe h1:KRj3wdvA9yE92prNmOjS7x5DOqoyjxqdE30qnrmTasc=
github.com/cuthix/go-keychain v0.0.0-20220405075754-31e7cee908fe/go.mod h1:ZoZU1fnBy3mOLWr3Pg+Y2+nTKtu6ypDte2kZg9HvSwY=
github.com/danieljoos/wincred v1.1.0 h1:3RNcEpBg4IhIChZdFRSdlQt1QjCp1sMAPIrOnm7Yf8g= github.com/danieljoos/wincred v1.1.0 h1:3RNcEpBg4IhIChZdFRSdlQt1QjCp1sMAPIrOnm7Yf8g=
github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg= github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -164,6 +166,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
github.com/godbus/dbus v4.1.0+incompatible h1:WqqLRTsQic3apZUK9qC5sGNfXthmPXzUZ7nQPrNITa4=
github.com/godbus/dbus v4.1.0+incompatible/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
@ -467,6 +471,8 @@ golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA=
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@ -514,6 +520,9 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20211008194852-3b03d305991f h1:1scJEYZBaF48BaG6tYbtxmLcXqwYGSfGcMoStTqkkIw= golang.org/x/net v0.0.0-20211008194852-3b03d305991f h1:1scJEYZBaF48BaG6tYbtxmLcXqwYGSfGcMoStTqkkIw=
golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA=
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@ -567,6 +576,8 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220111092808-5a964db01320 h1:0jf+tOCoZ3LyutmCOWpVni1chK4VfFLhRsDK7MhqGRY= golang.org/x/sys v0.0.0-20220111092808-5a964db01320 h1:0jf+tOCoZ3LyutmCOWpVni1chK4VfFLhRsDK7MhqGRY=
golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package api provides HTTP API of the Bridge. // Package api provides HTTP API of the Bridge.
// //
@ -34,7 +34,7 @@ import (
) )
var ( var (
log = logrus.WithField("pkg", "api") //nolint[gochecknoglobals] log = logrus.WithField("pkg", "api") //nolint:gochecknoglobals
) )
type apiServer struct { type apiServer struct {
@ -44,7 +44,7 @@ type apiServer struct {
} }
// NewAPIServer returns prepared API server struct. // NewAPIServer returns prepared API server struct.
func NewAPIServer(settings *settings.Settings, eventListener listener.Listener) *apiServer { //nolint[golint] func NewAPIServer(settings *settings.Settings, eventListener listener.Listener) *apiServer { //nolint:revive
return &apiServer{ return &apiServer{
host: bridge.Host, host: bridge.Host,
settings: settings, settings: settings,
@ -68,7 +68,7 @@ func (api *apiServer) ListenAndServe() {
api.eventListener.Emit(events.ErrorEvent, "API failed: "+err.Error()) api.eventListener.Emit(events.ErrorEvent, "API failed: "+err.Error())
log.Error("API failed: ", err) log.Error("API failed: ", err)
} }
defer server.Close() //nolint[errcheck] defer server.Close() //nolint:errcheck
} }
func (api *apiServer) getAddress() string { func (api *apiServer) getAddress() string {

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package api package api

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package api package api
@ -42,7 +42,7 @@ func CheckOtherInstanceAndFocus(port int) error {
if err != nil { if err != nil {
return err return err
} }
defer resp.Body.Close() //nolint[errcheck] defer resp.Body.Close() //nolint:errcheck
if resp.StatusCode != 200 { if resp.StatusCode != 200 {
log.Error("Focus error: ", resp.StatusCode) log.Error("Focus error: ", resp.StatusCode)

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package base package base

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package base implements a common application base currently shared by bridge and IE. // Package base implements a common application base currently shared by bridge and IE.
// The base includes the following: // The base includes the following:
@ -102,7 +102,7 @@ type Base struct {
teardown []func() error // actions to perform when app is exiting teardown []func() error // actions to perform when app is exiting
} }
func New( // nolint[funlen] func New( //nolint:funlen
appName, appName,
appUsage, appUsage,
configName, configName,
@ -159,6 +159,10 @@ func New( // nolint[funlen]
return nil, api.CheckOtherInstanceAndFocus(settingsObj.GetInt(settings.APIPortKey)) return nil, api.CheckOtherInstanceAndFocus(settingsObj.GetInt(settings.APIPortKey))
} }
if err := migrateRebranding(settingsObj, keychainName); err != nil {
logrus.WithError(err).Warn("Rebranding migration failed")
}
cachePath, err := locations.ProvideCachePath() cachePath, err := locations.ProvideCachePath()
if err != nil { if err != nil {
return nil, err return nil, err
@ -192,8 +196,8 @@ func New( // nolint[funlen]
sentryReporter.SetClientFromManager(cm) sentryReporter.SetClientFromManager(cm)
cm.AddConnectionObserver(pmapi.NewConnectionObserver( cm.AddConnectionObserver(pmapi.NewConnectionObserver(
func() { listener.Emit(events.InternetOffEvent, "") }, func() { listener.Emit(events.InternetConnChangedEvent, events.InternetOff) },
func() { listener.Emit(events.InternetOnEvent, "") }, func() { listener.Emit(events.InternetConnChangedEvent, events.InternetOn) },
)) ))
jar, err := cookies.NewCookieJar(settingsObj) jar, err := cookies.NewCookieJar(settingsObj)
@ -236,7 +240,7 @@ func New( // nolint[funlen]
} }
autostart := &autostart.App{ autostart := &autostart.App{
Name: appName, Name: startupNameForRebranding(appName),
DisplayName: appName, DisplayName: appName,
Exec: []string{exe, "--" + FlagNoWindow}, Exec: []string{exe, "--" + FlagNoWindow},
} }
@ -324,7 +328,7 @@ func (b *Base) AddTeardownAction(fn func() error) {
b.teardown = append(b.teardown, fn) b.teardown = append(b.teardown, fn)
} }
func (b *Base) wrapMainLoop(appMainLoop func(*Base, *cli.Context) error) cli.ActionFunc { // nolint[funlen] func (b *Base) wrapMainLoop(appMainLoop func(*Base, *cli.Context) error) cli.ActionFunc { //nolint:funlen
return func(c *cli.Context) error { return func(c *cli.Context) error {
defer b.CrashHandler.HandlePanic() defer b.CrashHandler.HandlePanic()
defer func() { _ = b.Lock.Close() }() defer func() { _ = b.Lock.Close() }()

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package base package base
@ -50,7 +50,7 @@ func migrateFiles(configName string) error {
if err := migrateCacheFromBoth15xAnd16x(locations, userCacheDir); err != nil { if err := migrateCacheFromBoth15xAnd16x(locations, userCacheDir); err != nil {
return err return err
} }
if err := migrateUpdatesFrom16x(configName, locations); err != nil { //nolint[revive] It is more clear to structure this way if err := migrateUpdatesFrom16x(configName, locations); err != nil { //nolint:revive It is more clear to structure this way
return err return err
} }
return nil return nil

View File

@ -0,0 +1,197 @@
// Copyright (c) 2022 Proton AG
//
// This file is part of Proton Mail Bridge.
//
// Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package base
import (
"errors"
"os"
"path/filepath"
"runtime"
"strings"
"github.com/ProtonMail/proton-bridge/internal/config/settings"
"github.com/ProtonMail/proton-bridge/pkg/keychain"
"github.com/hashicorp/go-multierror"
"github.com/sirupsen/logrus"
)
const darwin = "darwin"
func migrateRebranding(settingsObj *settings.Settings, keychainName string) (result error) {
if err := migrateStartupBeforeRebranding(); err != nil {
result = multierror.Append(result, err)
}
lastUsedVersion := settingsObj.Get(settings.LastVersionKey)
// Skipping migration: it is first bridge start or cache was cleared.
if lastUsedVersion == "" {
settingsObj.SetBool(settings.RebrandingMigrationKey, true)
return
}
// Skipping rest of migration: already done
if settingsObj.GetBool(settings.RebrandingMigrationKey) {
return
}
switch runtime.GOOS {
case "windows", "linux":
// GODT-1260 we would need admin rights to changes desktop files
// and start menu items.
settingsObj.SetBool(settings.RebrandingMigrationKey, true)
case darwin:
if shouldContinue, err := isMacBeforeRebranding(); !shouldContinue || err != nil {
if err != nil {
result = multierror.Append(result, err)
}
break
}
if err := migrateMacKeychainBeforeRebranding(settingsObj, keychainName); err != nil {
result = multierror.Append(result, err)
}
settingsObj.SetBool(settings.RebrandingMigrationKey, true)
}
return result
}
// migrateMacKeychainBeforeRebranding deals with write access restriction to
// mac keychain passwords which are caused by application renaming. The old
// passwords are copied under new name in order to have write access afer
// renaming.
func migrateMacKeychainBeforeRebranding(settingsObj *settings.Settings, keychainName string) error {
l := logrus.WithField("pkg", "app/base/migration")
l.Warn("Migrating mac keychain")
helperConstructor, ok := keychain.Helpers["macos-keychain"]
if !ok {
return errors.New("cannot find macos-keychain helper")
}
oldKC, err := helperConstructor("ProtonMailBridgeService")
if err != nil {
l.WithError(err).Error("Keychain constructor failed")
return err
}
idByURL, err := oldKC.List()
if err != nil {
l.WithError(err).Error("List old keychain failed")
return err
}
newKC, err := keychain.NewKeychain(settingsObj, keychainName)
if err != nil {
return err
}
for url, id := range idByURL {
li := l.WithField("id", id).WithField("url", url)
userID, secret, err := oldKC.Get(url)
if err != nil {
li.WithField("userID", userID).
WithField("err", err).
Error("Faild to get old item")
continue
}
if _, _, err := newKC.Get(userID); err == nil {
li.Warn("Skipping migration, item already exists.")
continue
}
if err := newKC.Put(userID, secret); err != nil {
li.WithError(err).Error("Failed to migrate user")
}
li.Info("Item migrated")
}
return nil
}
// migrateStartupBeforeRebranding removes old startup links. The creation of new links is
// handled by bridge initialisation.
func migrateStartupBeforeRebranding() error {
path, err := os.UserHomeDir()
if err != nil {
return err
}
switch runtime.GOOS {
case "windows":
path = filepath.Join(path, `AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ProtonMail Bridge.lnk`)
case "linux":
path = filepath.Join(path, `.config/autostart/ProtonMail Bridge.desktop`)
case darwin:
path = filepath.Join(path, `Library/LaunchAgents/ProtonMail Bridge.plist`)
default:
return errors.New("unknown GOOS")
}
if _, err := os.Stat(path); os.IsNotExist(err) {
return nil
}
logrus.WithField("pkg", "app/base/migration").Warn("Migrating autostartup links")
return os.Remove(path)
}
// startupNameForRebranding returns the name for autostart launcher based on
// type of rebranded instance i.e. update or manual.
//
// This only affects darwin when udpate re-writes the old startup and then
// manual installed it would not run proper exe. Therefore we return "old" name
// for updates and "new" name for manual which would be properly migrated.
//
// For orther (linux and windows) the link is always pointing to launcher which
// path didn't changed.
func startupNameForRebranding(origin string) string {
if runtime.GOOS == darwin {
if path, err := os.Executable(); err == nil && strings.Contains(path, "ProtonMail Bridge") {
return "ProtonMail Bridge"
}
}
// No need to solve for other OS. See comment above.
return origin
}
// isBeforeRebranding decide if last used version was older than 2.2.0. If
// cannot decide it returns false with error.
func isMacBeforeRebranding() (bool, error) {
// previous version | update | do mac migration |
// | first | false |
// cleared-cache | manual | false |
// cleared-cache | in-app | false |
// old | in-app | false |
// old in-app | in-app | false |
// old | manual | true |
// old in-app | manual | true |
// manual | in-app | false |
// Skip if it was in-app update and not manual
if path, err := os.Executable(); err != nil || strings.Contains(path, "ProtonMail Bridge") {
return false, err
}
return true, nil
}

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package base package base

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package base package base
@ -43,7 +43,7 @@ func (b *Base) restartApp(crash bool) error {
WithField("args", args). WithField("args", args).
Warn("Restarting") Warn("Restarting")
return exec.Command(b.command, args...).Start() // nolint[gosec] return exec.Command(b.command, args...).Start() //nolint:gosec
} }
// incrementRestartFlag increments the value of the restart flag. // incrementRestartFlag increments the value of the restart flag.

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package base package base

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package bridge implements the bridge CLI application. // Package bridge implements the bridge CLI application.
package bridge package bridge
@ -69,7 +69,7 @@ func New(base *base.Base) *cli.App {
return app return app
} }
func mailLoop(b *base.Base, c *cli.Context) error { // nolint[funlen] func mailLoop(b *base.Base, c *cli.Context) error { //nolint:funlen
tlsConfig, err := loadTLSConfig(b) tlsConfig, err := loadTLSConfig(b)
if err != nil { if err != nil {
return err return err

View File

@ -1,31 +1,38 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package bridge provides core functionality of Bridge app. // Package bridge provides core functionality of Bridge app.
package bridge package bridge
import "github.com/ProtonMail/proton-bridge/internal/config/settings"
// IsAutostartEnabled checks if link file exits.
func (b *Bridge) IsAutostartEnabled() bool { func (b *Bridge) IsAutostartEnabled() bool {
return b.autostart.IsEnabled() return b.autostart.IsEnabled()
} }
// EnableAutostart creates link and sets the preferences.
func (b *Bridge) EnableAutostart() error { func (b *Bridge) EnableAutostart() error {
b.settings.SetBool(settings.AutostartKey, true)
return b.autostart.Enable() return b.autostart.Enable()
} }
// DisableAutostart removes link and sets the preferences.
func (b *Bridge) DisableAutostart() error { func (b *Bridge) DisableAutostart() error {
b.settings.SetBool(settings.AutostartKey, false)
return b.autostart.Disable() return b.autostart.Disable()
} }

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package bridge provides core functionality of Bridge app. // Package bridge provides core functionality of Bridge app.
package bridge package bridge
@ -40,7 +40,7 @@ import (
logrus "github.com/sirupsen/logrus" logrus "github.com/sirupsen/logrus"
) )
var log = logrus.WithField("pkg", "bridge") //nolint[gochecknoglobals] var log = logrus.WithField("pkg", "bridge") //nolint:gochecknoglobals
var ErrLocalCacheUnavailable = errors.New("local cache is unavailable") var ErrLocalCacheUnavailable = errors.New("local cache is unavailable")

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package bridge package bridge
@ -153,7 +153,7 @@ func zipFiles(filenames []string) (io.Reader, error) {
buf := NewLimitedBuffer(MaxAttachmentSize) buf := NewLimitedBuffer(MaxAttachmentSize)
w := zip.NewWriter(buf) w := zip.NewWriter(buf)
defer w.Close() //nolint[errcheck] defer w.Close() //nolint:errcheck
for _, file := range filenames { for _, file := range filenames {
err := addFileToZip(file, w) err := addFileToZip(file, w)
@ -174,7 +174,7 @@ func addFileToZip(filename string, writer *zip.Writer) error {
if err != nil { if err != nil {
return err return err
} }
defer fileReader.Close() //nolint[errcheck] defer fileReader.Close() //nolint:errcheck,gosec
fileInfo, err := fileReader.Stat() fileInfo, err := fileReader.Stat()
if err != nil { if err != nil {

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package bridge package bridge

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Code generated by ./release-notes.sh at 'Fri Jan 22 11:01:06 AM CET 2021'. DO NOT EDIT. // Code generated by ./release-notes.sh at 'Fri Jan 22 11:01:06 AM CET 2021'. DO NOT EDIT.

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package bridge package bridge

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package bridge package bridge

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package cache provides access to contents inside a cache directory. // Package cache provides access to contents inside a cache directory.
package cache package cache

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package cache package cache

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package settings package settings
@ -61,7 +61,7 @@ func (p *keyValueStore) load() error {
if err != nil { if err != nil {
return err return err
} }
defer f.Close() //nolint[errcheck] defer f.Close() //nolint:errcheck,gosec
return json.NewDecoder(f).Decode(&p.cache) return json.NewDecoder(f).Decode(&p.cache)
} }

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package settings package settings

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package settings provides access to persistent user settings. // Package settings provides access to persistent user settings.
package settings package settings
@ -54,6 +54,7 @@ const (
FetchWorkers = "fetch_workers" FetchWorkers = "fetch_workers"
AttachmentWorkers = "attachment_workers" AttachmentWorkers = "attachment_workers"
ColorScheme = "color_scheme" ColorScheme = "color_scheme"
RebrandingMigrationKey = "rebranding_migrated"
) )
type Settings struct { type Settings struct {
@ -89,7 +90,7 @@ func (s *Settings) setDefaultValues() {
s.setDefault(ReportOutgoingNoEncKey, "false") s.setDefault(ReportOutgoingNoEncKey, "false")
s.setDefault(LastVersionKey, "") s.setDefault(LastVersionKey, "")
s.setDefault(UpdateChannelKey, "") s.setDefault(UpdateChannelKey, "")
s.setDefault(RolloutKey, fmt.Sprintf("%v", rand.Float64())) //nolint[gosec] G404 It is OK to use weak random number generator here s.setDefault(RolloutKey, fmt.Sprintf("%v", rand.Float64())) //nolint:gosec // G404 It is OK to use weak random number generator here
s.setDefault(PreferredKeychainKey, "") s.setDefault(PreferredKeychainKey, "")
s.setDefault(CacheEnabledKey, "true") s.setDefault(CacheEnabledKey, "true")
s.setDefault(CacheCompressionKey, "true") s.setDefault(CacheCompressionKey, "true")

View File

@ -1,26 +1,26 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package tls package tls
import "os/exec" import "os/exec"
func addTrustedCert(certPath string) error { func addTrustedCert(certPath string) error {
return exec.Command( // nolint[gosec] return exec.Command( //nolint:gosec
"/usr/bin/security", "/usr/bin/security",
"execute-with-privileges", "execute-with-privileges",
"/usr/bin/security", "/usr/bin/security",
@ -34,7 +34,7 @@ func addTrustedCert(certPath string) error {
} }
func removeTrustedCert(certPath string) error { func removeTrustedCert(certPath string) error {
return exec.Command( // nolint[gosec] return exec.Command( //nolint:gosec
"/usr/bin/security", "/usr/bin/security",
"execute-with-privileges", "execute-with-privileges",
"/usr/bin/security", "/usr/bin/security",

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package tls package tls

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package tls package tls

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package tls package tls
@ -55,8 +55,8 @@ func NewTLSTemplate() (*x509.Certificate, error) {
SerialNumber: serialNumber, SerialNumber: serialNumber,
Subject: pkix.Name{ Subject: pkix.Name{
Country: []string{"CH"}, Country: []string{"CH"},
Organization: []string{"Proton Technologies AG"}, Organization: []string{"Proton AG"},
OrganizationalUnit: []string{"ProtonMail"}, OrganizationalUnit: []string{"Proton Mail"},
CommonName: "127.0.0.1", CommonName: "127.0.0.1",
}, },
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
@ -110,7 +110,7 @@ func (t *TLS) GenerateCerts(template *x509.Certificate) error {
if err != nil { if err != nil {
return err return err
} }
defer certOut.Close() // nolint[errcheck] defer certOut.Close() //nolint:errcheck,gosec
if err := pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}); err != nil { if err := pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}); err != nil {
return err return err
@ -120,7 +120,7 @@ func (t *TLS) GenerateCerts(template *x509.Certificate) error {
if err != nil { if err != nil {
return err return err
} }
defer keyOut.Close() // nolint[errcheck] defer keyOut.Close() //nolint:errcheck,gosec
return pem.Encode(keyOut, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)}) return pem.Encode(keyOut, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)})
} }
@ -144,7 +144,7 @@ func (t *TLS) GetConfig() (*tls.Config, error) {
caCertPool := x509.NewCertPool() caCertPool := x509.NewCertPool()
caCertPool.AddCert(c.Leaf) caCertPool.AddCert(c.Leaf)
// nolint[gosec]: We need to support older TLS versions for AppleMail and Outlook. //nolint:gosec // We need to support older TLS versions for AppleMail and Outlook
return &tls.Config{ return &tls.Config{
Certificates: []tls.Certificate{c}, Certificates: []tls.Certificate{c},
ServerName: "127.0.0.1", ServerName: "127.0.0.1",

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package tls package tls

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package useragent package useragent

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package useragent package useragent

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package useragent package useragent

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package useragent package useragent

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge.Bridge. // This file is part of Proton Mail Bridge.Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package constants contains variables that are set via ldflags during build. // Package constants contains variables that are set via ldflags during build.
package constants package constants
@ -22,7 +22,7 @@ import "fmt"
const VendorName = "protonmail" const VendorName = "protonmail"
// nolint[gochecknoglobals] //nolint:gochecknoglobals
var ( var (
// Version of the build. // Version of the build.
Version = "" Version = ""

View File

@ -1,28 +1,29 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
//go:build !build_qa
// +build !build_qa // +build !build_qa
package constants package constants
import "time" import "time"
// nolint[gochecknoglobals] //nolint:gochecknoglobals
var ( var (
// UpdateCheckInterval defines how often we check for new version // UpdateCheckInterval defines how often we check for new version.
UpdateCheckInterval = time.Hour //nolint[gochecknoglobals] UpdateCheckInterval = time.Hour //nolint:gochecknoglobals
) )

View File

@ -1,27 +1,28 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
//go:build build_qa
// +build build_qa // +build build_qa
package constants package constants
import "time" import "time"
// nolint[gochecknoglobals] //nolint:gochecknoglobals
var ( var (
// UpdateCheckInterval defines how often we check for new version // UpdateCheckInterval defines how often we check for new version
UpdateCheckInterval = time.Duration(5 * time.Minute) UpdateCheckInterval = time.Duration(5 * time.Minute)

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package cookies implements a persistent cookie jar which satisfies the http.CookieJar interface. // Package cookies implements a persistent cookie jar which satisfies the http.CookieJar interface.
package cookies package cookies

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package cookies package cookies

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package crash package crash

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package crash implements a crash handler with configurable recovery actions. // Package crash implements a crash handler with configurable recovery actions.
package crash package crash

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package crash package crash

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package events provides names of events used by the event listener in bridge. // Package events provides names of events used by the event listener in bridge.
package events package events
@ -34,8 +34,9 @@ const (
AddressChangedLogoutEvent = "addressChangedLogout" AddressChangedLogoutEvent = "addressChangedLogout"
UserRefreshEvent = "userRefresh" UserRefreshEvent = "userRefresh"
RestartBridgeEvent = "restartBridge" RestartBridgeEvent = "restartBridge"
InternetOffEvent = "internetOff" InternetConnChangedEvent = "internetChanged"
InternetOnEvent = "internetOn" InternetOff = "internetOff"
InternetOn = "internetOn"
SecondInstanceEvent = "secondInstance" SecondInstanceEvent = "secondInstance"
OutgoingNoEncEvent = "outgoingNoEncryption" OutgoingNoEncEvent = "outgoingNoEncryption"
NoActiveKeyForRecipientEvent = "noActiveKeyForRecipient" NoActiveKeyForRecipientEvent = "noActiveKeyForRecipient"
@ -52,7 +53,7 @@ func SetupEvents(listener listener.Listener) {
listener.SetLimit(LogoutEvent, LogoutEventTimeout) listener.SetLimit(LogoutEvent, LogoutEventTimeout)
listener.SetBuffer(ErrorEvent) listener.SetBuffer(ErrorEvent)
listener.SetBuffer(CredentialsErrorEvent) listener.SetBuffer(CredentialsErrorEvent)
listener.SetBuffer(InternetOffEvent) listener.SetBuffer(InternetConnChangedEvent)
listener.SetBuffer(UpgradeApplicationEvent) listener.SetBuffer(UpgradeApplicationEvent)
listener.SetBuffer(TLSCertIssue) listener.SetBuffer(TLSCertIssue)
listener.SetBuffer(UserRefreshEvent) listener.SetBuffer(UserRefreshEvent)

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package cli package cli

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package cli package cli
@ -88,7 +88,7 @@ func (f *frontendCLI) showAccountAddressInfo(user types.User, address string) {
f.Println("") f.Println("")
} }
func (f *frontendCLI) loginAccount(c *ishell.Context) { // nolint[funlen] func (f *frontendCLI) loginAccount(c *ishell.Context) { //nolint:funlen
f.ShowPrompt(false) f.ShowPrompt(false)
defer f.ShowPrompt(true) defer f.ShowPrompt(true)

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package cli provides CLI interface of the Bridge. // Package cli provides CLI interface of the Bridge.
package cli package cli
@ -31,7 +31,7 @@ import (
) )
var ( var (
log = logrus.WithField("pkg", "frontend/cli") //nolint[gochecknoglobals] log = logrus.WithField("pkg", "frontend/cli") //nolint:gochecknoglobals
) )
type frontendCLI struct { type frontendCLI struct {
@ -47,7 +47,7 @@ type frontendCLI struct {
} }
// New returns a new CLI frontend configured with the given options. // New returns a new CLI frontend configured with the given options.
func New( //nolint[funlen] func New( //nolint:funlen
panicHandler types.PanicHandler, panicHandler types.PanicHandler,
locations *locations.Locations, locations *locations.Locations,
@ -56,7 +56,7 @@ func New( //nolint[funlen]
updater types.Updater, updater types.Updater,
bridge types.Bridger, bridge types.Bridger,
restarter types.Restarter, restarter types.Restarter,
) *frontendCLI { //nolint[golint] ) *frontendCLI { //nolint:revive
fe := &frontendCLI{ fe := &frontendCLI{
Shell: ishell.New(), Shell: ishell.New(),
@ -244,8 +244,7 @@ func New( //nolint[funlen]
func (f *frontendCLI) watchEvents() { func (f *frontendCLI) watchEvents() {
errorCh := f.eventListener.ProvideChannel(events.ErrorEvent) errorCh := f.eventListener.ProvideChannel(events.ErrorEvent)
credentialsErrorCh := f.eventListener.ProvideChannel(events.CredentialsErrorEvent) credentialsErrorCh := f.eventListener.ProvideChannel(events.CredentialsErrorEvent)
internetOffCh := f.eventListener.ProvideChannel(events.InternetOffEvent) internetConnChangedCh := f.eventListener.ProvideChannel(events.InternetConnChangedEvent)
internetOnCh := f.eventListener.ProvideChannel(events.InternetOnEvent)
addressChangedCh := f.eventListener.ProvideChannel(events.AddressChangedEvent) addressChangedCh := f.eventListener.ProvideChannel(events.AddressChangedEvent)
addressChangedLogoutCh := f.eventListener.ProvideChannel(events.AddressChangedLogoutEvent) addressChangedLogoutCh := f.eventListener.ProvideChannel(events.AddressChangedLogoutEvent)
logoutCh := f.eventListener.ProvideChannel(events.LogoutEvent) logoutCh := f.eventListener.ProvideChannel(events.LogoutEvent)
@ -256,10 +255,13 @@ func (f *frontendCLI) watchEvents() {
f.Println("Bridge failed:", errorDetails) f.Println("Bridge failed:", errorDetails)
case <-credentialsErrorCh: case <-credentialsErrorCh:
f.notifyCredentialsError() f.notifyCredentialsError()
case <-internetOffCh: case stat := <-internetConnChangedCh:
f.notifyInternetOff() if stat == events.InternetOff {
case <-internetOnCh: f.notifyInternetOff()
f.notifyInternetOn() }
if stat == events.InternetOn {
f.notifyInternetOn()
}
case address := <-addressChangedCh: case address := <-addressChangedCh:
f.Printf("Address changed for %s. You may need to reconfigure your email client.", address) f.Printf("Address changed for %s. You may need to reconfigure your email client.", address)
case address := <-addressChangedLogoutCh: case address := <-addressChangedLogoutCh:
@ -279,7 +281,7 @@ func (f *frontendCLI) watchEvents() {
// Loop starts the frontend loop with an interactive shell. // Loop starts the frontend loop with an interactive shell.
func (f *frontendCLI) Loop() error { func (f *frontendCLI) Loop() error {
f.Print(` f.Print(`
Welcome to ProtonMail Bridge interactive shell Welcome to Proton Mail Bridge interactive shell
___....___ ___....___
^^ __..-:'':__:..:__:'':-..__ ^^ __..-:'':__:..:__:'':-..__
_.-:__:.-:'': : : :'':-.:__:-._ _.-:__:.-:'': : : :'':-.:__:-._

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package cli package cli
@ -29,7 +29,7 @@ import (
) )
var ( var (
currentPort = "" //nolint[gochecknoglobals] currentPort = "" //nolint:gochecknoglobals
) )
func (f *frontendCLI) restart(c *ishell.Context) { func (f *frontendCLI) restart(c *ishell.Context) {

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package cli package cli

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package cli package cli
@ -29,7 +29,7 @@ const (
) )
var ( var (
bold = color.New(color.Bold).SprintFunc() //nolint[gochecknoglobals] bold = color.New(color.Bold).SprintFunc() //nolint:gochecknoglobals
) )
func isNotEmpty(val string) bool { func isNotEmpty(val string) bool {
@ -103,7 +103,7 @@ func (f *frontendCLI) notifyNeedUpgrade() {
func (f *frontendCLI) notifyCredentialsError() { 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("Proton Mail Bridge is not able to detect a supported password manager")
f.Println("(secret-service or pass). 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.")
} }
@ -114,15 +114,15 @@ func (f *frontendCLI) notifyCertIssue() {
be insecure. be insecure.
Description: Description:
ProtonMail Bridge was not able to establish a secure connection to Proton Proton Mail Bridge was not able to establish a secure connection to Proton
servers due to a TLS certificate error. This means your connection may servers due to a TLS certificate error. This means your connection may
potentially be insecure and susceptible to monitoring by third parties. potentially be insecure and susceptible to monitoring by third parties.
Recommendation: Recommendation:
* If you trust your network operator, you can continue to use ProtonMail * If you trust your network operator, you can continue to use Proton Mail
as usual. as usual.
* If you don't trust your network operator, reconnect to ProtonMail over a VPN * If you don't trust your network operator, reconnect to Proton Mail over a VPN
(such as ProtonVPN) which encrypts your Internet connection, or use (such as ProtonVPN) which encrypts your Internet connection, or use
a different network to access ProtonMail. a different network to access Proton Mail.
`) `)
} }

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package clientconfig provides automatic config of IMAP and SMTP. // Package clientconfig provides automatic config of IMAP and SMTP.
// For now only for Apple Mail. // For now only for Apple Mail.
@ -34,7 +34,7 @@ type AutoConfig interface {
} }
var ( var (
available = map[string]AutoConfig{} //nolint[gochecknoglobals] available = map[string]AutoConfig{} //nolint:gochecknoglobals
ErrNotAvailable = errors.New("configuration not available") ErrNotAvailable = errors.New("configuration not available")
) )

View File

@ -1,20 +1,21 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
//go:build darwin
// +build darwin // +build darwin
package clientconfig package clientconfig
@ -38,7 +39,7 @@ const (
bigSurPreferncesPane = "/System/Library/PreferencePanes/Profiles.prefPane" bigSurPreferncesPane = "/System/Library/PreferencePanes/Profiles.prefPane"
) )
func init() { //nolint[gochecknoinit] func init() { //nolint:gochecknoinit
available[AppleMailClient] = &appleMail{} available[AppleMailClient] = &appleMail{}
} }
@ -55,10 +56,10 @@ func (c *appleMail) Configure(imapPort, smtpPort int, imapSSL, smtpSSL bool, use
} }
if useragent.IsBigSurOrNewer() { if useragent.IsBigSurOrNewer() {
return exec.Command("open", bigSurPreferncesPane, confPath).Run() //nolint[gosec] G204: open command is safe, mobileconfig is generated by us return exec.Command("open", bigSurPreferncesPane, confPath).Run() //nolint:gosec G204: open command is safe, mobileconfig is generated by us
} }
return exec.Command("open", confPath).Run() //nolint[gosec] G204: open command is safe, mobileconfig is generated by us return exec.Command("open", confPath).Run() //nolint:gosec G204: open command is safe, mobileconfig is generated by us
} }
func prepareMobileConfig(imapPort, smtpPort int, imapSSL, smtpSSL bool, user types.User, address string) *mobileconfig.Config { func prepareMobileConfig(imapPort, smtpPort int, imapSSL, smtpSSL bool, user types.User, address string) *mobileconfig.Config {

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
// Package frontend provides all interfaces of the Bridge. // Package frontend provides all interfaces of the Bridge.
package frontend package frontend

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
@ -27,7 +27,7 @@ Item {
property ColorScheme colorScheme property ColorScheme colorScheme
property var user property var user
property var _spacing: 12 property var _spacing: 12 * ProtonStyle.px
property color usedSpaceColor : { property color usedSpaceColor : {
if (!root.enabled) return root.colorScheme.text_weak if (!root.enabled) return root.colorScheme.text_weak
@ -86,7 +86,7 @@ Item {
Layout.fillHeight: true Layout.fillHeight: true
Layout.preferredWidth: height Layout.preferredWidth: height
radius: 4 radius: ProtonStyle.avatar_radius
color: root.colorScheme.background_avatar color: root.colorScheme.background_avatar
@ -130,7 +130,7 @@ Item {
elide: Text.ElideMiddle elide: Text.ElideMiddle
} }
Item { implicitHeight: root.type == AccountDelegate.LargeView ? 6 : 0 } Item { implicitHeight: root.type == AccountDelegate.LargeView ? 6 * ProtonStyle.px : 0 }
RowLayout { RowLayout {
spacing: 0 spacing: 0
@ -161,14 +161,16 @@ Item {
Rectangle { Rectangle {
id: storage_bar
visible: root.user ? root.type == AccountDelegate.LargeView : false visible: root.user ? root.type == AccountDelegate.LargeView : false
width: 140 width: 140 * ProtonStyle.px
height: 4 height: 4 * ProtonStyle.px
radius: 3 radius: ProtonStyle.storage_bar_radius
color: root.colorScheme.border_weak color: root.colorScheme.border_weak
Rectangle { Rectangle {
radius: 3 id: storage_bar_filled
radius: ProtonStyle.storage_bar_radius
color: root.usedSpaceColor color: root.usedSpaceColor
visible: root.user ? parent.visible && root.user.loggedIn : false visible: root.user ? parent.visible && root.user.loggedIn : false
anchors { anchors {

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
@ -163,6 +163,7 @@ Item {
if (!splitMode.checked){ if (!splitMode.checked){
root.notifications.askEnableSplitMode(user) root.notifications.askEnableSplitMode(user)
} else { } else {
addressSelector.currentIndex = 0
root.user.toggleSplitMode(!splitMode.checked) root.user.toggleSplitMode(!splitMode.checked)
} }
} }

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
@ -73,20 +73,20 @@ Popup {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
width: parent.width + 10 width: parent.width + 10
radius: 10 radius: ProtonStyle.banner_radius
color: { color: {
if (!root.notification) { if (!root.notification) {
return "transparent" return "transparent"
} }
switch (root.notification.type) { switch (root.notification.type) {
case Notification.NotificationType.Info: case Notification.NotificationType.Info:
return root.colorScheme.signal_info return root.colorScheme.signal_info
case Notification.NotificationType.Success: case Notification.NotificationType.Success:
return root.colorScheme.signal_success return root.colorScheme.signal_success
case Notification.NotificationType.Warning: case Notification.NotificationType.Warning:
return root.colorScheme.signal_warning return root.colorScheme.signal_warning
case Notification.NotificationType.Danger: case Notification.NotificationType.Danger:
return root.colorScheme.signal_danger return root.colorScheme.signal_danger
} }
} }
@ -118,13 +118,13 @@ Popup {
} }
switch (root.notification.type) { switch (root.notification.type) {
case Notification.NotificationType.Info: case Notification.NotificationType.Info:
return "./icons/ic-info-circle-filled.svg" return "./icons/ic-info-circle-filled.svg"
case Notification.NotificationType.Success: case Notification.NotificationType.Success:
return "./icons/ic-info-circle-filled.svg" return "./icons/ic-info-circle-filled.svg"
case Notification.NotificationType.Warning: case Notification.NotificationType.Warning:
return "./icons/ic-exclamation-circle-filled.svg" return "./icons/ic-exclamation-circle-filled.svg"
case Notification.NotificationType.Danger: case Notification.NotificationType.Danger:
return "./icons/ic-exclamation-circle-filled.svg" return "./icons/ic-exclamation-circle-filled.svg"
} }
} }
@ -134,6 +134,7 @@ Popup {
colorScheme: root.colorScheme colorScheme: root.colorScheme
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.leftMargin: 16
color: root.colorScheme.text_invert color: root.colorScheme.text_invert
text: root.notification ? root.notification.description : "" text: root.notification ? root.notification.description : ""
@ -152,13 +153,13 @@ Popup {
} }
switch (root.notification.type) { switch (root.notification.type) {
case Notification.NotificationType.Info: case Notification.NotificationType.Info:
return root.colorScheme.signal_info_active return root.colorScheme.signal_info_active
case Notification.NotificationType.Success: case Notification.NotificationType.Success:
return root.colorScheme.signal_success_active return root.colorScheme.signal_success_active
case Notification.NotificationType.Warning: case Notification.NotificationType.Warning:
return root.colorScheme.signal_warning_active return root.colorScheme.signal_warning_active
case Notification.NotificationType.Danger: case Notification.NotificationType.Danger:
return root.colorScheme.signal_danger_active return root.colorScheme.signal_danger_active
} }
} }
@ -179,7 +180,7 @@ Popup {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
width: parent.width + 10 width: parent.width + 10
radius: 10 radius: ProtonStyle.banner_radius
color: { color: {
if (!root.notification) { if (!root.notification) {
return "transparent" return "transparent"
@ -190,22 +191,22 @@ Popup {
var active var active
switch (root.notification.type) { switch (root.notification.type) {
case Notification.NotificationType.Info: case Notification.NotificationType.Info:
norm = root.colorScheme.signal_info norm = root.colorScheme.signal_info
hover = root.colorScheme.signal_info_hover hover = root.colorScheme.signal_info_hover
active = root.colorScheme.signal_info_active active = root.colorScheme.signal_info_active
break; break;
case Notification.NotificationType.Success: case Notification.NotificationType.Success:
norm = root.colorScheme.signal_success norm = root.colorScheme.signal_success
hover = root.colorScheme.signal_success_hover hover = root.colorScheme.signal_success_hover
active = root.colorScheme.signal_success_active active = root.colorScheme.signal_success_active
break; break;
case Notification.NotificationType.Warning: case Notification.NotificationType.Warning:
norm = root.colorScheme.signal_warning norm = root.colorScheme.signal_warning
hover = root.colorScheme.signal_warning_hover hover = root.colorScheme.signal_warning_hover
active = root.colorScheme.signal_warning_active active = root.colorScheme.signal_warning_active
break; break;
case Notification.NotificationType.Danger: case Notification.NotificationType.Danger:
norm = root.colorScheme.signal_danger norm = root.colorScheme.signal_danger
hover = root.colorScheme.signal_danger_hover hover = root.colorScheme.signal_danger_hover
active = root.colorScheme.signal_danger_active active = root.colorScheme.signal_danger_active

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml 2.12 import QtQml 2.12
import QtQuick 2.13 import QtQuick 2.13
@ -34,6 +34,7 @@ QtObject {
} }
property var backend property var backend
property var title: "Proton Mail Bridge"
property Notifications _notifications: Notifications { property Notifications _notifications: Notifications {
id: notifications id: notifications
@ -47,6 +48,7 @@ QtObject {
id: mainWindow id: mainWindow
visible: false visible: false
title: root.title
backend: root.backend backend: root.backend
notifications: root._notifications notifications: root._notifications
@ -67,6 +69,7 @@ QtObject {
id: statusWindow id: statusWindow
visible: false visible: false
title: root.title
backend: root.backend backend: root.backend
notifications: root._notifications notifications: root._notifications
@ -133,7 +136,7 @@ QtObject {
return Qt.point(_x, _y) return Qt.point(_x, _y)
} }
// fir to the right // fit to the right
_x = iconRect.right _x = iconRect.right
if (isInInterval(_x, screenRect.left, screenRect.right - width)) { if (isInInterval(_x, screenRect.left, screenRect.right - width)) {
// position preferebly in the vertical center but bound to the screen rect // position preferebly in the vertical center but bound to the screen rect

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml 2.12 import QtQml 2.12
import QtQuick 2.13 import QtQuick 2.13

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml.Models 2.12 import QtQml.Models 2.12

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml 2.12 import QtQml 2.12
import QtQuick 2.13 import QtQuick 2.13
@ -262,7 +262,7 @@ Window {
// add one user on start // add one user on start
var hasUserOnStart = true var hasUserOnStart = false
if (hasUserOnStart) { if (hasUserOnStart) {
var newUserObject = root.userComponent.createObject(root) var newUserObject = root.userComponent.createObject(root)
newUserObject.username = "LerooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooyJenkins@protonmail.com" newUserObject.username = "LerooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooyJenkins@protonmail.com"
@ -551,7 +551,12 @@ Window {
root.reportBugFinished() root.reportBugFinished()
root.bugReportSendSuccess() root.bugReportSendSuccess()
} }
} }
}
ColumnLayout {
spacing: 5
Button { Button {
text: "Bug report send error" text: "Bug report send error"
@ -609,6 +614,22 @@ Window {
root.notifyRebuildKeychain() root.notifyRebuildKeychain()
} }
} }
Button {
text: "Address changed"
colorScheme: root.colorScheme
onClicked: {
root.addressChanged("p@v.el")
}
}
Button {
text: "Address changed + Logout"
colorScheme: root.colorScheme
onClicked: {
root.addressChangedLogout("p@v.el")
}
}
} }
} }
@ -729,6 +750,9 @@ Window {
console.log("check updates") console.log("check updates")
} }
signal checkUpdatesFinished() signal checkUpdatesFinished()
function installUpdate() {
console.log("manuall install update triggered")
}
property bool isDiskCacheEnabled: true property bool isDiskCacheEnabled: true
@ -748,7 +772,19 @@ Window {
property bool isAutomaticUpdateOn : true property bool isAutomaticUpdateOn : true
function toggleAutomaticUpdate(makeItActive) { function toggleAutomaticUpdate(makeItActive) {
console.debug("-> silent updates", makeItActive, root.isAutomaticUpdateOn) console.debug("-> silent updates", makeItActive, root.isAutomaticUpdateOn)
root.isAutomaticUpdateOn = makeItActive var callback = function () {
root.isAutomaticUpdateOn = makeItActive;
console.debug("-> CHANGED silent updates", makeItActive, root.isAutomaticUpdateOn)
}
atimer.onTriggered.connect(callback)
atimer.restart()
}
Timer {
id: atimer
interval: 2000
running: false
repeat: false
} }
property bool isAutostartOn : true // Example of settings with loading state property bool isAutostartOn : true // Example of settings with loading state
@ -800,6 +836,7 @@ Window {
property url logsPath: StandardPaths.standardLocations(StandardPaths.HomeLocation)[0] property url logsPath: StandardPaths.standardLocations(StandardPaths.HomeLocation)[0]
property url licensePath: StandardPaths.standardLocations(StandardPaths.HomeLocation)[0] property url licensePath: StandardPaths.standardLocations(StandardPaths.HomeLocation)[0]
property url releaseNotesLink: Qt.resolvedUrl("https://protonmail.com/download/bridge/early_releases.html") property url releaseNotesLink: Qt.resolvedUrl("https://protonmail.com/download/bridge/early_releases.html")
property url dependencyLicensesLink: Qt.resolvedUrl("https://github.com/ProtonMail/proton-bridge/blob/master/COPYING_NOTES.md#dependencies")
property url landingPageLink: Qt.resolvedUrl("https://protonmail.com/bridge") property url landingPageLink: Qt.resolvedUrl("https://protonmail.com/bridge")
property string colorSchemeName: "light" property string colorSchemeName: "light"

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
@ -127,19 +127,10 @@ SettingsView {
} }
TextEdit { TextEdit {
text: { text: qsTr("Reports are not end-to-end encrypted, please do not send any sensitive information.")
var address = "bridge@protonmail.com"
var mailTo = `<a href="mailto://${address}">${address}</a>`
return "<style>a:link { color: " + root.colorScheme.interaction_norm + "; }</style>" +qsTr(
"These reports are not end-to-end encrypted. In case of sensitive information, contact us at %1."
).arg(mailTo)
}
onLinkActivated: Qt.openUrlExternally(link)
textFormat: Text.RichText
readOnly: true readOnly: true
Layout.fillWidth: true Layout.fillWidth: true
color: root.colorScheme.text_weak color: root.colorScheme.text_weak
font.family: ProtonStyle.font_family font.family: ProtonStyle.font_family

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
@ -37,7 +37,7 @@ Rectangle {
implicitHeight: content.height + 2*root._margin implicitHeight: content.height + 2*root._margin
color: root.colorScheme.background_norm color: root.colorScheme.background_norm
radius: 9 radius: ProtonStyle.card_radius
property int _margin: 24 property int _margin: 24

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
@ -159,7 +159,7 @@ Item {
highlight: Rectangle { highlight: Rectangle {
color: leftBar.colorScheme.interaction_default_active color: leftBar.colorScheme.interaction_default_active
radius: 4 radius: ProtonStyle.account_row_radius
} }
model: root.backend.users model: root.backend.users

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
@ -105,10 +105,11 @@ SettingsView {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: qsTr("Proton Mail Bridge v%1<br>© 2021 Proton AG<br>%2 %3"). text: qsTr("Proton Mail Bridge v%1<br>© 2021 Proton AG<br>%2 %3<br>%4").
arg(root.backend.version). arg(root.backend.version).
arg(link(root.backend.licensePath, qsTr("License"))). arg(link(root.backend.licensePath, qsTr("License"))).
arg(link(root.backend.releaseNotesLink, qsTr("Release notes"))) arg(link(root.backend.dependencyLicensesLink, qsTr("Dependencies"))).
arg(link(root.backend.releaseNotesLink, qsTr("Release notes")))
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
} }

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml 2.12 import QtQml 2.12
import QtQuick 2.13 import QtQuick 2.13
@ -28,7 +28,6 @@ import "tests"
ApplicationWindow { ApplicationWindow {
id: root id: root
title: "ProtonMail Bridge"
width: 960 width: 960
height: 576 height: 576
@ -98,10 +97,6 @@ ApplicationWindow {
property bool _showSetup: false property bool _showSetup: false
currentIndex: { currentIndex: {
if (backend.showSplashScreen) {
return 3
}
// show welcome when there are no users or only one non-logged-in user is present // show welcome when there are no users or only one non-logged-in user is present
if (backend.users.count === 0) { if (backend.users.count === 0) {
return 1 return 1
@ -168,20 +163,19 @@ ApplicationWindow {
} }
} }
SplashScreen { // 3
id: splashScreen
colorScheme: root.colorScheme
backend: root.backend
Layout.fillHeight: true
Layout.fillWidth: true
}
} }
NotificationPopups { NotificationPopups {
colorScheme: root.colorScheme colorScheme: root.colorScheme
notifications: root.notifications notifications: root.notifications
mainWindow: root mainWindow: root
backend: root.backend
}
SplashScreen {
id: splashScreen
colorScheme: root.colorScheme
backend: root.backend
} }
function showLocalCacheSettings() { contentWrapper.showLocalCacheSettings() } function showLocalCacheSettings() { contentWrapper.showLocalCacheSettings() }

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml 2.12 import QtQml 2.12
import QtQuick 2.12 import QtQuick 2.12
@ -55,12 +55,12 @@ Dialog {
} }
switch (root.notification.type) { switch (root.notification.type) {
case Notification.NotificationType.Info: case Notification.NotificationType.Info:
return "./icons/ic-info.svg" return "./icons/ic-info.svg"
case Notification.NotificationType.Success: case Notification.NotificationType.Success:
return "./icons/ic-success.svg" return "./icons/ic-success.svg"
case Notification.NotificationType.Warning: case Notification.NotificationType.Warning:
case Notification.NotificationType.Danger: case Notification.NotificationType.Danger:
return "./icons/ic-alert.svg" return "./icons/ic-alert.svg"
} }
} }
@ -84,6 +84,7 @@ Dialog {
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
type: Label.LabelType.Body type: Label.LabelType.Body
onLinkActivated: Qt.openUrlExternally(link)
} }
Item { Item {

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml 2.12 import QtQml 2.12
import QtQuick 2.12 import QtQuick 2.12
@ -25,6 +25,7 @@ import Notifications 1.0
Item { Item {
id: root id: root
property var backend
property ColorScheme colorScheme property ColorScheme colorScheme
property var notifications property var notifications
@ -51,8 +52,11 @@ Item {
notification: root.notifications.updateManualReady notification: root.notifications.updateManualReady
Switch { Switch {
id:autoUpdate
colorScheme: root.colorScheme colorScheme: root.colorScheme
text: qsTr("Update automatically in the future") text: qsTr("Update automatically in the future")
checked: root.backend.isAutomaticUpdateOn
onClicked: root.backend.toggleAutomaticUpdate(autoUpdate.checked)
} }
} }

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml 2.12 import QtQml 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml 2.12 import QtQml 2.12
import QtQml.Models 2.12 import QtQml.Models 2.12

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml 2.12 import QtQml 2.12
import Qt.labs.platform 1.1 import Qt.labs.platform 1.1
@ -74,7 +74,8 @@ QtObject {
root.resetBridge, root.resetBridge,
root.deleteAccount, root.deleteAccount,
root.noKeychain, root.noKeychain,
root.rebuildKeychain root.rebuildKeychain,
root.addressChanged
] ]
// Connection // Connection
@ -100,8 +101,13 @@ QtObject {
// Updates // Updates
property Notification updateManualReady: Notification { property Notification updateManualReady: Notification {
title: qsTr("Update to Bridge %1").arg(data ? data.version : "") title: qsTr("Update to Bridge %1").arg(data ? data.version : "")
description: qsTr("A new version of ProtonMail Bridge is available. See what's changed.") description: {
brief: qsTr("Update available. (See what's new.)") var descr = qsTr("A new version of Proton Mail Bridge is available.")
var text = qsTr("See what's changed.")
var link = root.backend.releaseNotesLink
return `${descr} <a href="${link}">${text}</a>`
}
brief: qsTr("Update available.")
icon: "./icons/ic-info-circle-filled.svg" icon: "./icons/ic-info-circle-filled.svg"
type: Notification.NotificationType.Info type: Notification.NotificationType.Info
group: Notifications.Group.Update | Notifications.Group.Dialogs group: Notifications.Group.Update | Notifications.Group.Dialogs
@ -166,8 +172,9 @@ QtObject {
} }
property Notification updateManualError: Notification { property Notification updateManualError: Notification {
description: qsTr("Bridge couldnt update") title: qsTr("Bridge couldnt update")
brief: description brief: title
description: qsTr("Please follow manual installation in order to update Bridge.")
icon: "./icons/ic-exclamation-circle-filled.svg" icon: "./icons/ic-exclamation-circle-filled.svg"
type: Notification.NotificationType.Warning type: Notification.NotificationType.Warning
group: Notifications.Group.Update group: Notifications.Group.Update
@ -192,7 +199,7 @@ QtObject {
text: qsTr("Remind me later") text: qsTr("Remind me later")
onTriggered: { onTriggered: {
root.updateManualReady.active = false root.updateManualError.active = false
} }
} }
] ]
@ -273,7 +280,7 @@ QtObject {
onTriggered: { onTriggered: {
root.backend.quit() root.backend.quit()
root.updateForce.active = false root.updateForceError.active = false
} }
} }
] ]
@ -833,10 +840,10 @@ QtObject {
} }
property Notification deleteAccount: Notification { property Notification deleteAccount: Notification {
title: qsTr("Delete this account?") title: qsTr("Remove this account?")
brief: title brief: title
icon: "./icons/ic-exclamation-circle-filled.svg" icon: "./icons/ic-exclamation-circle-filled.svg"
description: qsTr("Are you sure you want to delete this account and all the stored preferences and other data associated with it?") description: qsTr("Are you sure you want to remove this account from Bridge and delete locally stored preferences and data?")
type: Notification.NotificationType.Danger type: Notification.NotificationType.Danger
group: Notifications.Group.Configuration | Notifications.Group.Dialogs group: Notifications.Group.Configuration | Notifications.Group.Dialogs
@ -860,7 +867,7 @@ QtObject {
}, },
Action { Action {
id: deleteAccount_delete id: deleteAccount_delete
text: qsTr("Delete this account") text: qsTr("Remove this account")
onTriggered: { onTriggered: {
root.deleteAccount.user.remove() root.deleteAccount.user.remove()
root.deleteAccount.active = false root.deleteAccount.active = false
@ -934,4 +941,37 @@ QtObject {
} }
] ]
} }
property Notification addressChanged: Notification {
title: qsTr("Address list changes")
description: qsTr("The address list for your account has changed. You might need to reconfigure your email client.")
brief: description
icon: "./icons/ic-exclamation-circle-filled.svg"
type: Notification.NotificationType.Warning
group: Notifications.Group.Configuration
Connections {
target: root.backend
onAddressChanged: {
root.addressChanged.description = qsTr("The address list for your account %1 has changed. You might need to reconfigure your email client.").arg(address)
root.addressChanged.active = true
}
onAddressChangedLogout: {
root.addressChanged.description = qsTr("The address list for your account %1 has changed. You have to reconfigure your email client.").arg(address)
root.addressChanged.active = true
}
}
action: [
Action {
text: qsTr("OK")
onTriggered: {
root.addressChanged.active = false
}
}
]
}
} }

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Templates 2.12 as T import QtQuick.Templates 2.12 as T

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml 2.12 import QtQml 2.12
import QtQuick 2.12 import QtQuick 2.12

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
@ -147,7 +147,7 @@ T.Button {
background: Rectangle { background: Rectangle {
implicitWidth: 36 implicitWidth: 36
implicitHeight: 36 implicitHeight: 36
radius: 4 radius: Style.button_radius
visible: true visible: true
color: { color: {
if (!isIcon) { if (!isIcon) {

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
@ -28,10 +28,10 @@ T.CheckBox {
id: control id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding) implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding, implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding) implicitIndicatorHeight + topPadding + bottomPadding)
padding: 0 padding: 0
spacing: 8 spacing: 8
@ -39,7 +39,7 @@ T.CheckBox {
indicator: Rectangle { indicator: Rectangle {
implicitWidth: 20 implicitWidth: 20
implicitHeight: 20 implicitHeight: 20
radius: 4 radius: Style.checkbox_radius
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2 y: control.topPadding + (control.availableHeight - height) / 2
@ -96,7 +96,7 @@ T.CheckBox {
// TODO: do we need PartiallyChecked state? // TODO: do we need PartiallyChecked state?
//Rectangle { // Rectangle {
// x: (parent.width - width) / 2 // x: (parent.width - width) / 2
// y: (parent.height - height) / 2 // y: (parent.height - height) / 2
// width: 16 // width: 16

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml 2.13 import QtQml 2.13
@ -88,4 +88,5 @@ QtObject {
// Images // Images
property string welcome_img property string welcome_img
property string logo_img
} }

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Window 2.12 import QtQuick.Window 2.12
@ -27,10 +27,10 @@ T.ComboBox {
property ColorScheme colorScheme property ColorScheme colorScheme
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding) implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding, implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding) implicitIndicatorHeight + topPadding + bottomPadding)
leftPadding: 12 + (!root.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) leftPadding: 12 + (!root.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
rightPadding: 12 + (root.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) rightPadding: 12 + (root.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
@ -64,7 +64,7 @@ T.ComboBox {
placeholderTextColor: root.enabled ? root.colorScheme.text_hint : root.colorScheme.text_disabled placeholderTextColor: root.enabled ? root.colorScheme.text_hint : root.colorScheme.text_disabled
background: Rectangle { background: Rectangle {
radius: 4 radius: Style.context_item_radius
visible: root.enabled && root.editable && !root.flat visible: root.enabled && root.editable && !root.flat
border.color: { border.color: {
if (root.activeFocus) { if (root.activeFocus) {
@ -85,7 +85,7 @@ T.ComboBox {
background: Rectangle { background: Rectangle {
implicitWidth: 140 implicitWidth: 140
implicitHeight: 36 implicitHeight: 36
radius: 4 radius: Style.context_item_radius
color: { color: {
if (root.down) { if (root.down) {
return root.colorScheme.interaction_default_active return root.colorScheme.interaction_default_active
@ -142,7 +142,7 @@ T.ComboBox {
palette.highlightedText: selected ? root.colorScheme.text_invert : root.colorScheme.text_norm palette.highlightedText: selected ? root.colorScheme.text_invert : root.colorScheme.text_norm
background: PaddedRectangle { background: PaddedRectangle {
radius: 4 radius: Style.context_item_radius
color: { color: {
if (parent.down) { if (parent.down) {
return root.colorScheme.interaction_default_active return root.colorScheme.interaction_default_active
@ -187,7 +187,7 @@ T.ComboBox {
background: Rectangle { background: Rectangle {
color: root.colorScheme.background_norm color: root.colorScheme.background_norm
radius: 10 radius: Style.dialog_radius
border.color: root.colorScheme.border_weak border.color: root.colorScheme.border_weak
border.width: 1 border.width: 1
} }

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQml 2.12 import QtQml 2.12
import QtQuick 2.12 import QtQuick 2.12
@ -53,19 +53,19 @@ T.Dialog {
anchors.centerIn: Overlay.overlay anchors.centerIn: Overlay.overlay
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding, contentWidth + leftPadding + rightPadding,
implicitHeaderWidth, implicitHeaderWidth,
implicitFooterWidth) implicitFooterWidth)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding contentHeight + topPadding + bottomPadding
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
padding: 24 padding: 24
background: Rectangle { background: Rectangle {
color: root.colorScheme.background_norm color: root.colorScheme.background_norm
radius: 10 radius: Style.dialog_radius
} }
// TODO: Add DropShadow here // TODO: Add DropShadow here

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
@ -27,10 +27,14 @@ T.Menu {
property ColorScheme colorScheme property ColorScheme colorScheme
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitWidth: Math.max(
contentWidth + leftPadding + rightPadding) implicitBackgroundWidth + leftInset + rightInset,
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentWidth + leftPadding + rightPadding
contentHeight + topPadding + bottomPadding) )
implicitHeight: Math.max(
implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding
)
margins: 0 margins: 0
overlap: 1 overlap: 1
@ -63,6 +67,6 @@ T.Menu {
color: colorScheme.background_norm color: colorScheme.background_norm
border.width: 1 border.width: 1
border.color: colorScheme.border_weak border.color: colorScheme.border_weak
radius: 10 radius: Style.account_row_radius
} }
} }

View File

@ -1,19 +1,19 @@
// Copyright (c) 2022 Proton Technologies AG // Copyright (c) 2022 Proton AG
// //
// This file is part of ProtonMail Bridge. // This file is part of Proton Mail Bridge.
// //
// ProtonMail Bridge is free software: you can redistribute it and/or modify // Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ProtonMail Bridge is distributed in the hope that it will be useful, // Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
@ -27,10 +27,10 @@ T.MenuItem {
property ColorScheme colorScheme property ColorScheme colorScheme
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding) implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding, implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding) implicitIndicatorHeight + topPadding + bottomPadding)
padding: 6 padding: 6
spacing: 6 spacing: 6
@ -66,7 +66,7 @@ T.MenuItem {
background: Rectangle { background: Rectangle {
implicitWidth: 164 implicitWidth: 164
implicitHeight: 36 implicitHeight: 36
radius: 4 radius: Style.button_radius
color: control.down ? control.colorScheme.interaction_default_active : control.highlighted ? control.colorScheme.interaction_default_hover : control.colorScheme.interaction_default color: control.down ? control.colorScheme.interaction_default_active : control.highlighted ? control.colorScheme.interaction_default_hover : control.colorScheme.interaction_default
} }
} }

Some files were not shown because too many files have changed in this diff Show More