Commit graph

46 commits

Author SHA1 Message Date
wrd
8ab3b14edd Move files to new folder structure
Co-authored-by: @rih-tutao
2024-07-26 16:42:13 +02:00
jhm
b6ad11e33a Remove LegacyMailWrapper (legacy mail bodies) and cleanup TutanotaModel
Prior to starting implementing static MailIds and MailSets, we
want to clean up the current TutanotaModel. Therefore, this commit
removes a lot of legacy metamodel definitions that are not used any
longer, including removing the LegacyMailWrapper (legacy mail bodies).

Additionally, this commit inter alia includes:
* removing types no longer needed after migrating to MailDetails, e.g.
  the "body", "toRecipients", "ccRecipients", "bccRecipients",
  "replyTos", "sentDate" and "headers" references / values from MAIL_TYPE
* removing "mails" reference form MAIL_BOX_TYPE
* removing "subFolders" reference from MAIL_FOLDER
* removing the legacy types MAIL_BODY_TYPE and MAIL_HEADERS
* removing Value.OLD_OWNER_GROUP_NAME, and Value.OLD_AREA_ID_NAME from
  FILE_TYPE and CONTACT_TYPE

Closes #7255

Co-authored-by: sug <sug@tutao.de>
2024-07-26 16:03:01 +02:00
mup
2fd81025fd
sys model v103 2024-07-04 11:32:51 +02:00
vis
5a5f924d70 Send user group key version when re-encrypting it
tutadb#1810
2024-06-26 14:23:28 +00:00
vaf
75f4f5cc93 process shared group key rotation,
handle group key updates as member of a shared group rotated by the owner,
tutadb#1793
2024-06-26 13:05:00 +00:00
vis
8a18979c09
Update to SystemModel101
tutadb#1770
2024-06-05 10:00:06 +02:00
vaf
d348d4b9d3
Extract keyCache from KeyLoaderFacade and UserFacade and handle user group key updates using a distribution key.
tutadb#1795
2024-06-04 16:03:09 +02:00
ivk
ad83f751b2 Extended notification preview, change credential encryption
Implemented extended notifications which include the sender.

Re-implemented credential encryption and storage, moved credential
data to the native storage, changed credential encryption on mobile to
always be device lock + implement app lock independently of encryption.

Re-implemented SSE on desktop in a more modular way.

Re-organized iOS app to share the code between the main app code and
app extensions.

Close #6608

