Commit graph

58 commits

Author SHA1 Message Date
bed
61fe0304ba
Setup release pipline for crypto-primitives.wasm
In order to make use of the crypto-primitives crate from the web client
we now generate wasm file using wasm-pack and included these steps into
the dev and webapp build process.

In order to test the behavior we also made use of the exported primitives from the Ed255519Facade

Also adds test for the Ed25519 exported functions.

tuta#2102, tuta#2099, tuta#2098

Co-authored-by: hec <hec@tutao.de>
Co-authored-by: bedhub <bedhub@users.noreply.github.com>
2025-08-07 09:51:21 +02:00
yoy
de6848b898
feat(signup): Add Proof-of-work captcha
- Introduce Proof-of-Work Captcha to prevent mass signups.
- The PoW captcha executes when the user begins entering information into the sign-up form.
- The progressDialog will appear if the PoW captcha is not solved when the user clicks the "Next" button.
- Update SystemModel to v134

Co-authored-by: nig <nig@tutao.de>
Co-authored-by: toj<toj@tutao.de>
2025-07-10 13:27:23 +02:00
ivk
fba2b284ec [desktop] Use @signalapp/sqlcipher fork for db
Co-authored-by: paw <paw-hub@users.noreply.github.com>
2025-06-04 10:37:52 +02:00
Kinan
edbf281b88
switch to typeIds and attrIds, add SystemMV126, TutanotaMV86, BaseMV2
Refactor our instance deserialization/serialization pipeline, both on
TypeScript and on Rust [sdk] to use typeId and attributeIds instead of
typeNames and attributeNames. We furthermore ignore cardinalities
on associations until the instance layer and always
store associations as arrays. This commit introduces **eventual
consistency** on the client, i.e. we are from now on always storing data
in the newest schema format (activeApplicationVersionsForWritingSum)
which ensures that all data is already available on the client after
updating the client to a newer version. This removes the need for
offline migrations on the client and also removes backward migrations
on the server. Furthermore, the server model types are now available
on the client, retrievable through the ApplicationTypesFacade. This is
our first step towards FastSync.

Co-authored-by: nig <nig@tutao.de>
Co-authored-by: abp <abp@tutao.de>
Co-authored-by: jomapp <17314077+jomapp@users.noreply.github.com>
Co-authored-by: map <mpfau@users.noreply.github.com>
Co-authored-by: sug <sug@tutao.de>
Co-authored-by: Kinan <104761667+kibibytium@users.noreply.github.com>
2025-04-28 12:44:35 +02:00
sug
adc9071828 [build/test] exclude memcpy from rolldown as an optional dep 2025-02-17 12:05:09 +01:00
ivk
b3147c23ed Mailbox export: downloading & persistence
Remove unused method from FileFacade

Co-authored-by: wrd <wrd@tutao.de>
2025-01-27 12:02:44 +01:00
ivk
a8a4c75f74
[ci] Do not skip node-mimimi build for browser tests
We need mimimi for type checking the project. It's not clear how it
worked before.
2025-01-13 10:05:20 +01:00
ivk
592b9fbfbd
[build] Improve WASM loader API 2025-01-13 10:05:19 +01:00
ivk
7f15a755e3
Cache wasm2js output. Switch dist builds to esm. 2025-01-13 10:05:18 +01:00
ivk
2ed48135a8
Replace esbuild with Rolldown
- switch desktop build to esm
 - convert mithril to esm
 - run worker as esm module
 - fix dependency from DesktopAlarmScheduler to calendar app
 - switch napi-rs cli to 3.0
 - fix mimimi imports
 - remove hacky method on generated dispatcher
 - refactor native rollup plugins

 Co-authored-by: bir <bir@tutao.de>
