Skip to content

Commit 5567c10

Browse files
committed
⬆️ Upgrade to Centrifugo v6
Mostly config refactoring. Syncing docs translations was a royal PITA.
1 parent a87ab16 commit 5567c10

File tree

32 files changed

+649
-335
lines changed

32 files changed

+649
-335
lines changed

Docs/src/content/docs/br/development/Server/Guide/centrifugo-running-environment.mdx

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,41 @@ The majority of the setup should already be done based on the parent Getting Sta
2121

2222
In the main directory, there is a `centrifugo-config.json`.
2323

24-
Ensure that in `allowed_origins` that the value in `config.open.publicUrl` is the array value.\
25-
Ensure that in `proxy_connect_endpoint` and `proxy_subscribe_endpoint` that the value in `config.api.publicUrl` is there. It should consist of api endpoints `/api/centrifugo/connect` and `/api/centrifugo/subscribe` in there respectively.\
26-
The value for `proxy_subscribe` should also be `true`.
24+
Ensure that in `client.allowed_origins` that the value in `config.open.publicUrl` is the array value.\
25+
Ensure that in `client.proxy.connect.endpoint` and `channel.proxy.subscribe.endpoint` that the value in `config.api.publicUrl` is there. It should consist of api endpoints `/api/centrifugo/connect` and `/api/centrifugo/subscribe` in there respectively.\
26+
The value for `channel.namespaces[...].subscribe_proxy_enabled` should also be `true`.
2727

2828
For example, if my `config.open.publicUrl` was `http://localhost:7000`, and my `config.api.publicUrl` was `http://localhost:8080`, then my `centrifugo-config.json` would look like this:
29-
3029
```json
3130
{
3231
...,
33-
"allowed_origins": [..., "http://localhost:7000", ...],
34-
...,
35-
"proxy_connect_endpoint": "http://127.0.0.1:8080/api/centrifugo/connect",
36-
...,
37-
"proxy_subscribe_endpoint": "http://127.0.0.1:8080/api/centrifugo/subscribe",
32+
"client": {
33+
...,
34+
"allowed_origins": [..., "http://localhost:7000", ...],
35+
"proxy": {
36+
"connect": {
37+
"endpoint": "http://127.0.0.1:8080/api/centrifugo/connect",
38+
...
39+
}
40+
}
41+
},
3842
...,
39-
"proxy_subscribe": true
43+
"channel": {
44+
"proxy": {
45+
"subscribe": {
46+
"endpoint": "http://127.0.0.1:8080/api/centrifugo/subscribe",
47+
...
48+
}
49+
},
50+
"namespaces": [
51+
{
52+
"name": "matchup",
53+
"subscribe_proxy_enabled": true,
54+
...
55+
},
56+
...
57+
],
58+
...
4059
}
4160
```
4261

@@ -54,7 +73,7 @@ In the console, there should be no errors when running.
5473

5574
This is only for if the above doesn't work, which can happen in Windows/WSL.
5675