Co-authored-by: wec43 <wec@tutao.de>
2024-05-22 14:10:08 +00:00
bedhub
fd38eed767
Show pq padlock symbol for sent mail, tutadb 1788 (#6699)
* Show pq padlock symbol for sent mail, tutadb 1788

To show the pq padlock symbol for the sender we introduced another enum value for the encryptionAuthStatus on Mail instances which is only set for the sent mail. It is only set in case the mail is confidential and all recipients support the TutaCrypt protocol.

* clean up outdated invitations from offlince cache
see the fix for tutadb#1800

---------

Co-authored-by: bedhub <bedhub@users.noreply.github.com>
Co-authored-by: vaf <vaf@tutao.de>
2024-05-06 09:08:05 +00:00
Johannes Münichsdorfer
67ac8fef91
remove canceledPremiumAccount flag from customer type (#6883) (#6884)
As of 2020 the canceledPremiumAccount boolean value has always been
set to false therefore this value is no longer needed, and we can
remove it. Additionally, this commit includes model changes for the
new TranslationService and removes the following unused
services and types.

* PREMIUM_FEATURE_SERVICE
* PREMIUM_FEATURE_DATA
* PREMIUM_FEATURE_RETURN
* MIGRATE_TO_V18_SERVICE
* DEFAULT_SYSTEM_MIGRATE_DATA
* REGISTRATION_CONFIG_SERVICE
* REGISTRATION_CONFIG_RETURN
* SHARE_SERVICE
* SHARE_DATA

close #6883

Co-authored-by: nig <nig@tutao.de>
2024-04-25 09:55:05 +00:00
Vitor Sakaguti
a6d6d26d1a
Support group key rotation (#6588)
* Allow groups to have multiple key versions

tutadb#1628

* Adapt to model changes

* Fix CommonMailUtilsTest

* Remove symEncBucketKey from SecureExternalRecipientKeyData

* Remove deprecated types

Also fix tests that relied on them as dummy types

* Add userKeyVersion to RecoverCode

* Remove clientKey

Seems to be unused.

* Remove CreateFolderService

Unused.

* Remove symEncSessionKey from DraftCreateData

Unused.

* Remove symEncShareBucketKey from MailBox

Unused.

* Add userKeyVersion to TutanotaProperties

* Remove PasswordRetrievalService type

The service itself had been long gone.

* Remove userKeyVersion from CustomerAccountCreateData CreateMailGroupData

* Fix customer account creation

Set the key version that we actually need there: the *system* admin pub
key version.

The sender key version is not needed, because the system admin only has
RSA keys. Also, this is a new customer, so that would be version zero
anyway.

* Fix resolving bucket key with group reference

Get the right versions along the way.

* Use current group key when encrypting instance session keys

* Remove left-over key getting

Also document a couple of current key usages

* Pass group key providers to EntityClient instead of group key

* Fix types and do not provide sender key version for rsa

Fix resolveServiceSessionKey

* Rename constant to avoid confusion

There is another constant with the same name.

* Use TutanotaModelV69

* Introduce client side mechanism to handle key rotation requests

see tutadb 1771

* Do not export 128-bit key generator

It is only needed for tests within the package.

* Remove group key version when creating user area groups

Plus some minor clarity improvements.

* Fix version handling when updating drafts and sending to secure external

* Remove versions when creating external users

They are zero.

* Fix changing the admin flag

* Remove (almost) all local admin related code

* Improve readability

* Default to user key version zero when loading entropy

* Decrypt current groupKey with correct userGroupKey version

* Fix system application offline migrations

* Fix tutanota application offline migrations

* Improve offline migration functions

* Use AesKey type

* Minor improvements from review

* Use AesKey type instead of Aes128Key where possible

* Model update after rebase

* Fix getting user group key

Should never try to get from the cache like a normal group key.

* Fix getting former group key

Start ID was off-by-one.

* Minor changes from review.

We just checked all usages of all public methods of KeyLoaderFacade to make sure we're using the correct versions where we need them.

* More minor changes from review.

* Pass ownerKeyProvider instead of ownerKey when updating with the EntityClient

* Pass ownerKeyProvider only when necessary

* Document ownerKeyProvider parameter

* Fix offline database migration

* Fix unlocking the indexer data

---------

Co-authored-by: vaf <vaf@tutao.de>
Co-authored-by: bedhub <bedhub@users.noreply.github.com>
Co-authored-by: bed <bed@tutao.de>
2024-04-17 08:34:33 +00:00
Willow
a604badbad
Contact book provider (#6553)
* Added vCard import to attachments

Now, when user receives a vCard as attachment an import option is
displayed inside the attachment bubble, allowing the user to preview
and import the users contained inside that vCard.

The app handles both vCard mime types, text/vcard and text/x-vcard.

* [android] Added vCard Handling

* [android] Added readDataFile

* [ios] Fix iOS readFile function

The iOS readFile function was using the wrong Data constructor,
leading to an Error related to invalid URL when trying to read the file.

The readFile function now uses the Data(fileURLWithPath: ) instead of
Data(contentsOf: ), allowing us to pass file paths to be loaded.

* Add view file handling from native side to app's web part

Now the app is capable to handle native side calls asking for importing
files, mainly used when a user view a supported file and want that Tuta
app handles it.

Currently, the only supported format is .vcf and only on Android, since
iOS doesn't support setting our app as a handler for vcf files.

* Make array readonly

* Create ContactFacade

Implements a ContactFacade to communicate with the worker and handle
errors correctly.

* Show contact icon when attachment is a vCard file

* Add ContactFacadeTest

* Changes after review

* Moved vCard parsing logic to ContactImporter

* Create ContactImporter class

* [android] Fix readDataFile to read on I/O thread

* Implement device contacts import

Close #6467

Co-authored-by: mup <mup@tutao.de>
Co-authored-by: ivk <ivk@tutao.de>

* Fix importing contacts from Device book on Android

* Don't show incorrect mail address info on legacy plans

It is not true that legacy plans can have unlimited custom domains. Make
it not display anything here to prevent confusion.

Fixes #6540

* Changes after review

* Implement device contacts import

Close #6467

Co-authored-by: mup <mup@tutao.de>
Co-authored-by: ivk <ivk@tutao.de>

* Get Dirty info from contact on Android

This commit adds the isDirty property to a contact and return Dirty
contacts to the web part of the app, allowing the app to deal with
native updates.

* Handle native contact Updates

This commit adds a handler to deal with contacts that were added or
edited through the native. If created, inserts the new contact into the
server, otherwise, updates it.

* Apply contact deletion from native side

When user deletes a contact from the native side, the deletion is
applied to the server

* Adjust iOS types

* [android] Two-way contact sync on Android

* Reset Contact's dirty state during Contact update

* Two-way contact sync on iOS

* Fix nickname and deletedOnDevice

* Fix preview list scroll issue

* Don't show incorrect mail address info on legacy plans

It is not true that legacy plans can have unlimited custom domains. Make
it not display anything here to prevent confusion.

Fixes #6540

* Add new fields to Contact

This commit add new fields described in #6590 to the model and adapts
the ContactEditor and ContactViewer to handle the new fields.

* [android] Added new fields to Android Contact Import

* Fix Xcode warning for TaggedSqlValue

* [ios] Add new contact fields to iOS

* Add new fields to vCard

This commit adds the following fields:
- Middle Name
- Name Suffix
- Department (Inside ORG)
- URL

The field ROLE was changed to TITLE since that TITLE seems to be the
expected name for this field.

* Fix tests and add translations

This commit fixes the vCard import/export tests and adds the missing
translations for DE and DE_SIE.

* Code cleanup

* Code cleanup

* Fix bugs from review

* Reset selection in contact list view when deleting selected contents

Call selectNone on the list model to clear the selection after deleting
a selection of contacts.

Fixes #6623

* Fix wrong label on new event button tooltip

This should be newEvent_action; createEvent_label is used as a
placeholder for when the event name is empty in the edit event dialog.

Fixes #6626

* Lower the minimized mail editor overlay

The overlay was position a bit too high due to the recent
overlay changes.

* Events are removed immediately when deleting single or changing rules

Took out some code that was no longer useful. Long events are now always

taken out when updated, the new event will automatically be filled in.

close #6491
close #6444

Co-authored-by: ivk <ivk@tutao.de>

* Fix label in global settings clipping on mobile

* Makes version number copiable from about Dialog

This commit makes the Version Number, License and Company Name able
to be copied

fix #6605

* Fix SearchBar returning no results even with not enabled index

The users were able to trigger an empty search result even without
accepting to enable the search index. Now, even if the user tries
to bypass the dialog, the SearchBar will not return any result

fix #2689

* Fix Android unwanted auto login

This commit flags an intent that has already been handled by the
app as handled, avoiding that when the user opens the app an
intent re-deliver causes auto login.

fix #6322

* Fix client-side captcha verification; fix SignupFormTest

Fix Captcha matching hours 25-29 and allows it to match times that
will never be correct (but can be checked locally).

Add missing SignupFormTest to the test suite.

Fixes #6316

* Align all day events in the calendar on desktop

The ideal solution in my eyes is to rewrite the calendar header so that
the header and body for the day are in one column flex. Using flex
is better than constantly calculating the sizes of elements ourselves
both in code simplicity and performance.

Until then, this quick workaround seems to do the trick.

* Allow switching the calendar for accepted events

Co-authored-by: wec43 <wec@tutao.de>

* Change default email domain when adding email address on legacy plan

fix #6667

* Tell user they cannot add an alias before add alias dialog

* [ci, ios] Separate staging app for iOS

 - Introduce new schemes in iOS app for debug, staging and prod
 - Add new appId
 - Add jobs to get provisioning profiles/certificates for staging app
 - Introduce new Fastlane lanes
 - Add Jenkins steps to build/upload staging app

 Close #6591

* [android] Two-way contact sync on Android

* Fix an initial underscore being generated for Kotlin enum cases

Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>

* Add an onboarding wizard prototype

This adds a guide that is displayed during the first run after
installing the app. This also includes it's first page,
the welcome page. This will be expanded upon in further commits.

The icon design still needs to be finalised, so
I have inserted a placeholder for now.

* Make the onboarding wizard show only on first run

This adds a property called `isSetupComplete` to `DeviceConfig` used to
determine whether the onboarding wizard has been displayed before.
The property is set to true after the wizard is completed or skipped
causing the wizard only to display once per install.

* Add notifications page to the Android version of the onboarding wizard

Includes the android implementation.

Co-authored-by: mup <mup@tutao.de>

* Fix `licc` generating incorrect code for enums

* Stop asking for notification permissions at launch

Co-authored-by: ivk <ivk@tutao.de>

* Add the theme page to the onboarding wizard

Co-authored-by: ivk <ivk@tutao.de>

* Create a wrapper for onboarding wizard pages

Co-authored-by: ivk <ivk@tutao.de>

* Add the contacts page to the onboarding wizard

Co-authored-by: ivk <ivk@tutao.de>

* Add the app lock page to the onboarding wizard

Co-authored-by: ivk <ivk@tutao.de>

* Enable back buttons in the onboarding wizard

* Implement the notifications page for iOS

Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>

* Fix the next button overlapping the content in landscape view

I am not happy about the magic '92%' value but to remove it we would
need to calculate the remaining space from the breadcrumbs & dialog
height. This may do for now.

* Change the congratulations page header to 'Welcome to Tuta!'

We decided to change it during a meeting. This way we welcome the user
to the Tuta ecosystem instead of just the app.

* Change `RadioSelector` styling

This styles the `RadioSelector` into a 'radio button button' for the
lack of a better term. This was decided in a meeting.

* Remove skip button from onboarding wizard

* Fix the app lock page of the onboarding wizard having too much padding

* Change wizard breadcrumbs styling

This changes the breadcrumbs in the wizard to make the style discussed
during the meeting.

* Remove the help text from the lock method options in the onboarding flow

This is so the unlock method pages matches our design.

* Improve the text in the onboarding wizard

This tries to make the wizard less wordy & includes a couple
small fixes.

* Align buttons in the onboarding wizard

* Clean up the notification permission check on visibility change code

Co-authored-by: ivk <ivk@tutao.de>

* Use a smaller dialog for the onboarding wizard

Co-authored-by: ivk <ivk@tutao.de>

* Fix Android build breaking due to Kotlin JVM version

* Fix import errors

* Stop asking for notification permissions at launch on iOS

* Add the illustrations to the onboarding wizard

This needs some optimization as the illustrations cause the CSS
animations to lag. `Icons.ts` is not the best place to have the
illustrations so we should create a new file. We could also look at
sanitizing the SVGs once a way to keep the CSS classes in the SVG is
found.

* Disable the app lock page on the onboarding wizard if it is not needed

* Move the onboarding wizard illustrations into a separate file

The illustrations do not clutter up the icons file this way.

* Apply redesign of the onboarding wizard

This adds the next version of the illustrations and
changes some layouts.

* Optimise Onboarding Wizard Rendering

This tries to speed up the wait between pressing 'next' and the next
page of the onboarding wizard appearing.

* Bring back the visualizer plugin

We need it to diagnose chunk problems. It was removed because it was not
compatible with our version of `rollup` at the time.

Co-authored-by: ivk <ivk@tutao.de>

* Load the onboarding wizard's illustrations externally

As suggested by ivk, the illustrations are loaded in via an `img` tag
to avoid bloating the chunks. I have manually optimised and inserted the
illustrations again. This improves the performance of the wizard
drastically.

* Ignore the onboarding wizard's illustrations in screen readers

---------

Co-authored-by: mup <mrex@tuta.io>
Co-authored-by: paw <paw-hub@users.noreply.github.com>
Co-authored-by: mup <mup@tutao.de>
Co-authored-by: mac-github <mac-github@tutao.de>
Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com>
Co-authored-by: jat <jat@tutao.de>
Co-authored-by: wrd <wrd@tutao.de>
Co-authored-by: wec43 <wec@tutao.de>
Co-authored-by: tutao <hello@tutao.de>
Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 09:53:51 +00:00
nig
9e6393219d update sys model, finish MailDetails migration
* stop setting the offline db version to 0 for old databases
  all offline dbs in use now have this field set to 1 already or are
  outdated and there is no migration that we need to run anymore.
* use raw key for desktop offline db instead of passphrase. this will
  recreate the offline DB for desktop clients.
* update minimum compatible model versions for the offline migrator
* remove old offline migrations. the remaining ones are the ones added
  with the lastNonOutdatedClientVersion (3.118.12 since ~120 days) or
  later, so no client that uses an offline db from before that would be
  able to log in and an offline db left by such a client will not be
  migrated due to being outdated.

In order to finish the migration to MailDetails we need to delete all
mails (with and without mailDetails) and mailBodies.
This is needed as we do no longer store the mailBodies directly on the
mail, and we currently do not support updating specific ranges of mails
that exist in the offline storage.
Therefore, deleting only those mails that have no mailDetails set is not
possible, as available offline ranges for mails might be broken
afterward.

includes sys model 94 for supportInfo on customerInfo.

@co-authored-by: jhm@tutao.de
2024-02-05 11:59:59 +01:00
vaf
15713f1047 add tuta-crypt hybrid post-quantum encryption support
tutadb#1639
2023-12-21 10:41:51 +01:00
paw
0461d52074 Remove contact forms
Contact forms have been erased, so to ease maintenance of the client and
server, the code shall be removed.

tutadb#1615
2023-11-27 13:23:57 +01:00
wrd
c4edcb94cc Share Contact lists with other users
Co-authored-by: ivk <ivk@tutao.de>

close #5433
2023-08-24 17:07:50 +02:00
wrd
deebaab898 Contact lists
Co-authored-by: ivk <ivk@tutao.de>

close #5407
2023-08-24 17:07:50 +02:00
paw
18da1c6331 3.118.0 model changes 2023-08-24 17:07:50 +02:00
vaf
49449c426d Support Argon2id
Allow deriving keys with it if the server requests it, but do not use it
by default to create new keys.

tutadb#1559

Co-authored-by: @vitoreiji, @paw-hub, @charlag
2023-08-18 16:29:22 +02:00
nig
3a68f207dd add altered event instances
* dragging & dropping, editing single instances
* deleting single altered instances
* import altered event instances from (internal) invites or ical exports

due to how altered instances are created and how we do shared calendars,
there's a bunch of not-obvious rules when creating and editing these.

* altered instances are created by cloning the original event
  (internally called progenitor), removing the repeat rule and
  adding a recurrenceId field that contains the original start
  time of the event instance. altered instances have the same
  UID as the progenitor.
* altered instances have independent sequence numbers
* our progenitors have one exclusion for each altered instance
  to make alarm handling and rendering easier. this is enforced
  during import / invite handling.
* even with read-write-access to the calendar,
  you cannot edit events that have attendees
  because you can't send updates if you're not
  the organizer, and organizer is always owner
  of the calendar.
* this means that you can't invite people to
  shared calendars
* for internal events, we keep attendee lists in
  sync between all instances. this includes attendance
  status.
* when editing the whole series, changing the start
  time or repeat rule invalidates the recurrenceIds
  of the altered instances. We delete all altered
  instances if this happens instead of trying to
  re-apply edit operations.
2023-07-28 11:19:15 +02:00
vaf
b7839b8407
model changes for basic promotion support
tutadb#1443
2023-07-06 15:10:27 +02:00
mpfau
7dd13338f6
custom plans for legacy users tutadb#1501 (#5522)
Implement support for custom plans in CustomerInfo to help with migration.

tutadb#1501
2023-06-12 15:51:22 +02:00
paw
031aaae951 new pricing plans, see tutadb milestone 202 2023-05-25 11:19:59 +02:00
nok
1b902087af tutanota model v61 and sys model v85
we have a no-op migration because MissedNotifications
are not cached, which the model does not know about for
legacy reasons.

Co-authored-by: nig <nig@tutao.de>
2023-03-24 15:26:16 +00:00
vaf
1919cee2f5 add referral link setting and news item, see server issue 1349, 1350, 1351 2023-03-22 09:14:11 +00:00
map
94e7a26f2e improve balance calculation tutadb#1373 2023-03-02 10:56:30 +00:00
ivk
e01157d1d9 Fix formatting 2023-02-08 09:08:56 +01:00
map
c73fd842b3 update models and fix offline migration 2023-02-03 16:39:00 +01:00
vaf
7f1344f38a handle userGroupEncBucketKey for external users in CryptoFacade, see server issue 1313 2023-02-03 15:21:48 +01:00
ivk
58cbd35af0 Cleanup OfflineStorageMigrator 2023-02-02 15:18:25 +01:00
ivk
05a701d14c Fix offline DB being deleted every time
DB downgrade check was not implemented properly where it would
determine runtime version based on migrations. We run into a situation
where we had multiple model versions with no migrations which made the
check think that we are downgrading every time. Switching it to using
modelInfo fixed the issue.

Another issue was not running migrations (and non populating metadata)
after DB re-creation. We've added the code to run the migrator on the
re-created database and handling for the old invalid state.

fix #5044
2023-02-02 15:18:25 +01:00
nig
bd1119ad1a changes after review: naming and code structure 2023-01-20 10:26:06 +01:00
nig
9cd88f34dc [desktop] delete and recreate offlineDb if the client is older than db
this can happen if clients have run migrations with a newer client and
then downgraded.

close #4866
2023-01-20 10:26:06 +01:00
map
b29a7b319a add MailDetails feature, #4719
server issues: 1276, 1271, 1279, 1272, 1270, 1258, 1254, 1253, 1242, 1241
2023-01-12 11:41:40 +01:00
ivk
50b23ebd1b Run prettier on the whole project 2022-12-27 16:08:23 +01:00
nok
43b1718aa7 tutanota model 57
CreateMailFolderData without parent

rename systemFolders into folders

Co-authored-by: ivk <ivk@tutao.de>
2022-12-19 18:08:06 +01:00
ivk
74fe8833a5 Changes after review 2022-11-24 17:35:21 +01:00
ivk
704ee4a75a tutanota model v56 with updated MailboxProperties, #516 2022-11-24 17:35:21 +01:00
ivk
2c10ed53ad Fix running ownerGroup migration
There were multiple issues:
 - if the database is old enough we would try to run other migrations
  first which wouldn't work because the db structure is not there yet
 - if the db is not new we would never write the version for offline
  migration and would never run it because `undefined < 1` is always
  false.

fix #4696
2022-11-01 09:57:02 +01:00
ivk
b3588fe079 Remove entities when the owner group membership is lost
Add ownerGroup column to offline db.

We detect the relationship change by the update of the user. We track
current user in cache storage because it already was receiving it in
case of offline storage and storage already had appropriate lifecycle
for it.

We empty the tables instead of migrating them because we want to remove
them anyway due to corruption (see #4664)

fix #2874
2022-10-27 15:50:33 +02:00
nok
c3ea0572bd repair existing broken events in offline dbs
we have some cases of technically illegal events that got imported into
some offline DBs. they were serialized in a lossy way and can be
detected by checking for zeroed out start- and end times.

this migration deletes the event lists from the offline db that contain
such events, they will then be re-downloaded when the calendar is
populated in the cache postlogin action.

we're leaving events belonging to these lists in the cache, they will be
overwritten while redownloading because of the use of INSERT OR REPLACE
and the way we have set up our primary keys.

#4660
2022-10-27 15:50:33 +02:00
now
9bca636f76 Add offline migration for sys80 2022-10-05 10:23:14 +02:00
now
93f29f3abd Opt-in dialog 2022-10-05 10:23:14 +02:00
vis
5eb2f40096
Implement termination form. server issue 1184 2022-09-21 18:39:03 +02:00
jom
1660ebaab1 Adapt to gift cards model change 2022-06-13 13:34:56 +02:00
jom
ca177b74f5
Add framework for migrating offline database
When there is a model change on the server that would conflict with
the entities stored in the offline database, we need to do a migration
We generate some model diffs with the code generator and use them
for a compile-time check.

Co-authored-by: ivk <ivk@tutao.de>
2022-05-25 16:30:34 +02:00