diff --git a/DSTClusterConfig/cluster_token.txt b/DSTClusterConfig/cluster_token.txt index 635e5f2..b9e1c61 100644 --- a/DSTClusterConfig/cluster_token.txt +++ b/DSTClusterConfig/cluster_token.txt @@ -1,10 +1 @@ -This file MUST be generated based on your Steam account. Enter the game and press "Play". -After you're logged in, bring up the console (by pressing `~`) and type the following command: - -TheNet:GenerateClusterToken() - -Press enter. The console will go away, and a `cluster_token.txt` was generated in: - - Unix: ~/.klei/DoNotStarveTogether - - Windows: C:\Users\\Documents\Klei\DoNotStarveTogether - - Get the generated file and OVERRIDE this one with the proper cluster token. +YourClusterTokenGoesHere-SeeTheDocs!=~ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b47449d..9df11e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,24 +2,39 @@ FROM debian:latest MAINTAINER Caio Mathielo -# Install required packages -RUN dpkg --add-architecture i386 && apt-get update -RUN apt-get install -y curl lib32gcc1 lib32stdc++6 libcurl4-gnutls-dev:i386 && apt-get clean +LABEL \ + description="Don't Starve Together dedicated server" \ + source="https://github.com/mathielo/dst-dedicated-server" # Create specific user to run DST server RUN useradd -ms /bin/bash/ dst -USER dst WORKDIR /home/dst -# Install Steam CMD (https://developer.valvesoftware.com/wiki/SteamCMD#Downloading_SteamCMD) -RUN curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - -RUN mkdir -p server_dst/mods +# Install required packages +RUN set -x && \ + dpkg --add-architecture i386 && \ + apt-get update && apt-get upgrade -y && \ + DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y wget ca-certificates lib32gcc1 lib32stdc++6 libcurl4-gnutls-dev:i386 && \ + # Download Steam CMD (https://developer.valvesoftware.com/wiki/SteamCMD#Downloading_SteamCMD) + wget -q -O - "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - && \ + chown -R dst:dst ./ && \ + # Cleanup + apt-get autoremove --purge -y wget && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +USER dst +RUN mkdir -p .klei/DoNotStarveTogether server_dst/mods # Install Don't Starve Together -RUN ./steamcmd.sh +@ShutdownOnFailedCommand 1 +@NoPromptForPassword 1 +login anonymous +force_install_dir /home/dst/server_dst +app_update 343050 validate +quit +RUN ./steamcmd.sh \ + +@ShutdownOnFailedCommand 1 \ + +@NoPromptForPassword 1 \ + +login anonymous \ + +force_install_dir /home/dst/server_dst \ + +app_update 343050 validate \ + +quit VOLUME ["/home/dst/.klei/DoNotStarveTogether", "/home/dst/server_dst/mods"] COPY ["start-container-server.sh", "/home/dst/"] - ENTRYPOINT ["/home/dst/start-container-server.sh"] diff --git a/README.md b/README.md index 5c17218..bd5511f 100644 --- a/README.md +++ b/README.md @@ -78,9 +78,9 @@ See more info in [Managing the Server](./docs/ManagingTheServer.md). ## Generate `cluster_token.txt` -:warning: The cluster token is stored in the `cluster_token.txt` file and without it **your server won't run**. +:warning: The cluster token is stored in the `DSTClusterConfig/cluster_token.txt` file and without it **your server won't run**. -Check instructions on how to get your token in [`cluster_token.txt`](./DSTClusterConfig/cluster_token.txt). After you get it, make sure to **delete everything** from this file and leave only your cluster token there, without any spaces or anything else. +Check the [detailed instructions to generate a cluster token](./docs/ClusterToken.md). After you get it, make sure to **delete everything** from this file and leave only your cluster token there, without any spaces or anything else. You can easily do that replacing `InsertYourTokenHere` in the following command and executing it in your server: diff --git a/docker-compose.yml b/docker-compose.yml index 40290a9..2cc06d7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: dst_caves: container_name: dst_caves - image: mathielo/dst-dedicated-server:0.2.0 + image: mathielo/dst-dedicated-server:0.3.0 ports: - 10998:10998/udp networks: @@ -17,7 +17,7 @@ services: dst_master: container_name: dst_master - image: mathielo/dst-dedicated-server:0.2.0 + image: mathielo/dst-dedicated-server:0.3.0 networks: - dst_cluster ports: diff --git a/docs/ClusterToken.md b/docs/ClusterToken.md new file mode 100644 index 0000000..aba7001 --- /dev/null +++ b/docs/ClusterToken.md @@ -0,0 +1,41 @@ +# Cluster Token Generation + +_The definitive guide on how to generate a cluster token for your Don't Starve Together dedicated server._ + +There are two main ways a cluster token can be generated. While both ways are in-game (you need to launch the game client), one is done via typing in a console command, while the other is done via GUI. + +For this project, the `cluster_token.txt` file is located in `DSTClusterConfig/cluster_token.txt`. + +> :closed_lock_with_key: This file **must** be generated based on your Steam account. The account that generates the token automatically gains **admin** access in-game, meaning you can rollback, regenerate the world or use console commands while playing. + +## Via console command + +Enter the game and press "Play". After you're logged in, bring up the console (by pressing `~`) and type the following command: + +TheNet:GenerateClusterToken() + +Press enter. The console will go away, and a `cluster_token.txt` was generated in: + - Unix: `~/.klei/DoNotStarveTogether` + - Windows: `C:\Users\\Documents\Klei\DoNotStarveTogether` + + Get the generated file and **override** `DSTClusterConfig/cluster_token.txt` with it. + +## Via "Account" interface + +Open the game and press "Play". + +![Play](./img/cluster_token_1.jpg) + +On the bottom left of the screen, click "Account". This will bring up information about your Klei Account. + +![Account](./img/cluster_token_2.jpg) + +You'll see your account information along with a list of all the Cluster Tokens your account ever generated in any way (console command, hosting a local server, etc). + +![Account](./img/cluster_token_3.jpg) + +Scroll to the bottom and you'll see a "Generate Server Token" button. You can add a "friendly name" for it so you can remember what it was created for. + +![Account](./img/cluster_token_4.jpg) + +The newly generated token will show up in the list along with the name you gave it. Open `DSTClusterConfig/cluster_token.txt`, **erase** it completely and paste the token in the file. Make sure to not leave any extra spaces or blank lines. diff --git a/docs/README.md b/docs/README.md index 4b826db..b1aebe0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -9,7 +9,7 @@ These are the minimum required steps to have a server running: * [Install Docker](/../../#install-docker) * Setup the server * [Server files](/../../#prepare-the-dedicated-server) (clone this repository) - * [Generate `cluster_token.txt`](/../../#generate-cluster_tokentxt) + * [Generate `cluster_token.txt`](./ClusterToken.md) * [Manage the server](./ManagingTheServer.md) (how to start, save and stop) * [Basic settings setup](/../../#the-server) (server name, password, etc.) @@ -20,7 +20,7 @@ Enhance your server by customizing it to your liking! * Customize your server * [Tweak server settings](/../../#the-server) (game mode, max players, Steam Group, description, etc.) * [World Settings](/../../#the-world) (World Size, Seasons, Difficulty, etc) - * [Install Mods](/../../DSTClusterConfig/mods) + * [Install Mods](../DSTClusterConfig/mods) * [Set Admins, Bans and Whitelisted Players](./AdminBanWhitelist.md) * How to optimize your [DST Server Performance](./ServerPerformance.md) diff --git a/docs/img/cluster_token_1.jpg b/docs/img/cluster_token_1.jpg new file mode 100644 index 0000000..002dc9f Binary files /dev/null and b/docs/img/cluster_token_1.jpg differ diff --git a/docs/img/cluster_token_2.jpg b/docs/img/cluster_token_2.jpg new file mode 100644 index 0000000..c5a6720 Binary files /dev/null and b/docs/img/cluster_token_2.jpg differ diff --git a/docs/img/cluster_token_3.jpg b/docs/img/cluster_token_3.jpg new file mode 100644 index 0000000..49397b4 Binary files /dev/null and b/docs/img/cluster_token_3.jpg differ diff --git a/docs/img/cluster_token_4.jpg b/docs/img/cluster_token_4.jpg new file mode 100644 index 0000000..83e0299 Binary files /dev/null and b/docs/img/cluster_token_4.jpg differ diff --git a/docs/img/rollback_1.jpg b/docs/img/rollback_1.jpg new file mode 100644 index 0000000..cc7e38d Binary files /dev/null and b/docs/img/rollback_1.jpg differ diff --git a/docs/img/rollback_2.jpg b/docs/img/rollback_2.jpg new file mode 100644 index 0000000..73aa55c Binary files /dev/null and b/docs/img/rollback_2.jpg differ diff --git a/docs/img/rollback_3.jpg b/docs/img/rollback_3.jpg new file mode 100644 index 0000000..65213e5 Binary files /dev/null and b/docs/img/rollback_3.jpg differ