From b53d98cb2ae9800949d4cf44dd986a57af4ec139 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Mon, 31 Oct 2016 19:59:57 +0000 Subject: [PATCH] set rcon password --- 0.14/Dockerfile | 2 +- 0.14/docker-entrypoint.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/0.14/Dockerfile b/0.14/Dockerfile index 48a53fb..fc70aad 100644 --- a/0.14/Dockerfile +++ b/0.14/Dockerfile @@ -7,7 +7,7 @@ COPY ./factorio.crt /opt/factorio.crt ENV VERSION=0.14.17 \ SHA1=ffb248fabed345aafadb6a8cdef3684312ac240f -RUN apk --update --no-cache add bash curl tini && \ +RUN apk --update --no-cache add bash curl tini pwgen && \ curl -sSL --cacert /opt/factorio.crt \ https://www.factorio.com/get-download/$VERSION/headless/linux64 \ -o /tmp/factorio_headless_x64_$VERSION.tar.gz && \ diff --git a/0.14/docker-entrypoint.sh b/0.14/docker-entrypoint.sh index 3cd1431..4340528 100755 --- a/0.14/docker-entrypoint.sh +++ b/0.14/docker-entrypoint.sh @@ -8,6 +8,10 @@ mkdir -p /factorio/saves mkdir -p /factorio/mods mkdir -p /factorio/config +if [ ! -f /factorio/config/rconpw ]; then + echo $(pwgen 15 1) > /factorio/config/rconpw +fi + if [ ! -f /factorio/config/server-settings.json ]; then cp /opt/factorio/data/server-settings.example.json /factorio/config/server-settings.json fi @@ -25,4 +29,6 @@ fi exec /opt/factorio/bin/x64/factorio \ --port 34197 \ --start-server-load-latest \ - --server-settings /opt/factorio/data/server-settings.json + --server-settings /opt/factorio/data/server-settings.json \ + --rcon-port 27015 \ + --rcon-password "$(cat /factorio/config/rconpw)"