Commit Graph

59 Commits

Author SHA1 Message Date
Atanas Janeshliev
194942e895 chore: Happy New Year (2026) 2026-01-08 13:00:18 +01:00
Jakub Cuth
082849dc6c chore: year bump 2025-01-02 14:03:49 +01:00
Xavier Michelon
cdcdd45bcf feat(BRIDGE-268): add kill switch feature flag for the IMAP AUTHENTICATE command. 2024-11-22 12:32:33 +01:00
Jakub
c9b6cc162b feat(GODT-3199): add package log field. 2024-02-27 13:07:37 +01:00
Jakub
b8ae5be58c fix(GODT-3188): Happy new year. 2024-01-02 15:06:05 +01:00
Leander Beernaert
9a96588afb feat(GODT-2814): Standalone Server Manager
Convert ServerManger into a standalone service so that it can become a
self contained module.
2023-08-07 16:47:41 +02:00
Leander Beernaert
823ca4d207 feat(GODT-2822): Integrate and activate all service
The bridge now runs on the new architecture.
2023-07-31 12:36:03 +02:00
Leander Beernaert
bc66841cdc chore(GODT-2799): Move SMTP backend to SMTP service module 2023-07-19 09:12:33 +02:00
Leander Beernaert
d120bbeffc chore(GODT-2799): Separate account states for SMTP Backend
Rather than accessing the Bridge user list, each user register their
individual SMTP service with the server manager.

Note that some dependencies on the user data are hidden behind the
`UserInterface`. These will be removed in a future patch.
2023-07-19 09:07:02 +02:00
Romain Le Jeune
802f7dbc67 feat(GODT-2673): Use NoClient as UserAgent without any client connected and... 2023-06-01 15:15:37 +00:00
Romain LE JEUNE
6adb440b84 fix(GODT-2623): log IMAP/SMTP login failure as error. 2023-05-12 07:28:41 +00:00
Leander Beernaert
fb4a0e77af feat(GODT-2585): Server Manager
Add a dedicated go-routine whose sole responsibility is to manage the
life time of the IMAP and SMTP servers and their listeners.

The current implementation behaves the same way as the previous state.
The new behavior will be implemented in a follow MR.
2023-05-11 09:48:54 +02:00
Jakub
7bb925b6d7 feat(GODT-2502): Improve logs. 2023-04-14 10:27:37 +02:00
Leander Beernaert
d6760d6f50 chore(GODT-2551): Store and Recover Last User Agent from Vault 2023-04-14 09:48:39 +02:00
Jakub
de5fd07a22 feat(GODT-2500): Reorganise async methods. 2023-04-03 07:07:22 +02:00
Jakub
ec92c918cd feat(GODT-2500): Add panic handlers everywhere. 2023-04-03 06:38:31 +02:00
Leander Beernaert
5007d451c2 feat(GODT-2385): Gluon cache fallback
Update Gluon to have access to the cache fallback reader.

Provide fallback reader to handle old cache file format.

Remove the old logic to erase all cache files on start as the fallback
option renders this irrelevant.
2023-02-22 12:00:23 +01:00
James Houlahan
f3c5e300cd fix(GODT-2327): Delay event processing until gluon user exists
We don't want to start processing events until those events have
somewhere to be sent to.

Also, to be safe, ensure remove and re-add the gluon user while
clearing its sync status. This shouldn't be necessary.

fix(GODT-2327): Only start processing events once sync is finished

fix(GODT-2327): avoid windows delete all deadlock

fix(GODT-2327): Clear update channels whenever clearing sync status

fix(GODT-2327): Properly cancel event stream when handling refresh

fix(GODT-2327): Remove unnecessary sync abort call

fix(GODT-2327): Fix lint issue

fix(GODT-2327): Don't retry with abortable context because it's canceled

fix(GODT-2327): Loop to retry until sync has complete

fix(GODT-2327): Better sleep (with context)
2023-02-07 13:41:16 +01:00
James Houlahan
34cd611a8b chore: Disable funlen linter 2023-02-06 14:29:13 +00:00
James Houlahan
2e832520e6 chore: Remove panics from SetGluonDir 2023-02-03 14:11:53 +00:00
James Houlahan
62285a141e feat(GODT-2144): Delay IMAP/SMTP server start until all users are loaded 2023-02-03 14:11:53 +00:00
Xavier Michelon
c3d5a0b8f8
feat(GODT-2295): notifications for IMAP login when signed out. 2023-02-03 11:18:59 +01:00
Leander Beernaert
0c8d4e8dd8 fix(GODT-2326): Only run sync after addIMAPUser()
There is concurrency bug due to competing sync calls that can occur when
we clear the sync status in the Vault. Running sync at the end of
addIMAPUser() avoids the problem.

This patch also remove the execution of a sync task for
`user.ClearSyncStatus()`
2023-02-02 11:32:54 +01:00
Leander Beernaert
45ec6b6e74 feat(GODT-2289): UIDValidity as Timestamp
Update UIDValidity to be timestamp with the number of seconds since
the 1st of February 2023. This avoids the problem where we lose the
last UIDValidity value due to the vault being missing/corrupted/deleted.
2023-02-01 14:04:45 +01:00
James Houlahan
e382687168 fix(GODT-2318): Remove gluon DB if label sync was incomplete 2023-01-31 12:40:42 +00:00
Leander Beernaert
e464e11ab9 GODT-2224: Refactor bridge sync to use less memory
Updates go-proton-api and Gluon to includes memory reduction changes and
modify the sync process to take into account how much memory is used
during the sync stage.

