From c4a5c2a9fe04cc93a47a8078e2a7d947bdf21731 Mon Sep 17 00:00:00 2001 From: hafometh88 Date: Wed, 13 Dec 2023 16:12:44 +0100 Subject: [PATCH 1/4] added RCON support --- Dockerfile | 5 +++++ README.md | 14 ++++++++++++++ docker-compose.yml | 1 + docker_default.json | 6 ++++++ launch.py | 12 ++++++++++++ 5 files changed, 38 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..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 1090733..48a5316 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"): From 749f8a296fae0914eb3ae044729a6b0600e746c9 Mon Sep 17 00:00:00 2001 From: hafometh88 <76481827+hafometh88@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:27:17 +0100 Subject: [PATCH 2/4] Update docker-compose.yml Co-authored-by: jonpas --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index d33a6f8..641d0e6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: ports: - "2001:2001/udp" - "17777:17777/udp" - - "19999:19999/udp" + - "19999:19999/udp" # RCON volumes: - ./reforger/configs:/reforger/Configs - ./reforger/profile:/home/profile From d2238a6b633f32fafe1a70923635abcb335f1e81 Mon Sep 17 00:00:00 2001 From: hafometh88 <76481827+hafometh88@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:27:31 +0100 Subject: [PATCH 3/4] Update README.md Co-authored-by: jonpas --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a1d90aa..506798c 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Path to a JSON file that contains array of mod objects. ``` ### RCON -RCON can be activated by defining the RCON_PASSWORD variable. +RCON can be activated by defining the `RCON_PASSWORD` variable. ```sh -e RCON_PASSWORD="ExamplePassword123" From 984b59e2b6acbe3bea26997a80dd61b0761c27a8 Mon Sep 17 00:00:00 2001 From: hafometh88 Date: Wed, 13 Dec 2023 23:27:06 +0100 Subject: [PATCH 4/4] removed unnecessary if --- launch.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/launch.py b/launch.py index 48a5316..b153240 100644 --- a/launch.py +++ b/launch.py @@ -70,8 +70,6 @@ def bool_str(text): 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"]),