Skip to content

Commit

Permalink
Merge branch 'release/0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Deinhamer committed Jul 30, 2016
2 parents 1e30152 + e586a69 commit a6efe9d
Show file tree
Hide file tree
Showing 19 changed files with 231 additions and 143 deletions.
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

## [next]

## [0.6.0]

### Added
- Add `BACKUP_LOG_COUNT` environment variable to configure backups for the log files.
- Add `VOTE_ENABLE` environment variable for configuring voting.
- Add `LANGUAGE` environment variable for setting the server's language.
- Implement the `version` command.

### Changed
- Update gosu to version 1.9.
- Use our own `steamcmd` image as base-image.

### Removed
- Remove the Vagrantfile.
- Remove deprecated console arguments `console` and `backup_logs`.

## [0.5.0]

### Added
Expand Down Expand Up @@ -79,7 +95,8 @@
### Added
- Initial release.

[next]: https://github.com/dst-academy/server/compare/v0.5.0...HEAD
[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
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Thomas "Thasmo" Deinhamer
Copyright (c) 2015-2016 Thomas "Thasmo" Deinhamer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 7 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Maintainers
> List of project maintainers.
## Core Maintainers

- [Thomas Deinhamer](https://github.com/thasmo) / [@thomasdeinhamer](https://twitter.com/thomasdeinhamer)
- [Brais Gabín](https://github.com/BraisGabin) / [@braisgabin](https://twitter.com/braisgabin)
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# DST:A Dedicated Server [![Build Status](https://travis-ci.org/dst-academy/server.svg?branch=develop)](https://travis-ci.org/dst-academy/server) [![Docker Pulls](https://img.shields.io/docker/pulls/dstacademy/server.svg)](https://hub.docker.com/r/dstacademy/server/) [![Slack Status](http://slack.dst.academy/badge.svg)](http://slack.dst.academy/)
> Don't Starve Together Academy Dedicated Server for Docker.
# Don't Starve Together - Dedicated Server
> Dockerfile for [Don't Starve Together][website].
[![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)]()
[![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)

---

This repository provides a `Dockerfile` for building the DST:A Dedicated Server
for the online multi-player survival game [*Don't Starve Together*][website].

If you want to set up your own server, have a look at the [DST:A Suite][suite].

## Features
- [x] Configuration via ENV variables.
- [x] World presets including caves.
Expand Down Expand Up @@ -48,7 +55,6 @@ Check out our [contribution guide][contribution-guide].
[docs-configuration]: /docs/configuration.md
[docs-usage]: /docs/usage.md
[website]: http://www.dontstarvetogether.com/
[suite]: https://github.com/dst-academy/suite
[contribution-guide]: /CONTRIBUTING.md
[docker-kitematic]: https://kitematic.com/
[docker-toolbox]: https://www.docker.com/docker-toolbox
Expand Down
56 changes: 0 additions & 56 deletions Vagrantfile

This file was deleted.

43 changes: 12 additions & 31 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,22 @@
FROM debian:jessie
MAINTAINER Thomas Deinhamer <[email protected]>
FROM dstacademy/steamcmd:0.1
MAINTAINER DST Academy <[email protected]>

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

# Install gosu.
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& curl -o /usr/local/bin/gosu -fsSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture)" \
&& curl -o /usr/local/bin/gosu.asc -fsSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture).asc" \
&& gpg --verify /usr/local/bin/gosu.asc \
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu

ENV STEAM_USER="steam" \
STEAM_HOME="/opt/steam" \
DST_HOME="/opt/dst" \
DSTA_HOME="/usr/local/share/dsta" \
CLUSTER_PATH="/var/lib/dsta/cluster"

# Add steam user.
RUN adduser --disabled-login --gecos "Steam" --home $STEAM_HOME $STEAM_USER

# Install SteamCMD.
RUN curl -fsSL "https://cdn.steamstatic.com/client/installer/steamcmd_linux.tar.gz" | gosu $STEAM_USER tar -xzvC $STEAM_HOME \
&& gosu $STEAM_USER $STEAM_HOME/steamcmd.sh \
+@ShutdownOnFailedCommand 1 \
+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
# Define build arguments.
ARG DST_HOME
ENV DST_HOME ${DST_HOME:-"/opt/dst"}
ARG DSTA_HOME
ENV DSTA_HOME ${DSTA_HOME:-"/usr/local/share/dsta"}
ARG CLUSTER_PATH
ENV CLUSTER_PATH ${CLUSTER_PATH:-"/var/lib/dsta/cluster"}

# Install Don't Starve Together Server.
RUN mkdir -p $DST_HOME \
Expand Down Expand Up @@ -73,7 +53,8 @@ ENV DESCRIPTION="Powered by DST Academy." \
PAUSE_WHEN_EMPTY=true \
SHARD_NAME=shard \
SHARD_IS_MASTER=false \
SHARD_BIND_IP="0.0.0.0"
SHARD_BIND_IP="0.0.0.0" \
BACKUP_LOG_COUNT=0

# Expose default server port.
EXPOSE $SERVER_PORT/udp
Expand Down
12 changes: 7 additions & 5 deletions build/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ if [ $1 == "dst-server" ]; then
mkdir -p $CLUSTER_PATH/$SHARD_NAME
chown -R $STEAM_USER:$STEAM_USER $CLUSTER_PATH

$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
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
fi

exec "$@"
4 changes: 2 additions & 2 deletions build/script/dontstarve_dedicated_server_nullrenderer
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ fi
sleep infinity > $DSTA_HOME/console &

cd $DST_HOME/bin

exec ./dontstarve_dedicated_server_nullrenderer \
-console \
-backup_logs \
-persistent_storage_root `dirname $CLUSTER_PATH` \
-conf_dir "." \
-cluster `basename $CLUSTER_PATH` \
-shard "$SHARD_NAME" \
-backup_log_count "$BACKUP_LOG_COUNT" \
"$@" < <({ stdbuf -oL cat $DSTA_HOME/console & stdbuf -oL cat & })
7 changes: 0 additions & 7 deletions build/script/steamcmd

This file was deleted.

54 changes: 54 additions & 0 deletions build/static/bin/version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash

usage(){
cat $DSTA_HOME/doc/version.usage
}

local_version(){
cat $DST_HOME/steamapps/appmanifest_343050.acf | clean_version
}

upstream_version(){
rm -rf $STEAM_HOME/Steam/appcache/*
steamcmd +login anonymous +app_info_update 1 +app_info_print 343050 +quit | clean_version
}

clean_version(){
grep -Po -m 1 "\"buildid\"\s*\"(.*)\"" | grep -Po "\d*"
}

if [ "$1" == "--help" ]; then
usage
exit 0
elif [ $# -eq 0 ]; then
local_version
exit 0
elif [ $# -eq 1 ]; then
case $1 in
--local)
local_version
exit 0
;;

--upstream)
upstream_version
exit 0
;;

--check)
version_local=`local_version`
version_upstream=`upstream_version`

if [ "$version_local" -eq "$version_upstream" ]; then
echo "Version is up to date.";
exit 0;
else
echo "Version is outdated.";
exit 1;
fi
;;
esac
fi

usage 1>&2
exit 1
9 changes: 8 additions & 1 deletion build/static/boot/settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ fi

source "`dirname "$0"`/aux.sh"

validate_option "LANGUAGE" \
brazilian bulgarian czech danish dutch english finnish french german \
greek hungarian italian japanese korean norwegian polish portuguese \
romanian russian schinese spanish swedish tchinese thai turkish ukrainian
validate_port "SERVER_PORT"
validate_bool "OFFLINE_ENABLE"
validate_int "MAX_PLAYERS" 1 64
Expand All @@ -24,6 +28,7 @@ validate_option "GAME_MODE" endless survival wilderness
validate_option "INTENTION" cooperative social competitive madness
validate_bool "AUTOSAVER_ENABLE"
validate_option "TICK_RATE" 15 20 30 60
validate_bool "VOTE_ENABLE"
validate_bool "VOTE_KICK_ENABLE"
validate_bool "PAUSE_WHEN_EMPTY"
validate_bool "LAN_ONLY"
Expand All @@ -47,6 +52,7 @@ if [[ ! -f $file_cluster ]]; then
conf "max_players" "$MAX_PLAYERS"
conf "pvp" "$PVP_ENABLE"
conf "pause_when_empty" "$PAUSE_WHEN_EMPTY"
conf "vote_enabled" "$VOTE_ENABLE"
conf "vote_kick_enabled" "$VOTE_KICK_ENABLE"

echo
Expand All @@ -61,11 +67,12 @@ if [[ ! -f $file_cluster ]]; then
conf "tick_rate" "$TICK_RATE"
conf "whitelist_slots" "$WHITELIST_SLOTS"

if [[ -n "$CONSOLE_ENABLE" ]] || [[ -n "$MAX_SNAPSHOTS" ]]; then
if [[ -n "$CONSOLE_ENABLE" ]] || [[ -n "$MAX_SNAPSHOTS" ]] || [[ -n "$LANGUAGE" ]]; then
echo
echo "[MISC]"
conf "console_enabled" "$CONSOLE_ENABLE"
conf "max_snapshots" "$MAX_SNAPSHOTS"
conf "language_code" "$LANGUAGE"
fi

if [[ "$SHARD_ENABLE" == "true" ]]; then
Expand Down
3 changes: 2 additions & 1 deletion build/static/doc/dst-server.usage
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ usage: dst-server [--help] <command> [<args>]

The commands are:
start Start the server
console Execute commands in the server console
console Execute commands on the server console
update Update game and/or mods
log Show a log
version Show the current server version

See 'dst-server help <command>' to read about a specific command.
10 changes: 10 additions & 0 deletions build/static/doc/version.usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
usage: dst-server version [--local|--upstream|--check]

Print the currently running version of the DST server.

--local
Return the local version.
--upstream
Return the currently released upstream version.
--check
Check if the currently running version is up to date.
Loading

0 comments on commit a6efe9d

Please sign in to comment.