Change the default maps to always come from github. One used to be able to install the server using the anonymous steam user, but now the mpmissions aren't included if the anonymous user is used.

Handle multiple env files for now while we transition server orchestration entirely to the web container.
Add MuchStuffPack mod integration.
Add git to the web container so we can checkout server resources from github as git. Allows us to just pull on git to keep up to date.
This commit is contained in:
Daniel Ceregatti 2024-06-19 16:59:33 -07:00
parent a905435bfc
commit 2f1509fb65
7 changed files with 43 additions and 22 deletions

2
.gitignore vendored
View file

@ -1,4 +1,4 @@
.idea
*.iml
.env
.env*
node_modules/

View file

@ -2,11 +2,17 @@
set -eE
if [ -f /files/mods/${1}/map.env ]
TERM="map"
if [[ ${1} =~ ^[0-9]+$ ]]
then
source /files/mods/${1}/map.env
TERM="mod id"
fi
if [ -f "/files/mods/${1}/map.env" ]
then
source "/files/mods/${1}/map.env"
else
echo "map.env not found for mod id ${1}..."
echo "map.env not found for ${TERM} ${1}..."
exit 1
fi
@ -14,17 +20,18 @@ if [[ ${2} = "uninstall" ]]
then
echo "Backing up, as uninstalling will remove the ${MAP} mpmissions directory"
dz backup
rm -rf ${SERVER_FILES}/mpmissions/${MPDIR}
elif [[ ${2} = "update" ]]
rm -rf "${SERVER_FILES}/mpmissions/${MPDIR}"
elif [[ ${2} = "update" ]] || [[ ${2} = "install" ]]
then
cd /tmp
git clone ${REPO} 2> /dev/null 1> /dev/null
cp -a ${DIR}/${MPDIR} ${SERVER_FILES}/mpmissions
rm -rf ${DIR}
elif [[ ${2} = "install" ]]
then
cd /tmp
git clone ${REPO} 2> /dev/null 1> /dev/null
cp -a ${DIR}/${MPDIR} ${SERVER_FILES}/mpmissions
rm -rf ${DIR}
if [ -d "${DIR}" ]
then
pushd "${DIR}" > /dev/null
git pull
popd > /dev/null
else
git clone "${REPO}"
fi
rm -rf "${SERVER_FILES}/mpmissions/${MPDIR}"
cp -a "${DIR}/${MPDIR}" "${SERVER_FILES}/mpmissions"
fi

View file

@ -0,0 +1 @@
TYPES=./extras/msp_types.xml

1
files/mods/@MuchStuffPack Symbolic link
View file

@ -0,0 +1 @@
1991570984

6
files/mods/enoch/map.env Normal file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
MAP="Enoch"
DIR="DayZ-Central-Economy"
REPO="https://github.com/BohemiaInteractive/${DIR}.git"
MPDIR="dayzOffline.enoch"

View file

@ -16,6 +16,7 @@ RUN sed -i /etc/apt/sources.list.d/debian.sources -e 's/Components: main/Compone
RUN apt-get update && apt-get -y upgrade && apt-get -y install --no-install-recommends \
binutils \
curl \
git \
gwenhywfar-tools \
jq \
libxml2-utils \

View file

@ -56,7 +56,6 @@ installxml(){
do
var=$(echo ${i} | cut -d: -f1)
CHECK=$(echo ${i} | cut -d: -f2)
CHILD=$(echo ${i} | cut -d: -f3)
if [ -f "${WORKSHOP_DIR}/${ID}/${var,,}.xml" ]
then
echo "Normalizing ${WORKSHOP_DIR}/${ID}/${var,,}.xml..."
@ -127,13 +126,14 @@ add(){
# Remove a mod
remove(){
if [ -d "${WORKSHOP_DIR}/${1}" ]
DIR="${WORKSHOP_DIR}/${1:?}"
if [ -d "${DIR}" ]
then
MODNAME=$(get_mod_name ${1})
echo "Removing directory ${WORKSHOP_DIR}/${1}"
rm -rf "${WORKSHOP_DIR}/${1}"
echo "Removing directory ${DIR}"
rm -rf "${DIR}"
else
echo "Directory ${WORKSHOP_DIR}/${1} doesn't exist?"
echo "Directory ${DIR} doesn't exist?"
fi
if [ -L "${SERVER_FILES}/@${MODNAME}" ]
then
@ -305,9 +305,14 @@ Mods: "
map(){
# Install map mpmissions for mods that have them. Presumes a map.env was created for the mod, with the required metadata (git URL, etc.)
if [ -f ${FILES}/mods/${1}/map.env ]
TERM="map"
if [[ "${1}" =~ ^[0-9]+$ ]]
then
echo "Installing mpmissions files for mod id ${1}..."
TERM="mod id"
fi
if [ -f "${FILES}/mods/${1}/map.env" ]
then
echo "Installing mpmissions files for ${TERM} ${1}..."
source ${FILES}/mods/${1}/map.env
${FILES}/bin/map.sh ${1} install
fi