57-
Download the binary from [latest releases](https://github.com/centrifugal/centrifugo/releases), and place it in the parent directory.\
76+
Download a v6.x.x binary from [latest releases](https://github.com/centrifugal/centrifugo/releases), and place it in the parent directory.\
5877
Afterwards, go to `scripts.centrifugo:local` in `package.json` located in the parent directory, and ensure it has the same port listed in `config.centrifugo.publicUrl` and `config.centrifugo.apiUrl`.
5978
Once done, it should run using the following command
6079

Docs/src/content/docs/br/development/index.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Os valores no seu arquivo de configuração pessoal `config/user/$USER.json` ser
7070

7171
:::note
7272

73-
<LinkCard
73+
<LinkCard
7474
title="STOP HERE FOR DOCS SETUP"
7575
description="If you wish to work on documentation, you may stop here and continue at the client guides section."
7676
href="client/guide/docs-running-environment"
@@ -110,12 +110,12 @@ Se sua conta for uma conta de bot, certifique-se de ter `botAccount` definido co
110110

111111
#### Setup
112112

113-
This is the most time-consuming part of the setup.
113+
This is the most time-consuming part of the setup.
114114
You will need the following:
115115

116116
##### Enable Developer Mode
117117

118-
Check the option at
118+
Check the option at
119119

120120
```
121121
User Settings > Appearance > Advanced > Developer Mode
@@ -177,7 +177,7 @@ Follow this link to add your bot to your server.
177177

178178
###### Bot
179179

180-
Head to the Bot section of the bot and copy your bot token.
180+
Head to the Bot section of the bot and copy your bot token.
181181
Paste it into `config.discord.token`
182182

183183
Ensure you enable the `Server Members` and `Message Content` intents under the **Privileged Gateway Intents** subsection before usage, the bot will not start otherwise, and you will be provided a `[DISALLOWED INTENTS]` error.
@@ -213,13 +213,13 @@ O banco de dados estará acessível em `127.0.0.1:3306`, e o nome do banco de da
213213

214214
##### Configuração Manual do MariaDB
215215

216-
Se você não deseja usar o Docker, precisará instalar o [MariaDB](https://mariadb.org/) e criar um banco de dados vazio, com o nome que desejar.
216+
Se você não deseja usar o Docker, precisará instalar o [MariaDB](https://mariadb.org/) e criar um banco de dados vazio, com o nome que desejar.
217217

218218
Pode ser tão simples quanto executar:
219219

220220
```bash
221221
mysql -u root -p
222-
MySQL> create database <new_db_name>;
222+
MySQL> create database <new_db_name>;
223223
```
224224

225225
Certifique-se de atualizar `config.database` para refletir sua escolha de nome e credenciais do banco de dados.
@@ -238,7 +238,7 @@ Usamos três buckets:
238238

239239
- `team-avatars` é um bucket público que armazena avatares de equipe e pode ser servido por um CDN sem autenticação;
240240
- `mappacks` é um bucket público que armazena mappacks públicos e pode ser servido por um CDN sem autenticação;
241-
- `mappacks-temp` is a private bucket that stores private mappacks that should not have public access
241+
- `mappacks-temp` is a private bucket that stores private mappacks that should not have public access
242242

243243
Generated mappacks are first uploaded to this bucket, users are given access through pre-signed URLs.
244244

@@ -268,7 +268,8 @@ We use Centrifugo for real-time notifications. You can find the documentation [h
268268

269269
On Unix: Run `npm run centrifugo` to start the centrifugo server. It will be available at `http://localhost:8001` by default, unless you change the port in the config files.
270270

271-
On WSL/Windows OR if the above doesn't work: Install the binary from [latest releases](https://github.com/centrifugal/centrifugo/releases), and add it to the root folder of this project.
271+
On WSL/Windows OR if the above doesn't work:
272+
Download a v6.x.x binary from [latest releases](https://github.com/centrifugal/centrifugo/releases), and add it to the root folder of this project.
272273
Afterwards, run `npm run centrifugo:local` to start the centrifugo server. If you want to change the port, change the `-p` flag in the repective script in `package.json`, and your config file's api URL.
273274

274275
:::note

Docs/src/content/docs/cn/development/Server/Guide/centrifugo-running-environment.mdx

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,41 @@ The majority of the setup should already be done based on the parent Getting Sta
2121

2222
In the main directory, there is a `centrifugo-config.json`.
2323

24-
Ensure that in `allowed_origins` that the value in `config.open.publicUrl` is the array value.\
25-
Ensure that in `proxy_connect_endpoint` and `proxy_subscribe_endpoint` that the value in `config.api.publicUrl` is there. It should consist of api endpoints `/api/centrifugo/connect` and `/api/centrifugo/subscribe` in there respectively.\
26-
The value for `proxy_subscribe` should also be `true`.
24+
Ensure that in `client.allowed_origins` that the value in `config.open.publicUrl` is the array value.\
25+
Ensure that in `client.proxy.connect.endpoint` and `channel.proxy.subscribe.endpoint` that the value in `config.api.publicUrl` is there. It should consist of api endpoints `/api/centrifugo/connect` and `/api/centrifugo/subscribe` in there respectively.\
26+
The value for `channel.namespaces[...].subscribe_proxy_enabled` should also be `true`.
2727

2828
For example, if my `config.open.publicUrl` was `http://localhost:7000`, and my `config.api.publicUrl` was `http://localhost:8080`, then my `centrifugo-config.json` would look like this:
29-
3029
```json
3130
{
3231
...,
33-
"allowed_origins": [..., "http://localhost:7000", ...],
34-
...,
35-
"proxy_connect_endpoint": "http://127.0.0.1:8080/api/centrifugo/connect",
36-
...,
37-
"proxy_subscribe_endpoint": "http://127.0.0.1:8080/api/centrifugo/subscribe",
32+
"client": {
33+
...,
34+
"allowed_origins": [..., "http://localhost:7000", ...],
35+
"proxy": {
36+
"connect": {
37+
"endpoint": "http://127.0.0.1:8080/api/centrifugo/connect",
38+
...
39+
}
40+
}
41+
},
3842
...,
39-
"proxy_subscribe": true
43+
"channel": {
44+
"proxy": {
45+
"subscribe": {
46+
"endpoint": "http://127.0.0.1:8080/api/centrifugo/subscribe",
47+
...
48+
}
49+
},
50+
"namespaces": [
51+
{
52+
"name": "matchup",
53+
"subscribe_proxy_enabled": true,
54+
...
55+
},
56+
...
57+
],
58+
...
4059
}
4160
```
4261

@@ -54,7 +73,7 @@ In the console, there should be no errors when running.
5473

5574
This is only for if the above doesn't work, which can happen in Windows/WSL.
5675

57-
Download the binary from [latest releases](https://github.com/centrifugal/centrifugo/releases), and place it in the parent directory.\
76+
Download a v6.x.x binary from [latest releases](https://github.com/centrifugal/centrifugo/releases), and place it in the parent directory.\
5877
Afterwards, go to `scripts.centrifugo:local` in `package.json` located in the parent directory, and ensure it has the same port listed in `config.centrifugo.publicUrl` and `config.centrifugo.apiUrl`.
5978
Once done, it should run using the following command
6079

Docs/src/content/docs/cn/development/index.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The values in your personal `config/user/$USER.json` config file will be referre
7070

7171
:::note
7272

73-
<LinkCard
73+
<LinkCard
7474
title="STOP HERE FOR DOCS SETUP"
7575
description="If you wish to work on documentation, you may stop here and continue at the client guides section."
7676
href="client/guide/docs-running-environment"
@@ -110,12 +110,12 @@ If your account is a bot account, then make sure to have `botAccount` set to tru
110110

111111
#### Setup
112112

113-
This is the most time-consuming part of the setup.
113+
This is the most time-consuming part of the setup.
114114
You will need the following:
115115

116116
##### Enable Developer Mode
117117

118-
Check the option at
118+
Check the option at
119119

120120
```
121121
User Settings > Appearance > Advanced > Developer Mode
@@ -130,7 +130,7 @@ Create a "staff" role and give it to yourself.
130130

131131
Right-click your server name and "Copy ID". Paste this into `config.discord.guild`.
132132

133-
Right-click your staff role and "Copy ID". You can either create a role for each corresponding role in the config, OR
133+
Right-click your staff role and "Copy ID". You can either create a role for each corresponding role in the config, OR
134134
paste that role ID into the following config values to give yourself god-tier permissions.
135135

136136
```
@@ -178,7 +178,7 @@ Follow this link to add your bot to your server.
178178

179179
###### Bot
180180

181-
Head to the `Bot` section of the Discord application and copy your bot token.
181+
Head to the `Bot` section of the Discord application and copy your bot token.
182182
Paste it into `config.discord.token`
183183

184184
Ensure you enable the `Server Members` and `Message Content` intents under the **Privileged Gateway Intents** subsection before usage, the bot will not start otherwise, and you will be provided a `[DISALLOWED INTENTS]` error.
@@ -214,13 +214,13 @@ The database will listen on `127.0.0.1:3306`, with `corsace` being the database
214214

215215
##### Manual MariaDB Setup
216216

217-
If you do not want to use Docker, you will need to install [MariaDB](https://mariadb.org/) and create an empty database, named whatever you like.
217+
If you do not want to use Docker, you will need to install [MariaDB](https://mariadb.org/) and create an empty database, named whatever you like.
218218

219219
It can be as simple as running:
220220

221221
```bash
222222
mysql -u root -p
223-
MySQL> create database <new_db_name>;
223+
MySQL> create database <new_db_name>;
224224
```
225225

226226
Make sure to update `config.database` to reflect your choice of database name and credentials.
@@ -239,7 +239,7 @@ We use three buckets:
239239

240240
- `team-avatars` is a public bucket that stores team avatars, can be served by a CDN without authentication
241241
- `mappacks` is a public bucket that stores public mappacks, can be served by a CDN without authentication
242-
- `mappacks-temp` is a private bucket that stores private mappacks that should not have public access
242+
- `mappacks-temp` is a private bucket that stores private mappacks that should not have public access
243243

244244
Generated mappacks are first uploaded to this bucket, users are given access through pre-signed URLs.
245245

@@ -267,7 +267,7 @@ On Unix:
267267
Run `npm run centrifugo` to start the centrifugo server. It will be available at `http://localhost:8001` by default, unless you change the port in the config files.
268268

269269
On WSL/Windows OR if the above doesn't work:
270-
Download the binary from [latest releases](https://github.com/centrifugal/centrifugo/releases), and add it to the root folder of this project.
270+
Download a v6.x.x binary from [latest releases](https://github.com/centrifugal/centrifugo/releases), and add it to the root folder of this project.
271271
Afterwards, run `npm run centrifugo:local` to start the centrifugo server. If you want to change the port, change the `-p` flag in the respective script in `package.json`, and your config file's api URL.
272272

273273
:::note

Docs/src/content/docs/de/development/Server/Guide/centrifugo-running-environment.mdx

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,41 @@ The majority of the setup should already be done based on the parent Getting Sta
2121

2222
In the main directory, there is a `centrifugo-config.json`.
2323

24-
Ensure that in `allowed_origins` that the value in `config.open.publicUrl` is the array value.\
25-
Ensure that in `proxy_connect_endpoint` and `proxy_subscribe_endpoint` that the value in `config.api.publicUrl` is there. It should consist of api endpoints `/api/centrifugo/connect` and `/api/centrifugo/subscribe` in there respectively.\
26-
The value for `proxy_subscribe` should also be `true`.
24+
Ensure that in `client.allowed_origins` that the value in `config.open.publicUrl` is the array value.\
25+
Ensure that in `client.proxy.connect.endpoint` and `channel.proxy.subscribe.endpoint` that the value in `config.api.publicUrl` is there. It should consist of api endpoints `/api/centrifugo/connect` and `/api/centrifugo/subscribe` in there respectively.\
26+
The value for `channel.namespaces[...].subscribe_proxy_enabled` should also be `true`.
2727

2828
For example, if my `config.open.publicUrl` was `http://localhost:7000`, and my `config.api.publicUrl` was `http://localhost:8080`, then my `centrifugo-config.json` would look like this:
29-
3029
```json
3130
{
3231
...,
33-
"allowed_origins": [..., "http://localhost:7000", ...],
34-
...,
35-
"proxy_connect_endpoint": "http://127.0.0.1:8080/api/centrifugo/connect",
36-
...,
37-
"proxy_subscribe_endpoint": "http://127.0.0.1:8080/api/centrifugo/subscribe",
32+
"client": {
33+
...,
34+
"allowed_origins": [..., "http://localhost:7000", ...],
35+
"proxy": {
36+
"connect": {
37+
"endpoint": "http://127.0.0.1:8080/api/centrifugo/connect",
38+
...
39+
}
40+
}
41+
},
3842
...,
39-
"proxy_subscribe": true
43+
"channel": {
44+
"proxy": {
45+
"subscribe": {
46+
"endpoint": "http://127.0.0.1:8080/api/centrifugo/subscribe",
47+
...
48+
}
49+
},
50+
"namespaces": [
51+
{
52+
"name": "matchup",
53+
"subscribe_proxy_enabled": true,
54+
...
55+
},
56+
...
57+
],
58+
...
4059
}
4160
```
4261

@@ -54,7 +73,7 @@ In the console, there should be no errors when running.
5473

5574
This is only for if the above doesn't work, which can happen in Windows/WSL.
5675

57-
Download the binary from [latest releases](https://github.com/centrifugal/centrifugo/releases), and place it in the parent directory.\
76+
Download a v6.x.x binary from [latest releases](https://github.com/centrifugal/centrifugo/releases), and place it in the parent directory.\
5877
Afterwards, go to `scripts.centrifugo:local` in `package.json` located in the parent directory, and ensure it has the same port listed in `config.centrifugo.publicUrl` and `config.centrifugo.apiUrl`.
5978
Once done, it should run using the following command
6079

0 commit comments

Comments
 (0)