Additional Setup ‐ Adding a game server to manage in CRCON - MarechJ/hll_rcon_tool GitHub Wiki

🧭 You are here : Wiki home / Additional Setup / Adding a game server to manage in CRCON


Menu


Edit you existing files

You have to edit two files to add a second server part in them :
(Note : obviously, if you want to add a third, fourth, etc server : repeat the steps)

.env

Add a 2nd server part at the end of the file and fill your game server RCON credentials.
See these install notes

#########################################################################################
###                                     SERVER 2                                      ###
#########################################################################################

# -----------------------------
# Server Details
# -----------------------------
HLL_HOST_2=
HLL_PORT_2=
HLL_PASSWORD_2=

# -----------------------------
# RCON Web Settings
# -----------------------------
RCONWEB_PORT_2=8011
RCONWEB_PORT_HTTPS_2=9011
PUBLIC_STATS_PORT_2=7012
PUBLIC_STATS_PORT_HTTPS_2=7013

GTX_SERVER_NAME_CHANGE_USERNAME_2=
GTX_SERVER_NAME_CHANGE_PASSWORD_2=

SENTRY_DSN_2=

SERVER_NUMBER_2=2
HLL_REDIS_DB_2=2

compose.yaml

If you have used one-server.yaml as your starting template for compose.yaml and now want to add a 2nd server to manage in CRCON, you can either :

  • (easier) copy the docker-templates/ten-servers.yaml as your new compose.yaml and delete the servers parts you won't use in it.
  • copy the ########### SERVER 2 ############# section from docker-templates/ten-servers.yaml and paste it at the end of your compose.yaml.

If you want to edit the existing compose.yaml file, here's what to do :

Add a server2 network line on top :

networks:
  common:
  server1:
  server2:

Add the whole "SERVER 2" part you'll find in docker-templates/ten-servers.yaml at the end of your compose.yaml file.
⚠️ Do not fill any info, just copy-paste it as it is.

  ########### SERVER 2  #############
  backend_2:
    <<: *backend
    environment: &env_2
      <<: *backend-env
      SERVER_NUMBER: ${SERVER_NUMBER_2}
      HLL_HOST: ${HLL_HOST_2}
      HLL_PORT: ${HLL_PORT_2}
      HLL_PASSWORD: ${HLL_PASSWORD_2}
      HLL_REDIS_DB: ${HLL_REDIS_DB_2}
      HLL_REDIS_URL: redis://${HLL_REDIS_HOST}:${HLL_REDIS_HOST_PORT}/${HLL_REDIS_DB_2}
      RCONWEB_PORT: ${RCONWEB_PORT_2}
      PUBLIC_STATS_PORT: ${PUBLIC_STATS_PORT_2}
      PUBLIC_STATS_PORT_HTTPS: ${PUBLIC_STATS_PORT_HTTPS_2}
      GTX_SERVER_NAME_CHANGE_USERNAME: ${GTX_SERVER_NAME_CHANGE_USERNAME_2}
      GTX_SERVER_NAME_CHANGE_PASSWORD: ${GTX_SERVER_NAME_CHANGE_PASSWORD_2}
      SENTRY_DSN: ${SENTRY_DSN_2}
    hostname: api_2
    networks:
      common:
      server2:
        aliases:
          - backend
  supervisor_2:
    <<: *supervisor
    environment:
      <<: *env_2
    depends_on:
      backend_2:
        condition: service_healthy
    networks:
      common:
      server2:
        aliases:
          - supervisor
  frontend_2:
    <<: *frontend
    ports:
      - ${RCONWEB_PORT_2}:80
      - ${RCONWEB_PORT_HTTPS_2}:443
      - ${PUBLIC_STATS_PORT_2}:81
      - ${PUBLIC_STATS_PORT_HTTPS_2}:444
    depends_on:
      backend_2:
        condition: service_healthy
    networks:
      common:
      server2:

Restart CRCON

cd /root/hll_rcon_tool
docker compose down
docker compose up -d --remove-orphans

Give server #2 "server_url" a value

Follow this installation part to configure the server_url parameter for the second server.

You may also have to configure Scorebot's settings for the 2nd server if you intend to use it.

You don't have to configure CRCON users again : the existing users will have access to the second server.

Example templates for 2 servers

.env template

Don't forget to fill your game servers RCON credentials.

[!CAUTION] DO NOT change HLL_DB_PASSWORD if you have a previously set it : that would block database access.
DO NOT change RCONWEB_API_SECRET if you have a previously set it : that would invalidate all the users passwords.

#########################################################################################
###                                   GENERAL SETTINGS                                ###
#########################################################################################

