Skip to content

Commit

Permalink
Merge branch 'release/0.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Deinhamer committed Dec 13, 2016
2 parents a6efe9d + 8bb0e27 commit 08583be
Show file tree
Hide file tree
Showing 46 changed files with 430 additions and 148 deletions.
4 changes: 0 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,3 @@ trim_trailing_whitespace = false
[*.yml]
indent_style = space
indent_size = 2

[Vagrantfile]
indent_style = space
indent_size = 2
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
# Development
/.vagrant/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
- docker

env:
- DOCKER_IMAGE_NAME=dstacademy/server
- DOCKER_IMAGE_NAME=dstacademy/dontstarvetogether

script:
- docker build -t $DOCKER_IMAGE_NAME ./build
Expand Down
41 changes: 34 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

## [next]

## [0.7.0]

### Added
- Add `DST_BRANCH` and `DST_BRANCH_PASSWORD` build arguments to enable building beta-branch images.
- Support providing options only on the Docker `CMD` command.
- Document the `SERVER_PORT` configuration variable.

### Changed
- Update the base-image to `dstacademy/steamcmd:0.2.1`.
- Rename the repository name on GitHub and on Docker Hub.
- Do not update the game and mods by default when starting a server/container.
- Remove default value for `MAX_PLAYERS` to use the game's default value.
- Remove default value for `GAME_MODE` to use the game's default value.
- Remove default value for `VOTE_KICK_ENABLE` to use the game's default value.
- Remove default value for `PAUSE_WHEN_EMPTY` to use the game's default value.
- Optimize configuration creation script to handle some options better.

### Removed
- Remove the `Vagrantfile`.

### Fixed
- Update examples documentation to use correct configuration variables.
- Do not overwrite mod configuration files when the game-files get updated.
- Use the correct configuration variable for enabling/disabling vote-kicking.
- Rename obsolete setting `offline_server` to `offline_cluster`.

## [0.6.0]

### Added
Expand Down Expand Up @@ -95,10 +121,11 @@
### Added
- Initial release.

[next]: https://github.com/dst-academy/server/compare/v0.6.0...HEAD
[0.6.0]: https://github.com/dst-academy/server/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/dst-academy/server/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/dst-academy/server/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/dst-academy/server/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/dst-academy/server/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/dst-academy/server/compare/da19beb5479033b82dd6dc1200bb0cf6724904c3...v0.1.0
[next]: https://github.com/dst-academy/docker-dontstarvetogether/compare/v0.7.0...HEAD
[0.7.0]: https://github.com/dst-academy/docker-dontstarvetogether/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/dst-academy/docker-dontstarvetogether/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/dst-academy/docker-dontstarvetogether/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/dst-academy/docker-dontstarvetogether/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/dst-academy/docker-dontstarvetogether/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/dst-academy/docker-dontstarvetogether/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/dst-academy/docker-dontstarvetogether/compare/da19beb5479033b82dd6dc1200bb0cf6724904c3...v0.1.0
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ Feel free to contact us if you have questions or feedback.
- Join our [Steam Group][contact-steam].
- Join our discussion on the [Klei Forums][contact-forums].

