Compare commits

...

325 Commits

Author SHA1 Message Date
Nad Chishtie
853008f20c Add example error pages 2020-03-20 17:04:12 +00:00
RiotRobot
c4f3d39d42 v1.5.13 2020-03-17 14:31:49 +00:00
RiotRobot
c84a01310f Prepare changelog for v1.5.13 2020-03-17 14:31:49 +00:00
RiotRobot
61bf0d5447 v1.5.13 2020-03-17 14:29:28 +00:00
RiotRobot
8002bc66d7 Upgrade matrix-react-sdk to 2.2.3 2020-03-17 14:29:06 +00:00
RiotRobot
c3553a2649 Upgrade matrix-js-sdk to 5.1.1 2020-03-17 14:28:23 +00:00
RiotRobot
d4a578542f v1.5.13-rc.1 2020-03-11 17:38:21 +00:00
RiotRobot
3dadc2d1d6 Prepare changelog for v1.5.13-rc.1 2020-03-11 17:38:21 +00:00
RiotRobot
149098921f v1.5.13-rc.1 2020-03-11 17:36:48 +00:00
RiotRobot
34817a0044 js-sdk & react-sdk rc.1 2020-03-11 17:36:18 +00:00
David Baker
87e32baefa Merge pull request #12688 from RiotTranslateBot/weblate-riot-web-riot-web
Update from Weblate
2020-03-11 14:24:40 +00:00
Weblate
789c52a9e1 Merge branch 'origin/develop' into Weblate. 2020-03-10 15:27:15 +00:00
Travis Ralston
32aa897ef8 Merge pull request #12670 from vector-im/travis/fix-docker-version
Fix Docker image version for develop builds
2020-03-10 09:27:08 -06:00
random
b7384a9a56 Translated using Weblate (Italian)
Currently translated at 100.0% (24 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/it/
2020-03-10 14:26:04 +00:00
Tirifto
6ec5dfc5f6 Translated using Weblate (Esperanto)
Currently translated at 100.0% (24 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/eo/
2020-03-10 14:26:04 +00:00
Travis Ralston
b0f71bc990 Fix Docker image version for develop builds
Turns out it helps to use the right syntax.

Fixes https://github.com/vector-im/riot-web/issues/12009
2020-03-09 19:57:52 -06:00
catborise
ecdfe24fa8 Translated using Weblate (Turkish)
Currently translated at 95.8% (23 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/tr/
2020-03-08 10:25:55 +00:00
Walter
0688641554 Translated using Weblate (Russian)
Currently translated at 100.0% (24 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/ru/
2020-03-08 10:25:55 +00:00
MamasLT
38644d9d30 Translated using Weblate (Lithuanian)
Currently translated at 100.0% (24 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/lt/
2020-03-08 10:25:55 +00:00
Tentarial
a751dd63fa Translated using Weblate (German)
Currently translated at 100.0% (24 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/de/
2020-03-08 10:25:54 +00:00
Osoitz
7da915b1b0 Translated using Weblate (Basque)
Currently translated at 100.0% (24 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/eu/
2020-03-08 10:25:54 +00:00
Weblate
c20028782c Merge branch 'origin/develop' into Weblate. 2020-03-05 17:05:23 +00:00
Szimszon
e2de059a78 Translated using Weblate (Hungarian)
Currently translated at 100.0% (24 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/hu/
2020-03-05 17:05:22 +00:00
Jeff Huang
a16faa2610 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (24 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/zh_Hant/
2020-03-05 17:05:22 +00:00
Travis Ralston
71f2f0e7c9 Merge pull request #12612 from Pestdoktor/docker-cleanup
docker: optimize custom sdk builds
2020-03-05 10:05:15 -07:00
Jonas Fentker
f5bd5a345e docker: download required branch only 2020-03-04 23:14:42 +01:00
Weblate
3ffce87d3a Merge branch 'origin/develop' into Weblate. 2020-03-04 13:08:34 +00:00
Nathan Follens
207677f1af Translated using Weblate (West Flemish)
Currently translated at 100.0% (24 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/vls/
2020-03-04 13:08:34 +00:00
Kévin C
d67d640ef9 Translated using Weblate (French)
Currently translated at 100.0% (24 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/fr/
2020-03-04 13:08:34 +00:00
Nathan Follens
60e5b5f94e Translated using Weblate (Dutch)
Currently translated at 100.0% (24 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/nl/
2020-03-04 13:08:34 +00:00
Besnik Bleta
959a6e91a0 Translated using Weblate (Albanian)
Currently translated at 100.0% (24 of 24 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/sq/
2020-03-04 13:08:33 +00:00
RiotRobot
872a7a74fb Reset matrix-react-sdk back to develop branch 2020-03-04 13:07:59 +00:00
RiotRobot
4548831ac5 Reset matrix-js-sdk back to develop branch 2020-03-04 13:07:45 +00:00
RiotRobot
d88f9ed2c0 Merge branch 'master' into develop 2020-03-04 13:06:43 +00:00
RiotRobot
6e68c106f7 v1.5.12 2020-03-04 12:58:03 +00:00
RiotRobot
2507073c20 Prepare changelog for v1.5.12 2020-03-04 12:58:03 +00:00
RiotRobot
096831c9df v1.5.12 2020-03-04 12:01:38 +00:00
RiotRobot
c26396d693 Upgrade matrix-react-sdk to 2.2.1 2020-03-04 12:01:31 +00:00
RiotRobot
b52b0f525f Log packages when checking version 2020-03-04 12:00:37 +00:00
Weblate
39ee5d77bd Merge branch 'origin/develop' into Weblate. 2020-03-03 22:27:52 +00:00
Michael Telatynski
48c8f16a4c Merge pull request #12590 from vector-im/t3chguy/sso
riot-desktop open SSO in browser so user doesn't have to auth twice
2020-03-03 22:27:46 +00:00
J. Ryan Stinnett
adc329c67f Revert "Upgrade to Electron 8.0.2"
This reverts commit 9b9d585af0.
2020-03-03 13:21:49 -07:00
J. Ryan Stinnett
2a5438d636 Revert "Remove will-navigate comment after Electron fix"
This reverts commit 749d7e8e4c.
2020-03-03 13:20:12 -07:00
Michael Telatynski
706834939f Revert "Remove will-navigate as we expect it to be broken like pre-8.0.2"
This reverts commit fb656ce8bd.
2020-03-03 13:20:03 -07:00
tctovsli
4525ead1df Translated using Weblate (Norwegian Nynorsk)
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/nn/
2020-03-02 20:25:33 +00:00
tctovsli
1f42f33102 Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/nb_NO/
2020-03-02 20:25:33 +00:00
forteller
0e3e1f3a9d Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/nb_NO/
2020-03-02 20:25:33 +00:00
Szimszon
4399af4189 Translated using Weblate (Hungarian)
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/hu/
2020-03-02 20:25:33 +00:00
Tentarial
2514f11471 Translated using Weblate (German)
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/de/
2020-03-02 20:25:33 +00:00
Michal Stanke
0546c74b3b Translated using Weblate (Czech)
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/cs/
2020-03-02 20:25:33 +00:00
ctr
340b6bf0d2 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/zh_Hans/
2020-03-02 20:25:33 +00:00
Michael Telatynski
bb6afd7c30 backport riot-desktop implementation into riot-web 2020-03-02 20:16:41 +00:00
Michael Telatynski
09ed0e781a Update copy for SSO modal 2020-03-02 20:04:31 +00:00
RiotRobot
94ceb5a46b Reset SDKs back to develop branch 2020-03-02 17:57:08 +00:00
RiotRobot
d077165858 Merge branch 'master' into develop 2020-03-02 17:55:04 +00:00
RiotRobot
43b70bf720 v1.5.11 2020-03-02 17:51:01 +00:00
RiotRobot
0c4048484e Prepare changelog for v1.5.11 2020-03-02 17:51:00 +00:00
RiotRobot
8710f7d196 v1.5.11 2020-03-02 17:47:58 +00:00
RiotRobot
620414187f Upgrade matrix-react-sdk to 2.2.0 2020-03-02 17:47:53 +00:00
RiotRobot
e71dcacd2d Upgrade matrix-js-sdk to 5.1.0 2020-03-02 17:47:32 +00:00
Michael Telatynski
178c61dbf7 fix typo 2020-03-02 15:01:06 +00:00
Michael Telatynski
c197661be0 riot-desktop open SSO in browser so user doesn't have to auth twice 2020-03-02 14:59:55 +00:00
Michael Telatynski
fb656ce8bd Remove will-navigate as we expect it to be broken like pre-8.0.2 2020-03-02 13:08:04 +00:00
J. Ryan Stinnett
749d7e8e4c Remove will-navigate comment after Electron fix
Electron 8.0.2 and later (which we're now using) resolves this issue with
`will-navigate`.
2020-03-02 13:07:49 +00:00
Michael Telatynski
e238fead7c Merge pull request #12585 from vector-im/t3chguy/sso
Fix SSO flows for electron 8.0.2 by re-breaking will-navigate
2020-03-02 12:56:41 +00:00
Michael Telatynski
0d9be8c255 Remove will-navigate as we expect it to be broken like pre-8.0.2 2020-03-02 11:09:06 +00:00
Travis Ralston
0e37aa9f69 Merge pull request #12563 from krkk/noscript
index.html: Place noscript on top of the page
2020-02-28 13:43:17 -07:00
Travis Ralston
22bc98c8bc Merge branch 'develop' into noscript 2020-02-28 13:34:39 -07:00
J. Ryan Stinnett
769c8b1f27 Merge pull request #12561 from vector-im/jryans/elec-will-nav
Remove will-navigate comment after Electron fix
2020-02-28 18:02:55 +00:00
J. Ryan Stinnett
1043b0eb11 Remove will-navigate comment after Electron fix
Electron 8.0.2 and later (which we're now using) resolves this issue with
`will-navigate`.
2020-02-28 11:42:08 +00:00
J. Ryan Stinnett
6bc79ad54a Merge pull request #12552 from vector-im/jryans/safari-e2e-idb
Update loading test for JS SDK IDB change
2020-02-27 16:48:16 +00:00
J. Ryan Stinnett
c70bfe1f91 Update loading test for JS SDK IDB change
Part of https://github.com/vector-im/riot-web/issues/12207
2020-02-27 14:57:52 +00:00
J. Ryan Stinnett
a4512ffa6d Merge pull request #12528 from vector-im/jryans/upgrade-deps-2020-02-26
Upgrade deps
2020-02-27 11:24:45 +00:00
J. Ryan Stinnett
bb5aa94707 Upgrade deps 2020-02-26 15:04:38 +00:00
RiotRobot
03f63397ff v1.5.11-rc.1 2020-02-26 14:37:19 +00:00
RiotRobot
b29a3721d2 Prepare changelog for v1.5.11-rc.1 2020-02-26 14:37:19 +00:00
RiotRobot
00244d5428 v1.5.11-rc.1 2020-02-26 14:35:20 +00:00
RiotRobot
a4d01a5f04 Upgrade matrix-react-sdk to 2.2.0-rc.1 2020-02-26 14:34:56 +00:00
RiotRobot
4fced076b7 Upgrade matrix-js-sdk to 5.1.0-rc.1 2020-02-26 14:33:57 +00:00
J. Ryan Stinnett
9b9d585af0 Upgrade to Electron 8.0.2 2020-02-26 13:44:07 +00:00
J. Ryan Stinnett
76430a9c77 Merge pull request #12523 from vector-im/jryans/relax-windows-signing
Change Windows signing to warning when missing token
2020-02-26 13:31:48 +00:00
Michael Telatynski
dacbc4dc6d Merge pull request #12524 from vector-im/t3chguy/eval
Modernizr remove t3st/es6/contains
2020-02-26 12:23:34 +00:00
Michael Telatynski
7c84e406ac Modernizr remove t3st/es6/contains
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-26 12:16:35 +00:00
J. Ryan Stinnett
096a828e44 Change Windows signing to warning when missing token
This allows Windows builds to complete when the singing token is not present.
2020-02-26 11:54:20 +00:00
Michael Telatynski
4916ed0870 Merge pull request #12519 from vector-im/t3chguy/eval
Switch out any eval-using Modernizr rules
2020-02-26 11:36:58 +00:00
J. Ryan Stinnett
d7893e1d58 Merge pull request #12522 from RiotTranslateBot/weblate-riot-web-riot-web
Update from Weblate
2020-02-26 11:33:18 +00:00
Nils J. Haugen
22dc0ba772 Translated using Weblate (Norwegian Nynorsk)
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/nn/
2020-02-26 11:31:36 +00:00
Michael Telatynski
37e17133bc Switch out any eval-using Modernizr rules
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-26 10:24:10 +00:00
Michael Telatynski
cf52ccad67 Merge pull request #12487 from vector-im/t3chguy/spellcheck
Notify electron of language changes
2020-02-26 09:52:30 +00:00
J. Ryan Stinnett
81578fc3cf Merge pull request #12503 from vector-im/jryans/relax-notarisation-check
Relax macOS notarisation check to print a warning
2020-02-25 13:30:09 +00:00
J. Ryan Stinnett
bdb395aa41 Change to banner style 2020-02-25 12:05:36 +00:00
J. Ryan Stinnett
420537a64d Relax macOS notarisation check to print a warning
This makes it a bit more friendly to build macOS Electron builds without a
notarisation config set up by only warning when it is missing.
2020-02-25 11:44:33 +00:00
Michael Telatynski
af0b57bcda make BasePlatform::setLanguage sync, handle promises internally
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-25 10:57:41 +00:00
J. Ryan Stinnett
9d1dbf4ce9 Merge pull request #12486 from vector-im/jryans/clarify-desktop-browsers
Clarify supported tier means desktop OSes
2020-02-24 17:27:31 +00:00
Michael Telatynski
5117efaf98 Notify electron of language changes
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-24 17:14:23 +00:00
J. Ryan Stinnett
b8766d5fb4 Clarify supported tier means desktop OSes
This clarifies that the "supported" tier is for browser and the official app on
desktop OSes only.

Fixes https://github.com/vector-im/riot-web/issues/12421
2020-02-24 16:52:30 +00:00
Michael Telatynski
421cd41279 Merge pull request #12477 from vector-im/t3chguy/fix_downloading
Use noreferrer in addition to noopener for edge case browsers
2020-02-24 13:37:50 +00:00
J. Ryan Stinnett
f98ca56b5e Merge pull request #12466 from vector-im/jryans/a11y-editor-keyboard
Document start / end composer shortcuts
2020-02-24 12:02:13 +00:00
David Baker
e3cbcc8fbd Merge pull request #12480 from RiotTranslateBot/weblate-riot-web-riot-web
Update from Weblate
2020-02-24 11:53:38 +00:00
Balázs Meskó
37c4da5614 Translated using Weblate (Hungarian)
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/hu/
2020-02-24 11:34:36 +00:00
Michael Telatynski
af17ca11c7 Use noreferrer in addition to noopener for edge case browsers
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-23 22:14:30 +00:00
Karol Kosek
b571ff766c index.html: Place noscript on top of the page
Before this change, you had to scroll down to see the noscript element.
This change places the noscript element on top of the page making sure
that a user will see this message when site is loaded without JavaScript.

Signed-off-by: Karol Kosek <krkk@krkk.ct8.pl>
2020-02-22 21:14:01 +01:00
J. Ryan Stinnett
9fb807772b Document start / end composer shortcuts
This documents shortcuts for jumping to the start / end of the composer
contents.

Part of https://github.com/vector-im/riot-web/issues/12438
Depends on https://github.com/matrix-org/matrix-react-sdk/pull/4108
2020-02-21 19:00:47 +00:00
Weblate
aa56edddd8 Merge branch 'origin/develop' into Weblate. 2020-02-21 17:34:06 +00:00
David Baker
65687dfd6f Merge pull request #12464 from vector-im/dbkr/move_bk_pipelines
Remove buildkite pipeline
2020-02-21 17:33:59 +00:00
David Baker
67eb261ddb Remove buildkite pipeline
Now moved to the pipelines repo
2020-02-21 17:20:58 +00:00
jakobrs
5fcb67d646 Translated using Weblate (Norwegian Bokmål)
Currently translated at 91.3% (21 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/nb_NO/
2020-02-20 21:24:48 +00:00
J. Ryan Stinnett
82652de078 Merge pull request #12435 from vector-im/jryans/rm-release-exec
Remove exec so release script continues
2020-02-20 13:37:50 +00:00
J. Ryan Stinnett
106ed43f36 Remove exec so release script continues
We now want to do post-processing after the JS SDK release script, so we can't
use `exec` here.
2020-02-20 12:10:26 +00:00
J. Ryan Stinnett
de71e36843 Reset matrix-react-sdk back to develop branch 2020-02-20 12:01:58 +00:00
J. Ryan Stinnett
120d36d70b Reset matrix-js-sdk back to develop branch 2020-02-20 12:01:58 +00:00
Michael Telatynski
d6587b9094 Merge pull request #12425 from vector-im/t3chguy/persist
Use Persistent Storage where possible
2020-02-20 11:56:59 +00:00
Michael Telatynski
5cc0cef06c Use Persistent Storage where possible
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-20 00:38:09 +00:00
RiotRobot
eb66d62f1a v1.5.10 2020-02-19 16:23:51 +00:00
RiotRobot
aba70979ba Prepare changelog for v1.5.10 2020-02-19 16:23:51 +00:00
RiotRobot
3147624df2 v1.5.10 2020-02-19 16:21:35 +00:00
RiotRobot
dafb2f01b1 released react-sdk & js-sdk 2020-02-19 16:20:44 +00:00
Michael Telatynski
2c572bbe1e Merge pull request #12292 from vector-im/t3chguy/usercontent
Get rid of dependence on usercontent.riot.im
2020-02-19 13:00:02 +00:00
Michael Telatynski
44ec8198e5 Merge branches 'develop' and 't3chguy/usercontent' of github.com:vector-im/riot-web into t3chguy/usercontent
 Conflicts:
	README.md
2020-02-19 12:51:34 +00:00
David Baker
5ac9902384 Switch back to develop deps 2020-02-17 14:15:21 +00:00
RiotRobot
5e44d174e8 Merge branch 'master' into develop 2020-02-17 13:44:59 +00:00
RiotRobot
a5d5e2800c v1.5.9 2020-02-17 13:42:37 +00:00
RiotRobot
b225367e0d Prepare changelog for v1.5.9 2020-02-17 13:42:36 +00:00
RiotRobot
38cd6a0d0c v1.5.9 2020-02-17 13:40:07 +00:00
RiotRobot
9b5655c1fa Released js-sdk & react-sdk 2020-02-17 13:39:24 +00:00
J. Ryan Stinnett
7168bdd6dc Merge pull request #12377 from vector-im/jryans/experimental-support-tier
Add experimental support tier
2020-02-17 12:40:58 +00:00
J. Ryan Stinnett
e482d69034 Merge pull request #12374 from vector-im/jryans/release-tag-tweaks
Automate SDK dep upgrades for release
2020-02-17 12:34:54 +00:00
J. Ryan Stinnett
e1eb354c1c Add experimental support tier
This updates and rewrites the supported environments portion of the README. It
also adds a new experimental support tier to clarify how we'll handle things
like installed PWAs and mobile web.
2020-02-14 18:04:54 +00:00
J. Ryan Stinnett
585d40f4c1 Reset SDK deps back to develop after a release
This automates the (frequently forgotten) step of resetting SDK deps back to the
develop branch after merging the release to develop.
2020-02-14 12:21:54 +00:00
J. Ryan Stinnett
a26bd6ef94 Add auto-upgrade support for SDK deps
This automates the SDK upgrade step of the release process.
2020-02-14 11:43:08 +00:00
J. Ryan Stinnett
aa95dcc0cb Check the next tag when looking for the latest version 2020-02-14 11:04:39 +00:00
RiotRobot
08c149ed66 v1.5.9-rc.1 2020-02-13 17:56:15 +00:00
RiotRobot
9dd89dff6a Prepare changelog for v1.5.9-rc.1 2020-02-13 17:56:14 +00:00
RiotRobot
49ece1cbf9 v1.5.9-rc.1 2020-02-13 17:53:36 +00:00
RiotRobot
35204416bf Upgrade JS SDK to 5.0.0-rc.1 and React SDK to 2.1.0-rc.2 2020-02-13 17:50:29 +00:00
Michael Telatynski
56f9149e84 update webpack paths
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-13 17:00:17 +00:00
Michael Telatynski
7664eb27c4 Move bulk to react-sdk and reference it from riot-web land
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-13 16:58:28 +00:00
Michael Telatynski
22d0d1029e update README
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-13 16:55:23 +00:00
Michael Telatynski
b7ed7a1dd7 Update comments and such
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-13 16:53:45 +00:00
Michael Telatynski
2645e6f525 Merge branches 'develop' and 't3chguy/usercontent' of github.com:vector-im/riot-web into t3chguy/usercontent 2020-02-13 16:36:11 +00:00
J. Ryan Stinnett
036348cd60 Electron 8.0.0 crashes on macOS, reverting to 7.1.12 2020-02-13 15:24:59 +00:00
J. Ryan Stinnett
51f2afb7b7 Add allow-jit entitlement from electron-builder defaults 2020-02-13 15:02:22 +00:00
J. Ryan Stinnett
2c0968e40e Return to default deb after install script
Upstream electron-builder now contains the SUID sandbox change.

See also https://github.com/electron-userland/electron-builder/pull/4163
2020-02-13 14:52:44 +00:00
J. Ryan Stinnett
3eb5eb1d21 Upgrade electron-builder 2020-02-13 14:50:19 +00:00
J. Ryan Stinnett
4a1b9d8ea4 Upgrade to Electron 8.0.0 2020-02-13 14:45:42 +00:00
J. Ryan Stinnett
1a84836fd0 Merge pull request #12354 from RiotTranslateBot/weblate-riot-web-riot-web
Update from Weblate
2020-02-13 14:35:02 +00:00
Weblate
2e2d90f335 Merge branch 'origin/develop' into Weblate. 2020-02-10 19:18:54 +00:00
Michael Telatynski
b3fb496212 Merge pull request #12310 from MattWThomas/patch-1
Add top left menu shortcut
2020-02-10 19:18:48 +00:00
Matthew Thomas
a24959319d Add top left menu shortcut
Add <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>`</kbd>
2020-02-10 12:59:35 -06:00
MozillaKab
e923f935ea Added translation using Weblate (Kabyle) 2020-02-09 03:24:46 +00:00
Michael Telatynski
0c62db3615 revert webpack changes 2020-02-07 22:09:41 +00:00
Michael Telatynski
d39d89de83 revert modernizr change 2020-02-07 22:08:57 +00:00
Michael Telatynski
98773df76e Get rid of dependence on usercontent.riot.im 2020-02-07 22:07:30 +00:00
Michael Telatynski
54f7347da5 Merge pull request #12272 from vector-im/t3chguy/m1
Remove modernizr rules for features on which we only soft depend
2020-02-06 21:22:40 +00:00
Michael Telatynski
95f749ccd9 Remove modernizr rules for features on which we only soft depend
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-06 18:01:53 +00:00
Michael Telatynski
eb62972aed Merge pull request #12258 from vector-im/t3chguy/csp
Embed CSP meta tag and stop using script-src unsafe-inline
2020-02-06 12:15:17 +00:00
Michael Telatynski
3a5a904afb Update src/vector/index.html
Co-Authored-By: J. Ryan Stinnett <jryans@gmail.com>
2020-02-06 11:54:05 +00:00
Michael Telatynski
7d68c2c465 re-add child-src as the common ancestor of worker-src and frame-src for backwards compat and split onto multiple lines for readability
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-06 11:52:21 +00:00
Michael Telatynski
074a3cfaaf fix font-src of CSP 2020-02-06 10:17:38 +00:00
Michael Telatynski
2b5e028cbe add comment 2020-02-05 16:37:19 +00:00
Michael Telatynski
ec20e1ece2 Embed CSP meta tag and stop using script-src unsafe-inline 2020-02-05 16:35:23 +00:00
Travis Ralston
b107da09fa Merge pull request #12251 from vector-im/jaywink/add-contribute-json
Add contribute.json
2020-02-05 15:21:07 +00:00
Jason Robinson
9534a25270 Fix contribute.json location as per spec
Signed-off-by: Jason Robinson <jasonr@matrix.org>
2020-02-05 16:28:44 +02:00
Michael Telatynski
f7e5613f30 Merge pull request #12232 from vector-im/t3chguy/modernizr
Improve Browser checks
2020-02-05 14:15:01 +00:00
Michael Telatynski
7d49078f22 Change them to Modernizr tests and add more rules 2020-02-05 14:05:46 +00:00
Jason Robinson
3abe61e13b Add contribute.json
This document is required for example for all Mozilla websites
and makes sense for Riot to also describe itself - see
https://www.contributejson.org/

Signed-off-by: Jason Robinson <jasonr@matrix.org>
2020-02-05 15:25:09 +02:00
Michael Telatynski
032efafe2e Rejig things around to catch Promises not being a thing at all 2020-02-04 13:35:05 +00:00
Michael Telatynski
087bcf0ae6 fix declaration order 2020-02-04 11:11:06 +00:00
Michael Telatynski
cdc1202bbe Add custom browser checks outside of Modernizr 2020-02-04 11:08:52 +00:00
Michael Telatynski
bceca49cdc Update vendored modernizr 2020-02-04 11:00:47 +00:00
Matthew Hodgson
c3e6a30789 Merge branch 'develop' of git+ssh://github.com/vector-im/riot-web into develop 2020-01-31 15:22:44 +00:00
Matthew Hodgson
87913e6c98 yarn electron nowadays does yarn build already 2020-01-31 15:22:16 +00:00
J. Ryan Stinnett
00fa5aad85 Enable padlock flag by default 2020-01-31 14:31:13 +00:00
J. Ryan Stinnett
2818de4d4a Merge pull request #12173 from vector-im/jryans/padlock-flag
Document padlock flag
2020-01-31 13:44:04 +00:00
J. Ryan Stinnett
e9f8700d6b Document padlock flag 2020-01-31 13:36:16 +00:00
Matthew Hodgson
d8b059452c fix rogue ` 2020-01-31 13:04:00 +00:00
J. Ryan Stinnett
98b8ba2650 Merge pull request #12126 from vector-im/t3chguy/develop_cs
Enable cross-signing on /develop
2020-01-29 16:37:52 +00:00
Michael Telatynski
37d924731d Enable cross-signing on /develop 2020-01-29 11:47:34 +00:00
Travis Ralston
4affaaf309 Merge pull request #12110 from vector-im/travis/legacy-decorators
Switch back to legacy decorators
2020-01-28 16:54:10 +00:00
Travis Ralston
d3d6e4ae77 Switch back to legacy decorators
For https://github.com/matrix-org/matrix-react-sdk/pull/3961
2020-01-28 16:46:02 +00:00
Travis Ralston
daf6aaaf30 Merge pull request #12102 from vector-im/travis/babel-skinning
Update babel targets
2020-01-28 14:50:25 +00:00
Travis Ralston
d50b52cdc5 Try to fix Jest 2020-01-28 14:31:09 +00:00
Travis Ralston
cff4ad9e82 Remove legacy and stop using deprecated things 2020-01-28 14:21:26 +00:00
Travis Ralston
e3e7a47aea Update babel targets 2020-01-28 12:48:27 +00:00
J. Ryan Stinnett
c30f901716 Merge pull request #12076 from vector-im/jryans/fetch-deps-lint
Install deps for linting
2020-01-27 16:13:10 +00:00
J. Ryan Stinnett
0ad0cbeb35 Install deps for linting 2020-01-27 16:05:41 +00:00
J. Ryan Stinnett
8ca6c2c433 Flip SDKs back to develop 2020-01-27 16:01:12 +00:00
RiotRobot
9782599c69 Merge branch 'master' into develop 2020-01-27 12:02:44 +00:00
RiotRobot
768cabe4bb v1.5.8 2020-01-27 11:57:49 +00:00
RiotRobot
5d01384af2 Prepare changelog for v1.5.8 2020-01-27 11:57:49 +00:00
RiotRobot
15a77e8826 v1.5.8 2020-01-27 11:52:56 +00:00
RiotRobot
dd26d43173 js-sdk 4.0.0 & react-sdk 2.0.0 2020-01-27 11:52:18 +00:00
David Baker
59d3bd2746 Merge pull request #12062 from RiotTranslateBot/weblate-riot-web-riot-web
Update from Weblate
2020-01-27 10:07:37 +00:00
Weblate
1bbb104600 Merge branch 'origin/develop' into Weblate. 2020-01-24 22:47:37 +00:00
J. Ryan Stinnett
9c258f9da9 Merge pull request #12049 from vector-im/jryans/webpack-minimal
Change to minimal Webpack output
2020-01-24 22:47:32 +00:00
J. Ryan Stinnett
4c4f885f25 Change to minimal Webpack output
This changes Webpack to only output errors, warnings, or new compilations.
This has the effect of hiding the massive list of modules. The giant list was
actually _hiding_ warnings because they appear first and scroll off the
terminal.
2020-01-24 22:34:15 +00:00
Weblate
fb32d41b3e Merge branch 'origin/develop' into Weblate. 2020-01-24 15:57:42 +00:00
Travis Ralston
2445f19431 Merge pull request #12015 from vector-im/travis/user-lists-labs
Remove docs for new invite dialog labs feature
2020-01-24 08:57:36 -07:00
Damir Jelić
7aff020d4d Merge branch 'poljar/seshat-ui' into develop 2020-01-24 14:40:54 +01:00
Weblate
192f2b8892 Merge branch 'origin/develop' into Weblate. 2020-01-24 13:40:37 +00:00
Weblate
3d804665da Merge branch 'origin/develop' into Weblate. 2020-01-24 13:39:07 +00:00
Damir Jelić
c0558f3527 Merge branch 'poljar/seshat-filepanel' into develop 2020-01-24 14:38:20 +01:00
Balázs Meskó
d6a5d701fe Translated using Weblate (Hungarian)
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/hu/
2020-01-24 10:23:08 +00:00
Travis Ralston
a34507f6e1 Remove DMs flag from the config too 2020-01-23 17:15:53 -07:00
Travis Ralston
8b08ba05c2 Remove docs for new invite dialog labs feature
It's the default now: https://github.com/matrix-org/matrix-react-sdk/pull/3906
2020-01-22 21:16:18 -07:00
Travis Ralston
9ee7febd9b Merge pull request #12008 from vector-im/travis/more-legal
Fix the remainder of the cookie links
2020-01-22 20:29:41 -07:00
Travis Ralston
47d88d6b79 Fix the remainder of the cookie links
Fixes https://github.com/vector-im/riot-web/issues/10362

Per https://github.com/vector-im/riot-web/pull/11998#issuecomment-577329852
2020-01-22 11:55:09 -07:00
J. Ryan Stinnett
d7e47841e5 Merge pull request #12001 from vector-im/jryans/bash-docker
Use bash in Docker scripts
2020-01-22 17:48:57 +00:00
J. Ryan Stinnett
b6963d0e5c Use bash in Docker scripts
Our Docker scripts use Bash-style conditionals that aren't supported by the
default Debian shell.
2020-01-22 17:45:22 +00:00
Travis Ralston
1b8ea4b6d7 Merge pull request #11999 from vector-im/travis/develop-docker
Use debian to build the Docker image
2020-01-22 10:04:01 -07:00
Travis Ralston
51a97571a0 Use debian to build the Docker image
Fixes not having certain OS capabilities to build some packages.
2020-01-22 09:08:05 -07:00
Michael Telatynski
1d53fc41ea Merge pull request #11998 from vector-im/t3chguy/update_config
Update cookie policy urls on /app and /develop config.json
2020-01-22 15:58:13 +00:00
Michael Telatynski
0798945109 Update cookie policy urls on /app and /develop config.json 2020-01-22 15:49:00 +00:00
Michael Telatynski
8d769dafca Merge pull request #11996 from vector-im/t3chguy/buildkite
BuildKite: Only deploy to /develop if everything else passed
2020-01-22 15:25:15 +00:00
Michael Telatynski
5d95a3ef7e Only deploy to /develop if everything else passed 2020-01-22 15:04:31 +00:00
J. Ryan Stinnett
0f24950466 Merge pull request #11995 from vector-im/jryans/extra-report-content
Add docs for admin report content message
2020-01-22 14:25:52 +00:00
RiotRobot
902252ad93 v1.5.8-rc.2 2020-01-22 14:24:50 +00:00
RiotRobot
43c35a760b Prepare changelog for v1.5.8-rc.2 2020-01-22 14:24:49 +00:00
RiotRobot
cd3fafb2b0 v1.5.8-rc.2 2020-01-22 14:22:40 +00:00
David Baker
eb5e14661d Actually pull in react-sdk rc.2 2020-01-22 14:20:46 +00:00
J. Ryan Stinnett
fe15d3b7c1 Add docs for admin report content message
Part of https://github.com/vector-im/riot-web/issues/11992
2020-01-22 14:18:29 +00:00
RiotRobot
ebd3f0e4e1 v1.5.8-rc.1 2020-01-22 13:22:19 +00:00
RiotRobot
5673d51cec Prepare changelog for v1.5.8-rc.1 2020-01-22 13:22:18 +00:00
RiotRobot
323762ffa7 v1.5.8-rc.1 2020-01-22 13:16:19 +00:00
David Baker
8913eba60d react-sdk rc.2 2020-01-22 13:06:37 +00:00
David Baker
a90e56a22b Merge pull request #11994 from vector-im/dbkr/steal-daves-webpack_rel
Fix webpack config (by stealing Dave's config)
2020-01-22 13:04:38 +00:00
David Baker
d4e46108c4 path.resolve does joining too so path.join is redundant 2020-01-22 13:02:46 +00:00
Travis Ralston
8c103b50af Fix webpack config (by stealing Dave's config)
Without doing something like this it's hard to use `yarn link`ed resources.
2020-01-22 13:02:41 +00:00
David Baker
c197c2f4fd Third try at fixing build 2020-01-22 13:02:35 +00:00
David Baker
2e2e09ed2b Fix build to not babel modules inside js/react sdk
Adds 'src' to react-sdk & js-sdk babel test path so we don't run node
modules inside js & react sdk through babel
2020-01-22 13:02:28 +00:00
Travis Ralston
3036bab1c6 Merge pull request #11959 from vector-im/travis/fix-skinning
Load as little as possible in index.js for the skinner
2020-01-21 09:33:15 -07:00
Damir Jelić
e1e3bba290 ElectronPlatform: Replace the indexSize method with the getStats method. 2020-01-21 13:35:29 +01:00
Damir Jelić
e556bb242f ElectronPlatform: Add the indexSize method. 2020-01-21 13:35:29 +01:00
David Baker
18bdbe13b4 Merge pull request #11956 from vector-im/travis/steal-daves-webpack
Fix webpack config (by stealing Dave's config)
2020-01-21 10:23:15 +00:00
David Baker
6835f6054b path.resolve does joining too so path.join is redundant 2020-01-21 10:16:32 +00:00
Travis Ralston
99e1ff9477 Load as little as possible in index.js for the skinner
Imports are optimized to be concurrent/async by webpack, which means that when the old index.js referenced the Lifecycle from the react-sdk it caused the app to explode. This is because in another branch the Lifecycle references a class member of a skinnable component, leading to the skinner complaining that the skin hasn't been loaded.

To work around this, we've shoved all the app stuff to a new app.js file, leaving just the skinning and some early bootstrap work in the index.js
2020-01-20 19:52:11 -07:00
Travis Ralston
932c221548 Fix webpack config (by stealing Dave's config)
Without doing something like this it's hard to use `yarn link`ed resources.
2020-01-20 18:10:06 -07:00
Travis Ralston
3e324f6544 Merge pull request #11954 from vector-im/travis/fix/tests/jest-resolve
Force Jest to resolve the js-sdk and react-sdk to src directories
2020-01-20 14:38:16 -07:00
Travis Ralston
5b575d5627 Force Jest to resolve the js-sdk and react-sdk to src directories 2020-01-20 14:28:29 -07:00
David Baker
be64e86cc3 Merge pull request #11949 from vector-im/dbkr/fix_webpack_build_fix
Fix build to not babel modules inside js/react sdk
2020-01-20 18:31:06 +00:00
David Baker
42743c3ead Third try at fixing build 2020-01-20 18:20:41 +00:00
David Baker
5d8d5d70d0 Fix build to not babel modules inside js/react sdk
Adds 'src' to react-sdk & js-sdk babel test path so we don't run node
modules inside js & react sdk through babel
2020-01-20 18:00:38 +00:00
David Baker
024297c200 Merge pull request #11947 from vector-im/dbkr/fix_build_webpack_rel
Fix webpack to babel js-sdk & react-sdk but no other deps
2020-01-20 17:23:23 +00:00
David Baker
db030d9733 Fix webpack to babel js-sdk & react-sdk but no other deps
This was happening implicitly in our dev setups and the CI build
because of the comment on the last line.
2020-01-20 17:22:21 +00:00
David Baker
4c699d8001 Merge pull request #11944 from vector-im/dbkr/fix_build_webpack
Fix webpack to babel js-sdk & react-sdk but no other deps
2020-01-20 17:19:59 +00:00
David Baker
922ed597d6 Fix webpack to babel js-sdk & react-sdk but no other deps
This was happening implicitly in our dev setups and the CI build
because of the comment on the last line.
2020-01-20 16:55:07 +00:00
David Baker
c3a5e2e5d3 react-sdk & js-sdk rc.1 2020-01-20 14:36:12 +00:00
David Baker
ad8bd62ae6 bump electron version 2020-01-20 14:15:40 +00:00
David Baker
119802d00f Merge pull request #11934 from RiotTranslateBot/weblate-riot-web-riot-web
Update from Weblate
2020-01-20 10:08:45 +00:00
Weblate
674adfb81e Merge branch 'origin/develop' into Weblate. 2020-01-18 01:36:54 +00:00
Travis Ralston
342d717ff6 Merge pull request #11926 from vector-im/travis/fix-rageshake
Fix rageshake post-sourcemaps
2020-01-17 18:36:48 -07:00
Travis Ralston
cdd25ea45f Fix rageshake post-sourcemaps 2020-01-17 18:27:37 -07:00
catborise
4191c51b42 Translated using Weblate (Turkish)
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/tr/
2020-01-17 20:22:42 +00:00
Damir Jelić
a2e256b4c9 ElectronPlatform: Add the ability to load file events from the event index. 2020-01-17 10:11:57 +01:00
J. Ryan Stinnett
e3b4f189b4 Merge pull request #11895 from vector-im/jryans/comma-yarn-start
Fix yarn start concurrent commands
2020-01-16 23:36:16 +00:00
J. Ryan Stinnett
8c6d6b1d09 Fix yarn start concurrent commands 2020-01-16 23:26:13 +00:00
Travis Ralston
63f8a22b34 Merge pull request #11894 from vector-im/travis/fix-reskindex
Run the react-sdk reskindexer for developers
2020-01-16 15:49:10 -07:00
Travis Ralston
b965188a5f Run the react-sdk reskindexer for developers
See https://github.com/matrix-org/matrix-react-sdk/pull/3856 for why chokidar was updated.
2020-01-16 15:40:34 -07:00
Travis Ralston
4ca41f4971 Merge pull request #11893 from vector-im/travis/ftue/user-lists/6.1-multidialog
Update labs documentation for feature_ftue_dms given new scope
2020-01-16 15:07:09 -07:00
Travis Ralston
276d14dd5d Update labs documentation for feature_ftue_dms given new scope
See https://github.com/matrix-org/matrix-react-sdk/pull/3854
2020-01-16 14:46:19 -07:00
Travis Ralston
9a084a6801 Merge pull request #11892 from vector-im/travis/fix-sourcemaps
Fix indentation on webpack config and make sourcemapped files legible
2020-01-16 12:01:32 -07:00
Travis Ralston
fb9503199d Don't calculate sourcemaps in production 2020-01-16 11:55:54 -07:00
Travis Ralston
bb931e25d8 Make sourcemaps legible by humans 2020-01-16 11:47:16 -07:00
Travis Ralston
69d49f9881 Fix indentation of webpack config 2020-01-16 11:33:55 -07:00
J. Ryan Stinnett
6ce50435e3 Merge pull request #11891 from vector-im/jryans/cross-signing-setup
Remove spinner check
2020-01-16 16:42:30 +00:00
Travis Ralston
0efd7edf0c Merge pull request #11867 from vector-im/travis/fix-ci
Don't minifiy builds of develop through CI packaging
2020-01-16 09:31:29 -07:00
Travis Ralston
4e37f8aa88 Merge branch 'develop' into travis/fix-ci 2020-01-16 09:25:10 -07:00
J. Ryan Stinnett
fb77bcf762 Remove spinner check
We may no longer see a spinner for some login paths with the changes to add a
complete security step.

Part of https://github.com/vector-im/riot-web/issues/11214
2020-01-16 16:07:49 +00:00
Travis Ralston
2652060e38 Merge pull request #11869 from vector-im/travis/jest
Use Jest for tests
2020-01-15 17:18:51 -07:00
Travis Ralston
3fb6b1ed63 Remove excessive sleep now that we're not using chrome 2020-01-15 15:31:08 -07:00
Travis Ralston
5cd54e9f6d Use jsdom 14 instead of 13 2020-01-15 15:30:40 -07:00
Travis Ralston
9ab40af430 Ensure autogenned files are present for tests 2020-01-15 14:52:26 -07:00
Travis Ralston
bcda501864 Replace usages of expect.toStartWith with boolean checks 2020-01-15 14:44:46 -07:00
Travis Ralston
c70d21a92e Force Jest to use exactly one copy of React and ReactDOM 2020-01-15 14:42:16 -07:00
Travis Ralston
5c915f3d02 Add canvas package so COLR check passes in tests
This is required for jsdom to do the right thing.

We also have to bump the jsdom version, but to do that we need an alternative test environment because Jest has it pinned lower.
2020-01-15 14:42:00 -07:00
Travis Ralston
f0dbc85ca5 Mock out browser-request to fix i18n 2020-01-15 14:06:55 -07:00
Travis Ralston
84439cff86 Import the cryptostore from the right place 2020-01-15 14:06:44 -07:00
Travis Ralston
e37da08730 Replace beforeEach with just a cleanLocalstorage call
The rest isn't needed anymore.
2020-01-15 14:06:24 -07:00
Travis Ralston
3c9c0ec447 Leave the language handler setup to the test init scripts 2020-01-15 14:05:55 -07:00
Travis Ralston
161a1342b2 Swap over to Jest, breaking everything 2020-01-15 13:24:19 -07:00
Travis Ralston
ae010ef649 Convert babel config to JS for Jest to pick up 2020-01-15 13:00:11 -07:00
Travis Ralston
909fddb732 Don't minifiy builds of develop through CI packaging
Fixes https://github.com/vector-im/riot-web/issues/11864

This uses an environment variable because the build script assumes you want a production build, but we don't for this particular script. To avoid having a mess of NPM scripts to worry about, we'll just pass a flag down.
2020-01-15 12:19:45 -07:00
Will Hunt
044720b7e5 Merge pull request #11858 from vector-im/hs/wasm-docker
Support application/wasm in Docker image
2020-01-15 18:02:39 +00:00
Travis Ralston
599b263e22 Merge pull request #11843 from vector-im/travis/sourcemaps
Fix sourcemaps by refactoring the build system
2020-01-15 10:11:39 -07:00
Will Hunt
625c21a8af @babolivier showed me the way 2020-01-15 17:07:38 +00:00
Half-Shot
d515bad46f Support application/wasm in docker
Signed-off-by: Half-Shot <will@half-shot.uk>
2020-01-15 13:13:03 +00:00
Travis Ralston
f2da98b136 Revert change to electron updater exports 2020-01-14 10:03:24 -07:00
David Baker
ab758d2377 Merge pull request #11850 from vector-im/dbkr/disdable_event_indexing_on_develop
Disable event indexing on develop
2020-01-14 11:10:46 +00:00
David Baker
1a3e5a3c70 Disable event indexing on develop
develop is a web deploy and therefore unlikely to have to node
module available
2020-01-14 11:01:40 +00:00
Travis Ralston
a978a6734f Fix CI tests
There's a bunch of generated files that webpack relies on to work, and Karma works off webpack. To make both happy we've added
a new `build:genfiles` script which takes care of this for us. We also have to install and build our other layers to get the
same effect (like generating the react-sdk's component index, while we still have one).

This commit also fixes all the imports in the tests because they were just wrong. They should have been caught in the ES6ification
earlier, but were missed.
2020-01-13 20:40:00 -07:00
Travis Ralston
3b688aaeb8 Don't run linter on tests for now
We previously ignored this whole directory, and it's a bit of wishful thinking that we'll have these delinted as a result.

Switching to Jest should fix most of the problems anyways, so we can enable the linter when we get there.
2020-01-13 20:37:10 -07:00
Travis Ralston
f73d2bae1f Merge branch 'develop' into travis/sourcemaps 2020-01-13 11:22:47 -07:00
J. Ryan Stinnett
6ce5377747 Merge pull request #11792 from Eothred/develop
Updated blog url
2020-01-13 17:12:29 +00:00
Matthew Hodgson
619cd57bc6 fix the blog url 2020-01-13 16:50:46 +00:00
RiotRobot
d426847f4f Merge branch 'master' into develop 2020-01-13 13:22:11 +00:00
J. Ryan Stinnett
9e8358dc24 Merge pull request #11829 from vector-im/jryans/feature-presence-indicator
Enable and document presence in room list feature flag
2020-01-13 12:25:10 +00:00
J. Ryan Stinnett
12267159f2 Enable and document presence in room list feature flag
Part of https://github.com/vector-im/riot-web/issues/11799
2020-01-13 11:53:46 +00:00
J. Ryan Stinnett
0e65d2ecfa Merge pull request #11774 from daleharvey/service-worker
Add stub service worker so users can install on desktop with Chrome
2020-01-13 10:06:35 +00:00
David Baker
1b1a8594c0 Merge pull request #11826 from RiotTranslateBot/weblate-riot-web-riot-web
Update from Weblate
2020-01-13 09:41:02 +00:00
catborise
2fdaf65244 Translated using Weblate (Turkish)
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/tr/
2020-01-11 17:22:25 +00:00
MamasLT
1cb0e39dcc Translated using Weblate (Lithuanian)
Currently translated at 100.0% (23 of 23 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/lt/
2020-01-11 17:22:25 +00:00
Dale Harvey
a41484cb35 Add stub service worker so users can install on desktop with Chrome
Signed-off-by: Dale Harvey <dale@arandomurl.com>
2020-01-10 19:08:56 +00:00
Travis Ralston
455b7ae347 Merge pull request #11802 from vector-im/travis/sourcemaps-dev
Sourcemaps: develop -> feature branch
2020-01-09 14:09:35 -07:00
Travis Ralston
d877187d5e Remove postinstall script now that it's not needed 2020-01-09 13:43:33 -07:00
Travis Ralston
9bf1c65971 [CONFLICT CHUNKS] Merge branch 'develop' into travis/sourcemaps-dev 2020-01-09 13:43:25 -07:00
Travis Ralston
a91bab29ff Merge pull request #11801 from vector-im/travis/babel7-wp-scripts
Update build scripts for new process
2020-01-09 13:34:09 -07:00
Travis Ralston
929096b3f9 Merge pull request #11712 from vector-im/travis/babel7-wp-wp
Make the webpack config work for us
2020-01-09 13:32:46 -07:00
Travis Ralston
5445f97998 Merge pull request #11810 from besendorf/patch-1
Updates URL for Electron Command Line Switches
2020-01-09 09:50:11 -07:00
besendorf
a6015d46f4 Updates URL for Electron Command Line Switches
old URL is not accessible anymore
2020-01-09 15:48:12 +01:00
Travis Ralston
110b63b816 Fix buildkite pipeline 2020-01-08 16:14:01 -07:00
Travis Ralston
ec66069e96 Update build scripts for new process
We have to convert *something* to TypeScript so it doesn't complain that there's nothing to compile, so this converts the easiest utility library.

Many of the scripts are copied from the react-sdk.
2020-01-08 16:09:42 -07:00
Travis Ralston
4482cac9b4 Merge branch 'travis/babel7-wp-wp' into travis/babel7-wp-scripts 2020-01-08 16:08:08 -07:00
Travis Ralston
1cd9c4ff11 Move babel config out to its own file
For reasons described within this diff.
2020-01-08 16:01:28 -07:00
Travis Ralston
203c9c8a7d Don't use so many extensions 2020-01-08 15:11:23 -07:00
Travis Ralston
37a83d469c Add giant comment about why we're runnign CSS through PostCSS 2020-01-08 14:56:40 -07:00
Travis Ralston
e19d86e822 Merge branch 'travis/sourcemaps' into travis/babel7-wp-wp 2020-01-08 14:44:01 -07:00
Yngve Levinsen
15982ae0b0 Updated blog url 2020-01-07 13:33:39 +01:00
Travis Ralston
9beb4e94d7 Merge pull request #11714 from vector-im/travis/babel7-wp-es6-src-imp
Import from src/ for the react-sdk and js-sdk
2019-12-25 15:13:00 -07:00
Travis Ralston
11e304f42f Merge pull request #11713 from vector-im/travis/babel7-wp-es6-export
Convert components to ES6 exports
2019-12-25 15:12:54 -07:00
Travis Ralston
17e332bb48 Import from src/ for the react-sdk and js-sdk
We compile directly for accuracy of sourcemaps.
2019-12-23 20:02:11 -07:00
Travis Ralston
8e754765e2 Convert components to ES6 exports 2019-12-23 19:59:15 -07:00
Travis Ralston
1b41dc3291 Make the webpack config work for us
This moves the babel and postcss configs into the webpack config for ease of maintenance (and because we need variations of them). The typescript config is left outside the webpack config for IDEs to pick it up.
2019-12-23 19:51:01 -07:00
Travis Ralston
c44a6e296e Merge branch 'develop' into travis/sourcemaps 2019-12-20 12:34:22 -07:00
Travis Ralston
4479018289 Merge pull request #11660 from vector-im/travis/babel7-reskindex
Remove now-retired package.json property
2019-12-17 08:11:14 -07:00
Travis Ralston
c143b9b2d7 Remove now-retired package.json property
For https://github.com/matrix-org/matrix-react-sdk/pull/3723
2019-12-12 19:47:31 -07:00
81 changed files with 7819 additions and 3697 deletions

View File

@@ -1,20 +0,0 @@
{
"presets": [
"react",
"es2015",
"es2016"
],
"plugins": [
[
"transform-builtin-extend",
{
"globals": ["Error"]
}
],
"transform-class-properties",
"transform-object-rest-spread",
"transform-runtime",
"add-module-exports",
"syntax-dynamic-import"
]
}

View File

@@ -1,57 +0,0 @@
steps:
- label: ":eslint: Lint"
command:
- "yarn install"
- "yarn lint"
plugins:
- docker#v3.0.1:
image: "node:10"
- label: ":karma: Tests"
agents:
# We use a medium sized instance instead of the normal small ones because
# webpack loves to gorge itself on resources.
queue: "medium"
command:
# Install chrome
- "echo '--- Installing Chrome'"
- "wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -"
- "sh -c 'echo \"deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main\" >> /etc/apt/sources.list.d/google.list'"
- "apt-get update"
- "apt-get install -y google-chrome-stable"
# Run tests
- "echo '--- Fetching Dependencies'"
- "./scripts/fetch-develop.deps.sh --depth 1"
- "yarn install"
- "echo '+++ Running Tests'"
- "yarn test"
env:
CHROME_BIN: "/usr/bin/google-chrome-stable"
plugins:
- docker#v3.0.1:
image: "node:10"
propagate-environment: true
- label: ":hammer: Package"
command:
- "echo '--- Fetching Dependencies'"
- "./scripts/fetch-develop.deps.sh --depth 1"
- "yarn install"
- "echo '+++ Packaging'"
- "./scripts/ci_package.sh"
branches: "develop"
artifact_paths: "dist/riot-*.tar.gz"
plugins:
- docker#v3.0.1:
image: "node:10"
- label: "🌐 i18n"
command:
- "echo '--- Fetching Dependencies'"
- "./scripts/fetch-develop.deps.sh --depth 1"
- "yarn install"
- "echo '+++ Testing i18n output'"
- "yarn diff-i18n"
plugins:
- docker#v3.0.1:
image: "node:10"

View File

@@ -5,12 +5,30 @@
"setClasses"
],
"feature-detects": [
"test/css/animations",
"test/css/displaytable",
"test/css/filters",
"test/css/flexbox",
"test/es5/specification",
"test/css/objectfit",
"test/storage/localstorage",
"test/workers/webworkers",
"test/indexeddb"
"test/es5/date",
"test/es5/function",
"test/es5/object",
"test/es5/undefined",
"test/es6/array",
"test/es6/collections",
"test/es6/promises",
"test/es6/string",
"test/svg",
"test/svg/asimg",
"test/svg/filters",
"test/cors",
"test/iframe/sandbox",
"test/json",
"test/network/fetch",
"test/storage/localstorage"
]
}

26
.stylelintrc.js Normal file
View File

@@ -0,0 +1,26 @@
// Copied from react-sdk
// TODO: Only keep one copy of this for synchronization purposes
module.exports = {
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-scss",
],
"rules": {
"indentation": 4,
"comment-empty-line-before": null,
"declaration-empty-line-before": null,
"length-zero-no-unit": null,
"rule-empty-line-before": null,
"color-hex-length": null,
"max-empty-lines": null,
"number-no-trailing-zeros": null,
"number-leading-zero": null,
"selector-list-comma-newline-after": null,
"at-rule-no-unknown": null,
"no-descending-specificity": null,
"scss/at-rule-no-unknown": [true, {
// https://github.com/vector-im/riot-web/issues/10544
"ignoreAtRules": ["define-mixin"],
}],
}
};

View File

@@ -1,3 +1,229 @@
Changes in [1.5.13](https://github.com/vector-im/riot-web/releases/tag/v1.5.13) (2020-03-17)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.13-rc.1...v1.5.13)
* Upgrade to JS SDK 5.1.1 and React SDK 2.2.3
Changes in [1.5.13-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.5.13-rc.1) (2020-03-11)
======================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.12...v1.5.13-rc.1)
* Update from Weblate
[\#12688](https://github.com/vector-im/riot-web/pull/12688)
* Fix Docker image version for develop builds
[\#12670](https://github.com/vector-im/riot-web/pull/12670)
* docker: optimize custom sdk builds
[\#12612](https://github.com/vector-im/riot-web/pull/12612)
* riot-desktop open SSO in browser so user doesn't have to auth twice
[\#12590](https://github.com/vector-im/riot-web/pull/12590)
* Fix SSO flows for electron 8.0.2 by re-breaking will-navigate
[\#12585](https://github.com/vector-im/riot-web/pull/12585)
* index.html: Place noscript on top of the page
[\#12563](https://github.com/vector-im/riot-web/pull/12563)
* Remove will-navigate comment after Electron fix
[\#12561](https://github.com/vector-im/riot-web/pull/12561)
* Update loading test for JS SDK IDB change
[\#12552](https://github.com/vector-im/riot-web/pull/12552)
* Upgrade deps
[\#12528](https://github.com/vector-im/riot-web/pull/12528)
Changes in [1.5.12](https://github.com/vector-im/riot-web/releases/tag/v1.5.12) (2020-03-04)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.11...v1.5.12)
* Upgrade to React SDK 2.2.1
* Revert to Electron 7.1.12 to fix Arch Linux tray icon
* Fix image download links so they open in a new tab
Changes in [1.5.11](https://github.com/vector-im/riot-web/releases/tag/v1.5.11) (2020-03-02)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.11-rc.1...v1.5.11)
* Upgrade to JS SDK 5.1.0 and React SDK 2.2.0
* Fix SSO flows for Electron 8.0.2 by disabling will-navigate
[\#12585](https://github.com/vector-im/riot-web/pull/12585)
Changes in [1.5.11-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.5.11-rc.1) (2020-02-26)
======================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.10...v1.5.11-rc.1)
* Upgrade to JS SDK 5.1.0-rc.1 and React SDK 2.2.0-rc.1
* Change Windows signing to warning when missing token
[\#12523](https://github.com/vector-im/riot-web/pull/12523)
* Modernizr remove t3st/es6/contains
[\#12524](https://github.com/vector-im/riot-web/pull/12524)
* Switch out any eval-using Modernizr rules
[\#12519](https://github.com/vector-im/riot-web/pull/12519)
* Update from Weblate
[\#12522](https://github.com/vector-im/riot-web/pull/12522)
* Notify electron of language changes
[\#12487](https://github.com/vector-im/riot-web/pull/12487)
* Relax macOS notarisation check to print a warning
[\#12503](https://github.com/vector-im/riot-web/pull/12503)
* Clarify supported tier means desktop OSes
[\#12486](https://github.com/vector-im/riot-web/pull/12486)
* Use noreferrer in addition to noopener for edge case browsers
[\#12477](https://github.com/vector-im/riot-web/pull/12477)
* Document start / end composer shortcuts
[\#12466](https://github.com/vector-im/riot-web/pull/12466)
* Update from Weblate
[\#12480](https://github.com/vector-im/riot-web/pull/12480)
* Remove buildkite pipeline
[\#12464](https://github.com/vector-im/riot-web/pull/12464)
* Remove exec so release script continues
[\#12435](https://github.com/vector-im/riot-web/pull/12435)
* Use Persistent Storage where possible
[\#12425](https://github.com/vector-im/riot-web/pull/12425)
Changes in [1.5.10](https://github.com/vector-im/riot-web/releases/tag/v1.5.10) (2020-02-19)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.9...v1.5.10)
* Get rid of dependence on usercontent.riot.im
[\#12292](https://github.com/vector-im/riot-web/pull/12292)
* Add experimental support tier
[\#12377](https://github.com/vector-im/riot-web/pull/12377)
Changes in [1.5.9](https://github.com/vector-im/riot-web/releases/tag/v1.5.9) (2020-02-17)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.9-rc.1...v1.5.9)
* Automate SDK dep upgrades for release
[\#12374](https://github.com/vector-im/riot-web/pull/12374)
Changes in [1.5.9-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.5.9-rc.1) (2020-02-13)
====================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.8...v1.5.9-rc.1)
* Upgrade JS SDK to 5.0.0-rc.1 and React SDK 2.1.0-rc.2
* Update from Weblate
[\#12354](https://github.com/vector-im/riot-web/pull/12354)
* Add top left menu shortcut
[\#12310](https://github.com/vector-im/riot-web/pull/12310)
* Remove modernizr rules for features on which we only soft depend
[\#12272](https://github.com/vector-im/riot-web/pull/12272)
* Embed CSP meta tag and stop using script-src unsafe-inline
[\#12258](https://github.com/vector-im/riot-web/pull/12258)
* Add contribute.json
[\#12251](https://github.com/vector-im/riot-web/pull/12251)
* Improve Browser checks
[\#12232](https://github.com/vector-im/riot-web/pull/12232)
* Document padlock flag
[\#12173](https://github.com/vector-im/riot-web/pull/12173)
* Enable cross-signing on /develop
[\#12126](https://github.com/vector-im/riot-web/pull/12126)
* Switch back to legacy decorators
[\#12110](https://github.com/vector-im/riot-web/pull/12110)
* Update babel targets
[\#12102](https://github.com/vector-im/riot-web/pull/12102)
* Install deps for linting
[\#12076](https://github.com/vector-im/riot-web/pull/12076)
* Update from Weblate
[\#12062](https://github.com/vector-im/riot-web/pull/12062)
* Change to minimal Webpack output
[\#12049](https://github.com/vector-im/riot-web/pull/12049)
* Remove docs for new invite dialog labs feature
[\#12015](https://github.com/vector-im/riot-web/pull/12015)
* ElectronPlatform: Add the indexSize method.
[\#11529](https://github.com/vector-im/riot-web/pull/11529)
* ElectronPlatform: Add the ability to load file events from the event index
[\#11907](https://github.com/vector-im/riot-web/pull/11907)
* Fix the remainder of the cookie links
[\#12008](https://github.com/vector-im/riot-web/pull/12008)
* Use bash in Docker scripts
[\#12001](https://github.com/vector-im/riot-web/pull/12001)
* Use debian to build the Docker image
[\#11999](https://github.com/vector-im/riot-web/pull/11999)
* Update cookie policy urls on /app and /develop config.json
[\#11998](https://github.com/vector-im/riot-web/pull/11998)
* BuildKite: Only deploy to /develop if everything else passed
[\#11996](https://github.com/vector-im/riot-web/pull/11996)
* Add docs for admin report content message
[\#11995](https://github.com/vector-im/riot-web/pull/11995)
* Load as little as possible in index.js for the skinner
[\#11959](https://github.com/vector-im/riot-web/pull/11959)
* Fix webpack config (by stealing Dave's config)
[\#11956](https://github.com/vector-im/riot-web/pull/11956)
* Force Jest to resolve the js-sdk and react-sdk to src directories
[\#11954](https://github.com/vector-im/riot-web/pull/11954)
* Fix build to not babel modules inside js/react sdk
[\#11949](https://github.com/vector-im/riot-web/pull/11949)
* Fix webpack to babel js-sdk & react-sdk but no other deps
[\#11944](https://github.com/vector-im/riot-web/pull/11944)
Changes in [1.5.8](https://github.com/vector-im/riot-web/releases/tag/v1.5.8) (2020-01-27)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.8-rc.2...v1.5.8)
* Fixes for alias display and copy / paste on composer
Changes in [1.5.8-rc.2](https://github.com/vector-im/riot-web/releases/tag/v1.5.8-rc.2) (2020-01-22)
====================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.8-rc.1...v1.5.8-rc.2)
* Fix incorrect version of react-sdk
Changes in [1.5.8-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.5.8-rc.1) (2020-01-22)
====================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.7...v1.5.8-rc.1)
This version contains an upgrade to the cryptography database
version. Once users run this version, their session's indexeddb
store will be upgraded and older version of Riot will no longer
be able to read it. Users will have to log out and log in if
the version of Riot is downgraded back to a previous version.
* Fix webpack config (by stealing Dave's config)
[\#11994](https://github.com/vector-im/riot-web/pull/11994)
* Fix webpack to babel js-sdk & react-sdk but no other deps
[\#11947](https://github.com/vector-im/riot-web/pull/11947)
* Update from Weblate
[\#11934](https://github.com/vector-im/riot-web/pull/11934)
* Fix rageshake post-sourcemaps
[\#11926](https://github.com/vector-im/riot-web/pull/11926)
* Fix yarn start concurrent commands
[\#11895](https://github.com/vector-im/riot-web/pull/11895)
* Run the react-sdk reskindexer for developers
[\#11894](https://github.com/vector-im/riot-web/pull/11894)
* Update labs documentation for feature_ftue_dms given new scope
[\#11893](https://github.com/vector-im/riot-web/pull/11893)
* Fix indentation on webpack config and make sourcemapped files legible
[\#11892](https://github.com/vector-im/riot-web/pull/11892)
* Remove spinner check
[\#11891](https://github.com/vector-im/riot-web/pull/11891)
* Don't minifiy builds of develop through CI packaging
[\#11867](https://github.com/vector-im/riot-web/pull/11867)
* Use Jest for tests
[\#11869](https://github.com/vector-im/riot-web/pull/11869)
* Support application/wasm in Docker image
[\#11858](https://github.com/vector-im/riot-web/pull/11858)
* Fix sourcemaps by refactoring the build system
[\#11843](https://github.com/vector-im/riot-web/pull/11843)
* Disable event indexing on develop
[\#11850](https://github.com/vector-im/riot-web/pull/11850)
* Updated blog url
[\#11792](https://github.com/vector-im/riot-web/pull/11792)
* Enable and document presence in room list feature flag
[\#11829](https://github.com/vector-im/riot-web/pull/11829)
* Add stub service worker so users can install on desktop with Chrome
[\#11774](https://github.com/vector-im/riot-web/pull/11774)
* Update from Weblate
[\#11826](https://github.com/vector-im/riot-web/pull/11826)
* Sourcemaps: develop -> feature branch
[\#11802](https://github.com/vector-im/riot-web/pull/11802)
* Update build scripts for new process
[\#11801](https://github.com/vector-im/riot-web/pull/11801)
* Make the webpack config work for us
[\#11712](https://github.com/vector-im/riot-web/pull/11712)
* Updates URL for Electron Command Line Switches
[\#11810](https://github.com/vector-im/riot-web/pull/11810)
* Import from src/ for the react-sdk and js-sdk
[\#11714](https://github.com/vector-im/riot-web/pull/11714)
* Convert components to ES6 exports
[\#11713](https://github.com/vector-im/riot-web/pull/11713)
* Remove now-retired package.json property
[\#11660](https://github.com/vector-im/riot-web/pull/11660)
Changes in [1.5.7](https://github.com/vector-im/riot-web/releases/tag/v1.5.7) (2020-01-13)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.7-rc.2...v1.5.7)

View File

@@ -1,5 +1,5 @@
# Builder
FROM node:10-alpine as builder
FROM node:10 as builder
# Support custom branches of the react-sdk and js-sdk. This also helps us build
# images of riot-web develop.
@@ -9,12 +9,12 @@ ARG REACT_SDK_BRANCH="master"
ARG JS_SDK_REPO="https://github.com/matrix-org/matrix-js-sdk.git"
ARG JS_SDK_BRANCH="master"
RUN apk add --no-cache git dos2unix
RUN apt-get update && apt-get install -y git dos2unix
WORKDIR /src
COPY . /src
RUN dos2unix /src/scripts/docker-link-repos.sh && sh /src/scripts/docker-link-repos.sh
RUN dos2unix /src/scripts/docker-link-repos.sh && bash /src/scripts/docker-link-repos.sh
RUN yarn --network-timeout=100000 install
RUN yarn build
@@ -22,7 +22,7 @@ RUN yarn build
RUN cp /src/config.sample.json /src/webapp/config.json
# Ensure we populate the version file
RUN dos2unix /src/scripts/docker-write-version.sh && sh /src/scripts/docker-write-version.sh
RUN dos2unix /src/scripts/docker-write-version.sh && bash /src/scripts/docker-write-version.sh
# App
@@ -30,5 +30,8 @@ FROM nginx:alpine
COPY --from=builder /src/webapp /app
# Insert wasm type into Nginx mime.types file so they load correctly.
RUN sed -i '3i\ \ \ \ application/wasm wasm\;' /etc/nginx/mime.types
RUN rm -rf /usr/share/nginx/html \
&& ln -s /app /usr/share/nginx/html

View File

@@ -1,12 +1,31 @@
Riot
====
Riot (formerly known as Vector) is a Matrix web client built using the [Matrix React SDK](https://github.com/matrix-org/matrix-react-sdk).
Riot (formerly known as Vector) is a Matrix web client built using the [Matrix
React SDK](https://github.com/matrix-org/matrix-react-sdk).
Riot is officially supported on the web in the last 2 major versions of Chrome, Firefox, and Safari. For Riot on Desktop (electron),
only the officially published app is supported. Other browsers and packages may work, however official support is not provided.
For accessing Riot on an Android or iOS device, check out [riot-android](https://github.com/vector-im/riot-android)
and [riot-ios](https://github.com/vector-im/riot-ios) - riot-web does not support mobile devices.
Supported Environments
======================
Riot has several tiers of support for different environments:
* Supported
* Definition: Issues **actively triaged**, regressions **block** the release
* Last 2 major versions of Chrome, Firefox, and Safari on desktop OSes
* Latest release of official Riot Desktop app on desktop OSes
* Desktop OSes means macOS, Windows, and Linux versions for desktop devices
that are actively supported by the OS vendor and receive security updates
* Experimental
* Definition: Issues **accepted**, regressions **do not block** the release
* Riot as an installed PWA via current stable version of Chrome, Firefox, and Safari
* Mobile web for current stable version of Chrome, Firefox, and Safari on Android, iOS, and iPadOS
* Not supported
* Definition: Issues only affecting unsupported environments are **closed**
* Everything else
For accessing Riot on an Android or iOS device, we currently recommend the
native apps [riot-android](https://github.com/vector-im/riot-android)
and [riot-ios](https://github.com/vector-im/riot-ios).
Getting Started
===============
@@ -52,15 +71,6 @@ We have put some coarse mitigations into place to try to protect against this
situation, but it's still not good practice to do it in the first place. See
https://github.com/vector-im/riot-web/issues/1977 for more details.
The same applies for end-to-end encrypted content, but since this is decrypted
on the client, Riot needs a way to supply the decrypted content from a separate
origin to the one Riot is hosted on. This currently done with a 'cross origin
renderer' which is a small piece of javascript hosted on a different domain.
To avoid all Riot installs needing one of these to be set up, riot.im hosts
one on usercontent.riot.im which is used by default.
https://github.com/vector-im/riot-web/issues/6173 tracks progress on replacing
this with something better.
Building From Source
====================

23
babel.config.js Normal file
View File

@@ -0,0 +1,23 @@
module.exports = {
"sourceMaps": true,
"presets": [
["@babel/preset-env", {
"targets": [
"last 2 Chrome versions", "last 2 Firefox versions", "last 2 Safari versions"
],
}],
"@babel/preset-typescript",
"@babel/preset-flow",
"@babel/preset-react"
],
"plugins": [
["@babel/plugin-proposal-decorators", {legacy: true}],
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-flow-comments",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-runtime"
]
};

17
contribute.json Normal file
View File

@@ -0,0 +1,17 @@
{
"name": "Riot",
"description": "A glossy Matrix collaboration client for the web.",
"repository": {
"url": "https://github.com/vector-im/riot-web",
"license": "Apache License 2.0"
},
"bugs": {
"list": "https://github.com/vector-im/riot-web/issues",
"report": "https://github.com/vector-im/riot-web/issues/new/choose"
},
"keywords": [
"chat",
"riot",
"matrix"
]
}

View File

@@ -37,6 +37,10 @@ For a good example, see https://riot.im/develop/config.json.
authentication flows
1. `authFooterLinks`: a list of links to show in the authentication page footer:
`[{"text": "Link text", "url": "https://link.target"}, {"text": "Other link", ...}]`
1. `reportEvent`: Configures the dialog for reporting content to the homeserver
admin.
1. `adminMessageMD`: An extra message to show on the reporting dialog to
mention homeserver-specific policies. Accepts Markdown.
1. `integrations_ui_url`: URL to the web interface for the integrations server. The integrations
server is not Riot and normally not your homeserver either. The integration server settings
may be left blank to disable integrations.
@@ -53,11 +57,6 @@ For a good example, see https://riot.im/develop/config.json.
1. `update_base_url` (electron app only): HTTPS URL to a web server to download
updates from. This should be the path to the directory containing `macos`
and `win32` (for update packages, not installer packages).
1. `cross_origin_renderer_url`: URL to a static HTML page hosting code to help display
encrypted file attachments. This MUST be hosted on a completely separate domain to
anything else since it is used to isolate the privileges of file attachments to this
domain. Default: `https://usercontent.riot.im/v1.html`. This needs to contain v1.html from
https://github.com/matrix-org/usercontent/blob/master/v1.html
1. `piwik`: Analytics can be disabled by setting `piwik: false` or by leaving the piwik config
option out of your config file. If you want to enable analytics, set `piwik` to be an object
containing the following properties:
@@ -83,7 +82,7 @@ For a good example, see https://riot.im/develop/config.json.
default homeserver when signing up or logging in.
1. `permalinkPrefix`: Used to change the URL that Riot generates permalinks with.
By default, this is "https://matrix.to" to generate matrix.to (spec) permalinks.
Set this to your Riot instance URL if you run an unfederated server (eg:
Set this to your Riot instance URL if you run an unfederated server (eg:
"https://riot.example.org").
Note that `index.html` also has an og:image meta tag that is set to an image

View File

@@ -82,13 +82,6 @@ that downloads, stores, and indexes room messages for E2E encrypted rooms.
The existing search will transparently work for encrypted rooms just like it
does for non-encrypted.
## New DM invite dialog (`feature_ftue_dms`)
An improved dialog for inviting users. Once finished, this will replace both the
DM creation dialog and the 'invite user' dialog. This is a work in progress and
as such not all functionality may be present until the feature replaces today's
UX.
## Bridge info tab (`feature_bridge_state`)
Adds a "Bridge Info" tab to the Room Settings dialog, if a compatible bridge is
@@ -100,3 +93,8 @@ tab as the single source of truth just yet.
This adds a presence indicator in the room list next to DM rooms where the other
person is online.
## Show padlocks on invite only rooms (`feature_invite_only_padlocks`)
This adds padlocks to room list tiles and room header for invite only rooms.
This feature flag (unlike most) is enabled by default.

View File

@@ -47,7 +47,7 @@ Again from the `electron_app/` directory:
Recompiling Seshat itself can be done like so:
yarn run electron-build-env -- --electron 6.1.1 -- neon build matrix-seshat --release`
yarn run electron-build-env -- --electron 6.1.1 -- neon build matrix-seshat --release
Please make sure to include all the `--` as well as the `--release` command line
switch at the end. Modify your electron version accordingly depending on the
@@ -56,6 +56,5 @@ version that is installed on your system.
After this is done the Electron version of Riot can be run from the main folder
as usual using:
yarn build
yarn electron

View File

@@ -10,4 +10,6 @@ The modifier is <kbd>Ctrl</kbd> on Windows & Linux and <kbd>⌘</kbd> on Mac.
- <kbd>↑</kbd>/<kbd>↓</kbd> - next/prev room when focus in room list
- <kbd>Alt</kbd>+<kbd>↑</kbd>/<kbd>↓</kbd> - resend previous messages when the composer is in focus
- <kbd>PageUp</kbd>/<kbd>PageDown</kbd> - scroll timeline up/down
- <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>Home</kbd>/<kbd>End</kbd> - jump to timeline start/end
- <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>Home</kbd>/<kbd>End</kbd> - jump to
start/end of the composer when focused, otherwise jump to timeline start/end
- <kbd>Ctrl</kbd>/<kbd>⌘</kbd>+<kbd>`</kbd> - toggle the top left menu

View File

@@ -9,6 +9,9 @@
Latest electron-builder does, but it appears to be causing issues:
(https://github.com/electron-userland/electron-builder/issues/4390)
-->
<!-- https://github.com/electron/electron-notarize#prerequisites -->
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<!-- https://github.com/electron-userland/electron-builder/issues/3940 -->

View File

@@ -1,14 +0,0 @@
#!/bin/bash
# Link to the binary
ln -sf '/opt/${productFilename}/${executable}' '/usr/bin/${executable}'
# SUID chrome-sandbox for Electron 5+
# Remove this entire file (after-install.tpl) and remove the reference in
# package.json once this change has been upstreamed so we go back to the copy
# from upstream.
# https://github.com/electron-userland/electron-builder/pull/4163
chmod 4755 '/opt/${productFilename}/chrome-sandbox' || true
update-mime-database /usr/share/mime || true
update-desktop-database /usr/share/applications || true

View File

@@ -2,7 +2,7 @@
"name": "riot-web",
"productName": "Riot",
"main": "src/electron-main.js",
"version": "1.5.7",
"version": "1.5.13",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"dependencies": {

View File

@@ -22,7 +22,7 @@
"piwik": {
"url": "https://piwik.riot.im/",
"siteId": 1,
"policyUrl": "https://matrix.org/docs/guides/riot_im_cookie_policy"
"policyUrl": "https://matrix.org/legal/riot-im-cookie-policy"
},
"phasedRollOut": {
"feature_lazyloading": {

View File

@@ -35,6 +35,7 @@ const tray = require('./tray');
const vectorMenu = require('./vectormenu');
const webContentsHandler = require('./webcontents-handler');
const updater = require('./updater');
const protocolInit = require('./protocol');
const windowStateKeeper = require('electron-window-state');
const Store = require('electron-store');
@@ -63,7 +64,7 @@ if (argv["help"]) {
console.log(" --hidden: Start the application hidden in the system tray.");
console.log(" --help: Displays this help message.");
console.log("And more such as --proxy, see:" +
"https://github.com/electron/electron/blob/master/docs/api/chrome-command-line-switches.md");
"https://electronjs.org/docs/api/chrome-command-line-switches#supported-chrome-command-line-switches");
app.exit();
}
@@ -346,6 +347,18 @@ ipcMain.on('seshat', async function(ev, payload) {
}
break;
case 'getStats':
if (eventIndex === null) ret = 0;
else {
try {
ret = await eventIndex.getStats();
} catch (e) {
sendError(payload.id, e);
return;
}
}
break;
case 'removeCrawlerCheckpoint':
if (eventIndex === null) ret = false;
else {
@@ -370,6 +383,18 @@ ipcMain.on('seshat', async function(ev, payload) {
}
break;
case 'loadFileEvents':
if (eventIndex === null) ret = [];
else {
try {
ret = await eventIndex.loadFileEvents(args[0]);
} catch (e) {
sendError(payload.id, e);
return;
}
}
break;
case 'loadCheckpoints':
if (eventIndex === null) ret = [];
else {
@@ -403,6 +428,9 @@ if (!gotLock) {
app.exit();
}
// do this after we know we are the primary instance of the app
protocolInit();
const launcher = new AutoLaunch({
name: vectorConfig.brand || 'Riot',
isHidden: true,

View File

@@ -0,0 +1,53 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const {app} = require('electron');
const processUrl = (url) => {
if (!global.mainWindow) return;
console.log("Handling link: ", url);
global.mainWindow.loadURL(url.replace("riot://", "vector://"));
};
module.exports = () => {
// get all args except `hidden` as it'd mean the app would not get focused
// XXX: passing args to protocol handlers only works on Windows,
// so unpackaged deep-linking and --profile passing won't work on Mac/Linux
const args = process.argv.slice(1).filter(arg => arg !== "--hidden" && arg !== "-hidden");
if (app.isPackaged) {
app.setAsDefaultProtocolClient('riot', process.execPath, args);
} else if (process.platform === 'win32') { // on Mac/Linux this would just cause the electron binary to open
// special handler for running without being packaged, e.g `electron .` by passing our app path to electron
app.setAsDefaultProtocolClient('riot', process.execPath, [app.getAppPath(), ...args]);
}
if (process.platform === 'darwin') {
// Protocol handler for macos
app.on('open-url', function(ev, url) {
ev.preventDefault();
processUrl(url);
});
} else {
// Protocol handler for win32/Linux
app.on('second-instance', (ev, commandLine) => {
const url = commandLine[commandLine.length - 1];
if (!url.startsWith("riot://")) return;
processUrl(url);
});
}
};

View File

@@ -174,19 +174,10 @@ function onEditableContextMenu(ev, params) {
module.exports = (webContents) => {
webContents.on('new-window', onWindowOrNavigate);
// XXX: The below now does absolutely nothing because of
// https://github.com/electron/electron/issues/8841
// Whilst this isn't a security issue since without
// node integration and with the sandbox, it should be
// no worse than opening the site in Chrome, it obviously
// means the user has to restart Riot to make it usable
// again (often unintuitive because it minimises to the
// system tray). We therefore need to be vigilant about
// putting target="_blank" on links in Riot (although
// we should generally be doing this anyway since links
// navigating you away from Riot in the browser is
// also annoying).
webContents.on('will-navigate', onWindowOrNavigate);
webContents.on('will-navigate', (ev, target) => {
if (target.startsWith("vector://")) return;
return onWindowOrNavigate(ev, target);
});
webContents.on('context-menu', function(ev, params) {
if (params.linkURL || params.srcURL) {

View File

@@ -1,178 +0,0 @@
// karma.conf.js - the config file for karma, which runs our tests.
var path = require('path');
var webpack = require('webpack');
var webpack_config = require('./webpack.config');
/*
* We use webpack to build our tests. It's a pain to have to wait for webpack
* to build everything; however it's the easiest way to load our dependencies
* from node_modules.
*
* If you run karma in multi-run mode (with `yarn test-multi`), it will watch
* the tests for changes, and webpack will rebuild using a cache. This is much quicker
* than a clean rebuild.
*/
// the name of the test file. By default, a special file which runs all tests.
var testFile = process.env.KARMA_TEST_FILE || 'test/all-tests.js';
process.env.PHANTOMJS_BIN = 'node_modules/.bin/phantomjs';
process.env.Q_DEBUG = 1;
/* the webpack config is based on the real one, to (a) try to simulate the
* deployed environment as closely as possible, and (b) to avoid a shedload of
* cut-and-paste.
*/
// find out if we're shipping olm, and where it is, if so.
const olm_entry = webpack_config.entry['olm'];
// remove the default entries - karma provides its own (via the 'files' and
// 'preprocessors' config below)
delete webpack_config['entry'];
// make sure we're flagged as development to avoid wasting time optimising
webpack_config.mode = 'development';
// add ./test as a search path for js
webpack_config.module.rules.unshift({
test: /\.js$/, use: "babel-loader",
include: [path.resolve('./src'), path.resolve('./test')],
});
// disable parsing for sinon, because it
// tries to do voodoo with 'require' which upsets
// webpack (https://github.com/webpack/webpack/issues/304)
webpack_config.module.noParse.push(/sinon\/pkg\/sinon\.js$/);
// ?
webpack_config.resolve.alias['sinon'] = 'sinon/pkg/sinon.js';
webpack_config.resolve.modules = [
path.resolve('./test'),
"node_modules"
];
webpack_config.devtool = 'inline-source-map';
module.exports = function (config) {
const myconfig = {
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha'],
// list of files / patterns to load in the browser
files: [
'node_modules/babel-polyfill/browser.js',
testFile,
// make the images available via our httpd. They will be avaliable
// below http://localhost:[PORT]/base/. See also `proxies` which
// defines alternative URLs for them.
//
// This isn't required by any of the tests, but it stops karma
// logging warnings when it serves a 404 for them.
{
pattern: 'node_modules/matrix-react-sdk/res/img/*',
watched: false, included: false, served: true, nocache: false,
},
{
pattern: 'res/**',
watched: false, included: false, served: true, nocache: false,
},
],
proxies: {
// redirect img links to the karma server. See above.
"/img/": "/base/node_modules/matrix-react-sdk/res/img/",
"/themes/": "/base/res/themes/",
"/welcome.html": "/base/res/welcome.html",
"/welcome/": "/base/res/welcome/",
},
// preprocess matching files before serving them to the browser
// available preprocessors:
// https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'{src,test}/**/*.js': ['webpack', 'sourcemap'],
},
// test results reporter to use
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['logcapture', 'spec', 'summary'],
specReporter: {
suppressErrorSummary: false, // do print error summary
suppressFailed: false, // do print information about failed tests
suppressPassed: false, // do print information about passed tests
showSpecTiming: true, // print the time elapsed for each spec
},
client: {
captureLogs: true,
},
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR ||
// config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file
// changes
autoWatch: true,
// start these browsers
// available browser launchers:
// https://npmjs.org/browse/keyword/karma-launcher
browsers: [
'Chrome',
//'PhantomJS',
//'ChromeHeadless'
],
customLaunchers: {
'VectorChromeHeadless': {
base: 'Chrome',
flags: [
'--no-sandbox',
// See https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
'--headless',
'--disable-gpu',
// Without a remote debugging port, Google Chrome exits immediately.
'--remote-debugging-port=9222',
],
}
},
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
// singleRun: false,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity,
webpack: webpack_config,
webpackMiddleware: {
stats: {
// don't fill the console up with a mahoosive list of modules
chunks: false,
},
},
};
// include the olm loader if we have it.
if (olm_entry) {
myconfig.files.unshift(olm_entry);
}
config.set(myconfig);
};

View File

@@ -2,7 +2,7 @@
"name": "riot-web",
"productName": "Riot",
"main": "electron_app/src/electron-main.js",
"version": "1.5.7",
"version": "1.5.13",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"repository": {
@@ -11,70 +11,63 @@
},
"license": "Apache-2.0",
"files": [
"AUTHORS.rst",
"CONTRIBUTING.rst",
"deploy",
"docs",
"karma.conf.js",
"lib",
"release.sh",
"scripts",
"res",
"src",
"test",
"webpack.config.js"
"webpack.config.js",
"scripts",
"docs",
"release.sh",
"deploy",
"CHANGELOG.md",
"CONTRIBUTING.rst",
"LICENSE",
"README.md",
"AUTHORS.rst",
"package.json",
"contribute.json"
],
"style": "bundle.css",
"matrix-react-parent": "matrix-react-sdk",
"scripts": {
"reskindex": "reskindex -h src/header",
"reskindex:watch": "reskindex -h src/header -w",
"i18n": "matrix-gen-i18n",
"prunei18n": "matrix-prune-i18n",
"diff-i18n": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && yarn i18n && node scripts/compare-file.js src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
"postinstall": "node scripts/yarn-sub.js matrix-js-sdk install && node scripts/yarn-sub.js matrix-react-sdk install",
"reskindex": "reskindex -h src/header",
"reskindex:watch": "reskindex -h src/header -w",
"reskindex:watch-react": "node scripts/yarn-sub.js matrix-react-sdk reskindex:watch",
"clean": "rimraf lib webapp electron_app/dist",
"build": "yarn clean && yarn build:genfiles && yarn build:compile && yarn build:types && yarn build:bundle",
"build:res": "node scripts/copy-res.js",
"build:genfiles": "yarn reskindex && yarn build:res",
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
"build:compile": "yarn reskindex && babel --source-maps -d lib src",
"build:compile": "babel -d lib --verbose --extensions \".ts,.js\" src",
"build:bundle": "cross-env NODE_ENV=production webpack -p --progress --bail --mode production",
"build:bundle:dev": "webpack --progress --bail --mode development",
"build:electron": "yarn clean && yarn build && yarn install:electron && electron-builder -wml --ia32 --x64",
"build:electron": "yarn build && yarn install:electron && electron-builder -wml --ia32 --x64",
"build:electron:linux": "yarn build && electron-builder -l --x64",
"build:electron:macos": "yarn build && electron-builder -m --x64",
"build:electron:windows": "yarn build && electron-builder -w --ia32 --x64",
"build:react-sdk": "node scripts/yarn-sub.js matrix-react-sdk build",
"build:js-sdk": "node scripts/yarn-sub.js matrix-js-sdk start:init",
"build": "yarn build:js-sdk && yarn build:react-sdk && yarn reskindex && yarn build:res && yarn build:bundle",
"build:dev": "yarn build:js-sdk && yarn build:react-sdk && yarn reskindex && yarn build:res && yarn build:bundle:dev",
"dist": "scripts/package.sh",
"build:types": "tsc --emitDeclarationOnly",
"install:electron": "electron-builder install-app-deps",
"electron": "yarn install:electron && electron .",
"dist": "scripts/package.sh",
"start": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n reskindex,reskindex-react,res,riot-js \"yarn reskindex:watch\" \"yarn reskindex:watch-react\" \"yarn start:res\" \"yarn start:js\"",
"start:res": "node scripts/copy-res.js -w",
"start:js": "webpack-dev-server --host=0.0.0.0 --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js -w --progress --mode development",
"start:js:prod": "cross-env NODE_ENV=production webpack-dev-server -w --progress --mode production",
"start:js-sdk": "node scripts/yarn-sub.js matrix-js-sdk start:watch",
"start:js-sdk:prod": "cross-env NODE_ENV=production node scripts/yarn-sub.js matrix-js-sdk start:watch",
"start:react-sdk": "node scripts/yarn-sub.js matrix-react-sdk start:all",
"start:react-sdk:prod": "cross-env NODE_ENV=production node scripts/yarn-sub.js matrix-react-sdk start:all",
"start": "yarn build:js-sdk && yarn build:react-sdk && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n js-sdk,react-sdk,reskindex,res,riot-js \"yarn start:js-sdk\" \"yarn start:react-sdk\" \"yarn reskindex:watch\" \"yarn start:res\" \"yarn start:js\"",
"start:prod": "yarn build:js-sdk && yarn build:react-sdk && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n js-sdk,react-sdk,reskindex,res,riot-js \"yarn start:js-sdk:prod\" \"yarn start:react-sdk:prod\" \"yarn reskindex:watch\" \"yarn start:res\" \"yarn start:js:prod\"",
"lint": "eslint src/",
"lintall": "eslint src/ test/",
"clean": "rimraf lib webapp electron_app/dist",
"prepare": "yarn clean && yarn build:compile",
"test": "karma start --single-run=true --autoWatch=false --browsers VectorChromeHeadless",
"test-multi": "karma start"
"electron": "yarn build && yarn install:electron && electron .",
"lint": "yarn lint:types && yarn lint:ts && yarn lint:js && yarn lint:style",
"lint:js": "eslint src",
"lint:ts": "echo 'We don't actually have a typescript linter at this layer because tslint is being removed from our stack. Presumably your TS is fine.'",
"lint:types": "tsc --noEmit",
"lint:style": "stylelint 'res/css/**/*.scss'",
"test": "jest"
},
"dependencies": {
"babel-polyfill": "^6.26.0",
"babel-runtime": "^6.26.0",
"browser-request": "^0.3.3",
"favico.js": "^0.3.10",
"gemini-scrollbar": "github:matrix-org/gemini-scrollbar#91e1e566",
"gfm.css": "^1.1.2",
"highlight.js": "^9.13.1",
"matrix-js-sdk": "3.0.0",
"matrix-react-sdk": "1.7.6",
"modernizr": "^3.6.0",
"matrix-js-sdk": "5.1.1",
"matrix-react-sdk": "2.2.3",
"olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz",
"postcss-easings": "^2.0.0",
"prop-types": "^15.7.2",
@@ -85,29 +78,36 @@
"url": "^0.11.0"
},
"devDependencies": {
"autoprefixer": "^6.6.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "^8.1.1",
"babel-loader": "^7.1.5",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-builtin-extend": "^1.1.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2016": "^6.24.1",
"babel-preset-es2017": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"chokidar": "^2.0.4",
"@babel/cli": "^7.7.5",
"@babel/core": "^7.7.5",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-decorators": "^7.7.4",
"@babel/plugin-proposal-export-default-from": "^7.7.4",
"@babel/plugin-proposal-numeric-separator": "^7.7.4",
"@babel/plugin-proposal-object-rest-spread": "^7.7.4",
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/plugin-transform-flow-comments": "^7.7.4",
"@babel/plugin-transform-runtime": "^7.7.6",
"@babel/preset-env": "^7.7.6",
"@babel/preset-flow": "^7.7.4",
"@babel/preset-react": "^7.7.4",
"@babel/preset-typescript": "^7.7.4",
"@babel/register": "^7.7.4",
"@babel/runtime": "^7.7.6",
"@types/react": "^16.9.17",
"@types/react-dom": "^16.9.4",
"autoprefixer": "^9.7.3",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-loader": "^8.0.6",
"canvas": "^2.6.1",
"chokidar": "^3.3.1",
"concurrently": "^4.0.1",
"cpx": "^1.3.2",
"cross-env": "^4.0.0",
"css-loader": "^2.1.0",
"electron-builder": "^21.2.0",
"electron-builder-squirrel-windows": "^21.2.0",
"cross-env": "^6.0.3",
"css-loader": "^3.3.2",
"electron-builder": "^22.3.2",
"electron-builder-squirrel-windows": "^22.3.2",
"electron-devtools-installer": "^2.2.4",
"electron-notarize": "^0.2.0",
"eslint": "^5.8.0",
@@ -117,45 +117,43 @@
"eslint-plugin-jest": "^23.0.4",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-react-hooks": "^2.2.0",
"expect": "^1.16.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^3.0.1",
"fake-indexeddb": "^3.0.0",
"file-loader": "^5.0.2",
"fs-extra": "^0.30.0",
"html-webpack-plugin": "^3.2.0",
"jest": "^24.9.0",
"jest-environment-jsdom-fourteen": "^1.0.1",
"json-loader": "^0.5.3",
"karma": "^3.1.2",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-logcapture-reporter": "0.0.1",
"karma-mocha": "^1.3.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.31",
"karma-summary-reporter": "^1.5.1",
"karma-webpack": "4.0.0-beta.0",
"loader-utils": "^1.2.3",
"matrix-mock-request": "^1.2.3",
"matrix-react-test-utils": "^0.2.2",
"mini-css-extract-plugin": "^0.8.0",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"mocha": "^5.2.0",
"modernizr": "^3.6.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"postcss-extend": "^1.0.5",
"postcss-import": "^11.1.0",
"postcss-loader": "^2.1.6",
"postcss-mixins": "^6.2.0",
"postcss-nested": "^3.0.0",
"postcss-scss": "^1.0.6",
"postcss-simple-vars": "^4.1.0",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"postcss-mixins": "^6.2.3",
"postcss-nested": "^4.2.1",
"postcss-preset-env": "^6.7.0",
"postcss-scss": "^2.0.0",
"postcss-simple-vars": "^5.0.2",
"postcss-strip-inline-comments": "^0.1.5",
"rimraf": "^2.4.3",
"shell-escape": "^0.2.0",
"source-map-loader": "^0.2.4",
"webpack": "^4.23.1",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.11"
"stylelint": "^12.0.1",
"terser-webpack-plugin": "^2.3.0",
"typescript": "^3.7.3",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.9.0"
},
"build": {
"appId": "im.riot.app",
"electronVersion": "7.1.7",
"electronVersion": "7.1.12",
"files": [
"node_modules/**",
"src/**"
@@ -175,9 +173,6 @@
"StartupWMClass": "riot"
}
},
"deb": {
"afterInstall": "electron_app/build/linux/after-install.tpl"
},
"mac": {
"category": "public.app-category.social-networking",
"darkModeSupport": true
@@ -193,6 +188,39 @@
"output": "electron_app/dist",
"app": "electron_app"
},
"afterSign": "scripts/electron_afterSign.js"
"afterSign": "scripts/electron_afterSign.js",
"protocols": [
{
"name": "riot",
"schemes": [
"riot"
]
}
]
},
"jest": {
"modulePathIgnorePatterns": [
"<rootDir>/electron_app"
],
"testEnvironment": "jest-environment-jsdom-fourteen",
"testMatch": [
"<rootDir>/test/**/*-test.js"
],
"setupFilesAfterEnv": [
"<rootDir>/node_modules/matrix-react-sdk/test/setupTests.js"
],
"moduleNameMapper": {
"\\.(gif|png|svg|ttf|woff2)$": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/imageMock.js",
"\\$webapp/i18n/languages.json": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/languages.json",
"^browser-request$": "<rootDir>/node_modules/matrix-react-sdk/__mocks__/browser-request.js",
"^react$": "<rootDir>/node_modules/react",
"^react-dom$": "<rootDir>/node_modules/react-dom",
"^matrix-js-sdk$": "<rootDir>/node_modules/matrix-js-sdk/src",
"^matrix-react-sdk$": "<rootDir>/node_modules/matrix-react-sdk/src"
},
"transformIgnorePatterns": [
"/node_modules/(?!matrix-js-sdk).+$",
"/node_modules/(?!matrix-react-sdk).+$"
]
}
}

View File

@@ -1,14 +0,0 @@
module.exports = {
plugins: [
require("postcss-import")(),
require("autoprefixer")(),
require("postcss-simple-vars")(),
require("postcss-extend")(),
require("postcss-nested")(),
require("postcss-mixins")(),
require("postcss-easings")(),
require("postcss-strip-inline-comments")(),
],
"parser": "postcss-scss",
"local-plugins": true,
};

View File

@@ -20,30 +20,59 @@ cd `dirname $0`
for i in matrix-js-sdk matrix-react-sdk
do
echo "Checking version of $i..."
depver=`cat package.json | jq -r .dependencies[\"$i\"]`
latestver=`yarn info -s $i version`
latestver=`yarn info -s $i dist-tags.next`
if [ "$depver" != "$latestver" ]
then
echo "The latest version of $i is $latestver but package.json depends on $depver"
echo -n "Type 'Yes' to continue anyway: "
echo "The latest version of $i is $latestver but package.json depends on $depver."
echo -n "Type 'u' to auto-upgrade, 'c' to continue anyway, or 'a' to abort:"
read resp
if [ "$resp" != "Yes" ]
if [ "$resp" != "u" ] && [ "$resp" != "c" ]
then
echo "OK, never mind."
echo "Aborting."
exit 1
fi
if [ "$resp" == "u" ]
then
echo "Upgrading $i to $latestver..."
yarn add -E $i@$latestver
git add -u
# The `-e` flag opens the editor and gives you a chance to check
# the upgrade for correctness.
git commit -m "Upgrade $i to $latestver" -e
fi
fi
done
# bump Electron's package.json first
release="${1#v}"
tag="v${release}"
echo "electron yarn version"
prerelease=0
# We check if this build is a prerelease by looking to
# see if the version has a hyphen in it. Crude,
# but semver doesn't support postreleases so anything
# with a hyphen is a prerelease.
echo $release | grep -q '-' && prerelease=1
# bump Electron's package.json first
echo "electron yarn version"
cd electron_app
yarn version --no-git-tag-version --new-version "$release"
git commit package.json -m "$tag"
cd ..
exec ./node_modules/matrix-js-sdk/release.sh -u vector-im -z "$orig_args"
./node_modules/matrix-js-sdk/release.sh -u vector-im -z "$orig_args"
if [ $prerelease -eq 0 ]
then
# For a release, reset SDK deps back to the `develop` branch.
for i in matrix-js-sdk matrix-react-sdk
do
echo "Resetting $i to develop branch..."
yarn add github:matrix-org/$i#develop
git add -u
git commit -m "Reset $i back to develop branch"
done
git push origin develop
fi

1
res/sw.js Normal file
View File

@@ -0,0 +1 @@
self.addEventListener('fetch',() => {});

View File

@@ -18,7 +18,7 @@
"piwik": {
"url": "https://piwik.riot.im/",
"siteId": 1,
"policyUrl": "https://matrix.org/docs/guides/riot_im_cookie_policy"
"policyUrl": "https://matrix.org/legal/riot-im-cookie-policy"
},
"roomDirectory": {
"servers": [
@@ -35,7 +35,7 @@
"text": "Privacy Policy"
},
{
"url": "https://matrix.org/docs/guides/riot_im_cookie_policy",
"url": "https://matrix.org/legal/riot-im-cookie-policy",
"text": "Cookie Policy"
}
]

View File

@@ -20,9 +20,9 @@
"feature_many_integration_managers": "labs",
"feature_mjolnir": "labs",
"feature_dm_verification": "labs",
"feature_cross_signing": "labs",
"feature_event_indexing": "labs",
"feature_ftue_dms": "labs",
"feature_cross_signing": "enable",
"feature_invite_only_padlocks": "enable",
"feature_event_indexing": "disable",
"feature_bridge_state": "labs",
"feature_presence_in_room_list": "labs"
},
@@ -30,7 +30,7 @@
"piwik": {
"url": "https://piwik.riot.im/",
"siteId": 1,
"policyUrl": "https://matrix.org/docs/guides/riot_im_cookie_policy"
"policyUrl": "https://matrix.org/legal/riot-im-cookie-policy"
},
"roomDirectory": {
"servers": [
@@ -47,7 +47,7 @@
"text": "Privacy Policy"
},
{
"url": "https://matrix.org/docs/guides/riot_im_cookie_policy",
"url": "https://matrix.org/legal/riot-im-cookie-policy",
"text": "Cookie Policy"
}
]

View File

@@ -14,4 +14,4 @@ JSSDK_SHA=$(cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD)
VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop
DIST_VERSION=$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA scripts/package.sh -d
CI_PACKAGE=true DIST_VERSION=$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA scripts/package.sh -d

View File

@@ -58,6 +58,7 @@ const INCLUDE_LANGS = [
// "dest/b/...".
const COPY_LIST = [
["res/manifest.json", "webapp"],
["res/sw.js", "webapp"],
["res/welcome.html", "webapp"],
["res/welcome/**", "webapp/welcome"],
["res/themes/**", "webapp/themes"],
@@ -65,6 +66,7 @@ const COPY_LIST = [
["node_modules/matrix-react-sdk/res/media/**", "webapp/media"],
["node_modules/olm/olm_legacy.js", "webapp", { directwatch: 1 }],
["./config.json", "webapp", { directwatch: 1 }],
["contribute.json", "webapp"],
];
const parseArgs = require('minimist');

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -ex
@@ -20,17 +20,15 @@ then
fi
echo "Linking js-sdk"
git clone $JS_SDK_REPO js-sdk
git clone --depth 1 --branch $JS_SDK_BRANCH $JS_SDK_REPO js-sdk
cd js-sdk
git checkout $JS_SDK_BRANCH
yarn link
yarn --network-timeout=100000 install
cd ../
echo "Linking react-sdk"
git clone $REACT_SDK_REPO react-sdk
git clone --depth 1 --branch $REACT_SDK_BRANCH $REACT_SDK_REPO react-sdk
cd react-sdk
git checkout $REACT_SDK_BRANCH
yarn link
yarn link matrix-js-sdk
yarn --network-timeout=100000 install

View File

@@ -11,7 +11,7 @@ DIST_VERSION=$TAG
# a few SHAs rather than a version.
# Docker Hub doesn't always check out the tag and sometimes checks out the branch, so we should look
# for an appropriately tagged branch as well (heads/v1.2.3).
if [ $BRANCH != 'HEAD' && $BRANCH != 'heads/v*' ]
if [[ $BRANCH != 'HEAD' && $BRANCH != 'heads/v*' ]]
then
REACT_SHA=$(cd node_modules/matrix-react-sdk; git rev-parse --short=12 HEAD)
JSSDK_SHA=$(cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD)

View File

@@ -10,7 +10,13 @@ exports.default = async function(context) {
// from the keychain, so we need to get it from the environment.
const userId = process.env.NOTARIZE_APPLE_ID;
if (userId === undefined) {
throw new Error("User ID not found. Set NOTARIZE_APPLE_ID.");
console.warn(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" +
"! Skipping macOS notarisation. !\n" +
"! User ID not found, set NOTARIZE_APPLE_ID. !\n" +
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
);
return;
}
console.log("Notarising macOS app. This may be some time.");

View File

@@ -8,23 +8,31 @@ exports.default = async function(options) {
const appOutDir = path.dirname(inPath);
// get the token passphrase from the keychain
const tokenPassphrase = await new Promise((resolve, reject) => {
execFile(
'security',
['find-generic-password', '-s', 'riot_signing_token', '-w'],
{},
(err, stdout) => {
if (err) {
console.error("Couldn't find signing token in keychain", err);
// electron-builder seems to print '[object Object]' on the
// console whether you reject with an Error or a string...
reject(err);
} else {
resolve(stdout.trim());
}
},
let tokenPassphrase;
try {
tokenPassphrase = await new Promise((resolve, reject) => {
execFile(
'security',
['find-generic-password', '-s', 'riot_signing_token', '-w'],
{},
(err, stdout) => {
if (err) {
reject(err);
} else {
resolve(stdout.trim());
}
},
);
});
} catch (err) {
console.warn(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" +
"! Skipping Windows signing. !\n" +
"! Signing token not found in keychain. !\n" +
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
);
});
return;
}
return new Promise((resolve, reject) => {
let cmdLine = 'osslsigncode sign ';

View File

@@ -78,6 +78,7 @@ dodep matrix-org matrix-js-sdk
pushd matrix-js-sdk
yarn link
yarn install
yarn build
popd
yarn link matrix-js-sdk
@@ -95,6 +96,7 @@ pushd matrix-react-sdk
yarn link
yarn link matrix-js-sdk
yarn install
yarn build
popd
yarn link matrix-react-sdk

View File

@@ -2,11 +2,6 @@
set -e
dev=""
if [ "$1" = '-d' ]; then
dev=":dev"
fi
if [ -n "$DIST_VERSION" ]; then
version=$DIST_VERSION
else
@@ -14,7 +9,7 @@ else
fi
yarn clean
yarn build$dev
yarn build
# include the sample config in the tarball. Arguably this should be done by
# `yarn build`, but it's just too painful.

View File

@@ -18,9 +18,9 @@ limitations under the License.
'use strict';
import EmbeddedPage from 'matrix-react-sdk/lib/components/structures/EmbeddedPage';
import EmbeddedPage from 'matrix-react-sdk/src/components/structures/EmbeddedPage';
import sanitizeHtml from 'sanitize-html';
import { _t } from 'matrix-react-sdk/lib/languageHandler';
import { _t } from 'matrix-react-sdk/src/languageHandler';
export default class VectorEmbeddedPage extends EmbeddedPage {
static replaces = 'EmbeddedPage';
@@ -29,7 +29,7 @@ export default class VectorEmbeddedPage extends EmbeddedPage {
translate(s) {
s = sanitizeHtml(_t(s));
// ugly fix for https://github.com/vector-im/riot-web/issues/4243
s = s.replace(/\[matrix\]/, '<a href="https://matrix.org" target="_blank" rel="noopener"><img width="79" height="34" alt="[matrix]" style="padding-left: 1px;vertical-align: middle" src="welcome/images/matrix.svg"/></a>');
s = s.replace(/\[matrix\]/, '<a href="https://matrix.org" target="_blank" rel="noreferrer noopener"><img width="79" height="34" alt="[matrix]" style="padding-left: 1px;vertical-align: middle" src="welcome/images/matrix.svg"/></a>');
return s;
}
}

View File

@@ -16,14 +16,13 @@ limitations under the License.
*/
import React from 'react';
import SdkConfig from 'matrix-react-sdk/lib/SdkConfig';
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
import { _t } from 'matrix-react-sdk/src/languageHandler';
import { _t } from 'matrix-react-sdk/lib/languageHandler';
module.exports = () => {
const VectorAuthFooter = () => {
const brandingConfig = SdkConfig.get().branding;
let links = [
{"text": "blog", "url": "https://medium.com/@RiotChat"},
{"text": "blog", "url": "https://blog.riot.im"},
{"text": "twitter", "url": "https://twitter.com/@RiotChat"},
{"text": "github", "url": "https://github.com/vector-im/riot-web"},
];
@@ -35,7 +34,7 @@ module.exports = () => {
const authFooterLinks = [];
for (const linkEntry of links) {
authFooterLinks.push(
<a href={linkEntry.url} key={linkEntry.text} target="_blank" rel="noopener">
<a href={linkEntry.url} key={linkEntry.text} target="_blank" rel="noreferrer noopener">
{linkEntry.text}
</a>,
);
@@ -44,8 +43,11 @@ module.exports = () => {
return (
<div className="mx_AuthFooter">
{authFooterLinks}
<a href="https://matrix.org" target="_blank" rel="noopener">{ _t('powered by Matrix') }</a>
<a href="https://matrix.org" target="_blank" rel="noreferrer noopener">{ _t('powered by Matrix') }</a>
</div>
);
};
module.exports.replaces = 'AuthFooter';
VectorAuthFooter.replaces = 'AuthFooter';
export default VectorAuthFooter;

View File

@@ -19,7 +19,7 @@ limitations under the License.
import React from 'react';
import PropTypes from 'prop-types';
import SdkConfig from 'matrix-react-sdk/lib/SdkConfig';
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
export default class VectorAuthHeaderLogo extends React.PureComponent {
static replaces = 'AuthHeaderLogo'

View File

@@ -17,8 +17,8 @@ limitations under the License.
'use strict';
import React from 'react';
import sdk from 'matrix-react-sdk/lib/index';
import SdkConfig from 'matrix-react-sdk/lib/SdkConfig';
import * as sdk from 'matrix-react-sdk/src/index';
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
export default class VectorAuthPage extends React.PureComponent {
static replaces = 'AuthPage'

View File

@@ -16,13 +16,13 @@ limitations under the License.
*/
import React from "react";
import { _t } from 'matrix-react-sdk/lib/languageHandler';
import { _t } from 'matrix-react-sdk/src/languageHandler';
/**
* This is identical to `CustomServerDialog` except for replacing "this app"
* with "Riot".
*/
module.exports = ({onFinished}) => {
const VectorCustomServerDialog = ({onFinished}) => {
return (
<div className="mx_ErrorDialog">
<div className="mx_Dialog_title">
@@ -44,4 +44,7 @@ module.exports = ({onFinished}) => {
</div>
);
};
module.exports.replaces = 'CustomServerDialog';
VectorCustomServerDialog.replaces = 'CustomServerDialog';
export default VectorCustomServerDialog;

View File

@@ -4,22 +4,22 @@
"You need to be using HTTPS to place a screen-sharing call.": "Pro uskutečnění hovoru se sdílením obrazovky musíte používat HTTPS.",
"Chat with Riot Bot": "Konverzovat s Riot Botem",
"Dismiss": "Zahodit",
"powered by Matrix": "poháněno Matrixem",
"Riot Desktop on %(platformName)s": "Riot Desktop na %(platformName)s",
"powered by Matrix": "používá protokol Matrix",
"Riot Desktop on %(platformName)s": "Riot Desktop pro %(platformName)s",
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s přes %(browserName)s na %(osName)s",
"Custom Server Options": "Vlastní serverové volby",
"Custom Server Options": "Vlastní nastavení serveru",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Decentralizovaný, šifrovaný chat a spolupráce na platformě [matrix]",
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Ve vlastních serverových volbách si můžete nastavit použití vlastního domovského serveru. To Vám umožní používat Riot s existujícím Matrix účtem na jiném serveru.",
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Ve vlastním nastavení serveru můžete nastavit použití vlastního domovského serveru. To vám umožní používat Riot s existujícím Matrix účtem na jiném serveru.",
"Sign In": "Přihlásit se",
"Create Account": "Vytvořit účet",
"Need help?": "Chcete pomoct?",
"Explore rooms": "Prohlížet místnosti",
"Need help?": "Potřebujete pomoc?",
"Explore rooms": "Procházet místnosti",
"Room Directory": "Adresář místností",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Konfigurace Riotu obsahuje neplatný JSON. Opravte prosím tento problém a obnovte stránku.",
"The message from the parser is: %(message)s": "Zpráva z parseru je: %(message)s",
"Invalid JSON": "Neplatný JSON",
"Your Riot is misconfigured": "Riot je špatně nakonfigurován",
"Unexpected error preparing the app. See console for details.": "Neočekávaná chyba při přípravě aplikace. V konzoli je více informací.",
"Unexpected error preparing the app. See console for details.": "Neočekávaná chyba při přípravě aplikace. Podrobnosti najdete v konzoli.",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Neplatná konfigurace: je možné specifikovat pouze jednu volbu z default_server_config, default_server_name, nebo default_hs_url.",
"Invalid configuration: no default server specified.": "Neplatná konfigurace: není zadán výchozí server."
}

View File

@@ -9,11 +9,11 @@
"Welcome to Riot.im": "Willkommen bei Riot.im",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Dezentrale, verschlüsselte Chat- &amp; Kollaborationslösung unterstützt von [matrix]",
"Chat with Riot Bot": "Chatte mit dem Riot Bot",
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Du kannst die erweiterte Serveroption nutzen um dich an einem anderen Matrixserver anzumelden, indem du eine andere Heimserver-URL angibst. Dies erlaubt dir, Riot mit einem existierenden Matrix-Konto auf einem anderen Heimserver zu nutzen.",
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Du kannst benutzerdefinierte Server-Optionen nutzen, um dich an anderen Matrix Servern anzumelden, indem du eine andere Heimserver-URL angibst. Dies erlaubt dir, Riot mit einem existierenden Matrix-Konto auf einem anderen Heimserver zu nutzen.",
"Sign In": "Anmelden",
"Create Account": "Konto erstellen",
"Create Account": "Account erstellen",
"Need help?": "Brauchst du Hilfe?",
"Explore rooms": "Räume erkunden",
"Explore rooms": "Erkunde Räume",
"Room Directory": "Raumverzeichnis",
"Unexpected error preparing the app. See console for details.": "Unerwarteter Fehler bei der Vorbereitung der App. Siehe Konsole für Details.",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Ungültige Konfiguration: Es kann nur eine der Optionen default_server_config, default_server_name oder default_hs_url angegeben werden.",
@@ -21,5 +21,6 @@
"Your Riot is misconfigured": "Dein Riot ist falsch konfiguriert",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Deine Riot Konfiguration enthält ungültiges JSON. Bitte korrigiere das Problem und lade die Seite neu.",
"The message from the parser is: %(message)s": "Die Nachricht des Parsers ist: %(message)s",
"Invalid JSON": "Ungültiges JSON"
"Invalid JSON": "Ungültiges JSON",
"Go to your browser to complete Sign In": "Gehe zu deinem Browser, um die Anmeldung abzuschließen"
}

View File

@@ -7,6 +7,7 @@
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.",
"Invalid configuration: no default server specified.": "Invalid configuration: no default server specified.",
"Riot Desktop on %(platformName)s": "Riot Desktop on %(platformName)s",
"Go to your browser to complete Sign In": "Go to your browser to complete Sign In",
"Unknown device": "Unknown device",
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s via %(browserName)s on %(osName)s",
"You need to be using HTTPS to place a screen-sharing call.": "You need to be using HTTPS to place a screen-sharing call.",

View File

@@ -21,5 +21,6 @@
"Your Riot is misconfigured": "Via kliento Riot estas misagordita",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Viaj Riot-agordoj enhavas nevalidan JSON-on. Bonvolu korekti la problemon kaj reŝarĝi la paĝon.",
"The message from the parser is: %(message)s": "La mesaĝo el la analizilo estas: %(message)s",
"Invalid JSON": "Nevalida JSON"
"Invalid JSON": "Nevalida JSON",
"Go to your browser to complete Sign In": "Iru al via foliumilo por fini la saluton"
}

View File

@@ -21,5 +21,6 @@
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Konfigurazio baliogabea: default_server_config, default_server_name, edo default_hs_url bat bakarra zehaztu daiteke.",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Zure Riot konfigurazioak baliogabeko JSON kodea du. Zuzendu arazoa eta kargatu orria berriro.",
"The message from the parser is: %(message)s": "Prozesatzailearen mezua hau da: %(message)s",
"Invalid JSON": "JSON baliogabea"
"Invalid JSON": "JSON baliogabea",
"Go to your browser to complete Sign In": "Joan zure nabigatzailera izena ematen bukatzeko"
}

View File

@@ -21,5 +21,6 @@
"Your Riot is misconfigured": "Votre Riot est mal configuré",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Votre configuration de Riot contient du JSON non valide. Corrigez ce problème et rechargez la page.",
"The message from the parser is: %(message)s": "Le message de lanalyseur est : %(message)s",
"Invalid JSON": "JSON non valide"
"Invalid JSON": "JSON non valide",
"Go to your browser to complete Sign In": "Utilisez votre navigateur pour terminer la connexion"
}

View File

@@ -1,25 +1,26 @@
{
"Custom Server Options": "Egyedi szerverbeállítások",
"Dismiss": "Eltüntet",
"Dismiss": "Eltüntetés",
"powered by Matrix": "Matrix hajtja",
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s alkalmazás %(browserName)s böngészőn %(osName)s rendszeren",
"Riot Desktop on %(platformName)s": "Riot Desktop itt: %(platformName)s",
"Unknown device": "Ismeretlen készülék",
"Unknown device": "Ismeretlen eszköz",
"You need to be using HTTPS to place a screen-sharing call.": "Képernyőmegosztás indításához HTTPS-t kell használnod.",
"Welcome to Riot.im": "Üdvözöl a Riot.im",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Decentralizált, titkosított csevegés és kollaboráció [matrix] alapokon",
"Chat with Riot Bot": "Csevegés a Riot Robottal",
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Használhatod az egyedi szerver beállítást más Matrix szerverre való belépéshez, azzal, hogy megadod a Matrix szerver URL-jét. Ezzel a Riot-ot használhatod más Matrix szerveren lévő fiókkal.",
"Sign In": "Bejelentkezés",
"Create Account": "Fiók készítés",
"Create Account": "Fiók létrehozása",
"Need help?": "Segíthetünk?",
"Explore rooms": "Szobák felderítése",
"Room Directory": "Szoba lista",
"Room Directory": "Szobalista",
"Unexpected error preparing the app. See console for details.": "Váratlan hiba történt az alkalmazás előkészítésénél. A részletekért nézd meg a konzolt.",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Érvénytelen konfiguráció: csak egyet lehet megadni a default_server_config, default_server_name és default_hs_url közül.",
"Invalid configuration: no default server specified.": "Érvénytelen konfiguráció: nincs megadva alapértelmezett szerver.",
"Your Riot is misconfigured": "A Riotod hibásan van beállítva",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "A Riot beállításod érvénytelen JSON szöveget tartalmaz. Kérlek javítsd és töltsd újra az oldalt.",
"The message from the parser is: %(message)s": "A feldolgozó algoritmus üzenete: %(message)s",
"Invalid JSON": "Érvénytelen JSON"
"Invalid JSON": "Érvénytelen JSON",
"Go to your browser to complete Sign In": "A böngészőben fejezd be a bejelentkezést"
}

View File

@@ -21,5 +21,6 @@
"Your Riot is misconfigured": "Il tuo Riot è configurato male",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "La tua configurazione di Riot contiene un JSON non valido. Correggi il problema e ricarica la pagina.",
"The message from the parser is: %(message)s": "Il messaggio dal parser è: %(message)s",
"Invalid JSON": "JSON non valido"
"Invalid JSON": "JSON non valido",
"Go to your browser to complete Sign In": "Vai nel tuo browser per completare l'accesso"
}

View File

@@ -0,0 +1 @@
{}

View File

@@ -2,7 +2,7 @@
"Unknown device": "Nežinomas įrenginys",
"powered by Matrix": "veikia su Matrix",
"Welcome to Riot.im": "Sveiki atvykę į Riot.im",
"Chat with Riot Bot": "Kalbėtis su Riot botu",
"Chat with Riot Bot": "Kalbėtis su Riot Botu",
"Riot Desktop on %(platformName)s": "Riot Desktop, naudojant %(platformName)s",
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s per %(browserName)s, naudojant %(osName)s",
"You need to be using HTTPS to place a screen-sharing call.": "Norint skambinti naudojant ekrano vaizdo dalijimosi funkciją, jūs turite naudoti HTTPS.",
@@ -12,7 +12,7 @@
"Sign In": "Prisijungti",
"Create Account": "Sukurti paskyrą",
"Need help?": "Reikia pagalbos?",
"Explore rooms": "Peržiūrėti kambarius",
"Explore rooms": "Žvalgyti kambarius",
"Room Directory": "Kambarių katalogas",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Jūsų Riot konfigūracijoje yra klaidingas JSON. Prašome pataisyti problemą ir iš naujo užkrauti puslapį.",
"The message from the parser is: %(message)s": "Analizatoriaus žinutė yra: %(message)s",
@@ -21,5 +21,6 @@
"Unexpected error preparing the app. See console for details.": "Netikėta klaida ruošiant programą. Norėdami sužinoti daugiau detalių, žiūrėkite konsolę.",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Klaidinga konfigūracija: galima nurodyti tik vieną iš default_server_config, default_server_name, arba default_hs_url.",
"Invalid configuration: no default server specified.": "Klaidinga konfigūracija: nenurodytas numatytasis serveris.",
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Jūs galite naudoti pasirinktinius serverio nustatymus, kad prisijungtumėte prie kitų Matrix serverių, nurodydami kito serverio URL. Tai leidžia jums naudotis Riot su esama Matrix paskyra kitame serveryje."
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Jūs galite naudoti pasirinktinius serverio nustatymus, kad prisijungtumėte prie kitų Matrix serverių, nurodydami kito serverio URL. Tai leidžia jums naudotis Riot su esama Matrix paskyra kitame serveryje.",
"Go to your browser to complete Sign In": "Norėdami užbaigti prisijungimą, eikite į naršyklę"
}

View File

@@ -7,14 +7,19 @@
"You need to be using HTTPS to place a screen-sharing call.": "Du er nødt til å bruke HTTPS for å ha en samtale med skjermdeling.",
"Dismiss": "Avvis",
"Welcome to Riot.im": "Velkommen til Riot.im",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Desentralisert, kryptert chat &amp; sammabeid drevet av [matrix]",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Desentralisert, kryptert chat &amp; samarbeid drevet av [matrix]",
"Chat with Riot Bot": "Chat med Riot Bot",
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Du kan bruke instillinger for «egendefinert tjener» til å logge inn på andre Matrix tjenere ved å spesifisere en annen URL. Dette lar deg bruke Riot med en eksisterende Matrix konto på en annen hjemmetjener.",
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Du kan bruke instillinger for «egendefinert tjener» til å logge inn på andre Matrix-tjenere ved å spesifisere en annen URL. Dette lar deg bruke Riot med en eksisterende Matrix-konto på en annen hjemmetjener.",
"Sign In": "Logg inn",
"Create Account": "Lag konto",
"Need help?": "Trenger du hjelp?",
"Room Directory": "Alle rom",
"Explore rooms": "Se alle rom",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Riot-konfigurasjonen din inneholder ugyldig JSON. Vennligst fiks problemet og oppdater siden.",
"The message from the parser is: %(message)s": "Meldingen fra parseren er: %(message)s"
"The message from the parser is: %(message)s": "Meldingen fra parseren er: %(message)s",
"Invalid JSON": "Ugyldig JSON",
"Your Riot is misconfigured": "Riot er feilkonfigurert",
"Invalid configuration: no default server specified.": "Ugyldig konfigurasjon: ingen standardserver spesifisert.",
"Unexpected error preparing the app. See console for details.": "Uventet feil oppsto mens appen ble gjort klar. Se konsollen for detaljer.",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Ugyldig konfigurasjon: Spesifiser kun en av følgende: default_server_config, default_server_name eller default_hs_url."
}

View File

@@ -21,5 +21,6 @@
"Your Riot is misconfigured": "Uw Riot is onjuist geconfigureerd",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Uw Riot-configuratie bevat ongeldige JSON. Corrigeer het probleem en herlaad de pagina.",
"The message from the parser is: %(message)s": "De ontleder meldt: %(message)s",
"Invalid JSON": "Ongeldige JSON"
"Invalid JSON": "Ongeldige JSON",
"Go to your browser to complete Sign In": "Ga naar uw browser om de aanmelding te voltooien"
}

View File

@@ -2,7 +2,7 @@
"Riot Desktop on %(platformName)s": "Riot på Skrivebord for %(platformName)s",
"Unknown device": "Ukjend eining",
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s gjennom %(browserName)s på %(osName)s",
"You need to be using HTTPS to place a screen-sharing call.": "Du må bruka HTTPS for å ha ei samtale med skjermdeling.",
"You need to be using HTTPS to place a screen-sharing call.": "Du må bruka HTTPS for å ha ein samtale med skjermdeling.",
"Dismiss": "Avvis",
"powered by Matrix": "Matrixdriven",
"Welcome to Riot.im": "Velkomen til Riot.im",
@@ -11,12 +11,12 @@
"Custom Server Options": "Tilpassa tenar-innstillingar",
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Du kan nytta dei eigendefinerte tenarinstillingane for å logga inn på andre Matrix-tenarar ved å uppgje ein annan heimtenar-URL. Dette lèt deg bruka Riot med ein Matrix-konto som allereie finst på ein annan heimtenar.",
"Sign In": "Logg inn",
"Create Account": "Lag brukar",
"Create Account": "Opprett konto",
"Need help?": "Treng du hjelp?",
"Explore rooms": "Utforsk romma",
"Room Directory": "Romkatalog",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Riot-konfigurasjonen din har ugyldig JSON-kode. Korriger dette og last inn sida på nytt.",
"The message from the parser is: %(message)s": "Meldingen frå kodetolkaren er: %(message)s",
"The message from the parser is: %(message)s": "Meldinga frå kodetolkaren er: %(message)s",
"Invalid JSON": "Ugyldig JSON",
"Your Riot is misconfigured": "Riot-klienten din er feilkonfiguert",
"Unexpected error preparing the app. See console for details.": "Uventa feil under lasting av programmet. Sjå konsollen for detaljar.",

View File

@@ -21,5 +21,6 @@
"Your Riot is misconfigured": "Ваш Riot неправильно настроен",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Ваша конфигурация Riot содержит нерабочий JSON. Пожалуйста исправьте проблему и перезагрузите страницу.",
"The message from the parser is: %(message)s": "Сообщение из парсера: %(message)s",
"Invalid JSON": "Нерабочий JSON"
"Invalid JSON": "Нерабочий JSON",
"Go to your browser to complete Sign In": "Перейдите в браузер для завершения входа"
}

View File

@@ -21,5 +21,6 @@
"Your Riot is misconfigured": "Riot-i juaj është i keqformësuar",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Formësimi juaj i Riot-it përmban JSON. Ju lutemi, ndreqeni problemin dhe ringarkoni faqen.",
"The message from the parser is: %(message)s": "Mesazhi prej procesit është: %(message)s",
"Invalid JSON": "JSON i pavlefshëm"
"Invalid JSON": "JSON i pavlefshëm",
"Go to your browser to complete Sign In": "Që të plotësoni Hyrjen, kaloni te shfletuesi juaj"
}

View File

@@ -8,10 +8,10 @@
"You need to be using HTTPS to place a screen-sharing call.": "Ekran paylaşımlı arama yapmak için HTTPS kullanıyor olmalısınız.",
"Welcome to Riot.im": "Riot.im'e hoş geldiniz",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "Merkezsiz, şifreli sohbet &amp; işbirliği ile Matrix tarafından desteklenmektedir",
"Chat with Riot Bot": "Riot Bot ile sohbet et",
"Chat with Riot Bot": "Riot Bot ile Sohbet Et",
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Özel sunucu seçenekleri kullanıp farklı bir anamakine URL'si belirleyerek diğer Matrix sunucularına giriş yapabilirsin. Bu Riot'u varolan bir Matrix hesabı ile farklı anamakine de kullanmanı sağlar.",
"Sign In": "Giriş yap",
"Create Account": "Kayıt Ol",
"Sign In": "Giriş Yap",
"Create Account": "Hesap Oluştur",
"Need help?": "Yardıma mı ihtiyacın var?",
"Explore rooms": "Odaları keşfet",
"Room Directory": "Oda Dizini",

View File

@@ -21,5 +21,6 @@
"Your Riot is misconfigured": "Je Riot is verkeerd geconfigureerd gewist",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Je Riot-configuroasje bevat oungeldigen JSON. Corrigeer t probleem en herload t blad.",
"The message from the parser is: %(message)s": "t Bericht van de verwerker is: %(message)s",
"Invalid JSON": "Oungeldigen JSON"
"Invalid JSON": "Oungeldigen JSON",
"Go to your browser to complete Sign In": "Goa noa je browser voe danmeldienge te voltooin"
}

View File

@@ -7,7 +7,7 @@
"Unknown device": "未知设备",
"You need to be using HTTPS to place a screen-sharing call.": "您需要使用 HTTPS 以进行共享屏幕通话。",
"Welcome to Riot.im": "欢迎来到 Riot.im",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "去中心化加密聊天 &amp; 由 [matrix] 驱动",
"Decentralised, encrypted chat &amp; collaboration powered by [matrix]": "去中心化加密聊天与协作,由 [matrix] 驱动",
"Chat with Riot Bot": "与 Riot 机器人聊天",
"Sign In": "登入",
"Create Account": "创建帐号",

View File

@@ -21,5 +21,6 @@
"Your Riot is misconfigured": "您的 Riot 沒有設定好",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "您的 Riot 包含無效的 JSON。請修正問題並重新整理頁面。",
"The message from the parser is: %(message)s": "從解析器而來的訊息為:%(message)s",
"Invalid JSON": "無效的 JSON"
"Invalid JSON": "無效的 JSON",
"Go to your browser to complete Sign In": "到您的瀏覽器完成登入"
}

486
src/vector/app.js Normal file
View File

@@ -0,0 +1,486 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Copyright 2018, 2019 New Vector Ltd
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import olmWasmPath from 'olm/olm.wasm';
import React from 'react';
// add React and ReactPerf to the global namespace, to make them easier to
// access via the console
global.React = React;
import ReactDOM from 'react-dom';
import * as sdk from 'matrix-react-sdk';
import PlatformPeg from 'matrix-react-sdk/src/PlatformPeg';
import * as VectorConferenceHandler from 'matrix-react-sdk/src/VectorConferenceHandler';
import * as languageHandler from 'matrix-react-sdk/src/languageHandler';
import {_t, _td, newTranslatableError} from 'matrix-react-sdk/src/languageHandler';
import AutoDiscoveryUtils from 'matrix-react-sdk/src/utils/AutoDiscoveryUtils';
import {AutoDiscovery} from "matrix-js-sdk/src/autodiscovery";
import * as Lifecycle from "matrix-react-sdk/src/Lifecycle";
import url from 'url';
import {parseQs, parseQsFromFragment} from './url_utils';
import ElectronPlatform from './platform/ElectronPlatform';
import WebPlatform from './platform/WebPlatform';
import {MatrixClientPeg} from 'matrix-react-sdk/src/MatrixClientPeg';
import SettingsStore from "matrix-react-sdk/src/settings/SettingsStore";
import SdkConfig from "matrix-react-sdk/src/SdkConfig";
import {setTheme} from "matrix-react-sdk/src/theme";
import Olm from 'olm';
import CallHandler from 'matrix-react-sdk/src/CallHandler';
let lastLocationHashSet = null;
function checkBrowserFeatures() {
if (!window.Modernizr) {
console.error("Cannot check features - Modernizr global is missing.");
return false;
}
// custom checks atop Modernizr because it doesn't have ES2018/ES2019 checks in it for some features we depend on,
// Modernizr requires rules to be lowercase with no punctuation:
// ES2018: http://www.ecma-international.org/ecma-262/9.0/#sec-promise.prototype.finally
window.Modernizr.addTest("promiseprototypefinally", () =>
window.Promise && window.Promise.prototype && typeof window.Promise.prototype.finally === "function");
// ES2019: http://www.ecma-international.org/ecma-262/10.0/#sec-object.fromentries
window.Modernizr.addTest("objectfromentries", () =>
window.Object && typeof window.Object.fromEntries === "function");
const featureList = Object.keys(window.Modernizr);
let featureComplete = true;
for (let i = 0; i < featureList.length; i++) {
if (window.Modernizr[featureList[i]] === undefined) {
console.error(
"Looked for feature '%s' but Modernizr has no results for this. " +
"Has it been configured correctly?", featureList[i],
);
return false;
}
if (window.Modernizr[featureList[i]] === false) {
console.error("Browser missing feature: '%s'", featureList[i]);
// toggle flag rather than return early so we log all missing features rather than just the first.
featureComplete = false;
}
}
return featureComplete;
}
// Parse the given window.location and return parameters that can be used when calling
// MatrixChat.showScreen(screen, params)
function getScreenFromLocation(location) {
const fragparts = parseQsFromFragment(location);
return {
screen: fragparts.location.substring(1),
params: fragparts.params,
};
}
// Here, we do some crude URL analysis to allow
// deep-linking.
function routeUrl(location) {
if (!window.matrixChat) return;
console.log("Routing URL ", location.href);
const s = getScreenFromLocation(location);
window.matrixChat.showScreen(s.screen, s.params);
}
function onHashChange(ev) {
if (decodeURIComponent(window.location.hash) === lastLocationHashSet) {
// we just set this: no need to route it!
return;
}
routeUrl(window.location);
}
// This will be called whenever the SDK changes screens,
// so a web page can update the URL bar appropriately.
function onNewScreen(screen) {
console.log("newscreen "+screen);
const hash = '#/' + screen;
lastLocationHashSet = hash;
window.location.hash = hash;
}
// We use this to work out what URL the SDK should
// pass through when registering to allow the user to
// click back to the client having registered.
// It's up to us to recognise if we're loaded with
// this URL and tell MatrixClient to resume registration.
//
// If we're in electron, we should never pass through a file:// URL otherwise
// the identity server will try to 302 the browser to it, which breaks horribly.
// so in that instance, hardcode to use riot.im/app for now instead.
function makeRegistrationUrl(params) {
let url;
if (window.location.protocol === "vector:") {
url = 'https://riot.im/app/#/register';
} else {
url = (
window.location.protocol + '//' +
window.location.host +
window.location.pathname +
'#/register'
);
}
const keys = Object.keys(params);
for (let i = 0; i < keys.length; ++i) {
if (i === 0) {
url += '?';
} else {
url += '&';
}
const k = keys[i];
url += k + '=' + encodeURIComponent(params[k]);
}
return url;
}
function onTokenLoginCompleted() {
// if we did a token login, we're now left with the token, hs and is
// url as query params in the url; a little nasty but let's redirect to
// clear them.
const parsedUrl = url.parse(window.location.href);
parsedUrl.search = "";
const formatted = url.format(parsedUrl);
console.log("Redirecting to " + formatted + " to drop loginToken " +
"from queryparams");
window.location.href = formatted;
}
export async function loadApp() {
// XXX: the way we pass the path to the worker script from webpack via html in body's dataset is a hack
// but alternatives seem to require changing the interface to passing Workers to js-sdk
const vectorIndexeddbWorkerScript = document.body.dataset.vectorIndexeddbWorkerScript;
if (!vectorIndexeddbWorkerScript) {
// If this is missing, something has probably gone wrong with
// the bundling. The js-sdk will just fall back to accessing
// indexeddb directly with no worker script, but we want to
// make sure the indexeddb script is present, so fail hard.
throw new Error("Missing indexeddb worker script!");
}
MatrixClientPeg.setIndexedDbWorkerScript(vectorIndexeddbWorkerScript);
CallHandler.setConferenceHandler(VectorConferenceHandler);
window.addEventListener('hashchange', onHashChange);
await loadOlm();
// set the platform for react sdk
if (window.ipcRenderer) {
console.log("Using Electron platform");
const plaf = new ElectronPlatform();
PlatformPeg.set(plaf);
} else {
console.log("Using Web platform");
PlatformPeg.set(new WebPlatform());
}
const platform = PlatformPeg.get();
let configJson;
let configError;
let configSyntaxError = false;
try {
configJson = await platform.getConfig();
} catch (e) {
configError = e;
if (e && e.err && e.err instanceof SyntaxError) {
console.error("SyntaxError loading config:", e);
configSyntaxError = true;
configJson = {}; // to prevent errors between here and loading CSS for the error box
}
}
// XXX: We call this twice, once here and once in MatrixChat as a prop. We call it here to ensure
// granular settings are loaded correctly and to avoid duplicating the override logic for the theme.
SdkConfig.put(configJson);
// Load language after loading config.json so that settingsDefaults.language can be applied
await loadLanguage();
const fragparts = parseQsFromFragment(window.location);
const params = parseQs(window.location);
// don't try to redirect to the native apps if we're
// verifying a 3pid (but after we've loaded the config)
// or if the user is following a deep link
// (https://github.com/vector-im/riot-web/issues/7378)
const preventRedirect = fragparts.params.client_secret || fragparts.location.length > 0;
if (!preventRedirect) {
const isIos = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
const isAndroid = /Android/.test(navigator.userAgent);
if (isIos || isAndroid) {
if (document.cookie.indexOf("riot_mobile_redirect_to_guide=false") === -1) {
window.location = "mobile_guide/";
return;
}
}
}
// as quickly as we possibly can, set a default theme...
await setTheme();
// Now that we've loaded the theme (CSS), display the config syntax error if needed.
if (configSyntaxError) {
const errorMessage = (
<div>
<p>
{_t(
"Your Riot configuration contains invalid JSON. Please correct the problem " +
"and reload the page.",
)}
</p>
<p>
{_t(
"The message from the parser is: %(message)s",
{message: configError.err.message || _t("Invalid JSON")},
)}
</p>
</div>
);
const GenericErrorPage = sdk.getComponent("structures.GenericErrorPage");
window.matrixChat = ReactDOM.render(
<GenericErrorPage message={errorMessage} title={_t("Your Riot is misconfigured")} />,
document.getElementById('matrixchat'),
);
return;
}
const validBrowser = checkBrowserFeatures();
const acceptInvalidBrowser = window.localStorage && window.localStorage.getItem('mx_accepts_unsupported_browser');
const urlWithoutQuery = window.location.protocol + '//' + window.location.host + window.location.pathname;
console.log("Vector starting at " + urlWithoutQuery);
if (configError) {
window.matrixChat = ReactDOM.render(<div className="error">
Unable to load config file: please refresh the page to try again.
</div>, document.getElementById('matrixchat'));
} else if (validBrowser || acceptInvalidBrowser) {
platform.startUpdater();
// Don't bother loading the app until the config is verified
verifyServerConfig().then((newConfig) => {
const MatrixChat = sdk.getComponent('structures.MatrixChat');
window.matrixChat = ReactDOM.render(
<MatrixChat
onNewScreen={onNewScreen}
makeRegistrationUrl={makeRegistrationUrl}
ConferenceHandler={VectorConferenceHandler}
config={newConfig}
realQueryParams={params}
startingFragmentQueryParams={fragparts.params}
enableGuest={!configJson.disable_guests}
onTokenLoginCompleted={onTokenLoginCompleted}
initialScreenAfterLogin={getScreenFromLocation(window.location)}
defaultDeviceDisplayName={platform.getDefaultDeviceDisplayName()}
/>,
document.getElementById('matrixchat'),
);
}).catch(err => {
console.error(err);
let errorMessage = err.translatedMessage
|| _t("Unexpected error preparing the app. See console for details.");
errorMessage = <span>{errorMessage}</span>;
// Like the compatibility page, AWOOOOOGA at the user
const GenericErrorPage = sdk.getComponent("structures.GenericErrorPage");
window.matrixChat = ReactDOM.render(
<GenericErrorPage message={errorMessage} title={_t("Your Riot is misconfigured")} />,
document.getElementById('matrixchat'),
);
});
} else {
console.error("Browser is missing required features.");
// take to a different landing page to AWOOOOOGA at the user
const CompatibilityPage = sdk.getComponent("structures.CompatibilityPage");
window.matrixChat = ReactDOM.render(
<CompatibilityPage onAccept={function() {
if (window.localStorage) window.localStorage.setItem('mx_accepts_unsupported_browser', true);
console.log("User accepts the compatibility risks.");
loadApp();
}} />,
document.getElementById('matrixchat'),
);
}
}
function loadOlm() {
/* Load Olm. We try the WebAssembly version first, and then the legacy,
* asm.js version if that fails. For this reason we need to wait for this
* to finish before continuing to load the rest of the app. In future
* we could somehow pass a promise down to react-sdk and have it wait on
* that so olm can be loading in parallel with the rest of the app.
*
* We also need to tell the Olm js to look for its wasm file at the same
* level as index.html. It really should be in the same place as the js,
* ie. in the bundle directory, but as far as I can tell this is
* completely impossible with webpack. We do, however, use a hashed
* filename to avoid caching issues.
*/
return Olm.init({
locateFile: () => olmWasmPath,
}).then(() => {
console.log("Using WebAssembly Olm");
}).catch((e) => {
console.log("Failed to load Olm: trying legacy version", e);
return new Promise((resolve, reject) => {
const s = document.createElement('script');
s.src = 'olm_legacy.js'; // XXX: This should be cache-busted too
s.onload = resolve;
s.onerror = reject;
document.body.appendChild(s);
}).then(() => {
// Init window.Olm, ie. the one just loaded by the script tag,
// not 'Olm' which is still the failed wasm version.
return window.Olm.init();
}).then(() => {
console.log("Using legacy Olm");
}).catch((e) => {
console.log("Both WebAssembly and asm.js Olm failed!", e);
});
});
}
async function loadLanguage() {
const prefLang = SettingsStore.getValue("language", null, /*excludeDefault=*/true);
let langs = [];
if (!prefLang) {
languageHandler.getLanguagesFromBrowser().forEach((l) => {
langs.push(...languageHandler.getNormalizedLanguageKeys(l));
});
} else {
langs = [prefLang];
}
try {
await languageHandler.setLanguage(langs);
document.documentElement.setAttribute("lang", languageHandler.getCurrentLanguage());
} catch (e) {
console.error("Unable to set language", e);
}
}
async function verifyServerConfig() {
let validatedConfig;
try {
console.log("Verifying homeserver configuration");
// Note: the query string may include is_url and hs_url - we only respect these in the
// context of email validation. Because we don't respect them otherwise, we do not need
// to parse or consider them here.
// Note: Although we throw all 3 possible configuration options through a .well-known-style
// verification, we do not care if the servers are online at this point. We do moderately
// care if they are syntactically correct though, so we shove them through the .well-known
// validators for that purpose.
const config = SdkConfig.get();
let wkConfig = config['default_server_config']; // overwritten later under some conditions
const serverName = config['default_server_name'];
const hsUrl = config['default_hs_url'];
const isUrl = config['default_is_url'];
const incompatibleOptions = [wkConfig, serverName, hsUrl].filter(i => !!i);
if (incompatibleOptions.length > 1) {
// noinspection ExceptionCaughtLocallyJS
throw newTranslatableError(_td(
"Invalid configuration: can only specify one of default_server_config, default_server_name, " +
"or default_hs_url.",
));
}
if (incompatibleOptions.length < 1) {
// noinspection ExceptionCaughtLocallyJS
throw newTranslatableError(_td("Invalid configuration: no default server specified."));
}
if (hsUrl) {
console.log("Config uses a default_hs_url - constructing a default_server_config using this information");
console.warn(
"DEPRECATED CONFIG OPTION: In the future, default_hs_url will not be accepted. Please use " +
"default_server_config instead.",
);
wkConfig = {
"m.homeserver": {
"base_url": hsUrl,
},
};
if (isUrl) {
wkConfig["m.identity_server"] = {
"base_url": isUrl,
};
}
}
let discoveryResult = null;
if (wkConfig) {
console.log("Config uses a default_server_config - validating object");
discoveryResult = await AutoDiscovery.fromDiscoveryConfig(wkConfig);
}
if (serverName) {
console.log("Config uses a default_server_name - doing .well-known lookup");
console.warn(
"DEPRECATED CONFIG OPTION: In the future, default_server_name will not be accepted. Please " +
"use default_server_config instead.",
);
discoveryResult = await AutoDiscovery.findClientConfig(serverName);
}
validatedConfig = AutoDiscoveryUtils.buildValidatedConfigFromDiscovery(serverName, discoveryResult, true);
} catch (e) {
const {hsUrl, isUrl, userId} = Lifecycle.getLocalStorageSessionVars();
if (hsUrl && userId) {
console.error(e);
console.warn("A session was found - suppressing config error and using the session's homeserver");
console.log("Using pre-existing hsUrl and isUrl: ", {hsUrl, isUrl});
validatedConfig = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(hsUrl, isUrl, true);
} else {
// the user is not logged in, so scream
throw e;
}
}
validatedConfig.isDefault = true;
// Just in case we ever have to debug this
console.log("Using homeserver config:", validatedConfig);
// Add the newly built config to the actual config for use by the app
console.log("Updating SdkConfig with validated discovery information");
SdkConfig.add({"validated_server_config": validatedConfig});
return SdkConfig.get();
}

View File

@@ -22,6 +22,21 @@
<meta name="msapplication-config" content="<%= require('../../res/vector-icons/browserconfig.xml') %>">
<meta name="theme-color" content="#ffffff">
<meta property="og:image" content="<%= htmlWebpackPlugin.options.vars.og_image_url %>" />
<meta http-equiv="Content-Security-Policy" content="
default-src 'none';
style-src 'self' 'unsafe-inline';
script-src 'self' 'unsafe-eval' https://www.recaptcha.net https://www.gstatic.com;
img-src * blob: data:;
connect-src *;
font-src 'self' data:;
media-src * blob: data:;
child-src * blob: data:;
worker-src 'self';
frame-src * blob: data:;
form-action 'self';
object-src 'self';
manifest-src 'self';
">
<% for (var i=0; i < htmlWebpackPlugin.files.css.length; i++) {
var file = htmlWebpackPlugin.files.css[i];
var match = file.match(/^bundles\/.*?\/theme-(.*)\.css$/);
@@ -34,12 +49,9 @@
<% }
} %>
</head>
<body style="height: 100%;">
<section id="matrixchat" style="height: 100%; overflow: auto;"></section>
<body style="height: 100%;" data-vector-indexeddb-worker-script="<%= htmlWebpackPlugin.files.chunks['indexeddb-worker'].entry %>">
<noscript>Sorry, Riot requires JavaScript to be enabled.</noscript> <!-- TODO: Translate this? -->
<script>
window.vector_indexeddb_worker_script = '<%= htmlWebpackPlugin.files.chunks['indexeddb-worker'].entry %>';
</script>
<section id="matrixchat" style="height: 100%; overflow: auto;"></section>
<script src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>"></script>
<img src="<%= require('matrix-react-sdk/res/img/warning.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/e2e/warning.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>

View File

@@ -3,6 +3,7 @@ Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Copyright 2018, 2019 New Vector Ltd
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,464 +25,24 @@ require('gemini-scrollbar/gemini-scrollbar.css');
require('gfm.css/gfm.css');
require('highlight.js/styles/github.css');
import olmWasmPath from 'olm/olm.wasm';
// These are things that can run before the skin loads - be careful not to reference the react-sdk though.
import './rageshakesetup';
import React from 'react';
// add React and ReactPerf to the global namespace, to make them easier to
// access via the console
global.React = React;
import './modernizr';
import ReactDOM from 'react-dom';
import sdk from 'matrix-react-sdk';
import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg';
sdk.loadSkin(require('../component-index'));
import VectorConferenceHandler from 'matrix-react-sdk/lib/VectorConferenceHandler';
import * as languageHandler from 'matrix-react-sdk/lib/languageHandler';
import {_t, _td, newTranslatableError} from 'matrix-react-sdk/lib/languageHandler';
import AutoDiscoveryUtils from 'matrix-react-sdk/lib/utils/AutoDiscoveryUtils';
import {AutoDiscovery} from "matrix-js-sdk/lib/autodiscovery";
import * as Lifecycle from "matrix-react-sdk/lib/Lifecycle";
import url from 'url';
import {parseQs, parseQsFromFragment} from './url_utils';
import ElectronPlatform from './platform/ElectronPlatform';
import WebPlatform from './platform/WebPlatform';
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
import SettingsStore from "matrix-react-sdk/lib/settings/SettingsStore";
import SdkConfig from "matrix-react-sdk/lib/SdkConfig";
import {setTheme} from "matrix-react-sdk/lib/theme";
import Olm from 'olm';
import CallHandler from 'matrix-react-sdk/lib/CallHandler';
let lastLocationHashSet = null;
function checkBrowserFeatures(featureList) {
if (!window.Modernizr) {
console.error("Cannot check features - Modernizr global is missing.");
return false;
}
let featureComplete = true;
for (let i = 0; i < featureList.length; i++) {
if (window.Modernizr[featureList[i]] === undefined) {
console.error(
"Looked for feature '%s' but Modernizr has no results for this. " +
"Has it been configured correctly?", featureList[i],
);
return false;
}
if (window.Modernizr[featureList[i]] === false) {
console.error("Browser missing feature: '%s'", featureList[i]);
// toggle flag rather than return early so we log all missing features
// rather than just the first.
featureComplete = false;
}
}
return featureComplete;
// load service worker if available on this platform
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
}
// Parse the given window.location and return parameters that can be used when calling
// MatrixChat.showScreen(screen, params)
function getScreenFromLocation(location) {
const fragparts = parseQsFromFragment(location);
return {
screen: fragparts.location.substring(1),
params: fragparts.params,
};
}
// Ensure the skin is the very first thing to load for the react-sdk. We don't even want to reference
// the SDK until we have to in imports.
console.log("Loading skin...");
import * as sdk from 'matrix-react-sdk';
import * as skin from "../component-index";
sdk.loadSkin(skin);
console.log("Skin loaded!");
// Here, we do some crude URL analysis to allow
// deep-linking.
function routeUrl(location) {
if (!window.matrixChat) return;
console.log("Routing URL ", location.href);
const s = getScreenFromLocation(location);
window.matrixChat.showScreen(s.screen, s.params);
}
function onHashChange(ev) {
if (decodeURIComponent(window.location.hash) === lastLocationHashSet) {
// we just set this: no need to route it!
return;
}
routeUrl(window.location);
}
// This will be called whenever the SDK changes screens,
// so a web page can update the URL bar appropriately.
function onNewScreen(screen) {
console.log("newscreen "+screen);
const hash = '#/' + screen;
lastLocationHashSet = hash;
window.location.hash = hash;
}
// We use this to work out what URL the SDK should
// pass through when registering to allow the user to
// click back to the client having registered.
// It's up to us to recognise if we're loaded with
// this URL and tell MatrixClient to resume registration.
//
// If we're in electron, we should never pass through a file:// URL otherwise
// the identity server will try to 302 the browser to it, which breaks horribly.
// so in that instance, hardcode to use riot.im/app for now instead.
function makeRegistrationUrl(params) {
let url;
if (window.location.protocol === "vector:") {
url = 'https://riot.im/app/#/register';
} else {
url = (
window.location.protocol + '//' +
window.location.host +
window.location.pathname +
'#/register'
);
}
const keys = Object.keys(params);
for (let i = 0; i < keys.length; ++i) {
if (i === 0) {
url += '?';
} else {
url += '&';
}
const k = keys[i];
url += k + '=' + encodeURIComponent(params[k]);
}
return url;
}
function onTokenLoginCompleted() {
// if we did a token login, we're now left with the token, hs and is
// url as query params in the url; a little nasty but let's redirect to
// clear them.
const parsedUrl = url.parse(window.location.href);
parsedUrl.search = "";
const formatted = url.format(parsedUrl);
console.log("Redirecting to " + formatted + " to drop loginToken " +
"from queryparams");
window.location.href = formatted;
}
async function loadApp() {
if (window.vector_indexeddb_worker_script === undefined) {
// If this is missing, something has probably gone wrong with
// the bundling. The js-sdk will just fall back to accessing
// indexeddb directly with no worker script, but we want to
// make sure the indexeddb script is present, so fail hard.
throw new Error("Missing indexeddb worker script!");
}
MatrixClientPeg.setIndexedDbWorkerScript(window.vector_indexeddb_worker_script);
CallHandler.setConferenceHandler(VectorConferenceHandler);
window.addEventListener('hashchange', onHashChange);
await loadOlm();
// set the platform for react sdk
if (window.ipcRenderer) {
console.log("Using Electron platform");
const plaf = new ElectronPlatform();
PlatformPeg.set(plaf);
} else {
console.log("Using Web platform");
PlatformPeg.set(new WebPlatform());
}
const platform = PlatformPeg.get();
let configJson;
let configError;
let configSyntaxError = false;
try {
configJson = await platform.getConfig();
} catch (e) {
configError = e;
if (e && e.err && e.err instanceof SyntaxError) {
console.error("SyntaxError loading config:", e);
configSyntaxError = true;
configJson = {}; // to prevent errors between here and loading CSS for the error box
}
}
// XXX: We call this twice, once here and once in MatrixChat as a prop. We call it here to ensure
// granular settings are loaded correctly and to avoid duplicating the override logic for the theme.
SdkConfig.put(configJson);
// Load language after loading config.json so that settingsDefaults.language can be applied
await loadLanguage();
const fragparts = parseQsFromFragment(window.location);
const params = parseQs(window.location);
// don't try to redirect to the native apps if we're
// verifying a 3pid (but after we've loaded the config)
// or if the user is following a deep link
// (https://github.com/vector-im/riot-web/issues/7378)
const preventRedirect = fragparts.params.client_secret || fragparts.location.length > 0;
if (!preventRedirect) {
const isIos = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
const isAndroid = /Android/.test(navigator.userAgent);
if (isIos || isAndroid) {
if (document.cookie.indexOf("riot_mobile_redirect_to_guide=false") === -1) {
window.location = "mobile_guide/";
return;
}
}
}
// as quickly as we possibly can, set a default theme...
await setTheme();
// Now that we've loaded the theme (CSS), display the config syntax error if needed.
if (configSyntaxError) {
const errorMessage = (
<div>
<p>
{_t(
"Your Riot configuration contains invalid JSON. Please correct the problem " +
"and reload the page.",
)}
</p>
<p>
{_t(
"The message from the parser is: %(message)s",
{message: configError.err.message || _t("Invalid JSON")},
)}
</p>
</div>
);
const GenericErrorPage = sdk.getComponent("structures.GenericErrorPage");
window.matrixChat = ReactDOM.render(
<GenericErrorPage message={errorMessage} title={_t("Your Riot is misconfigured")} />,
document.getElementById('matrixchat'),
);
return;
}
const validBrowser = checkBrowserFeatures([
"displaytable", "flexbox", "es5object", "es5function", "localstorage",
"objectfit", "indexeddb", "webworkers",
]);
const acceptInvalidBrowser = window.localStorage && window.localStorage.getItem('mx_accepts_unsupported_browser');
const urlWithoutQuery = window.location.protocol + '//' + window.location.host + window.location.pathname;
console.log("Vector starting at " + urlWithoutQuery);
if (configError) {
window.matrixChat = ReactDOM.render(<div className="error">
Unable to load config file: please refresh the page to try again.
</div>, document.getElementById('matrixchat'));
} else if (validBrowser || acceptInvalidBrowser) {
platform.startUpdater();
// Don't bother loading the app until the config is verified
verifyServerConfig().then((newConfig) => {
const MatrixChat = sdk.getComponent('structures.MatrixChat');
window.matrixChat = ReactDOM.render(
<MatrixChat
onNewScreen={onNewScreen}
makeRegistrationUrl={makeRegistrationUrl}
ConferenceHandler={VectorConferenceHandler}
config={newConfig}
realQueryParams={params}
startingFragmentQueryParams={fragparts.params}
enableGuest={!configJson.disable_guests}
onTokenLoginCompleted={onTokenLoginCompleted}
initialScreenAfterLogin={getScreenFromLocation(window.location)}
defaultDeviceDisplayName={platform.getDefaultDeviceDisplayName()}
/>,
document.getElementById('matrixchat'),
);
}).catch(err => {
console.error(err);
let errorMessage = err.translatedMessage
|| _t("Unexpected error preparing the app. See console for details.");
errorMessage = <span>{errorMessage}</span>;
// Like the compatibility page, AWOOOOOGA at the user
const GenericErrorPage = sdk.getComponent("structures.GenericErrorPage");
window.matrixChat = ReactDOM.render(
<GenericErrorPage message={errorMessage} title={_t("Your Riot is misconfigured")} />,
document.getElementById('matrixchat'),
);
});
} else {
console.error("Browser is missing required features.");
// take to a different landing page to AWOOOOOGA at the user
const CompatibilityPage = sdk.getComponent("structures.CompatibilityPage");
window.matrixChat = ReactDOM.render(
<CompatibilityPage onAccept={function() {
if (window.localStorage) window.localStorage.setItem('mx_accepts_unsupported_browser', true);
console.log("User accepts the compatibility risks.");
loadApp();
}} />,
document.getElementById('matrixchat'),
);
}
}
function loadOlm() {
/* Load Olm. We try the WebAssembly version first, and then the legacy,
* asm.js version if that fails. For this reason we need to wait for this
* to finish before continuing to load the rest of the app. In future
* we could somehow pass a promise down to react-sdk and have it wait on
* that so olm can be loading in parallel with the rest of the app.
*
* We also need to tell the Olm js to look for its wasm file at the same
* level as index.html. It really should be in the same place as the js,
* ie. in the bundle directory, but as far as I can tell this is
* completely impossible with webpack. We do, however, use a hashed
* filename to avoid caching issues.
*/
return Olm.init({
locateFile: () => olmWasmPath,
}).then(() => {
console.log("Using WebAssembly Olm");
}).catch((e) => {
console.log("Failed to load Olm: trying legacy version", e);
return new Promise((resolve, reject) => {
const s = document.createElement('script');
s.src = 'olm_legacy.js'; // XXX: This should be cache-busted too
s.onload = resolve;
s.onerror = reject;
document.body.appendChild(s);
}).then(() => {
// Init window.Olm, ie. the one just loaded by the script tag,
// not 'Olm' which is still the failed wasm version.
return window.Olm.init();
}).then(() => {
console.log("Using legacy Olm");
}).catch((e) => {
console.log("Both WebAssembly and asm.js Olm failed!", e);
});
});
}
async function loadLanguage() {
const prefLang = SettingsStore.getValue("language", null, /*excludeDefault=*/true);
let langs = [];
if (!prefLang) {
languageHandler.getLanguagesFromBrowser().forEach((l) => {
langs.push(...languageHandler.getNormalizedLanguageKeys(l));
});
} else {
langs = [prefLang];
}
try {
await languageHandler.setLanguage(langs);
document.documentElement.setAttribute("lang", languageHandler.getCurrentLanguage());
} catch (e) {
console.error("Unable to set language", e);
}
}
async function verifyServerConfig() {
let validatedConfig;
try {
console.log("Verifying homeserver configuration");
// Note: the query string may include is_url and hs_url - we only respect these in the
// context of email validation. Because we don't respect them otherwise, we do not need
// to parse or consider them here.
// Note: Although we throw all 3 possible configuration options through a .well-known-style
// verification, we do not care if the servers are online at this point. We do moderately
// care if they are syntactically correct though, so we shove them through the .well-known
// validators for that purpose.
const config = SdkConfig.get();
let wkConfig = config['default_server_config']; // overwritten later under some conditions
const serverName = config['default_server_name'];
const hsUrl = config['default_hs_url'];
const isUrl = config['default_is_url'];
const incompatibleOptions = [wkConfig, serverName, hsUrl].filter(i => !!i);
if (incompatibleOptions.length > 1) {
// noinspection ExceptionCaughtLocallyJS
throw newTranslatableError(_td(
"Invalid configuration: can only specify one of default_server_config, default_server_name, " +
"or default_hs_url.",
));
}
if (incompatibleOptions.length < 1) {
// noinspection ExceptionCaughtLocallyJS
throw newTranslatableError(_td("Invalid configuration: no default server specified."));
}
if (hsUrl) {
console.log("Config uses a default_hs_url - constructing a default_server_config using this information");
console.warn(
"DEPRECATED CONFIG OPTION: In the future, default_hs_url will not be accepted. Please use " +
"default_server_config instead.",
);
wkConfig = {
"m.homeserver": {
"base_url": hsUrl,
},
};
if (isUrl) {
wkConfig["m.identity_server"] = {
"base_url": isUrl,
};
}
}
let discoveryResult = null;
if (wkConfig) {
console.log("Config uses a default_server_config - validating object");
discoveryResult = await AutoDiscovery.fromDiscoveryConfig(wkConfig);
}
if (serverName) {
console.log("Config uses a default_server_name - doing .well-known lookup");
console.warn(
"DEPRECATED CONFIG OPTION: In the future, default_server_name will not be accepted. Please " +
"use default_server_config instead.",
);
discoveryResult = await AutoDiscovery.findClientConfig(serverName);
}
validatedConfig = AutoDiscoveryUtils.buildValidatedConfigFromDiscovery(serverName, discoveryResult, true);
} catch (e) {
const {hsUrl, isUrl, userId} = Lifecycle.getLocalStorageSessionVars();
if (hsUrl && userId) {
console.error(e);
console.warn("A session was found - suppressing config error and using the session's homeserver");
console.log("Using pre-existing hsUrl and isUrl: ", {hsUrl, isUrl});
validatedConfig = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(hsUrl, isUrl, true);
} else {
// the user is not logged in, so scream
throw e;
}
}
validatedConfig.isDefault = true;
// Just in case we ever have to debug this
console.log("Using homeserver config:", validatedConfig);
// Add the newly built config to the actual config for use by the app
console.log("Updating SdkConfig with validated discovery information");
SdkConfig.add({"validated_server_config": validatedConfig});
return SdkConfig.get();
}
loadApp();
// Finally, load the app. All of the other react-sdk imports are in this file which causes the skinner to
// run on the components. We use `require` here to make sure webpack doesn't optimize this into an async
// import and thus running before the skin can load.
require("./app").loadApp();

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import {IndexedDBStoreWorker} from 'matrix-js-sdk/lib/indexeddb-worker.js';
import {IndexedDBStoreWorker} from 'matrix-js-sdk/src/indexeddb-worker.js';
const remoteWorker = new IndexedDBStoreWorker(postMessage);

View File

@@ -0,0 +1,185 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<style type="text/css">
/* By default, hide the custom IS stuff - enabled in JS */
#custom_is, #is_url {
display: none;
}
body {
background: #c5e0f7;
background: -moz-linear-gradient(top, #c5e0f7 0%, #ffffff 100%);
background: -webkit-linear-gradient(top, #c5e0f7 0%,#ffffff 100%);
background: linear-gradient(to bottom, #c5e0f7 0%,#ffffff 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c5e0f7', endColorstr='#ffffff',GradientType=0 );
max-width: 680px;
margin: auto;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
.mx_Button {
border: 0;
border-radius: 4px;
font-size: 18px;
margin-left: 4px;
margin-right: 4px;
min-width: 80px;
background-color: #03B381;
color: #fff;
cursor: pointer;
padding: 12px 22px;
word-break: break-word;
text-decoration: none;
}
.mx_Center {
justify-content: center;
}
.mx_ClearDecoration {
text-decoration: none !important;
}
.mx_HomePage_header {
color: #2E2F32;
display: flex;
align-items: center;
justify-content: center;
}
.mx_HomePage h3 {
margin-top: 30px;
}
.mx_HomePage_header {
align-items: center;
}
.mx_HomePage_col {
display: flex;
flex-direction: row;
}
.mx_HomePage_row {
flex: 1 1 0;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.mx_HomePage_logo {
margin-right: 20px;
margin-top: -10px;
}
.mx_HomePage_container {
display: block ! important;
margin: 10px 20px;
}
.mx_HomePage_errorContainer {
display: none; /* shown in JS if needed */
margin: 20px;
border: 1px solid red;
background-color: #ffb9b9;
padding: 5px;
}
.mx_HomePage_container h1,
.mx_HomePage_container h2,
.mx_HomePage_container h3,
.mx_HomePage_container h4 {
font-weight: 600;
margin-bottom: 32px;
}
.mx_Spacer {
margin-top: 24px;
}
.mx_FooterLink {
color: #368BD6;
text-decoration: none;
}
.mx_Subtext {
font-size: 14px;
}
.mx_SubtextTop {
margin-top: 32px;
}
@media screen and (max-width: 1120px) {
body {
font-size: 20px;
}
h1 {
font-size: 20px;
}
h4 {
font-size: 16px;
}
.mx_Button {
font-size: 18px;
padding: 14px 28px;
}
.mx_HomePage_header {
justify-content: left;
}
.mx_Spacer {
margin-top: 24px;
}
}
</style>
<meta name="apple-itunes-app" content="app-id=id1083446067">
</head>
<body>
<div class="mx_HomePage_errorContainer">
<!-- populated by JS if needed -->
</div>
<div class="mx_HomePage_container">
<div class="mx_HomePage_header">
<span class="mx_HomePage_logo">
<svg width="34px" height="42px" viewBox="0 0 34 42" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="blue" transform="translate(1.000000, 1.000000)">
<path d="M11.6756011,11.3799998 L11.6756011,17.149751 L17.5348252,17.1437188 C17.6092313,17.1437188 17.6771226,17.1417081 17.744671,17.1373516 C19.2852547,17.0358104 20.4894678,15.7727453 20.4894678,14.2620269 C20.4894678,12.6725555 19.1669592,11.3799998 17.5406542,11.3799998 L11.6756011,11.3799998 Z M5.88083947,39.8778856 C2.68069092,39.8778856 0.0860778277,37.342372 0.0860778277,34.2143673 L0.0860778277,23.4205057 C0.0651618241,23.2247959 0.0538388139,23.025735 0.0538388139,22.8243282 C0.0535037238,22.6192351 0.0644760535,22.416823 0.0860778277,22.2170918 L0.0860778277,5.71648153 C0.0860778277,2.58847681 2.68069092,0.0526281121 5.88083947,0.0526281121 L17.5406542,0.0526281121 C25.5573126,0.0526281121 32.079334,6.42693471 32.079334,14.2620269 C32.079334,21.7113966 26.1261594,27.9382507 18.5264495,28.4382489 C18.2034515,28.4600316 17.8705099,28.4710906 17.5406542,28.4710906 L11.6756011,28.4767876 L11.6756011,34.2143673 C11.6756011,37.342372 9.08133089,39.8778856 5.88083947,39.8778856 L5.88083947,39.8778856 Z" id="Fill-1" fill="#A2DDEF"></path>
<path d="M11.6756011,11.3799998 L11.6756011,17.149751 L17.5348252,17.1437188 C17.6092313,17.1437188 17.6771226,17.1417081 17.744671,17.1373516 C19.2852547,17.0358104 20.4894678,15.7727453 20.4894678,14.2620269 C20.4894678,12.6725555 19.1669592,11.3799998 17.5406542,11.3799998 L11.6756011,11.3799998 Z M5.88083947,39.8778856 C2.68069092,39.8778856 0.0860778277,37.342372 0.0860778277,34.2143673 L0.0860778277,23.4205057 C0.0651618241,23.2247959 0.0538388139,23.025735 0.0538388139,22.8243282 C0.0535037238,22.6192351 0.0644760535,22.416823 0.0860778277,22.2170918 L0.0860778277,5.71648153 C0.0860778277,2.58847681 2.68069092,0.0526281121 5.88083947,0.0526281121 L17.5406542,0.0526281121 C25.5573126,0.0526281121 32.079334,6.42693471 32.079334,14.2620269 C32.079334,21.7113966 26.1261594,27.9382507 18.5264495,28.4382489 C18.2034515,28.4600316 17.8705099,28.4710906 17.5406542,28.4710906 L11.6756011,28.4767876 L11.6756011,34.2143673 C11.6756011,37.342372 9.08133089,39.8778856 5.88083947,39.8778856 Z" id="Stroke-3" stroke="#368BD6" stroke-width="1.02344117"></path>
<path d="M5.88087375,34.2142667 L5.88087375,5.716381 L17.5406885,5.716381 C22.3695423,5.716381 26.2842638,9.54243948 26.2842638,14.2619264 C26.2842638,18.7857035 22.6877398,22.488438 18.1373089,22.7876997 C17.939807,22.8007693 17.7412764,22.8074717 17.5406885,22.8074717 L5.84864254,22.8188658" id="Stroke-5" stroke="#368BD6" stroke-width="1.02344117" stroke-linecap="round"></path>
<path d="M22.882533,19.5375774 L31.0723484,30.9604582 C32.909185,33.5221111 32.2731328,37.0539347 29.6524604,38.8484992 C28.640263,39.5418613 27.480282,39.8746349 26.3319591,39.8746349 C24.505752,39.8746349 22.709033,39.0334852 21.5812832,37.4607697 L13.3914677,26.0378889 C11.5549741,23.476236 12.1910263,19.9444124 14.8116987,18.1498479 C17.432371,16.3539429 21.0460393,16.9759245 22.882533,19.5375774 Z M10.6558259,2.46823596 C11.5442417,3.70717248 11.8854126,5.21051822 11.6165905,6.69945383 C11.3474256,8.1893948 10.5004989,9.48731234 9.23182325,10.3549365 C6.61252242,12.1461499 2.98925341,11.5224926 1.15515992,8.96452603 C0.266744094,7.72558951 -0.0744267831,6.22257889 0.194738181,4.73297304 C0.463560259,3.24336719 1.31048696,1.94511453 2.57950547,1.07782546 C5.19880631,-0.713387872 8.82173243,-0.08973062 10.6558259,2.46823596 Z" id="Combined-Shape" fill="#368BD6"></path>
</g>
</g>
</svg>
</span>
<h1>Invalid config</h1>
</div>
<div class="mx_HomePage_col">
<div class="mx_HomePage_row">
<div>
<h2 id="step1_heading">This Riot is misconfigured</h2>
<p>Something something... contact your server admin.</p>
</div>
</div>
</div>
<div class="mx_HomePage_row mx_Center mx_Spacer">
<p class="mx_Spacer">
<a href="https://riot.im" target="_blank" class="mx_FooterLink">
Go to Riot.im
</a>
</p>
</div>
</div>
</body>

View File

@@ -0,0 +1,185 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<style type="text/css">
/* By default, hide the custom IS stuff - enabled in JS */
#custom_is, #is_url {
display: none;
}
body {
background: #c5e0f7;
background: -moz-linear-gradient(top, #c5e0f7 0%, #ffffff 100%);
background: -webkit-linear-gradient(top, #c5e0f7 0%,#ffffff 100%);
background: linear-gradient(to bottom, #c5e0f7 0%,#ffffff 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c5e0f7', endColorstr='#ffffff',GradientType=0 );
max-width: 680px;
margin: auto;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
.mx_Button {
border: 0;
border-radius: 4px;
font-size: 18px;
margin-left: 4px;
margin-right: 4px;
min-width: 80px;
background-color: #03B381;
color: #fff;
cursor: pointer;
padding: 12px 22px;
word-break: break-word;
text-decoration: none;
}
.mx_Center {
justify-content: center;
}
.mx_ClearDecoration {
text-decoration: none !important;
}
.mx_HomePage_header {
color: #2E2F32;
display: flex;
align-items: center;
justify-content: center;
}
.mx_HomePage h3 {
margin-top: 30px;
}
.mx_HomePage_header {
align-items: center;
}
.mx_HomePage_col {
display: flex;
flex-direction: row;
}
.mx_HomePage_row {
flex: 1 1 0;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.mx_HomePage_logo {
margin-right: 20px;
margin-top: -10px;
}
.mx_HomePage_container {
display: block ! important;
margin: 10px 20px;
}
.mx_HomePage_errorContainer {
display: none; /* shown in JS if needed */
margin: 20px;
border: 1px solid red;
background-color: #ffb9b9;
padding: 5px;
}
.mx_HomePage_container h1,
.mx_HomePage_container h2,
.mx_HomePage_container h3,
.mx_HomePage_container h4 {
font-weight: 600;
margin-bottom: 32px;
}
.mx_Spacer {
margin-top: 24px;
}
.mx_FooterLink {
color: #368BD6;
text-decoration: none;
}
.mx_Subtext {
font-size: 14px;
}
.mx_SubtextTop {
margin-top: 32px;
}
@media screen and (max-width: 1120px) {
body {
font-size: 20px;
}
h1 {
font-size: 20px;
}
h4 {
font-size: 16px;
}
.mx_Button {
font-size: 18px;
padding: 14px 28px;
}
.mx_HomePage_header {
justify-content: left;
}
.mx_Spacer {
margin-top: 24px;
}
}
</style>
<meta name="apple-itunes-app" content="app-id=id1083446067">
</head>
<body>
<div class="mx_HomePage_errorContainer">
<!-- populated by JS if needed -->
</div>
<div class="mx_HomePage_container">
<div class="mx_HomePage_header">
<span class="mx_HomePage_logo">
<svg width="34px" height="42px" viewBox="0 0 34 42" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="blue" transform="translate(1.000000, 1.000000)">
<path d="M11.6756011,11.3799998 L11.6756011,17.149751 L17.5348252,17.1437188 C17.6092313,17.1437188 17.6771226,17.1417081 17.744671,17.1373516 C19.2852547,17.0358104 20.4894678,15.7727453 20.4894678,14.2620269 C20.4894678,12.6725555 19.1669592,11.3799998 17.5406542,11.3799998 L11.6756011,11.3799998 Z M5.88083947,39.8778856 C2.68069092,39.8778856 0.0860778277,37.342372 0.0860778277,34.2143673 L0.0860778277,23.4205057 C0.0651618241,23.2247959 0.0538388139,23.025735 0.0538388139,22.8243282 C0.0535037238,22.6192351 0.0644760535,22.416823 0.0860778277,22.2170918 L0.0860778277,5.71648153 C0.0860778277,2.58847681 2.68069092,0.0526281121 5.88083947,0.0526281121 L17.5406542,0.0526281121 C25.5573126,0.0526281121 32.079334,6.42693471 32.079334,14.2620269 C32.079334,21.7113966 26.1261594,27.9382507 18.5264495,28.4382489 C18.2034515,28.4600316 17.8705099,28.4710906 17.5406542,28.4710906 L11.6756011,28.4767876 L11.6756011,34.2143673 C11.6756011,37.342372 9.08133089,39.8778856 5.88083947,39.8778856 L5.88083947,39.8778856 Z" id="Fill-1" fill="#A2DDEF"></path>
<path d="M11.6756011,11.3799998 L11.6756011,17.149751 L17.5348252,17.1437188 C17.6092313,17.1437188 17.6771226,17.1417081 17.744671,17.1373516 C19.2852547,17.0358104 20.4894678,15.7727453 20.4894678,14.2620269 C20.4894678,12.6725555 19.1669592,11.3799998 17.5406542,11.3799998 L11.6756011,11.3799998 Z M5.88083947,39.8778856 C2.68069092,39.8778856 0.0860778277,37.342372 0.0860778277,34.2143673 L0.0860778277,23.4205057 C0.0651618241,23.2247959 0.0538388139,23.025735 0.0538388139,22.8243282 C0.0535037238,22.6192351 0.0644760535,22.416823 0.0860778277,22.2170918 L0.0860778277,5.71648153 C0.0860778277,2.58847681 2.68069092,0.0526281121 5.88083947,0.0526281121 L17.5406542,0.0526281121 C25.5573126,0.0526281121 32.079334,6.42693471 32.079334,14.2620269 C32.079334,21.7113966 26.1261594,27.9382507 18.5264495,28.4382489 C18.2034515,28.4600316 17.8705099,28.4710906 17.5406542,28.4710906 L11.6756011,28.4767876 L11.6756011,34.2143673 C11.6756011,37.342372 9.08133089,39.8778856 5.88083947,39.8778856 Z" id="Stroke-3" stroke="#368BD6" stroke-width="1.02344117"></path>
<path d="M5.88087375,34.2142667 L5.88087375,5.716381 L17.5406885,5.716381 C22.3695423,5.716381 26.2842638,9.54243948 26.2842638,14.2619264 C26.2842638,18.7857035 22.6877398,22.488438 18.1373089,22.7876997 C17.939807,22.8007693 17.7412764,22.8074717 17.5406885,22.8074717 L5.84864254,22.8188658" id="Stroke-5" stroke="#368BD6" stroke-width="1.02344117" stroke-linecap="round"></path>
<path d="M22.882533,19.5375774 L31.0723484,30.9604582 C32.909185,33.5221111 32.2731328,37.0539347 29.6524604,38.8484992 C28.640263,39.5418613 27.480282,39.8746349 26.3319591,39.8746349 C24.505752,39.8746349 22.709033,39.0334852 21.5812832,37.4607697 L13.3914677,26.0378889 C11.5549741,23.476236 12.1910263,19.9444124 14.8116987,18.1498479 C17.432371,16.3539429 21.0460393,16.9759245 22.882533,19.5375774 Z M10.6558259,2.46823596 C11.5442417,3.70717248 11.8854126,5.21051822 11.6165905,6.69945383 C11.3474256,8.1893948 10.5004989,9.48731234 9.23182325,10.3549365 C6.61252242,12.1461499 2.98925341,11.5224926 1.15515992,8.96452603 C0.266744094,7.72558951 -0.0744267831,6.22257889 0.194738181,4.73297304 C0.463560259,3.24336719 1.31048696,1.94511453 2.57950547,1.07782546 C5.19880631,-0.713387872 8.82173243,-0.08973062 10.6558259,2.46823596 Z" id="Combined-Shape" fill="#368BD6"></path>
</g>
</g>
</svg>
</span>
<h1>Unable to load</h1>
</div>
<div class="mx_HomePage_col">
<div class="mx_HomePage_row">
<div>
<h2 id="step1_heading">Riot can't load</h2>
<p>Something something... contact your server admin.</p>
</div>
</div>
</div>
<div class="mx_HomePage_row mx_Center mx_Spacer">
<p class="mx_Spacer">
<a href="https://riot.im" target="_blank" class="mx_FooterLink">
Go to Riot.im
</a>
</p>
</div>
</div>
</body>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -5,6 +5,7 @@ Copyright 2016 Aviral Dasgupta
Copyright 2016 OpenMarket Ltd
Copyright 2018 New Vector Ltd
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -20,10 +21,15 @@ limitations under the License.
*/
import VectorBasePlatform, {updateCheckStatusEnum} from './VectorBasePlatform';
import BaseEventIndexManager from 'matrix-react-sdk/lib/indexing/BaseEventIndexManager';
import dis from 'matrix-react-sdk/lib/dispatcher';
import { _t } from 'matrix-react-sdk/lib/languageHandler';
import rageshake from 'matrix-react-sdk/lib/rageshake/rageshake';
import BaseEventIndexManager from 'matrix-react-sdk/src/indexing/BaseEventIndexManager';
import dis from 'matrix-react-sdk/src/dispatcher';
import { _t } from 'matrix-react-sdk/src/languageHandler';
import * as rageshake from 'matrix-react-sdk/src/rageshake/rageshake';
import {MatrixClient} from "matrix-js-sdk";
import Modal from "matrix-react-sdk/src/Modal";
import InfoDialog from "matrix-react-sdk/src/components/views/dialogs/InfoDialog";
import Spinner from "matrix-react-sdk/src/components/views/elements/Spinner";
import React from "react";
const ipcRenderer = window.ipcRenderer;
@@ -144,6 +150,10 @@ class SeshatIndexManager extends BaseEventIndexManager {
return this._ipcCall('removeCrawlerCheckpoint', checkpoint);
}
async loadFileEvents(args): Promise<[EventAndProfile]> {
return this._ipcCall('loadFileEvents', args);
}
async loadCheckpoints(): Promise<[CrawlerCheckpoint]> {
return this._ipcCall('loadCheckpoints');
}
@@ -152,6 +162,10 @@ class SeshatIndexManager extends BaseEventIndexManager {
return this._ipcCall('closeEventIndex');
}
async getStats(): Promise<> {
return this._ipcCall('getStats');
}
async deleteEventIndex(): Promise<> {
return this._ipcCall('deleteEventIndex');
}
@@ -192,16 +206,6 @@ export default class ElectronPlatform extends VectorBasePlatform {
this.startUpdateCheck = this.startUpdateCheck.bind(this);
this.stopUpdateCheck = this.stopUpdateCheck.bind(this);
this._tryPersistStorage();
}
async _tryPersistStorage() {
if (navigator.storage && navigator.storage.persist) {
const granted = await navigator.storage.persist();
const persisted = await navigator.storage.persisted();
console.log("Storage persist request granted: " + granted + " persisted: " + persisted);
}
}
async getConfig(): Promise<{}> {
@@ -387,4 +391,25 @@ export default class ElectronPlatform extends VectorBasePlatform {
getEventIndexingManager(): BaseEventIndexManager | null {
return this.eventIndexManager;
}
setLanguage(preferredLangs: string[]) {
this._ipcCall('setLanguage', preferredLangs).catch(error => {
console.log("Failed to send setLanguage IPC to Electron");
console.error(error);
});
}
getSSOCallbackUrl(hsUrl: string, isUrl: string): URL {
const url = super.getSSOCallbackUrl(hsUrl, isUrl);
url.protocol = "riot";
return url;
}
startSingleSignOn(mxClient: MatrixClient, loginType: "sso" | "cas") {
super.startSingleSignOn(mxClient, loginType); // this will get intercepted by electron-main will-navigate
Modal.createTrackedDialog('Electron', 'SSO', InfoDialog, {
title: _t("Go to your browser to complete Sign In"),
description: <Spinner />,
});
}
}

View File

@@ -19,9 +19,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import BasePlatform from 'matrix-react-sdk/lib/BasePlatform';
import { _t } from 'matrix-react-sdk/lib/languageHandler';
import dis from 'matrix-react-sdk/lib/dispatcher';
import BasePlatform from 'matrix-react-sdk/src/BasePlatform';
import { _t } from 'matrix-react-sdk/src/languageHandler';
import dis from 'matrix-react-sdk/src/dispatcher';
import {getVectorConfig} from "../getconfig";
import Favico from 'favico.js';

View File

@@ -19,8 +19,8 @@ limitations under the License.
import VectorBasePlatform, {updateCheckStatusEnum} from './VectorBasePlatform';
import request from 'browser-request';
import dis from 'matrix-react-sdk/lib/dispatcher.js';
import { _t } from 'matrix-react-sdk/lib/languageHandler';
import dis from 'matrix-react-sdk/src/dispatcher.js';
import { _t } from 'matrix-react-sdk/src/languageHandler';
import url from 'url';
import UAParser from 'ua-parser-js';

View File

@@ -1,5 +1,6 @@
/*
Copyright 2018 New Vector Ltd
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -25,8 +26,9 @@ limitations under the License.
* from the rageshake.)
*/
import rageshake from "matrix-react-sdk/lib/rageshake/rageshake";
import SdkConfig from "matrix-react-sdk/lib/SdkConfig";
import * as rageshake from "matrix-react-sdk/src/rageshake/rageshake";
import SdkConfig from "matrix-react-sdk/src/SdkConfig";
import sendBugReport from "matrix-react-sdk/src/rageshake/submit-rageshake";
function initRageshake() {
rageshake.init().then(() => {
@@ -54,15 +56,13 @@ global.mxSendRageshake = function(text, withLogs) {
console.error("Cannot send a rageshake without a message - please tell us what went wrong");
return;
}
require(['matrix-react-sdk/lib/rageshake/submit-rageshake'], (s) => {
s(SdkConfig.get().bug_report_endpoint_url, {
userText: text,
sendLogs: withLogs,
progressCallback: console.log.bind(console),
}).then(() => {
console.log("Bug report sent!");
}, (err) => {
console.error(err);
});
sendBugReport(SdkConfig.get().bug_report_endpoint_url, {
userText: text,
sendLogs: withLogs,
progressCallback: console.log.bind(console),
}).then(() => {
console.log("Bug report sent!");
}, (err) => {
console.error(err);
});
};

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import qs from 'querystring';
import * as qs from 'querystring';
// We want to support some name / value pairs in the fragment
// so we're re-using query string like format

View File

@@ -1,13 +0,0 @@
// all-tests.js
//
// Our master test file: uses the webpack require API to find our test files
// and run them
// ideally these unit tests could be run under nodejs rather than in a browser
// via karma, but having two separate test frameworks in the same project
// seems confusing
const unit_tests = require.context('./unit-tests', true, /\.js$/);
unit_tests.keys().forEach(unit_tests);
const app_tests = require.context('./app-tests', true, /\.jsx?$/);
app_tests.keys().forEach(app_tests);

View File

@@ -16,30 +16,28 @@ limitations under the License.
/* joining.js: tests for the various paths when joining a room */
import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg';
import PlatformPeg from 'matrix-react-sdk/src/PlatformPeg';
import WebPlatform from '../../src/vector/platform/WebPlatform';
import * as sdk from "matrix-react-sdk";
import * as jssdk from "matrix-js-sdk";
import "../skin-sdk";
import "../jest-mocks";
import React from "react";
import ReactDOM from "react-dom";
import ReactTestUtils from "react-dom/test-utils";
import {makeType} from "matrix-react-sdk/src/utils/TypeUtils";
import {ValidatedServerConfig} from "matrix-react-sdk/src/utils/AutoDiscoveryUtils";
import {sleep} from "../test-utils";
import * as test_utils from "../test-utils";
import MockHttpBackend from "matrix-mock-request";
import "fake-indexeddb/auto";
require('skin-sdk');
const jssdk = require('matrix-js-sdk');
const sdk = require('matrix-react-sdk');
const MatrixChat = sdk.getComponent('structures.MatrixChat');
const RoomDirectory = sdk.getComponent('structures.RoomDirectory');
const RoomPreviewBar = sdk.getComponent('rooms.RoomPreviewBar');
const RoomView = sdk.getComponent('structures.RoomView');
const React = require('react');
const ReactDOM = require('react-dom');
const ReactTestUtils = require('react-dom/test-utils');
const expect = require('expect');
import {makeType} from "matrix-react-sdk/lib/utils/TypeUtils";
import {ValidatedServerConfig} from "matrix-react-sdk/lib/utils/AutoDiscoveryUtils";
import {sleep} from "../test-utils";
const test_utils = require('../test-utils');
const MockHttpBackend = require('matrix-mock-request');
const HS_URL='http://localhost';
const IS_URL='http://localhost';
const USER_ID='@me:localhost';

View File

@@ -1,5 +1,6 @@
/*
Copyright 2016 OpenMarket Ltd
Copyright 2020 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -16,46 +17,32 @@ limitations under the License.
/* loading.js: test the myriad paths we have for loading the application */
import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg';
import PlatformPeg from 'matrix-react-sdk/src/PlatformPeg';
import WebPlatform from '../../src/vector/platform/WebPlatform';
import 'skin-sdk';
import '../skin-sdk';
import "../jest-mocks";
import React from 'react';
import ReactDOM from 'react-dom';
import ReactTestUtils from 'react-dom/test-utils';
import expect from 'expect';
import MatrixReactTestUtils from 'matrix-react-test-utils';
import jssdk from 'matrix-js-sdk';
import sdk from 'matrix-react-sdk';
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
import * as languageHandler from 'matrix-react-sdk/lib/languageHandler';
import {VIEWS} from 'matrix-react-sdk/lib/components/structures/MatrixChat';
import dis from 'matrix-react-sdk/lib/dispatcher';
import * as jssdk from 'matrix-js-sdk';
import * as sdk from 'matrix-react-sdk';
import {MatrixClientPeg} from 'matrix-react-sdk/src/MatrixClientPeg';
import {VIEWS} from 'matrix-react-sdk/src/components/structures/MatrixChat';
import dis from 'matrix-react-sdk/src/dispatcher';
import * as test_utils from '../test-utils';
import MockHttpBackend from 'matrix-mock-request';
import {parseQs, parseQsFromFragment} from '../../src/vector/url_utils';
import {makeType} from "matrix-react-sdk/lib/utils/TypeUtils";
import {ValidatedServerConfig} from "matrix-react-sdk/lib/utils/AutoDiscoveryUtils";
import {makeType} from "matrix-react-sdk/src/utils/TypeUtils";
import {ValidatedServerConfig} from "matrix-react-sdk/src/utils/AutoDiscoveryUtils";
import {sleep} from "../test-utils";
import "fake-indexeddb/auto";
import {cleanLocalstorage} from "../test-utils";
import {IndexedDBCryptoStore} from "matrix-js-sdk/src/crypto/store/indexeddb-crypto-store";
const DEFAULT_HS_URL='http://my_server';
const DEFAULT_IS_URL='http://my_is';
expect.extend({
toStartWith(prefix) {
expect.assert(
this.actual.startsWith(prefix),
'expected %s to start with %s',
this.actual, prefix,
);
return this;
}
});
describe('loading:', function() {
let parentDiv;
let httpBackend;
@@ -70,7 +57,6 @@ describe('loading:', function() {
let tokenLoginCompletePromise;
beforeEach(function() {
test_utils.beforeEach(this);
httpBackend = new MockHttpBackend();
jssdk.request(httpBackend.requestFn);
parentDiv = document.createElement('div');
@@ -81,10 +67,6 @@ describe('loading:', function() {
windowLocation = null;
matrixChat = null;
languageHandler.setMissingEntryGenerator(function(key) {
return key.split('|', 2)[1];
});
});
afterEach(async function() {
@@ -98,14 +80,12 @@ describe('loading:', function() {
// unmounting should have cleared the MatrixClientPeg
expect(MatrixClientPeg.get()).toBe(null);
// chrome seems to take *ages* to delete the indexeddbs.
this.timeout(10000);
// clear the indexeddbs so we can start from a clean slate next time.
await Promise.all([
test_utils.deleteIndexedDB('matrix-js-sdk:crypto'),
test_utils.deleteIndexedDB('matrix-js-sdk:riot-web-sync'),
]);
cleanLocalstorage();
console.log(`${Date.now()}: loading: afterEach complete`);
});
@@ -323,11 +303,11 @@ describe('loading:', function() {
localStorage.setItem("mx_last_room_id", "!last_room:id");
// Create a crypto store as well to satisfy storage consistency checks
const cryptoStore = new jssdk.IndexedDBCryptoStore(
const cryptoStore = new IndexedDBCryptoStore(
indexedDB,
"matrix-js-sdk:crypto",
);
await cryptoStore._connect();
await cryptoStore.startup();
});
it('shows the last known room by default', function() {
@@ -481,7 +461,7 @@ describe('loading:', function() {
assertAtLoadingSpinner(matrixChat);
httpBackend.when('POST', '/register').check(function(req) {
expect(req.path).toStartWith(DEFAULT_HS_URL);
expect(req.path.startsWith(DEFAULT_HS_URL)).toBe(true);
expect(req.queryParams.kind).toEqual('guest');
}).respond(200, {
user_id: "@guest:localhost",
@@ -494,7 +474,7 @@ describe('loading:', function() {
}).then(() => {
return expectAndAwaitSync({isGuest: true});
}).then((req) => {
expect(req.path).toStartWith(DEFAULT_HS_URL);
expect(req.path.startsWith(DEFAULT_HS_URL)).toBe(true);
// once the sync completes, we should have a welcome page
httpBackend.verifyNoOutstandingExpectation();
@@ -682,10 +662,6 @@ describe('loading:', function() {
// Wait for another trip around the event loop for the UI to update
return sleep(1);
}).then(() => {
// we expect a spinner
ReactTestUtils.findRenderedComponentWithType(
matrixChat, sdk.getComponent('elements.Spinner'));
httpBackend.when('GET', '/pushrules').respond(200, {});
httpBackend.when('POST', '/filter').respond(200, { filter_id: 'fid' });
return expectAndAwaitSync().catch((e) => {

14
test/jest-mocks.js Normal file
View File

@@ -0,0 +1,14 @@
// https://jestjs.io/docs/en/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
Object.defineProperty(window, 'matchMedia', {
writable: true,
value: jest.fn().mockImplementation(query => ({
matches: false,
media: query,
onchange: null,
addListener: jest.fn(), // deprecated
removeListener: jest.fn(), // deprecated
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
})),
});

View File

@@ -4,5 +4,6 @@
* Skins the react-sdk with the vector components
*/
const sdk = require('matrix-react-sdk');
sdk.loadSkin(require('../src/component-index'));
import * as sdk from "matrix-react-sdk";
import * as skin from "../src/component-index";
sdk.loadSkin(skin);

View File

@@ -1,30 +1,7 @@
"use strict";
/**
* Perform common actions before each test case, e.g. printing the test case
* name to stdout.
* @param {Mocha.Context} context The test context
*/
export function beforeEach(context) {
const desc = context.currentTest.fullTitle();
console.log();
console.log(desc);
console.log(new Array(1 + desc.length).join("="));
// some tests store things in localstorage. Improve independence of tests
// by making sure that they don't inherit any old state.
export function cleanLocalstorage() {
window.localStorage.clear();
}
/**
* returns true if the current environment supports webrtc
*/
export function browserSupportsWebRTC() {
const n = global.window.navigator;
return n.getUserMedia || n.webkitGetUserMedia ||
n.mozGetUserMedia;
}
export function deleteIndexedDB(dbName) {
return new Promise((resolve, reject) => {
if (!window.indexedDB) {

19
tsconfig.json Normal file
View File

@@ -0,0 +1,19 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"module": "commonjs",
"moduleResolution": "node",
"target": "es2016",
"noImplicitAny": false,
"sourceMap": false,
"outDir": "./lib",
"declaration": true,
"types": [
"node"
]
},
"include": [
"./src/**/*.ts"
]
}

View File

@@ -1,213 +1,362 @@
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const webpack = require("webpack");
let og_image_url = process.env.RIOT_OG_IMAGE_URL;
if (!og_image_url) og_image_url = 'https://riot.im/app/themes/riot/img/logos/riot-im-logo-black-text.png';
module.exports = {
entry: {
// Load babel-polyfill first to avoid issues where some imports (namely react)
// are potentially loaded before babel-polyfill.
"bundle": ["babel-polyfill", "./src/vector/index.js"],
"indexeddb-worker": "./src/vector/indexeddb-worker.js",
module.exports = (env, argv) => {
if (process.env.CI_PACKAGE) {
// Don't run minification for CI builds (this is only set for runs on develop)
argv.mode = "development";
}
"mobileguide": "./src/vector/mobile_guide/index.js",
const development = {};
if (argv.mode !== "production") {
// This makes the sourcemaps human readable for developers. We use eval-source-map
// because the plain source-map devtool ruins the alignment.
development['devtool'] = 'eval-source-map';
}
// CSS themes
"theme-light": "./node_modules/matrix-react-sdk/res/themes/light/css/light.scss",
"theme-dark": "./node_modules/matrix-react-sdk/res/themes/dark/css/dark.scss",
"theme-light-custom": "./node_modules/matrix-react-sdk/res/themes/light-custom/css/light-custom.scss",
"theme-dark-custom": "./node_modules/matrix-react-sdk/res/themes/dark-custom/css/dark-custom.scss",
},
module: {
rules: [
{ enforce: 'pre', test: /\.js$/, use: "source-map-loader", exclude: /node_modules/, },
{ test: /\.js$/, use: "babel-loader", include: path.resolve(__dirname, 'src') },
{
test: /\.wasm$/,
loader: "file-loader",
type: "javascript/auto", // https://github.com/webpack/webpack/issues/6725
options: {
name: '[name].[hash:7].[ext]',
outputPath: '.',
// Resolve the directories for the react-sdk and js-sdk for later use. We resolve these early so we
// don't have to call them over and over. We also resolve to the package.json instead of the src
// directory so we don't have to rely on a index.js or similar file existing.
const reactSdkSrcDir = path.resolve(require.resolve("matrix-react-sdk/package.json"), '..', 'src');
const jsSdkSrcDir = path.resolve(require.resolve("matrix-js-sdk/package.json"), '..', 'src');
return {
...development,
entry: {
"bundle": "./src/vector/index.js",
"indexeddb-worker": "./src/vector/indexeddb-worker.js",
"mobileguide": "./src/vector/mobile_guide/index.js",
"usercontent": "./node_modules/matrix-react-sdk/src/usercontent/index.js",
// CSS themes
"theme-light": "./node_modules/matrix-react-sdk/res/themes/light/css/light.scss",
"theme-dark": "./node_modules/matrix-react-sdk/res/themes/dark/css/dark.scss",
"theme-light-custom": "./node_modules/matrix-react-sdk/res/themes/light-custom/css/light-custom.scss",
"theme-dark-custom": "./node_modules/matrix-react-sdk/res/themes/dark-custom/css/dark-custom.scss",
},
optimization: {
// Put all of our CSS into one useful place - this is needed for MiniCssExtractPlugin.
// Previously we used a different extraction plugin that did this magic for us, but
// now we need to consider that the CSS needs to be bundled up together.
splitChunks: {
cacheGroups: {
styles: {
name: 'styles',
test: /\.css$/,
enforce: true,
// Do not add `chunks: 'all'` here because you'll break the app entry point.
},
},
},
{
test: /\.scss$/,
// 1. postcss-loader turns the SCSS into normal CSS.
// 2. css-loader turns the CSS into a JS module whose default
// export is a string containing the CSS, while also adding
// the images and fonts from CSS as Webpack inputs.
// 3. ExtractTextPlugin turns that string into a separate asset.
use: ExtractTextPlugin.extract({
// This fixes duplicate files showing up in chrome with sourcemaps enabled.
// See https://github.com/webpack/webpack/issues/7128 for more info.
namedModules: false,
// Minification is normally enabled by default for webpack in production mode, but
// we use a CSS optimizer too and need to manage it ourselves.
minimize: argv.mode === 'production',
minimizer: argv.mode === 'production' ? [new TerserPlugin({}), new OptimizeCSSAssetsPlugin({})] : [],
},
resolve: {
// We define an alternative import path so we can safely use src/ across the react-sdk
// and js-sdk. We already import from src/ where possible to ensure our source maps are
// extremely accurate (and because we're capable of compiling the layers manually rather
// than relying on partially-mangled output from babel), though we do need to fix the
// package level import (stuff like `import {Thing} from "matrix-js-sdk"` for example).
// We can't use the aliasing down below to point at src/ because that'll fail to resolve
// the package.json for the dependency. Instead, we rely on the package.json of each
// layer to have our custom alternate fields to load things in the right order. These are
// the defaults of webpack prepended with `matrix_src_`.
mainFields: ['matrix_src_browser', 'matrix_src_main', 'browser', 'main'],
aliasFields: ['matrix_src_browser', 'browser'],
// We need to specify that TS can be resolved without an extension
extensions: ['.js', '.json', '.ts'],
alias: {
// alias any requires to the react module to the one in our path,
// otherwise we tend to get the react source included twice when
// using `npm link` / `yarn link`.
"react": path.resolve(__dirname, 'node_modules/react'),
"react-dom": path.resolve(__dirname, 'node_modules/react-dom'),
// same goes for js-sdk - we don't need two copies.
"matrix-js-sdk": path.resolve(__dirname, 'node_modules/matrix-js-sdk'),
// Define a variable so the i18n stuff can load
"$webapp": path.resolve(__dirname, 'webapp'),
},
},
module: {
noParse: [
// for cross platform compatibility use [\\\/] as the path separator
// this ensures that the regex trips on both Windows and *nix
// don't parse the languages within highlight.js. They cause stack
// overflows (https://github.com/webpack/webpack/issues/1721), and
// there is no need for webpack to parse them - they can just be
// included as-is.
/highlight\.js[\\\/]lib[\\\/]languages/,
// olm takes ages for webpack to process, and it's already heavily
// optimised, so there is little to gain by us uglifying it.
/olm[\\\/](javascript[\\\/])?olm\.js$/,
],
rules: [
{
test: /\.(ts|js)x?$/,
include: (f) => {
// our own source needs babel-ing
if (f.startsWith(path.resolve(__dirname, 'src'))) return true;
// we use the original source files of react-sdk and js-sdk, so we need to
// run them through babel. Because the path tested is the resolved, absolute
// path, these could be anywhere thanks to yarn link. We must also not
// include node modules inside these modules, so we add 'src'.
if (f.startsWith(reactSdkSrcDir)) return true;
if (f.startsWith(jsSdkSrcDir)) return true;
// but we can't run all of our dependencies through babel (many of them still
// use module.exports which breaks if babel injects an 'include' for its
// polyfills: probably fixable but babeling all our dependencies is probably
// not necessary anyway). So, for anything else, don't babel.
return false;
},
loader: 'babel-loader',
options: {
cacheDirectory: true
}
},
{
test: /\.css$/,
use: [
"css-loader",
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
importLoaders: 1,
sourceMap: true,
}
},
{
loader: 'postcss-loader',
ident: 'postcss',
options: {
config: {
path: './postcss.config.js',
sourceMap: true,
plugins: () => [
// Note that we use significantly fewer plugins on the plain
// CSS parser. If we start to parse plain CSS, we end with all
// kinds of nasty problems (like stylesheets not loading).
//
// You might have noticed that we're also sending regular CSS
// through PostCSS. This looks weird, and in fact is probably
// not what you'd expect, however in order for our CSS build
// to work nicely we have to do this. Because down the line
// our SCSS stylesheets reference plain CSS we have to load
// the plain CSS through PostCSS so it can find it safely. This
// also acts like a babel-for-css by transpiling our (S)CSS
// down/up to the right browser support (prefixes, etc).
// Further, if we don't do this then PostCSS assumes that our
// plain CSS is SCSS and it really doesn't like that, even
// though plain CSS should be compatible. The chunking options
// at the top of this webpack config help group the SCSS and
// plain CSS together for the bundler.
require("postcss-simple-vars")(),
require("postcss-strip-inline-comments")(),
// It's important that this plugin is last otherwise we end
// up with broken CSS.
require('postcss-preset-env')({stage: 3, browsers: 'last 2 versions'}),
],
parser: "postcss-scss",
"local-plugins": true,
},
},
]
},
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
importLoaders: 1,
sourceMap: true,
}
},
{
loader: 'postcss-loader',
ident: 'postcss',
options: {
sourceMap: true,
plugins: () => [
// Note that we use slightly different plugins for SCSS.
require('postcss-import')(),
require("postcss-simple-vars")(),
require("postcss-extend")(),
require("postcss-nested")(),
require("postcss-mixins")(),
require("postcss-easings")(),
require("postcss-strip-inline-comments")(),
// It's important that this plugin is last otherwise we end
// up with broken CSS.
require('postcss-preset-env')({stage: 3, browsers: 'last 2 versions'}),
],
parser: "postcss-scss",
"local-plugins": true,
},
},
]
},
{
test: /\.wasm$/,
loader: "file-loader",
type: "javascript/auto", // https://github.com/webpack/webpack/issues/6725
options: {
name: '[name].[hash:7].[ext]',
outputPath: '.',
},
},
{
// cache-bust languages.json file placed in
// riot-web/webapp/i18n during build by copy-res.js
test: /\.*languages.json$/,
type: "javascript/auto",
loader: 'file-loader',
options: {
name: 'i18n/[name].[hash:7].[ext]',
},
},
{
test: /\.(gif|png|svg|ttf|woff|woff2|xml|ico)$/,
// Use a content-based hash in the name so that we can set a long cache
// lifetime for assets while still delivering changes quickly.
oneOf: [
{
// Assets referenced in CSS files
issuer: /\.(scss|css)$/,
loader: 'file-loader',
options: {
esModule: false,
name: '[name].[hash:7].[ext]',
outputPath: getImgOutputPath,
publicPath: function(url, resourcePath) {
// CSS image usages end up in the `bundles/[hash]` output
// directory, so we adjust the final path to navigate up
// twice.
const outputPath = getImgOutputPath(url, resourcePath);
return toPublicPath(path.join("../..", outputPath));
},
},
},
{
// Assets referenced in HTML and JS files
loader: 'file-loader',
options: {
esModule: false,
name: '[name].[hash:7].[ext]',
outputPath: getImgOutputPath,
publicPath: function(url, resourcePath) {
const outputPath = getImgOutputPath(url, resourcePath);
return toPublicPath(outputPath);
},
},
},
],
}),
},
{
// this works similarly to the scss case, without postcss.
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: "css-loader",
}),
},
{
// cache-bust languages.json file placed in
// riot-web/webapp/i18n during build by copy-res.js
test: /\.*languages.json$/,
type: "javascript/auto",
loader: 'file-loader',
options: {
name: 'i18n/[name].[hash:7].[ext]',
},
},
{
test: /\.(gif|png|svg|ttf|woff|woff2|xml|ico)$/,
// Use a content-based hash in the name so that we can set a long cache
// lifetime for assets while still delivering changes quickly.
oneOf: [
{
// Assets referenced in CSS files
issuer: /\.(scss|css)$/,
loader: 'file-loader',
options: {
name: '[name].[hash:7].[ext]',
outputPath: getImgOutputPath,
publicPath: function(url, resourcePath) {
// CSS image usages end up in the `bundles/[hash]` output
// directory, so we adjust the final path to navigate up
// twice.
const outputPath = getImgOutputPath(url, resourcePath);
return toPublicPath(path.join("../..", outputPath));
},
},
},
{
// Assets referenced in HTML and JS files
loader: 'file-loader',
options: {
name: '[name].[hash:7].[ext]',
outputPath: getImgOutputPath,
publicPath: function(url, resourcePath) {
const outputPath = getImgOutputPath(url, resourcePath);
return toPublicPath(outputPath);
},
},
},
],
},
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
},
}),
// This exports our CSS using the splitChunks and loaders above.
new MiniCssExtractPlugin({
filename: 'bundles/[hash]/[name].css',
ignoreOrder: false, // Enable to remove warnings about conflicting order
}),
// This is the app's main entry point.
new HtmlWebpackPlugin({
template: './src/vector/index.html',
// we inject the links ourselves via the template, because
// HtmlWebpackPlugin will screw up our formatting like the names
// of the themes and which chunks we actually care about.
inject: false,
excludeChunks: ['mobileguide', 'usercontent'],
minify: argv.mode === 'production',
vars: {
og_image_url: og_image_url,
},
}),
// This is the mobile guide's entry point (separate for faster mobile loading)
new HtmlWebpackPlugin({
template: './src/vector/mobile_guide/index.html',
filename: 'mobile_guide/index.html',
minify: argv.mode === 'production',
chunks: ['mobileguide'],
}),
// This is the usercontent sandbox's entry point (separate for iframing)
new HtmlWebpackPlugin({
template: './node_modules/matrix-react-sdk/src/usercontent/index.html',
filename: 'usercontent/index.html',
minify: argv.mode === 'production',
chunks: ['usercontent'],
}),
],
noParse: [
// for cross platform compatibility use [\\\/] as the path separator
// this ensures that the regex trips on both Windows and *nix
// don't parse the languages within highlight.js. They cause stack
// overflows (https://github.com/webpack/webpack/issues/1721), and
// there is no need for webpack to parse them - they can just be
// included as-is.
/highlight\.js[\\\/]lib[\\\/]languages/,
output: {
path: path.join(__dirname, "webapp"),
// olm takes ages for webpack to process, and it's already heavily
// optimised, so there is little to gain by us uglifying it.
/olm[\\\/](javascript[\\\/])?olm\.js$/,
],
},
output: {
path: path.join(__dirname, "webapp"),
// The generated JS (and CSS, from the ExtractTextPlugin) are put in a
// unique subdirectory for the build. There will only be one such
// 'bundle' directory in the generated tarball; however, hosting
// servers can collect 'bundles' from multiple versions into one
// directory and symlink it into place - this allows users who loaded
// an older version of the application to continue to access webpack
// chunks even after the app is redeployed.
filename: "bundles/[hash]/[name].js",
chunkFilename: "bundles/[hash]/[name].js",
devtoolModuleFilenameTemplate: function(info) {
// Reading input source maps gives only relative paths here for
// everything. Until I figure out how to fix this, this is a
// workaround.
// We use the relative resource path with any '../'s on the front
// removed which gives a tree with matrix-react-sdk and vector
// trees smashed together, but this fixes everything being under
// various levels of '.' and '..'
// Also, sometimes the resource path is absolute.
return path.relative(process.cwd(), info.resourcePath).replace(/^[\/\.]*/, '');
},
},
resolve: {
alias: {
// alias any requires to the react module to the one in our path,
// otherwise we tend to get the react source included twice when
// using `npm link` / `yarn link`.
"react": path.resolve('./node_modules/react'),
"react-dom": path.resolve('./node_modules/react-dom'),
// same goes for js-sdk
"matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'),
"$webapp": path.resolve('./webapp'),
},
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
},
}),
new ExtractTextPlugin("bundles/[hash]/[name].css", {
allChunks: true,
}),
new HtmlWebpackPlugin({
template: './src/vector/index.html',
// we inject the links ourselves via the template, because
// HtmlWebpackPlugin wants to put the script tags either at the
// bottom of <head> or the bottom of <body>, and I'm a bit scared
// about moving them.
inject: false,
excludeChunks: ['mobileguide'],
vars: {
og_image_url: og_image_url,
},
}),
new HtmlWebpackPlugin({
template: './src/vector/mobile_guide/index.html',
filename: 'mobile_guide/index.html',
chunks: ['mobileguide'],
}),
],
devtool: 'source-map',
// configuration for the webpack-dev-server
devServer: {
// serve unwebpacked assets from webapp.
contentBase: './webapp',
stats: {
// don't fill the console up with a mahoosive list of modules
chunks: false,
// The generated JS (and CSS, from the extraction plugin) are put in a
// unique subdirectory for the build. There will only be one such
// 'bundle' directory in the generated tarball; however, hosting
// servers can collect 'bundles' from multiple versions into one
// directory and symlink it into place - this allows users who loaded
// an older version of the application to continue to access webpack
// chunks even after the app is redeployed.
filename: "bundles/[hash]/[name].js",
chunkFilename: "bundles/[hash]/[name].js",
},
// hot mdule replacement doesn't work (I think we'd need react-hot-reload?)
// so webpack-dev-server reloads the page on every update which is quite
// tedious in Riot since that can take a while.
hot: false,
inline: false,
},
// configuration for the webpack-dev-server
devServer: {
// serve unwebpacked assets from webapp.
contentBase: './webapp',
// Only output errors, warnings, or new compilations.
// This hides the massive list of modules.
stats: 'minimal',
// hot module replacement doesn't work (I think we'd need react-hot-reload?)
// so webpack-dev-server reloads the page on every update which is quite
// tedious in Riot since that can take a while.
hot: false,
inline: false,
},
};
};
/**

7776
yarn.lock

File diff suppressed because it is too large Load Diff