A lightweight, simple Go webserver build on Gin to provide a REST API frontend to sending RCON commands to a game server. Available in a Docker image, see the packages page for this repo.
Assuming you have a default RCON server specified (see environment variables)
curl --location 'http://localhost:8080/command' \
--header 'Content-Type: application/json' \
--data '{
"command": "Save"
}'
curl --location 'http://localhost:8080/command' \
--header 'Content-Type: application/json' \
--data '{
"server": "gameserver:25575",
"password": "1234",
"command": "Save"
}'
curl --location 'http://localhost:8080/status'
A docker image that runs this application is available under the repo packages, or at ghcr.io/holysoles/ginrcon
.
PORT
: Optional, override the port (default 8080) of the webserver within the containerTRUSTED_PROXIES
: Optional, set specified trusted proxy addressesRCON_SERVER
: Optional, configure a default RCON server's hostnameRCON_PORT
: Optional, configure a default RCON server's portRCON_ADMIN_PASSWORD
: Optional, configure the password to a default RCON server
An example compose file can be found in the repo here
docker build --tag ghcr.io/holysoles/ginrcon:<tag> .
docker run --rm -d -p 8080:8081 -e "PORT=8081" ghcr.io/holysoles/ginrcon:<tag>
docker push ghcr.io/holysoles/ginrcon:<tag>
Special thanks to the following projects for providing essential libraries: