diff --git a/Dockerfile b/Dockerfile
index e73fcce..054704a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM ubuntu:14.04
MAINTAINER TuRzAm
@@ -17,24 +17,16 @@ ENV NBPLAYERS 70
ENV UPDATEONSTART 1
# if the server is backup when start with docker start
ENV BACKUPONSTART 1
-# Tag on github for ark server tools
-ENV GIT_TAG v1.6.56
+# branch on github for ark server tools
+ENV BRANCH master
# Server PORT (you can't remap with docker, it doesn't work)
ENV SERVERPORT 27015
# Steam port (you can't remap with docker, it doesn't work)
ENV STEAMPORT 7778
-# if the server should backup after stopping
-ENV BACKUPONSTOP 0
-# If the server warn the players before stopping
-ENV WARNONSTOP 0
-# UID of the user steam
-ENV UID 1000
-# GID of the user steam
-ENV GID 1000
# Install dependencies
RUN apt-get update &&\
- apt-get install -y curl lib32gcc1 lsof git sudo
+ apt-get install -y curl lib32gcc1 lsof git
# Enable passwordless sudo for users under the "sudo" group
RUN sed -i.bkp -e \
@@ -52,20 +44,15 @@ RUN usermod -a -G sudo steam
# Copy & rights to folders
COPY run.sh /home/steam/run.sh
-COPY user.sh /home/steam/user.sh
COPY crontab /home/steam/crontab
COPY arkmanager-user.cfg /home/steam/arkmanager.cfg
-RUN touch /root/.bash_profile
RUN chmod 777 /home/steam/run.sh
-RUN chmod 777 /home/steam/user.sh
RUN mkdir /ark
# We use the git method, because api github has a limit ;)
-RUN git clone https://github.com/FezVrasta/ark-server-tools.git /home/steam/ark-server-tools
-WORKDIR /home/steam/ark-server-tools/
-RUN git checkout $GIT_TAG
+RUN git clone -b $BRANCH https://github.com/FezVrasta/ark-server-tools.git /home/steam/ark-server-tools
# Install
WORKDIR /home/steam/ark-server-tools/tools
RUN chmod +x install.sh
@@ -74,15 +61,12 @@ RUN ./install.sh steam
# Allow crontab to call arkmanager
RUN ln -s /usr/local/bin/arkmanager /usr/bin/arkmanager
-# Define default config file in /etc/arkmanager
+# Define default config file in /ark
COPY arkmanager-system.cfg /etc/arkmanager/arkmanager.cfg
-# Define default config file in /etc/arkmanager
-COPY instance.cfg /etc/arkmanager/instances/main.cfg
-
RUN chown steam -R /ark && chmod 755 -R /ark
-#USER steam
+USER steam
# download steamcmd
RUN mkdir /home/steam/steamcmd &&\
@@ -91,12 +75,9 @@ RUN mkdir /home/steam/steamcmd &&\
# First run is on anonymous to download the app
-# We can't download from docker hub anymore -_-
-#RUN /home/steam/steamcmd/steamcmd.sh +login anonymous +quit
+RUN /home/steam/steamcmd/steamcmd.sh +login anonymous +quit
EXPOSE ${STEAMPORT} 32330 ${SERVERPORT}
-# Add UDP
-EXPOSE ${STEAMPORT}/udp ${SERVERPORT}/udp
VOLUME /ark
@@ -104,4 +85,4 @@ VOLUME /ark
WORKDIR /ark
# Update game launch the game.
-ENTRYPOINT ["/home/steam/user.sh"]
+ENTRYPOINT ["/home/steam/run.sh"]
diff --git a/README.md b/README.md
index 79dc045..8aabce0 100644
--- a/README.md
+++ b/README.md
@@ -59,9 +59,9 @@ You can easily configure automatic update and backup.
If you edit the file `/my/path/to/ark/crontab` you can add your crontab job.
For example :
`# Update the server every hours`
-`0 * * * * arkmanager update --warn --update-mods >> /ark/log/crontab.log 2>&1`
+`0 * * * * arkmanager update --warn --update-mods >> /ark/log/crontab.log 2&>1`
`# Backup the server each day at 00:00 `
-`0 0 * * * arkmanager backup >> /ark/log/crontab.log 2>&1`
+`0 0 * * * arkmanager backup >> /ark/log/crontab.log 2&>1`
*You can check [this website](http://www.unix.com/man-page/linux/5/crontab/) for more information on cron.*
To add mods, you only need to change the variable ark_GameModIds in *arkmanager.cfg* with a list of your modIds (like this `ark_GameModIds="987654321,1234568"`). If UPDATEONSTART is enable, just restart your docker or use `docker exec ark arkmanager update --update-mods`.
@@ -75,8 +75,8 @@ To add mods, you only need to change the variable ark_GameModIds in *arkmanager.
- Edit */my/path/to/ark/GameUserSetting.ini and Game.ini*
- Edit */my/path/to/ark/arkserver.cfg* to add mods and configure warning time.
- Add auto update every day and autobackup by editing */my/path/to/ark/crontab* with this lines :
-`0 0 * * * arkmanager update --warn --update-mods >> /ark/log/crontab.log 2>&1`
-`0 0 * * * arkmanager backup >> /ark/log/crontab.log 2>&1`
+`0 0 * * * arkmanager update --warn --update-mods >> /ark/log/crontab.log 2&>1`
+`0 0 * * * arkmanager backup >> /ark/log/crontab.log 2&>1`
- `docker start ark`
- Check your server with :
`docker exec ark arkmanager status`
@@ -100,16 +100,8 @@ Steam server port (can't rebind with docker, it doesn't work) (default : 7778)
1 : Backup the server when the container is started. 0: no backup (default : 1)
+ __UPDATEPONSTART__
1 : Update the server when the container is started. 0: no update (default : 1)
-+ __BACKUPONSTOP__
-1 : Backup the server when the container is stopped. 0: no backup (default : 0)
-+ __WARNONSTOP__
-1 : Warn the players before the container is stopped. 0: no warning (default : 0)
+ __TZ__
Time Zone : Set the container timezone (for crontab). (You can get your timezone posix format with the command `tzselect`. For example, France is "Europe/Paris").
-+ __UID__
-UID of the user used. Owner of the volume /ark
-+ __GID__
-GID of the user used. Owner of the volume /ark
---
@@ -126,7 +118,6 @@ GID of the user used. Owner of the volume /ark
+ /ark/template : Default config files
+ /ark/template/arkmanager.cfg : default config file for Ark Server Tools
+ /ark/template/crontab : default config file for crontab
- + /ark/staging : default directory if you use the --downloadonly option when updating.
---
@@ -155,13 +146,4 @@ GID of the user used. Owner of the volume /ark
- You can now config crontab with the file /your/ark/path/crontab
- Add template directory with default config files.
- Add documentation on TZ variable.
-+ 1.3 :
- - Add BACKUPONSTOP to backup the server when you stop the server (thanks to [fkoester](https://github.com/fkoester))
- - Add WARNONSTOP to add warning message when you stop the server (default: 60 min)
- - Works with Ark Server Tools v1.5
- - Compressing backups so they take up less space
- - Downloading updates to a staging directory before applying
- - Added support for automatically updating on restart
- - Show a spinner when updating
- - Add UID & GID to set the uid & gid of the user used in the container (and permissions on the volume /ark)
diff --git a/arkmanager-system.cfg b/arkmanager-system.cfg
index b15199a..ab328d1 100644
--- a/arkmanager-system.cfg
+++ b/arkmanager-system.cfg
@@ -17,7 +17,6 @@ arkserverroot="/ark/server" # path of yo
arkserverexec="ShooterGame/Binaries/Linux/ShooterGameServer" # name of ARK server executable
arkbackupdir="/ark/backup" # path to backup directory
arkautorestartfile="ShooterGame/Saved/.autorestart" # path to autorestart file
-arkStagingDir="/ark/staging"
# config Service
servicename="arkserv" # Name of the service (don't change if you don't know what are you doing)
@@ -31,14 +30,5 @@ ark_RCONPort="32330" # RCON Port
# steamdb specific
appid=376030 # Linux server App ID
-mod_appid=346110 # App ID for mods
-
-# Need to be true to work with UPDATEPONSTART (See #10)
-arkAutoUpdateOnStart="true" # set this to true if you want to always update before startup
-
-defaultinstance="main"
-
-# We don't use the dots because it doesn't show.
-progressDisplayType=spinner
source /ark/arkmanager.cfg
diff --git a/arkmanager-user.cfg b/arkmanager-user.cfg
index f5d3ff2..a972ff4 100644
--- a/arkmanager-user.cfg
+++ b/arkmanager-user.cfg
@@ -3,8 +3,6 @@
# comment out these values if you want to define them
# inside your GameUserSettings.ini file
serverMap=${SERVERMAP} # server map (default TheIsland)
-#serverMapModId="469987622" # Uncomment this to specify the Map Mod Id (<fileid> in http://steamcommunity.com/sharedfiles/filedetails/?id=<fileid>)
-#ark_TotalConversionMod="496735411" # Uncomment this to specify a total-conversion mod
ark_SessionName=${SESSIONNAME} # if your session name needs special characters please use the .ini instead
ark_ServerPassword=${SERVERPASSWORD} # ARK server password, empty: no password required to login
ark_ServerAdminPassword=${ADMINPASSWORD} # ARK server admin password, KEEP IT SAFE!
@@ -28,22 +26,10 @@ mod_branch=Windows
# ARK server options - i.e. for -optname=val, use arkopt_optname=val
#arkopt_StructureDestructionTag=DestroySwampSnowStructures
-#ark_AltSaveDirectoryName="SotF" # Uncomment to specify a different save directory name
# Update warning messages
# Modify as desired, putting the %d replacement operator where the number belongs
msgWarnUpdateMinutes="This ARK server will shutdown for an update in %d minutes"
msgWarnUpdateSeconds="This ARK server will shutdown for an update in %d seconds"
-msgWarnRestartMinutes="This ARK server will shutdown for a restart in %d minutes"
-msgWarnRestartSeconds="This ARK server will shutdown for a restart in %d seconds"
-msgWarnShutdownMinutes="This ARK server will shutdown in %d minutes"
-msgWarnShutdownSeconds="This ARK server will shutdown in %d seconds"
-
-# config environment
-arkwarnminutes="60" # number of minutes to warn players when using update --warn
arkBackupPreUpdate="false" # set this to true if you want to perform a backup before updating
-
-# Options to automatically remove old backups to keep backup size in check
-# Each compressed backup is generally about 1-2MB in size.
-arkMaxBackupSizeMB="500" # Set to automatically remove old backups when size exceeds this limit
-#arkMaxBackupSizeGB="2" # Uncomment this and comment the above to specify the limit in whole GB
+arkwarnminutes="30" # number of minutes to warn players when using update --warn
diff --git a/docker-compose.yml b/docker-compose.yml
deleted file mode 100644
index 71126e9..0000000
--- a/docker-compose.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-ark:
- container_name: ark
- image: turzam/ark
- environment:
- - SESSIONNAME=Ark Docker
- - SERVERMAP=TheIsland
- - SERVERPASSWORD=""
- - ADMINPASSWORD=adminpassword
- - BACKUPONSTART=1
- - UPDATEONSTART=1
- - TZ=Europe/Paris
- - GID=1000
- - UID=1000
- volumes:
- - /my/path/to/ark:/ark
- ports:
- - 7778:7778/udp
- - 7778:7778
- - 27015:27015/udp
- - 27015:27015
- - 32330:32330
diff --git a/instance.cfg b/instance.cfg
deleted file mode 100644
index 1585d84..0000000
--- a/instance.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-# Config root directory
-arkserverroot="/ark/server"
diff --git a/run.sh b/run.sh
index 80fff6b..fbe2fe6 100644
--- a/run.sh
+++ b/run.sh
@@ -1,27 +1,16 @@
#!/usr/bin/env bash
echo "###########################################################################"
echo "# Ark Server - " `date`
-echo "# UID $UID - GID $GID"
echo "###########################################################################"
[ -p /tmp/FIFO ] && rm /tmp/FIFO
mkfifo /tmp/FIFO
export TERM=linux
-function stop {
- if [ ${BACKUPONSTOP} -eq 1 ] && [ "$(ls -A server/ShooterGame/Saved/SavedArks)" ]; then
- echo "[Backup on stop]"
- arkmanager backup
- fi
- if [ ${WARNONSTOP} -eq 1 ];then
- arkmanager stop --warn
- else
- arkmanager stop
- fi
- exit
-}
-
-
+if [ ! -w /ark ]; then
+ echo "[Error] Can't access ark directory. Check permissions on your mapped directory with /ark"
+ exit 1
+fi
# Change working directory to /ark to allow relative path
cd /ark
@@ -35,29 +24,27 @@ cp /home/steam/crontab /ark/template/crontab
[ ! -f /ark/arkmanager.cfg ] && cp /home/steam/arkmanager.cfg /ark/arkmanager.cfg
[ ! -d /ark/log ] && mkdir /ark/log
[ ! -d /ark/backup ] && mkdir /ark/backup
-[ ! -d /ark/staging ] && mkdir /ark/staging
-[ ! -L /ark/Game.ini ] && ln -s server/ShooterGame/Saved/Config/LinuxServer/Game.ini Game.ini
-[ ! -L /ark/GameUserSettings.ini ] && ln -s server/ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini GameUserSettings.ini
-[ ! -f /ark/crontab ] && cp /ark/template/crontab /ark/crontab
+[ ! -f /ark/Game.ini ] && ln -s server/ShooterGame/Saved/Config/LinuxServer/Game.ini Game.ini
+[ ! -f /ark/GameUserSettings.ini ] && ln -s server/ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini GameUserSettings.ini
-if [ ! -d /ark/server ] || [ ! -f /ark/server/version.txt ];then
- echo "No game files found. Installing..."
- mkdir -p /ark/server/ShooterGame/Saved/SavedArks
- mkdir -p /ark/server/ShooterGame/Content/Mods
- mkdir -p /ark/server/ShooterGame/Binaries/Linux/
- touch /ark/server/ShooterGame/Binaries/Linux/ShooterGameServer
+if [ ! -d "/ark/server" ] || [ ! -f "/ark/server/arkversion" ];then
arkmanager install
# Create mod dir
+ mkdir /ark/server/ShooterGame/Content/Mods
else
- if [ ${BACKUPONSTART} -eq 1 ] && [ "$(ls -A server/ShooterGame/Saved/SavedArks/)" ]; then
+ if [ ${BACKUPONSTART} -eq 1 ]; then
echo "[Backup]"
arkmanager backup
fi
-fi
+ if [ ${UPDATEONSTART} -eq 1 ]; then
+ echo "[Update]"
+ arkmanager update --update-mods
+ fi
+fi
# If there is uncommented line in the file
CRONNUMBER=`grep -v "^#" /ark/crontab | wc -l`
@@ -72,17 +59,13 @@ else
fi
# Launching ark server
-if [ $UPDATEONSTART -eq 0 ]; then
- arkmanager start -noautoupdate
-else
- arkmanager start
-fi
+arkmanager start
# Stop server in case of signal INT or TERM
echo "Waiting..."
-trap stop INT
-trap stop TERM
+trap 'arkmanager stop;' INT
+trap 'arkmanager stop' TERM
read < /tmp/FIFO &
wait
diff --git a/user.sh b/user.sh
deleted file mode 100644
index a49bdfc..0000000
--- a/user.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-# Change the UID if needed
-if [ ! "$(id -u steam)" -eq "$UID" ]; then
- echo "Changing steam uid to $UID."
- usermod -o -u "$UID" steam ;
-fi
-# Change gid if needed
-if [ ! "$(id -g steam)" -eq "$GID" ]; then
- echo "Changing steam gid to $GID."
- groupmod -o -g "$GID" steam ;
-fi
-
-# Put steam owner of directories (if the uid changed, then it's needed)
-chown -R steam:steam /ark /home/steam
-
-# avoid error message when su -p (we need to read the /root/.bash_rc )
-chmod -R 777 /root/
-
-# Launch run.sh with user steam (-p allow to keep env variables)
-su -p - steam -c /home/steam/run.sh