REDIS_IMAGE=redis:alpine
POSTGRES_IMAGE=postgres:12-alpine
BACKEND_DOCKER_REPOSITORY=cericmathey/hll_rcon_tool
FRONTEND_DOCKER_REPOSITORY=cericmathey/hll_rcon_tool_frontend
TAGGED_VERSION=latest

HLL_DB_PASSWORD=  <- use your own if you have one, leave blank if not

HLL_DB_NAME=rcon
HLL_DB_USER=rcon
HLL_DB_HOST=postgres
HLL_DB_HOST_PORT=5432
HLL_REDIS_HOST=redis
HLL_REDIS_HOST_PORT=6379

RCONWEB_API_SECRET=  <- use your own if you have one, leave blank if not

NB_API_WORKERS=1
NB_API_THREADS=8
RCONWEB_EXTERNAL_ADDRESS=localhost
DONT_SEED_ADMIN_USER=


#########################################################################################
###                                     SERVER 1                                      ###
#########################################################################################

HLL_HOST=  <- use your own
HLL_PORT=  <- use your own
HLL_PASSWORD=  <- use your own

RCONWEB_PORT=8010
RCONWEB_PORT_HTTPS=9010
PUBLIC_STATS_PORT=7010
PUBLIC_STATS_PORT_HTTPS=7011
GTX_SERVER_NAME_CHANGE_USERNAME=
GTX_SERVER_NAME_CHANGE_PASSWORD=
SENTRY_DSN=
SERVER_NUMBER=1
HLL_REDIS_DB=1

#########################################################################################
###                                     SERVER 2                                      ###
#########################################################################################

HLL_HOST_2=  <- use your own
HLL_PORT_2=  <- use your own
HLL_PASSWORD_2=  <- use your own

RCONWEB_PORT_2=8011
RCONWEB_PORT_HTTPS_2=9011
PUBLIC_STATS_PORT_2=7012
PUBLIC_STATS_PORT_HTTPS_2=7013
GTX_SERVER_NAME_CHANGE_USERNAME_2=
GTX_SERVER_NAME_CHANGE_PASSWORD_2=
SENTRY_DSN_2=
SERVER_NUMBER_2=2
HLL_REDIS_DB_2=2

compose.yaml template

⚠️ Do not edit anything in it. Just copy it in your CRCON root folder as it is.

include:
  - docker-compose-common-components.yaml

networks:
  common:
  server1:
  server2:

# This is defined here and not in common-components because anchors don't
# work between files and are prefixed with x- because they are just anchors
# for merging later, if they're defined under services: docker will want to start them
# compose ignores any fields that start with x-
x-backend: &backend
  image: ${BACKEND_DOCKER_REPOSITORY}:${TAGGED_VERSION}
  environment: &backend-env
    LOGGING_LEVEL: "INFO"
    LOGGING_PATH: /logs/
    CONFIG_DIR: /config/
    HLL_REDIS_HOST: ${HLL_REDIS_HOST}
    HLL_REDIS_PORT: ${HLL_REDIS_HOST_PORT}
    HLL_DB_USER: ${HLL_DB_USER}
    HLL_DB_PASSWORD: ${HLL_DB_PASSWORD}
    HLL_DB_NAME: ${HLL_DB_NAME}
    HLL_DB_HOST: ${HLL_DB_HOST}
    HLL_DB_HOST_PORT: ${HLL_DB_HOST_PORT}
    HLL_DB_URL: postgresql://${HLL_DB_USER}:${HLL_DB_PASSWORD}@${HLL_DB_HOST}:${HLL_DB_HOST_PORT}/${HLL_DB_NAME}
    RCONWEB_API_SECRET: ${RCONWEB_API_SECRET}
    SUPERVISOR_RPC_URL: http://supervisor:9001/RPC2
    NB_API_WORKERS: ${NB_API_WORKERS}
    NB_API_THREADS: ${NB_API_THREADS}
    RCONWEB_EXTERNAL_ADDRESS: ${RCONWEB_EXTERNAL_ADDRESS}
    DONT_SEED_ADMIN_USER: ${DONT_SEED_ADMIN_USER}
  command: web
  restart: on-failure
  healthcheck:
    test:
      [
        "CMD-SHELL",
        "if [ -e /code/rconweb/gunicorn.pid ]; then echo 0; else echo 1; fi",
      ]
    start_period: 30s
    interval: 15s
    timeout: 30s
    retries: 5
  depends_on:
    postgres:
      condition: service_healthy
    redis:
      condition: service_healthy
    maintenance:
      condition: service_healthy
  volumes:
    - ./logs:/logs/
    - ./servicediscovery:/servicediscovery
    - ./static:/static/
    - ./config:/config/