[issues-create]: https://github.com/dst-academy/server/issues/new/
[issues-contribute]: https://github.com/dst-academy/server/labels/contribution
[file-editorconfig]: https://github.com/dst-academy/server/blob/develop/.editorconfig
[file-readme]: https://github.com/dst-academy/server/blob/develop/README.md
[file-changelog]: https://github.com/dst-academy/server/blob/develop/CHANGELOG.md
[issues-create]: https://github.com/dst-academy/docker-dontstarvetogether/issues/new/
[issues-contribute]: https://github.com/dst-academy/docker-dontstarvetogether/labels/contribution
[file-editorconfig]: https://github.com/dst-academy/docker-dontstarvetogether/blob/develop/.editorconfig
[file-readme]: https://github.com/dst-academy/docker-dontstarvetogether/blob/develop/README.md
[file-changelog]: https://github.com/dst-academy/docker-dontstarvetogether/blob/develop/CHANGELOG.md
[contact-slack]: http://slack.dst.academy/
[contact-steam]: https://steamcommunity.com/groups/dst-academy
[contact-forums]: http://forums.kleientertainment.com/topic/61674-custom-dedicated-server-with-docker/
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Don't Starve Together - Dedicated Server
> Dockerfile for [Don't Starve Together][website].
# Don't Starve Together
> Dockerfile for building a [Don't Starve Together][website] dedicated-server image.
[![Build Status](https://img.shields.io/travis/dst-academy/server/develop.svg)](https://travis-ci.org/dst-academy/server)
[![GitHub Release](https://img.shields.io/github/release/dst-academy/server.svg)](https://github.com/dst-academy/server/releases/latest)
[![Docker Pulls](https://img.shields.io/docker/pulls/dstacademy/server.svg)](https://hub.docker.com/r/dstacademy/server/)
[![License](https://img.shields.io/github/license/dst-academy/server.svg?maxAge=2592000?style=flat-square)]()
[![Build Status](https://img.shields.io/travis/dst-academy/docker-dontstarvetogether/develop.svg)](https://travis-ci.org/dst-academy/docker-dontstarvetogether)
[![GitHub Release](https://img.shields.io/github/release/dst-academy/docker-dontstarvetogether.svg)](https://github.com/dst-academy/docker-dontstarvetogether/releases/latest)
[![Docker Pulls](https://img.shields.io/docker/pulls/dstacademy/dontstarvetogether.svg)](https://hub.docker.com/r/dstacademy/dontstarvetogether/)
[![License](https://img.shields.io/github/license/dst-academy/docker-dontstarvetogether.svg)](https://github.com/dst-academy/docker-dontstarvetogether/blob/develop/LICENSE.md)
[![Slack](https://img.shields.io/badge/slack-join-E01563.svg)](https://slack.dst.academy/)
[![Steam](https://img.shields.io/badge/steam-join-1b2838.svg)](https://steamcommunity.com/groups/dst-academy)

Expand All @@ -14,32 +14,29 @@ This repository provides a `Dockerfile` for building the DST:A Dedicated Server
for the online multi-player survival game [*Don't Starve Together*][website].

## Features
- [x] Configuration via ENV variables.
- [x] World presets including caves.
- [x] Customized world generation.
- [x] Mods and custom mod-configuration.
- [x] Connected worlds via sharding.
- [x] Control the server directly on the CLI.
- [x] World-persistence on container destruction.
- [x] Configuration via **ENV** variables.
- [x] World presets including **caves**.
- [x] Customized **world generation**.
- [x] Mods and custom **mod-configuration**.
- [x] Connected worlds via **sharding**.
- [x] Control the server directly on the **CLI**.
- [x] **World-persistence** on container destruction.
- [ ] Automatic update of game files.
- [ ] Automatic update of mod files.
- [x] Sharing game and mod-files between instances.
- [x] **Sharing** game and mod-files between instances.

## Documentation
- [Setup][docs-setup]
- [Configuration][docs-configuration]
- [Usage][docs-usage]
- [Examples][docs-examples]

## Contribution
Do you want to contribute to the project?
Check out our [contribution guide][contribution-guide].

## Frequently Asked Questions

- **On which operating systems can I run Docker and the DST:A Dedicated Server?**
Docker runs natively on Linux, but there are official solutions for running Docker on Windows and OSX.
Have a look at Docker's [Kitematic][docker-kitematic] and Docker's [Toolbox][docker-kitematic].

- **Why does Steam take so long to update the game?**
It can happen that Steam takes a really long time to update the game. This is a known problem with
SteamCMD - sort of a bug. One solution is to install a DNS cache on your system, which was reported
Expand All @@ -51,9 +48,14 @@ Check out our [contribution guide][contribution-guide].
- [Dedicated Server Guide (Wikia)][reference-guide]
- [Server Console Commands (Wikia)][reference-commands]

---

[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://forthebadge.com)

[docs-setup]: /docs/setup.md
[docs-configuration]: /docs/configuration.md
[docs-usage]: /docs/usage.md
[docs-examples]: /docs/examples/
[website]: http://www.dontstarvetogether.com/
[contribution-guide]: /CONTRIBUTING.md
[docker-kitematic]: https://kitematic.com/
Expand Down
71 changes: 39 additions & 32 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,67 @@
FROM dstacademy/steamcmd:0.1
FROM dstacademy/steamcmd:0.2.1
MAINTAINER DST Academy <[email protected]>

# Install dependencies.
RUN dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
lib32stdc++6 \
libcurl4-gnutls-dev:i386 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Define build arguments.
# Set build arguments.
ARG DST_HOME
ENV DST_HOME ${DST_HOME:-"/opt/dst"}
ARG DST_BRANCH
ENV DST_BRANCH ${DST_BRANCH}
ARG DST_BRANCH_PASSWORD
ENV DST_BRANCH_PASSWORD ${DST_BRANCH_PASSWORD}
ARG DSTA_HOME
ENV DSTA_HOME ${DSTA_HOME:-"/usr/local/share/dsta"}
ARG CLUSTER_PATH
ENV CLUSTER_PATH ${CLUSTER_PATH:-"/var/lib/dsta/cluster"}

# Set environment variables.
ENV DESCRIPTION="Powered by DST Academy." \
SERVER_PORT="10999" \
SHARD_NAME=shard \
SHARD_BIND_IP="0.0.0.0" \
BACKUP_LOG_COUNT=0

# Install dependencies.
RUN set -x \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
lib32stdc++6 \
libcurl4-gnutls-dev:i386 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install Don't Starve Together Server.
RUN mkdir -p $DST_HOME \
RUN set -x \
&& mkdir -p $DST_HOME \
&& chown $STEAM_USER:$STEAM_USER $DST_HOME \
&& sync \
&& gosu $STEAM_USER $STEAM_HOME/steamcmd.sh \
&& gosu $STEAM_USER steamcmd \
+@ShutdownOnFailedCommand 1 \
+login anonymous \
+force_install_dir $DST_HOME \
+app_update 343050 validate \
+app_update 343050 \
$([ -n "$DST_BRANCH" ] && printf %s "-beta $DST_BRANCH") \
$([ -n "$DST_BRANCH_PASSWORD" ] && printf %s "-betapassword $DST_BRANCH_PASSWORD") \
validate \
+quit \
&& rm -rf $STEAM_HOME/Steam/logs $STEAM_HOME/Steam/appcache/httpcache \
&& find $STEAM_HOME/package -type f ! -name "steam_cmd_linux.installed" ! -name "steam_cmd_linux.manifest" -delete

# Copy common scripts.
COPY /script/* /usr/local/bin/

# Copy entrypoint script.
COPY /docker-entrypoint.sh /entrypoint.sh

# Copy static files.
COPY /static $DSTA_HOME
RUN mkfifo $DSTA_HOME/console \

# Create pipe for the game console.
RUN set -x \
&& mkfifo $DSTA_HOME/console \
&& chown -R $STEAM_USER:$STEAM_USER $DSTA_HOME \
&& mkdir -p `dirname $CLUSTER_PATH` \
&& chown $STEAM_USER:$STEAM_USER `dirname $CLUSTER_PATH`
&& mkdir -p $(dirname $CLUSTER_PATH) \
&& chown $STEAM_USER:$STEAM_USER $(dirname $CLUSTER_PATH)

# Set environment variables.
ENV DESCRIPTION="Powered by DST Academy." \
SERVER_PORT="10999" \
MAX_PLAYERS=4 \
GAME_MODE=survival \
VOTE_KICK_ENABLE=true \
PAUSE_WHEN_EMPTY=true \
SHARD_NAME=shard \
SHARD_IS_MASTER=false \
SHARD_BIND_IP="0.0.0.0" \
BACKUP_LOG_COUNT=0
# Copy entrypoint script.
COPY /docker-entrypoint.sh /

# Expose default server port.
EXPOSE $SERVER_PORT/udp
Expand All @@ -63,5 +70,5 @@ EXPOSE $SERVER_PORT/udp
VOLUME ["$CLUSTER_PATH"]

# Set entrypoint and default command.
ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["dst-server", "start"]
24 changes: 14 additions & 10 deletions build/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
#!/usr/bin/env bash

if [ $1 == "dst-server" ]; then
set -e
# Exit immediately on non-zero return codes.
set -e

# Configure the server
# Run start command if only options given.
if [ "${1:0:1}" = '-' ]; then
set -- dst-server start "$@"
fi

# Run boot scripts before starting the server.
if [ "$1" = 'dst-server' ]; then

# Prepare the shard directory.
mkdir -p $CLUSTER_PATH/$SHARD_NAME
chown -R $STEAM_USER:$STEAM_USER $CLUSTER_PATH

if [ "$2" == "start" ]; then
$DSTA_HOME/boot/token.sh
$DSTA_HOME/boot/settings.sh
$DSTA_HOME/boot/lists.sh
$DSTA_HOME/boot/world.sh
$DSTA_HOME/boot/mods.sh
fi
# Run via steam user if the command is `dst-server`.
set -- gosu $STEAM_USER "$@"
fi

# Execute the command.
exec "$@"
8 changes: 7 additions & 1 deletion build/static/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ usage(){
}

if [ $# -eq 0 ]; then
update=3
update=0
elif [ $1 == "--help" ]; then
usage
exit 0
Expand Down Expand Up @@ -39,4 +39,10 @@ if (((update & 2) == 0)); then
flag="-skip_update_server_mods"
fi

$DSTA_HOME/boot/token.sh
$DSTA_HOME/boot/settings.sh
$DSTA_HOME/boot/lists.sh
$DSTA_HOME/boot/world.sh
$DSTA_HOME/boot/mods.sh

exec dontstarve_dedicated_server_nullrenderer $flag
11 changes: 6 additions & 5 deletions build/static/bin/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ if [ "$1" == "--help" ]; then
usage
exit 0
elif [ $# -eq 0 ]; then
local_version
echo "Local version: `local_version`"
echo "Upstream version: `upstream_version`"
exit 0
elif [ $# -eq 1 ]; then
case $1 in
Expand All @@ -40,11 +41,11 @@ elif [ $# -eq 1 ]; then
version_upstream=`upstream_version`

if [ "$version_local" -eq "$version_upstream" ]; then
echo "Version is up to date.";
exit 0;
echo "Version is up to date."
exit 0
else
echo "Version is outdated.";
exit 1;
echo "Version is outdated."
exit 1
fi
;;
esac
Expand Down
File renamed without changes.
Loading

0 comments on commit 08583be

Please sign in to comment.