Skip to content

Commit

Permalink
added support for RCON
Browse files Browse the repository at this point in the history
  • Loading branch information
hafometh88 committed Dec 13, 2023
1 parent 4d4ec2c commit 771c1c1
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down Expand Up @@ -78,6 +83,7 @@ VOLUME /reforger/workshop

EXPOSE 2001/udp
EXPOSE 17777/udp
EXPOSE 19999/udp

STOPSIGNAL SIGINT

Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
ports:
- "2001:2001/udp"
- "17777:17777/udp"
- "19999:19999/udp"
volumes:
- ./reforger/configs:/reforger/Configs
- ./reforger/profile:/home/profile
Expand Down
6 changes: 6 additions & 0 deletions docker_default.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"address": "",
"port": 17777
},
"rcon": {
"address": "",
"port": 19999,
"password": "",
"permission": ""
},
"game": {
"name": "Arma Reforger Docker Server",
"password": "",
Expand Down
12 changes: 12 additions & 0 deletions launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit 771c1c1

Please sign in to comment.