2025-01-13 10:05:18 +01:00
nig
bed43c6040 don't build rust code for browser-only tests 2025-01-02 16:52:08 +01:00
ivk
acbc430161
[build] Improve tuta-wasm-loader API, allow not generating the fallback 2024-07-02 16:10:27 +02:00
mup
38b89c25f7 Change optimization level 2024-05-23 14:42:14 +00:00
mup
2734a794e0 Add emscripten to tests pipeline 2024-05-22 08:47:10 +00:00
mup
4dd743dfa0 Fix Tests for Fallback
Adapt the tests to work with the new format of loading the fallback and
the wasm files. This commit also fixes the ESBuild function to correctly
resolve the fallback and generate it.

Remove the hardcoded make command and add the option to use a provided
command instead of make. Also adds the possibility to provide env vars
and a working dir for Wasm generation.
2024-05-22 08:47:10 +00:00
mup
74ebf6834d Add Wasm fallback generation to build process
This commit adds the generation of WASM files and their respective
fallback to the build process.
2024-05-22 08:47:10 +00:00
mup
1733b27684 Add JavaScript fallback for Liboqs & Argon2
This commit adds the generation of a JavaScript transpile for the Liboqs
and Argon2 WebAssembly files. This is done through wasm2js that's
builtin on emcc.

WASM/JS fallbacks use the same interface and reduce the extra type
casting once initialized.

Co-authored-by: wec43 <wec@tutao.de>
Co-authored-by: paw <paw-hub@users.noreply.github.com>
2024-05-22 08:47:10 +00:00
ivk
7afc69a2e7 [build] Fix test build because importing "util" is a problem now? 2024-02-26 13:37:28 +00:00
nig
212ce6720f remove keytar 2024-01-18 14:23:01 +01:00
vaf
15713f1047 add tuta-crypt hybrid post-quantum encryption support
tutadb#1639
2023-12-21 10:41:51 +01:00
ivk
3bf53aa5c2 [ci] Use cached better-sqlite3 in github actions 2023-12-01 12:41:55 +01:00
tutao
d79c542eda Fix non-universal libraries being included when building universal 2023-11-27 13:37:36 +00:00
ivk
58721df61a Introduce domain configs to support 2FA across domains
#5638
2023-10-18 10:16:11 +02:00
nig
1adc36e08e [build] vendor electron-updater
* according to rollups type definitions, the output option property is
 ignored by rollup.rollup, so it moved to bundle.write
* we don't use commonjs deps in the desktop bundle anymore, so the
  commonjs plugin can go away from DesktopBuilder

[build] remove some unnecessary rollup plugins

[build] unify the native plugins

[build] vendor keytar

[build] vendor better-sqlite3 deps and restrict module resolution

it's now checked in and can be updated with buildSrc/updateLibs.js

close #4213
2023-08-30 16:38:00 +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
ivk
ada89d6fc2 Switch to @tutao/otest from ospec 2023-07-28 16:08:22 +02:00
nig
978d9780c2 fix linter errors for missing node: protocol
close #4367
2023-05-05 11:29:09 +02:00
ivk
2182b8dba1 Update typescript to 5.0.3 for all packages 2023-04-11 13:05:34 +02:00
ivk
a8564c77da [build] Make building packages faster
Building packages is a part of most build invocations. Our old approach
during dev builds was to

1. Invoke npm once to run build-packages
2. Invoke npm per each package to run tsc.

Unfortunately, npm is very slow. Additionally, the old approach was
leading to tsc re-checking some packages multiple times because of
dependencies between them. This would only worsen with time.

In our new approach we

1. invoke tsc only once
2. try to avoid invoking npm as much as possible

Unfortunately there is still one case where we invoke npx because we
can't be sure that the location of node_modules/.bin is stable as we
are sometimes used as a package. Without this we could reduce the time
even further.
2023-03-09 10:59:05 +00: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
nig
d0c95ee63b [maintenance] upgrade mithril.js to v2.2.2
close #4245
2022-07-07 13:53:49 +02:00
ivk
6998fdbc33
[build] Run typecheck with better output 2022-05-27 16:17:01 +02:00
ivk
7ec57e1190 Merge api/client tests into a single entry point 2022-05-16 07:59:43 +02:00
ivk
86e180b2c8
Cleanup/fixes after esbuild conversion 2022-05-11 11:44:43 +02:00
ivk
c86cfd6d71
[build] Cleanup build 2022-05-10 17:56:07 +02:00
ivk
458412795e
[build] esbuild for tests 2022-05-10 17:55:23 +02:00
nig
4b4e459490 [firefox] sanitize inline svg to fix potential hard-to-execute XSS
The Problem:
When you receive an email with an embedded svg like this:

