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 .idea
*.iml *.iml
.env .env*
node_modules/ node_modules/

View file

@ -2,11 +2,17 @@
set -eE set -eE
if [ -f /files/mods/${1}/map.env ] TERM="map"
if [[ ${1} =~ ^[0-9]+$ ]]
then 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 else
echo "map.env not found for mod id ${1}..." echo "map.env not found for ${TERM} ${1}..."
exit 1 exit 1
fi fi
@ -14,17 +20,18 @@ if [[ ${2} = "uninstall" ]]
then then
echo "Backing up, as uninstalling will remove the ${MAP} mpmissions directory" echo "Backing up, as uninstalling will remove the ${MAP} mpmissions directory"
dz backup dz backup
rm -rf ${SERVER_FILES}/mpmissions/${MPDIR} rm -rf "${SERVER_FILES}/mpmissions/${MPDIR}"
elif [[ ${2} = "update" ]] elif [[ ${2} = "update" ]] || [[ ${2} = "install" ]]
then then
cd /tmp cd /tmp
git clone ${REPO} 2> /dev/null 1> /dev/null if [ -d "${DIR}" ]
cp -a ${DIR}/${MPDIR} ${SERVER_FILES}/mpmissions then
rm -rf ${DIR} pushd "${DIR}" > /dev/null
elif [[ ${2} = "install" ]] git pull
then popd > /dev/null
cd /tmp else
git clone ${REPO} 2> /dev/null 1> /dev/null git clone "${REPO}"
cp -a ${DIR}/${MPDIR} ${SERVER_FILES}/mpmissions fi
rm -rf ${DIR} rm -rf "${SERVER_FILES}/mpmissions/${MPDIR}"
cp -a "${DIR}/${MPDIR}" "${SERVER_FILES}/mpmissions"
fi 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 \ RUN apt-get update && apt-get -y upgrade && apt-get -y install --no-install-recommends \
binutils \ binutils \
curl \ curl \
git \
gwenhywfar-tools \ gwenhywfar-tools \
jq \ jq \
libxml2-utils \ libxml2-utils \

View file

@ -56,7 +56,6 @@ installxml(){
do do
var=$(echo ${i} | cut -d: -f1) var=$(echo ${i} | cut -d: -f1)
CHECK=$(echo ${i} | cut -d: -f2) CHECK=$(echo ${i} | cut -d: -f2)
CHILD=$(echo ${i} | cut -d: -f3)
if [ -f "${WORKSHOP_DIR}/${ID}/${var,,}.xml" ] if [ -f "${WORKSHOP_DIR}/${ID}/${var,,}.xml" ]
then then
echo "Normalizing ${WORKSHOP_DIR}/${ID}/${var,,}.xml..." echo "Normalizing ${WORKSHOP_DIR}/${ID}/${var,,}.xml..."
@ -127,13 +126,14 @@ add(){
# Remove a mod # Remove a mod
remove(){ remove(){
if [ -d "${WORKSHOP_DIR}/${1}" ] DIR="${WORKSHOP_DIR}/${1:?}"
if [ -d "${DIR}" ]
then then
MODNAME=$(get_mod_name ${1}) MODNAME=$(get_mod_name ${1})
echo "Removing directory ${WORKSHOP_DIR}/${1}" echo "Removing directory ${DIR}"
rm -rf "${WORKSHOP_DIR}/${1}" rm -rf "${DIR}"
else else
echo "Directory ${WORKSHOP_DIR}/${1} doesn't exist?" echo "Directory ${DIR} doesn't exist?"
fi fi
if [ -L "${SERVER_FILES}/@${MODNAME}" ] if [ -L "${SERVER_FILES}/@${MODNAME}" ]
then then
@ -305,9 +305,14 @@ Mods: "
map(){ 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.) # 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 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 source ${FILES}/mods/${1}/map.env
${FILES}/bin/map.sh ${1} install ${FILES}/bin/map.sh ${1} install
fi fi