From 771c1c11b7f709c3a9b7461a5ad4f3aff10f7fb5 Mon Sep 17 00:00:00 2001 From: hafometh88 Date: Wed, 13 Dec 2023 15:38:19 +0100 Subject: [PATCH] added support for RCON --- Dockerfile | 6 ++++++ README.md | 14 ++++++++++++++ docker-compose.yml | 1 + docker_default.json | 6 ++++++ launch.py | 12 ++++++++++++ 5 files changed, 39 insertions(+) diff --git a/Dockerfile b/Dockerfile index ae2f2a9..21925f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,6 +49,11 @@ ENV SERVER_PUBLIC_PORT=2001 ENV SERVER_A2S_ADDRESS="0.0.0.0" ENV SERVER_A2S_PORT=17777 +ENV RCON_ADDRESS="0.0.0.0" +ENV RCON_PORT=19999 +ENV RCON_PASSWORD="" +ENV RCON_PERMISSION="admin" + ENV GAME_NAME="Arma Reforger Docker Server" ENV GAME_PASSWORD="" ENV GAME_PASSWORD_ADMIN="" @@ -78,6 +83,7 @@ VOLUME /reforger/workshop EXPOSE 2001/udp EXPOSE 17777/udp +EXPOSE 19999/udp STOPSIGNAL SIGINT diff --git a/README.md b/README.md index c90eafe..a1d90aa 100644 --- a/README.md +++ b/README.md @@ -67,3 +67,17 @@ Path to a JSON file that contains array of mod objects. } ] ``` +### RCON + +RCON can be activated by defining the RCON_PASSWORD variable. + +```sh +-e RCON_PASSWORD="ExamplePassword123" +``` + +The password: +* is required for RCON to start +* does not support spaces +* must be at least 3 characters long + +Use `-e RCON_PERMISSION=""` to change [permission](https://community.bistudio.com/wiki/Arma_Reforger:Server_Config#permission) for all RCON clients. \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index d0a81fd..d33a6f8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,7 @@ services: ports: - "2001:2001/udp" - "17777:17777/udp" + - "19999:19999/udp" volumes: - ./reforger/configs:/reforger/Configs - ./reforger/profile:/home/profile diff --git a/docker_default.json b/docker_default.json index b696185..4c31b9b 100644 --- a/docker_default.json +++ b/docker_default.json @@ -7,6 +7,12 @@ "address": "", "port": 17777 }, + "rcon": { + "address": "", + "port": 19999, + "password": "", + "permission": "" + }, "game": { "name": "Arma Reforger Docker Server", "password": "", diff --git a/launch.py b/launch.py index f6bca78..d3b27a3 100644 --- a/launch.py +++ b/launch.py @@ -69,6 +69,18 @@ def bool_str(text): else: config["a2s"] = None + if env_defined("RCON_ADDRESS") and env_defined("RCON_PORT"): + if not env_defined("RCON_PASSWORD"): + config["rcon"]["password"] = "" + config["rcon"] = { + "address": os.environ["RCON_ADDRESS"], + "port": int(os.environ["RCON_PORT"]), + "password": os.environ["RCON_PASSWORD"], + "permission": os.environ["RCON_PERMISSION"], + } + else: + config["rcon"] = None + if env_defined("GAME_NAME"): config["game"]["name"] = os.environ["GAME_NAME"] if env_defined("GAME_PASSWORD"):