From b5a6f3de568a83bd92d6beafe469e904c5b87432 Mon Sep 17 00:00:00 2001 From: klebold <76481827+hafometh88@users.noreply.github.com> Date: Fri, 15 Dec 2023 16:12:10 +0100 Subject: [PATCH] [Feature] RCON support (#36) --- Dockerfile | 5 +++++ README.md | 14 ++++++++++++++ docker-compose.yml | 1 + docker_default.json | 6 ++++++ launch.py | 10 ++++++++++ 5 files changed, 36 insertions(+) diff --git a/Dockerfile b/Dockerfile index ae2f2a9..c19e491 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="" diff --git a/README.md b/README.md index c90eafe..506798c 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..641d0e6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,7 @@ services: ports: - "2001:2001/udp" - "17777:17777/udp" + - "19999:19999/udp" # RCON 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..9a2ed83 100644 --- a/launch.py +++ b/launch.py @@ -69,6 +69,16 @@ def bool_str(text): else: config["a2s"] = None + if env_defined("RCON_ADDRESS") and env_defined("RCON_PORT"): + 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"):