Skip to content

Commit 5d39bd6

Browse files
committed
Merge branch 'develop' into optimize-image-assets
2 parents 5a39eaf + 6b19653 commit 5d39bd6

40 files changed

+1732
-1005
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Riot is a modular webapp built with modern ES6 and uses a Node.js build system.
7878
Ensure you have the latest LTS version of Node.js installed.
7979

8080
Using `yarn` instead of `npm` is recommended. Please see the Yarn [install
81-
guide](https://yarnpkg.com/docs/install/) if you do not have it already.
81+
guide](https://classic.yarnpkg.com/en/docs/install) if you do not have it already.
8282

8383
1. Install or update `node.js` so that your `node` is at least v10.x.
8484
1. Install `yarn` if not present already.
@@ -288,6 +288,7 @@ yarn install
288288
yarn start
289289
```
290290

291+
291292
Wait a few seconds for the initial build to finish; you should see something like:
292293
```
293294
Hash: b0af76309dd56d7275c8
@@ -309,6 +310,23 @@ modifying it. See the [configuration docs](docs/config.md) for details.
309310

310311
Open http://127.0.0.1:8080/ in your browser to see your newly built Riot.
311312

313+
**Note**: The build script uses inotify by default on Linux to monitor directories
314+
for changes. If the inotify watch limit is too low your build will silently fail.
315+
To avoid this issue, we recommend a limit of at least 128M.
316+
317+
To set a new inotify watch limit, execute:
318+
319+
```
320+
$ sudo sysctl fs.inotify.max_user_watches=131072
321+
$ sudo sysctl -p
322+
```
323+
324+
If you wish, you can make this new limit permanent, by executing:
325+
326+
```
327+
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
328+
$ sudo sysctl -p
329+
```
312330
___
313331

314332
When you make changes to `matrix-react-sdk` or `matrix-js-sdk` they should be

docs/config.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ For a good example, see https://riot.im/develop/config.json.
3232
homeserver know what email template to use when talking to you.
3333
1. `branding`: Configures various branding and logo details, such as:
3434
1. `welcomeBackgroundUrl`: An image to use as a wallpaper outside the app
35-
during authentication flows
35+
during authentication flows. If an array is passed, an image is chosen randomly for each visit.
3636
1. `authHeaderLogoUrl`: An logo image that is shown in the header during
3737
authentication flows
3838
1. `authFooterLinks`: a list of links to show in the authentication page footer:
@@ -84,10 +84,23 @@ For a good example, see https://riot.im/develop/config.json.
8484
By default, this is "https://matrix.to" to generate matrix.to (spec) permalinks.
8585
Set this to your Riot instance URL if you run an unfederated server (eg:
8686
"https://riot.example.org").
87-
1. `jitsi`: Used to change the default conference options.
87+
1. `jitsi`: Used to change the default conference options. Learn more about the
88+
Jitsi options at [jitsi.md](./jitsi.md).
8889
1. `preferredDomain`: The domain name of the preferred Jitsi instance. Defaults
8990
to `jitsi.riot.im`. This is used whenever a user clicks on the voice/video
9091
call buttons - integration managers may use a different domain.
92+
1. `enable_presence_by_hs_url`: The property key should be the URL of the homeserver
93+
and its value defines whether to enable/disable the presence status display
94+
from that homeserver. If no options are configurd, presence is shown for all
95+
homeservers.
96+
1. `disable_guests`: Disables guest access tokens and auto-guest registrations.
97+
Defaults to false (guests are allowed).
98+
1. `disable_login_language_selector`: Disables the login language selector. Defaults
99+
to false (language selector is shown).
100+
1. `disable_3pid_login`: Disables 3rd party identity options on login and registration form
101+
Defaults to false (3rd party identity options are shown).
102+
1. `default_federate`: Default option for room federation when creating a room
103+
Defaults to true (room federation enabled).
91104

92105
Note that `index.html` also has an og:image meta tag that is set to an image
93106
hosted on riot.im. This is the image used if links to your copy of Riot

docs/jitsi-dev.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Jitsi wrapper developer docs
2+
3+
*If you're looking for information on how to set up Jitsi in your Riot, see
4+
[jitsi.md](./jitsi.md) instead.*
5+
6+
These docs are for developers wondering how the different conference buttons work
7+
within Riot. If you're not a developer, you're probably looking for [jitsi.md](./jitsi.md).
8+
9+
## Brief introduction to widgets
10+
11+
Widgets are embedded web applications in a room, controlled through state events, and
12+
have a `url` property. They are largely specified by [MSC1236](https://github.com/matrix-org/matrix-doc/issues/1236)
13+
and have extensions proposed under [MSC1286](https://github.com/matrix-org/matrix-doc/issues/1286).
14+
15+
The `url` is typically something we shove into an iframe with sandboxing (see `AppTile`
16+
in the react-sdk), though for some widgets special integration can be done. v2 widgets
17+
have a `data` object which helps achieve that special integration, though v1 widgets
18+
are best iframed and left alone.
19+
20+
Widgets have a `postMessage` API they can use to interact with Riot, which also allows
21+
Riot to interact with them. Typically this is most used by the sticker picker (an
22+
account-level widget), though widgets like the Jitsi widget will request permissions to
23+
get 'stuck' into the room list during a conference.
24+
25+
Widgets can be added with the `/addwidget <url>` command.
26+
27+
## Brief introduction to integration managers
28+
29+
Integration managers (like Scalar and Dimension) are accessible via the 4 squares in
30+
the top right of the room and provide a simple UI over top of bridges, bots, and other
31+
stuff to plug into a room. They are a separate service to Riot and are thus iframed
32+
in a dialog as well. They also have a `postMessage` API they can use to interact with
33+
the client to create things like widgets, give permissions to bridges, and generally
34+
set everything up for the integration the user is working with.
35+
36+
Integration managers do not currently have a spec associated with them, though efforts
37+
are underway in [MSC1286](https://github.com/matrix-org/matrix-doc/issues/1286).
38+
39+
## Widgets configured by integration managers
40+
41+
Integration managers will often "wrap" a widget by using a widget `url` which points
42+
to the integration manager instead of to where the user requested the widget be. For
43+
example, a custom widget added in an integration manager for https://matrix.org will
44+
end up creating a widget with a URL like `https://integrations.example.org?widgetUrl=https%3A%2F%2Fmatrix.org`.
45+
46+
The integration manager's wrapper will typically have another iframe to isolate the
47+
widget from the client by yet another layer. The wrapper often provides other functionality
48+
which might not be available on the embedded site, such as a fullscreen button or the
49+
communication layer with the client (all widgets *should* be talking to the client
50+
over `postMessage`, even if they aren't going to be using the widget APIs).
51+
52+
Widgets added with the `/addwidget` command will *not* be wrapped as they are not going
53+
through an integration manager. The widgets themselves *should* also work outside of
54+
Riot. Widgets currently have a "pop out" button which opens them in a new tab and
55+
therefore have no connection back to Riot.
56+
57+
## Jitsi widgets from integration managers
58+
59+
Integration managers will create an entire widget event and send it over `postMessage`
60+
for the client to add to the room. This means that the integration manager gets to
61+
decide the conference domain, conference name, and other aspects of the widget. As
62+
a result, users can end up with a Jitsi widget that does not use the same conference
63+
server they specified in their config.json - this is expected.
64+
65+
Some integration managers allow the user to change the conference name while others
66+
will generate one for the user.
67+
68+
## Jitsi widgets generated by Riot itself
69+
70+
When the user clicks on the call buttons by the composer, the integration manager is
71+
not involved in the slightest. Instead, Riot itself generates a widget event, this time
72+
using the config.json parameters, and publishes that to the room. If there's only two
73+
people in the room, a plain WebRTC call is made instead of using a widget at all - these
74+
are defined in the Matrix specification.
75+
76+
The Jitsi widget created by Riot uses a local `jitsi.html` wrapper (or one hosted by
77+
`https://riot.im/app` for desktop users or those on non-https domains) as the widget
78+
`url`. The wrapper has some basic functionality for talking to Riot to ensure the
79+
required `postMessage` calls are fulfilled.
80+
81+
**Note**: Per [jitsi.md](./jitsi.md) the `preferredDomain` can also come from the server's
82+
client .well-known data.
83+
84+
## The Jitsi wrapper in Riot
85+
86+
Whenever Riot sees a Jitsi widget, it ditches the `url` and instead replaces it with
87+
its local wrapper, much like what it would do when creating a widget. However, instead
88+
of using one from riot.im/app, it will use one local to the client instead.
89+
90+
The wrapper is used to provide a consistent experience to users, as well as being faster
91+
and less risky to load. The local wrapper URL is populated with the conference information
92+
from the original widget (which could be a v1 or v2 widget) so the user joins the right
93+
call.
94+
95+
Critically, when the widget URL is reconstructed it does *not* take into account the
96+
config.json's `preferredDomain` for Jitsi. If it did this, users would end up on different
97+
conference servers and therefore different calls entirely.
98+
99+
**Note**: Per [jitsi.md](./jitsi.md) the `preferredDomain` can also come from the server's
100+
client .well-known data.

docs/jitsi.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Jitsi in Riot
2+
3+
Riot uses [Jitsi](https://jitsi.org/) for conference calls, which provides options for
4+
self-hosting your own server and supports most major platforms.
5+
6+
1:1 calls, or calls between you and one other person, do not use Jitsi. Instead, those
7+
calls work directly between clients or via TURN servers configured on the respective
8+
homeservers.
9+
10+
There's a number of ways to start a Jitsi call: the easiest way is to click on the
11+
voice or video buttons near the message composer in a room with more than 2 people. This
12+
will add a Jitsi widget which allows anyone in the room to join.
13+
14+
Integration managers (available through the 4 squares in the top right of the room) may
15+
provide their own approaches for adding Jitsi widgets.
16+
17+
## Configuring Riot to use your self-hosted Jitsi server
18+
19+
Riot will use the Jitsi server that is embedded in the widget, even if it is not the
20+
one you configured. This is because conference calls must be held on a single Jitsi
21+
server and cannot be split over multiple servers.
22+
23+
However, you can configure Riot to *start* a conference with your Jitsi server by adding
24+
to your [config](./config.md) the following:
25+
```json
26+
{
27+
"jitsi": {
28+
"preferredDomain": "your.jitsi.example.org"
29+
}
30+
}
31+
```
32+
33+
The default is `jitsi.riot.im` (a free service offered by Riot), and the demo site for
34+
Jitsi uses `meet.jit.si` (also free).
35+
36+
Once you've applied the config change, refresh Riot and press the call button. This
37+
should start a new conference on your Jitsi server.
38+
39+
**Note**: The widget URL will point to a `jitsi.html` page hosted by Riot. The Jitsi
40+
domain will appear later in the URL as a configuration parameter.
41+
42+
**Hint**: If you want everyone on your homeserver to use the same Jitsi server by
43+
default, and you are using riot-web 1.6 or newer, set the following on your homeserver's
44+
`/.well-known/matrix/client` config:
45+
```json
46+
{
47+
"im.vector.riot.jitsi": {
48+
"preferredDomain": "your.jitsi.example.org"
49+
}
50+
}
51+
```
52+
53+
## Mobile app support
54+
55+
Currently the Riot mobile apps do not support custom Jitsi servers and will instead
56+
use the default `jitsi.riot.im` server. When users on the mobile apps join the call,
57+
they will be joining a different conference which has the same name, but not the same
58+
participants. This is a known bug and which needs to be fixed.

docs/labs.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Labs features
22

3-
Some notes on the features you can enable by going to `Settings->Labs`. Not exhaustive, chat in
3+
If Labs is enabled in the [Riot config](config.md), you can enable some of these features by going
4+
to `Settings->Labs`. This list is non-exhaustive and subject to change, chat in
45
[#riot-web:matrix.org](https://matrix.to/#/#riot-web:matrix.org) for more information.
56

67
**Be warned! Labs features are not finalised, they may be fragile, they may change, they may be
@@ -66,13 +67,24 @@ An implementation of [MSC2241](https://github.com/matrix-org/matrix-doc/pull/224
6667

6768
This also includes a new implementation of the user & member info panel, designed to share more code between showing community members & room members. Built on top of this new panel is also a new UX for verification from the member panel.
6869

69-
## Cross-signing (in development) (`feature_cross_signing`)
70+
## Cross-signing
7071

7172
Cross-signing ([MSC1756](https://github.com/matrix-org/matrix-doc/pull/1756))
7273
improves the device verification experience by allowing you to verify a user
7374
instead of verifying each of their devices.
7475

75-
This feature is still in development and will be landing in several chunks.
76+
The feature is enabled by default and does not follow a traditional labs flag
77+
at the moment. If something goes wrong, add this to your config to disable it:
78+
```json
79+
{
80+
"settingDefaults": {
81+
"feature_cross_signing": false
82+
}
83+
}
84+
```
85+
86+
The setting will be removed in a future release, enabling it non-optionally for
87+
all users.
7688

7789
## Event indexing and E2EE search support using Seshat (`feature_event_indexing`)
7890

electron_app/riot.im/config.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@
2323
"siteId": 1,
2424
"policyUrl": "https://matrix.org/legal/riot-im-cookie-policy"
2525
},
26-
"phasedRollOut": {
27-
"feature_lazyloading": {
28-
"offset": 1539684000000,
29-
"period": 604800000
30-
}
31-
},
3226
"features": {
33-
"feature_lazyloading": "enable"
27+
"feature_cross_signing": "enable"
3428
},
3529
"enable_presence_by_hs_url": {
3630
"https://matrix.org": false,

electron_app/src/electron-main.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const tray = require('./tray');
3535
const vectorMenu = require('./vectormenu');
3636
const webContentsHandler = require('./webcontents-handler');
3737
const updater = require('./updater');
38-
const protocolInit = require('./protocol');
38+
const {getProfileFromDeeplink, protocolInit, recordSSOSession} = require('./protocol');
3939

4040
const windowStateKeeper = require('electron-window-state');
4141
const Store = require('electron-store');
@@ -68,7 +68,11 @@ if (argv["help"]) {
6868
app.exit();
6969
}
7070

71-
if (argv['profile-dir']) {
71+
// check if we are passed a profile in the SSO callback url
72+
const userDataPathInProtocol = getProfileFromDeeplink(argv["_"]);
73+
if (userDataPathInProtocol) {
74+
app.setPath('userData', userDataPathInProtocol);
75+
} else if (argv['profile-dir']) {
7276
app.setPath('userData', argv['profile-dir']);
7377
} else if (argv['profile']) {
7478
app.setPath('userData', `${app.getPath('userData')}-${argv['profile']}`);
@@ -233,6 +237,19 @@ ipcMain.on('ipcCall', async function(ev, payload) {
233237
case 'getConfig':
234238
ret = vectorConfig;
235239
break;
240+
case 'navigateBack':
241+
if (mainWindow.webContents.canGoBack()) {
242+
mainWindow.webContents.goBack();
243+
}
244+
break;
245+
case 'navigateForward':
246+
if (mainWindow.webContents.canGoForward()) {
247+
mainWindow.webContents.goForward();
248+
}
249+
break;
250+
case 'startSSOFlow':
251+
recordSSOSession(args[0]);
252+
break;
236253

237254
default:
238255
mainWindow.webContents.send('ipcReply', {

0 commit comments

Comments
 (0)