The sync process now has an extra stage which first download the message
metada to ensure that we only download up to `syncMaxDownloadRequesMem`
messages or 250 messages total. This allows for scaling the download
request automatically to accommodate many small or few very large
messages.

The IDs are then sent to a download go-routine which downloads the
message and its attachments. The result is then forwarded to another
go-routine which builds the actual message. This stage tries to ensure
that we don't use more than `syncMaxMessageBuildingMem` to build these
messages.

Finally the result is sent to a last go-routine which applies the
changes to Gluon and waits for them to be completed.

The new process is currently limited to 2GB. Dynamic scaling will be
implemented in a follow up. For systems with less than 2GB of memory we
limit the values to a set of values that is known to work.
2023-01-30 15:05:43 +01:00
James Houlahan
cf32b84257 GODT-2305: Detect missing gluon DB 2023-01-25 14:55:13 +01:00
James Houlahan
03c8c323bc GODT-2251: Store gluon cache in user cache rather than user data 2023-01-16 16:27:41 +01:00
Romain Le Jeune
0580842ad2 GODT-2229: Own the full path for gluon and do not change Database path. 2023-01-12 13:23:09 +00:00
Jakub
715efaa087 Revert "GODT-2229: Allow changing cache folder to a non-empty folder."
This reverts commit b19e16e4b8.
2023-01-11 10:19:38 +01:00
Romain Le Jeune
b19e16e4b8 GODT-2229: Allow changing cache folder to a non-empty folder. 2023-01-10 16:40:52 +00:00
Xavier Michelon
bb07138fb0
GODT-2236: add log entry when SMTP / IMAP serve method fails. 2023-01-04 16:45:34 +01:00
Leander Beernaert
6d0a128111 Other: Update copyright year 2023-01-02 11:09:11 +01:00
Leander Beernaert
1c374b59d3 GODT-2160: Prevent double closing of bridge if restart fails
Set imapServer instance to nil once the server is no longer running to
prevent multiple calls to close on shutdown.
2022-11-29 08:38:21 +01:00
James Houlahan
e601245f01 Other(chore): Bump major version to v3 2022-11-23 16:08:27 +01:00
James Houlahan
294d1edfee GODT-2120: Encrypt gluon store with gzip 2022-11-21 17:37:56 +01:00
Xavier Michelon
1f0312573a GODT-1846: remove restart cues, implement restart-less behaviour.
Other: fixed case issue in SSL member function names.
Other: removed 'restart' mention in SMTP and IMAP SSL settings.
GODT-1846: modified gRPC server to introduce ConnectionMode settings.
GODT-1846: implemented connection mode handling in bridge-gui.
GODT-1846: implemented error reporting in bridge-gui for connection mode.
Other: gathered all IMAP/SMTP server settings.
GODT-1846: wired IMAP/SMTP port change errors.
Other: Renamed some error events and signals.
Other: Fixed crash in IMAP restart when not started.
Other: dismiss port error notifications before changing ports.
Other: misc. fixes.
2022-11-21 09:08:52 +00:00
James Houlahan
7d84ab37f6 GODT-2100: Load users in parallel at startup 2022-11-19 12:13:33 +01:00
James Houlahan
6bdcdf7fd2 GODT-2033: Only set user agent from IMAP ID if not empty 2022-11-18 19:55:23 +01:00
James Houlahan
e60bbaa60f Other: Add more user-level logs 2022-11-18 13:30:45 +00:00
Jakub
ae87d7b236 GODT-1913: pass reporter to gluon, limit restarts, add crash handlers. 2022-11-16 13:48:31 +01:00
James Houlahan
2023df3ef8 Other: Log mailbox message counts at startup 2022-11-16 13:48:31 +01:00
James Houlahan
c548ba85fe Other: Add more extensive logging 2022-11-16 13:48:30 +01:00
James Houlahan
bc7912e8fb GODT-2022: Fix change between address modes 2022-11-16 13:48:30 +01:00
James Houlahan
a553ced979 Other: go mod tidy/goimports/gofumpt after rebase on devel 2022-11-16 13:48:30 +01:00
James Houlahan
2bda47fcad Other(refactor): Less unwieldy user type in Bridge
Instead of the annoying safe.Map type, we just use a normal go map
and mutex pair, and use safe.Lock/safe.RLock as a helper function
2022-11-16 13:48:30 +01:00
James Houlahan
afc5307a23 Other: Don't close IMAP/SMTP listeners if they could not be created 2022-11-16 13:48:30 +01:00
James Houlahan
6fbf6d90dc Other: Fix IMAP/SMTP/Login leaks/race conditions
Depending on the timing of bridge closure, it was possible for the 
IMAP/SMTP servers to not have started serving yet. By grouping this in
a cancelable goroutine group (*xsync.Group), we mitigate this issue.

Further, depending on internet disconnection timing during user login,
it was possible for a user to be improperly logged in. This change 
fixes this and adds test coverage for it.

Lastly, depending on timing, certain background tasks (updates check,
connectivity ping) could be improperly started or closed. This change
groups them in the *xsync.Group as well to be closed properly.
2022-11-16 13:48:30 +01:00
Leander Beernaert
7c62312220 Other: Fix all linter errors 2022-11-16 12:26:09 +01:00
Leander Beernaert
e10cd2a3ed GODT-1901: Allow to set IMAP SSL from UI 2022-11-16 12:26:09 +01:00