x-supervisor: &supervisor
  image: ${BACKEND_DOCKER_REPOSITORY}:${TAGGED_VERSION}
  restart: on-failure
  command: supervisor
  volumes:
    - ./logs:/logs/
    - ./supervisor_data:/data
    - ./config:/config/
x-frontend: &frontend
  build:
    context: .
    dockerfile: Dockerfile-frontend
  image: ${FRONTEND_DOCKER_REPOSITORY}:${TAGGED_VERSION}
  environment:
    RCONWEB_EXTERNAL_ADDRESS: ${RCONWEB_EXTERNAL_ADDRESS}
  restart: always
  volumes:
    - ./static:/static/
    - ./certs:/certs/

services:
  ########### SERVER 1  #############
  backend_1:
    <<: *backend
    environment: &env_1
      <<: *backend-env
      SERVER_NUMBER: ${SERVER_NUMBER}
      HLL_HOST: ${HLL_HOST}
      HLL_PORT: ${HLL_PORT}
      HLL_PASSWORD: ${HLL_PASSWORD}
      HLL_REDIS_DB: ${HLL_REDIS_DB}
      HLL_REDIS_URL: redis://${HLL_REDIS_HOST}:${HLL_REDIS_HOST_PORT}/${HLL_REDIS_DB}
      RCONWEB_PORT: ${RCONWEB_PORT}
      PUBLIC_STATS_PORT: ${PUBLIC_STATS_PORT}
      PUBLIC_STATS_PORT_HTTPS: ${PUBLIC_STATS_PORT_HTTPS}
      GTX_SERVER_NAME_CHANGE_USERNAME: ${GTX_SERVER_NAME_CHANGE_USERNAME}
      GTX_SERVER_NAME_CHANGE_PASSWORD: ${GTX_SERVER_NAME_CHANGE_PASSWORD}
      SENTRY_DSN: ${SENTRY_DSN}
    hostname: api_1
    networks:
      common:
      server1:
        aliases:
          - backend
  supervisor_1:
    <<: *supervisor
    environment:
      <<: *env_1
    depends_on:
      backend_1:
        condition: service_healthy
    networks:
      common:
      server1:
        aliases:
          - supervisor
  frontend_1:
    <<: *frontend
    ports:
      - ${RCONWEB_PORT}:80
      - ${RCONWEB_PORT_HTTPS}:443
      - ${PUBLIC_STATS_PORT}:81
      - ${PUBLIC_STATS_PORT_HTTPS}:444
    depends_on:
      backend_1:
        condition: service_healthy
    networks:
      common:
      server1:

  ########### SERVER 2  #############
  backend_2:
    <<: *backend
    environment: &env_2
      <<: *backend-env
      SERVER_NUMBER: ${SERVER_NUMBER_2}
      HLL_HOST: ${HLL_HOST_2}
      HLL_PORT: ${HLL_PORT_2}
      HLL_PASSWORD: ${HLL_PASSWORD_2}
      HLL_REDIS_DB: ${HLL_REDIS_DB_2}
      HLL_REDIS_URL: redis://${HLL_REDIS_HOST}:${HLL_REDIS_HOST_PORT}/${HLL_REDIS_DB_2}
      RCONWEB_PORT: ${RCONWEB_PORT_2}
      PUBLIC_STATS_PORT: ${PUBLIC_STATS_PORT_2}
      PUBLIC_STATS_PORT_HTTPS: ${PUBLIC_STATS_PORT_HTTPS_2}
      GTX_SERVER_NAME_CHANGE_USERNAME: ${GTX_SERVER_NAME_CHANGE_USERNAME_2}
      GTX_SERVER_NAME_CHANGE_PASSWORD: ${GTX_SERVER_NAME_CHANGE_PASSWORD_2}
      SENTRY_DSN: ${SENTRY_DSN_2}
    hostname: api_2
    networks:
      common:
      server2:
        aliases:
          - backend
  supervisor_2:
    <<: *supervisor
    environment:
      <<: *env_2
    depends_on:
      backend_2:
        condition: service_healthy
    networks:
      common:
      server2:
        aliases:
          - supervisor
  frontend_2:
    <<: *frontend
    ports:
      - ${RCONWEB_PORT_2}:80
      - ${RCONWEB_PORT_HTTPS_2}:443
      - ${PUBLIC_STATS_PORT_2}:81
      - ${PUBLIC_STATS_PORT_HTTPS_2}:444
    depends_on:
      backend_2:
        condition: service_healthy
    networks:
      common:
      server2: