You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can now connect a 1.20.1 Minecraft client to the game server at port `25565`, such as through `127.0.0.1:25565` or `domain_name:25565`.
205
+
206
+
## Running Hyperion in a production environment
171
207
172
208
### Network topology
173
209
174
210
Hyperion uses one game server which runs all game-related code (e.g. physics, game events). One or more proxies can connect to the game server. Players connect to one of the proxies.
175
211
176
-
For development and testing purposes, it is okay to run one game server and one proxy on the same server. When generating keys, you will need to change the key and certificate file names used below to avoid file name conflicts.
177
-
178
-
On a production environment, the game server and each proxy should run on separate servers for performance.
212
+
On a production environment, the game server and each proxy should run on separate servers to improve performance.
179
213
180
214
### Generating keys and certificates
181
215
182
216
The connection between the game server and the proxies are encrypted through mTLS to ensure that the connection is secure and authenticate the proxies.
183
217
184
218
> [!WARNING]
185
-
> All private keys must be stored securely, and it is strongly recommended to generate the private keys on the server that will use them instead of transferring them over the Internet. Malicious proxies that have access to a private key can circumvent player authentication and can cause the game server to exhibit undefined behavior which can potentially lead to arbitrary code execution on the game server. If any private key has been compromised, redo this section to create new keys.
219
+
> All private keys (`.pem` files) must be stored securely, and it is strongly recommended to generate the private keys on the server that will use them instead of transferring them over the Internet. Do not send these private keys to anyone. Malicious proxies that have access to a private key can circumvent player authentication and can cause the game server to exhibit undefined behavior which can potentially lead to arbitrary code execution on the game server. If any private key has been compromised, redo this section to create new keys.
186
220
187
221
#### Create a private certificate authority (CA)
188
222
@@ -191,14 +225,12 @@ A server should be picked to store the certificate authority keys and will be re
191
225
On the certificate authority server, generate a key and certificate by running:
OpenSSL will ask for information when running the command. All fields can be left empty.
198
-
199
231
The `-days` field specifies when the certificate will expire. It will expire in 365 days in the above command, but this can be modified as needed.
200
232
201
-
`root_ca.crt` is the root CA cert and should be copied to the game server and all proxy servers. When running the game server or the proxy, make sure to pass `--root-ca-cert root_ca.crt` as a command line flag.
233
+
`root_ca.crt` is the root CA cert and should be copied to the game server and all proxy servers.
202
234
203
235
#### Generate server keys and certificates
204
236
@@ -207,11 +239,9 @@ Follow these instructions for the game server and each proxy server. The server
OpenSSL will ask for information when running the command. All fields can be left empty.
214
-
215
245
Afterwards, transfer `server.csr` to the certificate authority server. On the certificate authority server, run:
216
246
217
247
```bash
@@ -227,24 +257,42 @@ Then, transfer `server.crt` to the target server.
227
257
228
258
`server.csr` and `server.crt` on the certificate authority server and `server.csr` on the target server are no longer needed and may be deleted.
229
259
230
-
`server.crt` is the target server's certificate and `server_private_key.pem` is the target server's private key. When running the game server or the proxy, make sure to pass `--cert server.crt --private-key server_private_key.pem` as a command line flag.
260
+
### With local build
261
+
262
+
#### Running the proxy
263
+
264
+
First, compile the proxy on a machine with Cargo installed:
231
265
232
-
### Without cloning
266
+
```bash
267
+
cargo build --release --bin hyperion-proxy
268
+
```
269
+
270
+
If the proxy servers are running on different targets (e.g. different CPU architectures, different OS, different libc), you will need to compile the proxy for each target.
271
+
272
+
Now, copy `target/release/hyperion-proxy` to each proxy server.
Replace `game_server_ip` with the IP or domain name of the game server. Note that this must match the `subjectAltName` used to generate the game server certificate above.
281
+
282
+
#### Running the game server
283
+
284
+
First, compile the game server on a machine with Cargo installed that is the same target as the game server (i.e. same CPU architecture, same OS, same libc). This can also be compiled directly on the game server.
239
285
240
286
```bash
241
-
docker compose up --pull always
287
+
cargo build --release --bin bedwars
242
288
```
243
289
244
-
### With local build (for development)
290
+
Now, copy `target/release/bedwars` to the game server.
0 commit comments