From 2c48098a62032f5577845d3a4f27765ff7162857 Mon Sep 17 00:00:00 2001 From: Philipp Hufnagl Date: Sun, 15 Apr 2018 21:40:50 +0200 Subject: [PATCH] Initial commit --- .gitignore | 1 + Dockerfile | 12 ++++++++++ conf/Caves/server.ini | 12 ++++++++++ conf/Caves/worldgenoverride.lua | 4 ++++ conf/Master/server.ini | 11 ++++++++++ conf/cluster.ini | 24 ++++++++++++++++++++ entrypoint.sh | 39 +++++++++++++++++++++++++++++++++ save/adminlist.txt | 1 + 8 files changed, 104 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 conf/Caves/server.ini create mode 100644 conf/Caves/worldgenoverride.lua create mode 100644 conf/Master/server.ini create mode 100644 conf/cluster.ini create mode 100644 entrypoint.sh create mode 100644 save/adminlist.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..64b7dba --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +conf/cluster_token.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8fecec8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM docker.zom.bi/dockerfiles/steam:latest +RUN dpkg --add-architecture i386 +RUN apt-get update +RUN apt-get install -y libcurl4-gnutls-dev:i386 +EXPOSE 11000 11000/udp 27018 27018/udp 8768 +EXPOSE 8768/udp +COPY conf/ /home/steam/.klei/DoNotStarveTogether/ +RUN chown -R steam ~steam +COPY entrypoint.sh /entrypoint.sh +RUN chmod +xr /entrypoint.sh +USER steam +ENTRYPOINT ["/entrypoint.sh"] diff --git a/conf/Caves/server.ini b/conf/Caves/server.ini new file mode 100644 index 0000000..536d642 --- /dev/null +++ b/conf/Caves/server.ini @@ -0,0 +1,12 @@ +[NETWORK] +server_port = 11001 + + +[SHARD] +is_master = false +name = Caves + + +[STEAM] +master_server_port = 27019 +authentication_port = 8769 diff --git a/conf/Caves/worldgenoverride.lua b/conf/Caves/worldgenoverride.lua new file mode 100644 index 0000000..f35ce24 --- /dev/null +++ b/conf/Caves/worldgenoverride.lua @@ -0,0 +1,4 @@ +return { + override_enabled = true, + preset = "DST_CAVE", +} diff --git a/conf/Master/server.ini b/conf/Master/server.ini new file mode 100644 index 0000000..ba523eb --- /dev/null +++ b/conf/Master/server.ini @@ -0,0 +1,11 @@ +[NETWORK] +server_port = 11000 + + +[SHARD] +is_master = true + + +[STEAM] +master_server_port = 27018 +authentication_port = 8768 diff --git a/conf/cluster.ini b/conf/cluster.ini new file mode 100644 index 0000000..0a1d175 --- /dev/null +++ b/conf/cluster.ini @@ -0,0 +1,24 @@ +[GAMEPLAY] +game_mode = survival +max_players = 6 +pvp = false +pause_when_empty = true + + +[NETWORK] +cluster_description = Don't Starve server of the Zom.bi community +cluster_name = Zom.bi +cluster_intention = cooperative +cluster_password = + + +[MISC] +console_enabled = true + + +[SHARD] +shard_enabled = true +bind_ip = 127.0.0.1 +master_ip = 127.0.0.1 +master_port = 10889 +cluster_key = paul diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..15c0c00 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# what are we trying to install? +game_nm="DST" +game_id=343050 + +cluster_name="Zom.bi" +dontstarve_dir="$HOME/.klei/DoNotStarveTogether" + +# install game to this directory +installdir=/home/steam/games/$game_nm + +# if path does not exist, create it +mkdir -p $installdir + +if [[ -w $installdir ]] # can we write into the directory? +then + # Install or update the game in /home/steam/games/[game name] + /opt/steamcmd/steamcmd.sh \ + +login anonymous \ + +force_install_dir $installdir \ + +app_update $game_id validate \ + +quit +else + # install dir maybe mounted read-only, simply + # skip installing/updating and inform the user. + echo "Skipped game installation." +fi + +# run the next commands from the installdir +cd $installdir/bin + +run_shared=(./dontstarve_dedicated_server_nullrenderer) +run_shared+=(-console) +run_shared+=(-cluster "$cluster_name") +run_shared+=(-monitor_parent_process $$) + +"${run_shared[@]}" -shard Caves | sed 's/^/Caves: /' & +"${run_shared[@]}" -shard Master | sed 's/^/Master: /' diff --git a/save/adminlist.txt b/save/adminlist.txt new file mode 100644 index 0000000..f2e8b3e --- /dev/null +++ b/save/adminlist.txt @@ -0,0 +1 @@ +KU_W-8duuIH