Skip to content

Commit

Permalink
[Feature] RCON support (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
hafometh88 committed Dec 15, 2023
1 parent 3e9bc28 commit b5a6f3d
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
5 changes: 5 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
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" # RCON
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
10 changes: 10 additions & 0 deletions launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit b5a6f3d

Please sign in to comment.