Skip to content

Commit 0e9e761

Browse files
authored
Merge pull request element-hq#10195 from vector-im/jryans/config-docs
Extract configuration docs to separate file
2 parents 9d14f92 + b93388f commit 0e9e761

File tree

2 files changed

+124
-113
lines changed

2 files changed

+124
-113
lines changed

README.md

Lines changed: 13 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ released version of Riot:
2121
1. Untar the tarball on your web server
2222
1. Move (or symlink) the `riot-x.x.x` directory to an appropriate name
2323
1. If desired, copy `config.sample.json` to `config.json` and edit it
24-
as desired. See below for details.
24+
as desired. See the [configuration docs](docs/config.md) for details.
2525
1. Enter the URL into your browser and log into Riot!
2626

2727
Releases are signed using gpg and the OpenPGP standard, and can be checked against the public key located
@@ -52,9 +52,9 @@ on the client, Riot needs a way to supply the decrypted content from a separate
5252
origin to the one Riot is hosted on. This currently done with a 'cross origin
5353
renderer' which is a small piece of javascript hosted on a different domain.
5454
To avoid all Riot installs needing one of these to be set up, riot.im hosts
55-
one on usercontent.riot.im which is used by default. See 'config.json' if you'd
56-
like to host your own. https://github.com/vector-im/riot-web/issues/6173 tracks
57-
progress on replacing this with something better.
55+
one on usercontent.riot.im which is used by default.
56+
https://github.com/vector-im/riot-web/issues/6173 tracks progress on replacing
57+
this with something better.
5858

