Add RCON support

This commit is contained in:
JeremyStar™ 2024-04-20 16:53:15 +02:00
parent 40d21732df
commit bfe0ceabbf
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 8 additions and 2 deletions

View file

@ -15,13 +15,17 @@ cp config.example.env config.env
``` ```
## Step 2: Installing the server software ## Step 2: Installing the server software
Rename the jar file of your preferred server software to `server.jar` and move it into the `server/` directory. Rename the jar file of your preferred server software to `server.jar` and move it into the `server/` directory.
## Step 3: Modify the configuration ## Step 3: Modify the configuration
Take a look at the environment variables inside the `config.env` file. Take a look at the environment variables inside the `config.env` file.
## Step 4: Launching the server ## Step 4: Launching the server
You need to start your server two times as we need to generate the `server.properties` file first. MCSD will do this automatically for you. You need to start your server two times as we need to generate the `server.properties` file first. MCSD will do this automatically for you.
```plain ```plain
# Use this to launch your server every time you need it # Use this to launch your server every time you need it
docker compose up -d docker compose up -d
``` ```
# Using RCON
To access your server console you must use RCON. To use it, set `enable-rcon` to `true` and `rcon.password` to `mcsdrcon` in your `server.properties` file. \
After doing that one-time setup, you simply need to execute `./rcon.sh` and you'll connect to your server's console.
## Security
You might be worried that the RCON port 25575 is accessible to the public. One quick look into the `docker-compose.yml` file however will tell you that it's not possible to access the RCON port unless the attacker has direct access to the machine.

2
rcon.sh Normal file
View file

@ -0,0 +1,2 @@
#!/bin/bash
docker compose exec -it mcsd rcon -a 127.0.0.1:25575 -p mcsdrcon