```svg
<svg
    version="1.1"
    baseProfile="full"
    xmlns="http://www.w3.org/2000/svg"
>
<polygon id="triangle" points="0,0 0,50 50,0" fill="#009900"/>
<script type="text/javascript">
alert(localStorage.getItem("tutanotaConfig"));
</script>
</svg>
```
then

* drag the image up into the URL bar or
* right click - open in new tab - then click on the URL and hit enter

it will execute javascript in the context of tutanota. The above PoC
will display the "tutanotaConfig" local storage.
Just opening in a new tab doesn't trigger the javascript, due to a CSP
policy, but loading it via either of the above two methods does.

The fix:
* sanitize inline svg after loading them:
  + parse the xml file and get the svg node
  + reserialize it
  + sanitize it with DOMPurify
  + add an xml declaration back to the result and use that for display
* we can sanitize and return only the first svg element from the parsed
  tree because more than one svg element per document is invalid anyway.
* we only support utf-8 svg documents because there's a lot of encodings
  and we don't want to risk letting through unsanitized svg due to not
  being able to decode/parse it.
* any files with type image/svg+xml that don't parse as a utf-8 svg are
  replaced with an empty byte array before display.
2022-05-04 10:42:19 +02:00
ivk
721d436add Rewrite EventBusClientTest, use proper parsing for counter message
Also small improvements for TypeRef and assertThrows()
2022-03-09 14:20:20 +01:00
ivk
350d522533 [build] Fixes for admin client
1. Change getVersion() in nativeLibraryProvider to handle curious
`npm list` behavior.
2. Reorganize rollup plugins so that admin client can import our helper
plugins without importing rollup plugins from node_modules. This makes
it more resilient when we link against local tutanota-3 (libs hoisted
to upper level will not be found across the symlink).
3. Change LaunchHtml to not rely on mithril for the same reason.
2022-03-08 12:00:01 +01:00
jom
591554aa51 [build] Build better-sqlite3 on windows during Jenkins CI
This commit not only sets up the build for windows on jenkins,
it also consolidates how we get prebuilt binaries for native modules i.e. keytar and better-sqlite3
and generally has some refactorings
2022-03-07 10:26:06 +01:00
ivk
d54be5a7c2 [build] Change keytar to be compiled on demand
Compiling keytar in postinstall is problematic because we need node-gyp
to successfully finish installation. Because of that it is hard to
depend on tutanota-3 (e.g. in admin client).

Doing this on demand avoids the issue.
2022-02-22 14:31:28 +01:00
ivk
d09fed54d7 Webauth in desktop 2022-02-17 16:58:21 +01:00
jom
c9328df2af Use testdouble
This commit introduces testdouble as a mocking framework
as well as rewriting two tests to use it.
2022-02-17 14:04:21 +01:00
sas
7cb4828c56 Introduce persistent cache for desktop, close #3823 2022-02-15 09:54:54 +01:00
ivk
253441b9ac Convert codebase to Typescript, close #3746 close #3594
Co-authored-by: jom <jom@tutao.de>
Co-authored-by: thp <thp@tutao.de>
Co-authored-by: vis <vis@tutao.de>
2022-01-07 16:21:07 +01:00
jom
72d25e68a5 Fix test build failing due to invalid env params 2021-10-18 11:49:52 +02:00
ivk
b9da6d72b5 [build] Make creating env more explicit 2021-10-15 15:42:12 +02:00
ivk
dd976592d9 Replace fromCallback, remove the rest of Bluebird, close #2725 2021-08-11 11:23:35 +02:00
jom
f3227aa155
Enable spawning multiple build servers
And we spawn different build servers for make.js and test.js,
as well as splitting their output directories

fix #3233
2021-07-21 10:41:40 +02:00