5959
Building From Source
6060
====================
@@ -91,7 +91,7 @@ guide](https://yarnpkg.com/docs/install/) if you do not have it already.
9191
develop branch. (Note that we don't reference the develop versions in git directly
9292
due to https://github.com/npm/npm/issues/3055.)
9393
1. Configure the app by copying `config.sample.json` to `config.json` and
94-
modifying it (see below for details).
94+
modifying it. See the [configuration docs](docs/config.md) for details.
9595
1. `yarn dist` to build a tarball to deploy. Untaring this file will give
9696
a version-specific directory containing all the files that need to go on your
9797
web server.
@@ -101,101 +101,6 @@ which will build all the necessary files into the `webapp` directory. The versio
101101
will not appear in Settings without using the dist script. You can then mount the
102102
`webapp` directory on your webserver to actually serve up the app, which is entirely static content.
103103

104-
config.json
105-
===========
106-
107-
You can configure the app by copying `config.sample.json` to
108-
`config.json` and customising it:
109-
110-
For a good example, see https://riot.im/develop/config.json.
111-
112-
1. `default_server_config` sets the default homeserver and identity server URL for
113-
Riot to use. The object is the same as returned by [https://<server_name>/.well-known/matrix/client](https://matrix.org/docs/spec/client_server/latest.html#get-well-known-matrix-client),
114-
with added support for a `server_name` under the `m.homeserver` section to display
115-
a custom homeserver name. Alternatively, the config can contain a `default_server_name`
116-
instead which is where Riot will go to get that same object, although this option is
117-
deprecated - see the `.well-known` link above for more information on using this option.
118-
Note that the `default_server_name` is used to get a complete server configuration
119-
whereas the `server_name` in the `default_server_config` is for display purposes only.
120-
* *Note*: The URLs can also be individually specified as `default_hs_url` and
121-
`default_is_url`, however these are deprecated. They are maintained for backwards
122-
compatibility with older configurations. `default_is_url` is respected only
123-
if `default_hs_url` is used.
124-
* The identity server is used for verifying third party identifiers like emails
125-
and phone numbers. It is not used to store your password or account information.
126-
If not provided, the identity server defaults to vector.im unless `disable_identity_server`
127-
is set to true in the config. Currently the only two public identity servers
128-
are https://matrix.org and https://vector.im, however in future identity servers
129-
will be decentralised.
130-
* Riot will fail to load if a mix of `default_server_config`, `default_server_name`, or
131-
`default_hs_url` is specified. When multiple sources are specified, it is unclear
132-
which should take priority and therefore the application cannot continue.
133-
1. `features`: Lookup of optional features that may be `enable`d, `disable`d, or exposed to the user
134-
in the `labs` section of settings. The available optional experimental features vary from
135-
release to release. Some of the available features are described in the Labs Feature section
136-
of this README.
137-
1. `showLabsSettings`: Shows the "labs" tab of user settings even when no `features` are enabled
138-
or present. Useful for getting at settings which may be otherwise hidden.
139-
1. `brand`: String to pass to your homeserver when configuring email notifications, to let the
140-
homeserver know what email template to use when talking to you.
141-
1. `branding`: Configures various branding and logo details, such as:
142-
1. `welcomeBackgroundUrl`: An image to use as a wallpaper outside the app
143-
during authentication flows
144-
1. `authHeaderLogoUrl`: An logo image that is shown in the header during
145-
authentication flows
146-
1. `authFooterLinks`: a list of links to show in the authentication page footer:
147-
`[{"text": "Link text", "url": "https://link.target"}, {"text": "Other link", ...}]`
148-
1. `integrations_ui_url`: URL to the web interface for the integrations server. The integrations
149-
server is not Riot and normally not your homeserver either. The integration server settings
150-
may be left blank to disable integrations.
151-
1. `integrations_rest_url`: URL to the REST interface for the integrations server.
152-
1. `integrations_widgets_urls`: list of URLs to the REST interface for the widget integrations server.
153-
1. `bug_report_endpoint_url`: endpoint to send bug reports to (must be running a
154-
https://github.com/matrix-org/rageshake server). Bug reports are sent when a user clicks
155-
"Send Logs" within the application. Bug reports can be disabled by leaving the
156-
`bug_report_endpoint_url` out of your config file.
157-
1. `roomDirectory`: config for the public room directory. This section is optional.
158-
1. `roomDirectory.servers`: List of other homeservers' directories to include in the drop
159-
down list. Optional.
160-
1. `default_theme`: name of theme to use by default (e.g. 'light')
161-
1. `update_base_url` (electron app only): HTTPS URL to a web server to download
162-
updates from. This should be the path to the directory containing `macos`
163-
and `win32` (for update packages, not installer packages).
164-
1. `cross_origin_renderer_url`: URL to a static HTML page hosting code to help display
165-
encrypted file attachments. This MUST be hosted on a completely separate domain to
166-
anything else since it is used to isolate the privileges of file attachments to this
167-
domain. Default: `https://usercontent.riot.im/v1.html`. This needs to contain v1.html from
168-
https://github.com/matrix-org/usercontent/blob/master/v1.html
169-
1. `piwik`: Analytics can be disabled by setting `piwik: false` or by leaving the piwik config
170-
option out of your config file. If you want to enable analytics, set `piwik` to be an object
171-
containing the following properties:
172-
1. `url`: The URL of the Piwik instance to use for collecting analytics
173-
1. `whitelistedHSUrls`: a list of HS URLs to not redact from the analytics
174-
1. `whitelistedISUrls`: a list of IS URLs to not redact from the analytics
175-
1. `siteId`: The Piwik Site ID to use when sending analytics to the Piwik server configured above
176-
1. `welcomeUserId`: the user ID of a bot to invite whenever users register that can give them a tour
177-
1. `embeddedPages`: Configures the pages displayed in portions of Riot that
178-
embed static files, such as:
179-
1. `welcomeUrl`: Initial content shown on the outside of the app when not
180-
logged in. Defaults to `welcome.html` supplied with Riot.
181-
1. `homeUrl`: Content shown on the inside of the app when a specific room is
182-
not selected. By default, no home page is configured. If one is set, a
183-
button to access it will be shown in the top left menu.
184-
1. `defaultCountryCode`: The ISO 3166 alpha2 country code to use when showing
185-
country selectors, like the phone number input on the registration page.
186-
Defaults to `GB` if the given code is unknown or not provided.
187-
188-
189-
Note that `index.html` also has an og:image meta tag that is set to an image
190-
hosted on riot.im. This is the image used if links to your copy of Riot
191-
appear in some websites like Facebook, and indeed Riot itself. This has to be
192-
static in the HTML and an absolute URL (and HTTP rather than HTTPS), so it's
193-
not possible for this to be an option in config.json. If you'd like to change
194-
it, you can build Riot as above, but run
195-
`RIOT_OG_IMAGE_URL="http://example.com/logo.png" yarn build`.
196-
Alternatively, you can edit the `og:image` meta tag in `index.html` directly
197-
each time you download a new version of Riot.
198-
199104
Running as a Desktop app
200105
========================
201106

@@ -248,19 +153,8 @@ yarn global add nativefier
248153
nativefier https://riot.im/app/
249154
```
250155

251-
Desktop app configuration
252-
=========================
253-
254-
To run multiple instances of the desktop app for different accounts, you can launch the executable with the `--profile` argument followed by a unique identifier, e.g `riot-web --profile Work` for it to run a separate profile and not interfere with the default one.
255-
256-
Alternatively, a custom location for the profile data can be specified using the `--profile-dir` flag followed by the desired path.
257-
258-
To change the config.json for the desktop app, create a config file which will be used to override values in the config which ships in the package:
259-
+ `%APPDATA%\$NAME\config.json` on Windows
260-
+ `$XDG_CONFIG_HOME\$NAME\config.json` or `~/.config/$NAME/config.json` on Linux
261-
+ `~Library/Application Support/$NAME/config.json` on macOS
262-
263-
In the paths above, `$NAME` is typically `Riot`, unless you use `--profile $PROFILE` in which case it becomes `Riot-$PROFILE`.
156+
The [configuration docs](docs/config.md#desktop-app-configuration) show how to
157+
override the desktop app's default settings if desired.
264158

265159
Running from Docker
266160
===================
@@ -298,6 +192,12 @@ docker build -t vectorim/riot-web:develop \
298192
.
299193
```
300194

195+
config.json
196+
===========
197+
198+
Riot supports a variety of settings to configure default servers, behaviour, themes, etc.
199+
See the [configuration docs](docs/config.md) for more details.
200+
301201
Labs Features
302202
=============
303203

docs/config.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
Configuration
2+
=============
3+
4+
You can configure the app by copying `config.sample.json` to
5+
`config.json` and customising it:
6+
7+
For a good example, see https://riot.im/develop/config.json.
8+
9+
1. `default_server_config` sets the default homeserver and identity server URL for
10+
Riot to use. The object is the same as returned by [https://<server_name>/.well-known/matrix/client](https://matrix.org/docs/spec/client_server/latest.html#get-well-known-matrix-client),
11+
with added support for a `server_name` under the `m.homeserver` section to display
12+
a custom homeserver name. Alternatively, the config can contain a `default_server_name`
13+
instead which is where Riot will go to get that same object, although this option is
14+
deprecated - see the `.well-known` link above for more information on using this option.
15+
Note that the `default_server_name` is used to get a complete server configuration
16+
whereas the `server_name` in the `default_server_config` is for display purposes only.
17+
* *Note*: The URLs can also be individually specified as `default_hs_url` and
18+
`default_is_url`, however these are deprecated. They are maintained for backwards
19+
compatibility with older configurations. `default_is_url` is respected only
20+
if `default_hs_url` is used.
21+
* The identity server is used for verifying third party identifiers like emails
22+
and phone numbers. It is not used to store your password or account information.
23+
If not provided, the identity server defaults to vector.im unless `disable_identity_server`
24+
is set to true in the config. Currently the only two public identity servers
25+
are https://matrix.org and https://vector.im, however in future identity servers
26+
will be decentralised.
27+
* Riot will fail to load if a mix of `default_server_config`, `default_server_name`, or
28+
`default_hs_url` is specified. When multiple sources are specified, it is unclear
29+
which should take priority and therefore the application cannot continue.
30+
1. `features`: Lookup of optional features that may be `enable`d, `disable`d, or exposed to the user
31+
in the `labs` section of settings. The available optional experimental features vary from
32+
release to release. Some of the available features are described in the Labs Feature section
33+
of this README.
34+
1. `showLabsSettings`: Shows the "labs" tab of user settings even when no `features` are enabled
35+
or present. Useful for getting at settings which may be otherwise hidden.
36+
1. `brand`: String to pass to your homeserver when configuring email notifications, to let the
37+
homeserver know what email template to use when talking to you.
38+
1. `branding`: Configures various branding and logo details, such as:
39+
1. `welcomeBackgroundUrl`: An image to use as a wallpaper outside the app
40+
during authentication flows
41+
1. `authHeaderLogoUrl`: An logo image that is shown in the header during
42+
authentication flows
43+
1. `authFooterLinks`: a list of links to show in the authentication page footer:
44+
`[{"text": "Link text", "url": "https://link.target"}, {"text": "Other link", ...}]`
45+
1. `integrations_ui_url`: URL to the web interface for the integrations server. The integrations
46+
server is not Riot and normally not your homeserver either. The integration server settings
47+
may be left blank to disable integrations.
48+
1. `integrations_rest_url`: URL to the REST interface for the integrations server.
49+
1. `integrations_widgets_urls`: list of URLs to the REST interface for the widget integrations server.
50+
1. `bug_report_endpoint_url`: endpoint to send bug reports to (must be running a
51+
https://github.com/matrix-org/rageshake server). Bug reports are sent when a user clicks
52+
"Send Logs" within the application. Bug reports can be disabled by leaving the
53+
`bug_report_endpoint_url` out of your config file.
54+
1. `roomDirectory`: config for the public room directory. This section is optional.
55+
1. `roomDirectory.servers`: List of other homeservers' directories to include in the drop
56+
down list. Optional.
57+
1. `default_theme`: name of theme to use by default (e.g. 'light')
58+
1. `update_base_url` (electron app only): HTTPS URL to a web server to download
59+
updates from. This should be the path to the directory containing `macos`
60+
and `win32` (for update packages, not installer packages).
61+
1. `cross_origin_renderer_url`: URL to a static HTML page hosting code to help display
62+
encrypted file attachments. This MUST be hosted on a completely separate domain to
63+
anything else since it is used to isolate the privileges of file attachments to this
64+
domain. Default: `https://usercontent.riot.im/v1.html`. This needs to contain v1.html from
65+
https://github.com/matrix-org/usercontent/blob/master/v1.html
66+
1. `piwik`: Analytics can be disabled by setting `piwik: false` or by leaving the piwik config
67+
option out of your config file. If you want to enable analytics, set `piwik` to be an object
68+
containing the following properties:
69+
1. `url`: The URL of the Piwik instance to use for collecting analytics
70+
1. `whitelistedHSUrls`: a list of HS URLs to not redact from the analytics
71+
1. `whitelistedISUrls`: a list of IS URLs to not redact from the analytics
72+
1. `siteId`: The Piwik Site ID to use when sending analytics to the Piwik server configured above
73+
1. `welcomeUserId`: the user ID of a bot to invite whenever users register that can give them a tour
74+
1. `embeddedPages`: Configures the pages displayed in portions of Riot that
75+
embed static files, such as:
76+
1. `welcomeUrl`: Initial content shown on the outside of the app when not
77+
logged in. Defaults to `welcome.html` supplied with Riot.
78+
1. `homeUrl`: Content shown on the inside of the app when a specific room is
79+
not selected. By default, no home page is configured. If one is set, a
80+
button to access it will be shown in the top left menu.
81+
1. `defaultCountryCode`: The ISO 3166 alpha2 country code to use when showing
82+
country selectors, like the phone number input on the registration page.
83+
Defaults to `GB` if the given code is unknown or not provided.
84+
85+
Note that `index.html` also has an og:image meta tag that is set to an image
86+
hosted on riot.im. This is the image used if links to your copy of Riot
87+
appear in some websites like Facebook, and indeed Riot itself. This has to be
88+
static in the HTML and an absolute URL (and HTTP rather than HTTPS), so it's
89+
not possible for this to be an option in config.json. If you'd like to change
90+
it, you can build Riot, but run
91+
`RIOT_OG_IMAGE_URL="http://example.com/logo.png" yarn build`.
92+
Alternatively, you can edit the `og:image` meta tag in `index.html` directly
93+
each time you download a new version of Riot.
94+
95+
Desktop app configuration
96+
=========================
97+
98+
To run multiple instances of the desktop app for different accounts, you can
99+
launch the executable with the `--profile` argument followed by a unique
100+
identifier, e.g `riot-web --profile Work` for it to run a separate profile and
101+
not interfere with the default one.
102+
103+
Alternatively, a custom location for the profile data can be specified using the
104+
`--profile-dir` flag followed by the desired path.
105+
106+
+ `%APPDATA%\$NAME\config.json` on Windows
107+
+ `$XDG_CONFIG_HOME\$NAME\config.json` or `~/.config/$NAME/config.json` on Linux
108+
+ `~Library/Application Support/$NAME/config.json` on macOS
109+
110+
In the paths above, `$NAME` is typically `Riot`, unless you use `--profile
111+
$PROFILE` in which case it becomes `Riot-$PROFILE`.

0 commit comments

Comments
 (0)