Mods working, HTTP addon server working

This commit is contained in:
James Plante 2025-02-15 13:16:24 -05:00
parent 5fb7c08135
commit 615674d5b6
9 changed files with 70 additions and 8 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
# Ignore all assets in data folder except for template, etc.
data/*
!data/_placeholder
!data/ringserv-template.cfg
!data/addons/_placeholder

View File

@ -1,4 +1,6 @@
FROM alpine:3 FROM alpine:3.21
ARG RR_VERSION
# Install Essential Utilities # Install Essential Utilities
RUN apk update RUN apk update
@ -25,8 +27,12 @@ RUN ./build.sh
# After building # After building
WORKDIR /home/ringracers WORKDIR /home/ringracers
COPY --chown=ringracers:ringracers run_server.sh .
RUN chmod +x run_server.sh
COPY --chown=ringracers:ringracers ringserv-template.cfg ./server
# Set up environment variables # Set up environment variables
ENV RINGRACERSWADDIR=/data/ringracers-data ENV RINGRACERSWADDIR=/data/ringracers-data
ENV RR_VERSION=${RR_VERSION}
ENTRYPOINT [ "server/ringracers_v2.3", "-dedicated" ] ENTRYPOINT [ "./run_server.sh" ]

View File

@ -1,13 +1,12 @@
#! /bin/bash #! /bin/bash
RR_VERSION=2,3
BUILDDIR=/buildfiles/RingRacers BUILDDIR=/buildfiles/RingRacers
OUTDIR=/home/ringracers/server OUTDIR=/home/ringracers/server
cd $BUILDDIR cd $BUILDDIR
git fetch --tags git fetch --tags
git switch --detach tags/v2.3 git switch --detach tags/$RR_VERSION
cmake --preset ninja-release cmake --preset ninja-release
cmake --build --preset ninja-release cmake --build --preset ninja-release
[[ -d $OUTDIR ]] || mkdir $OUTDIR [[ -d $OUTDIR ]] || mkdir $OUTDIR
cp build/ninja-release/bin/ringracers_v2.3 $OUTDIR cp build/ninja-release/bin/ringracers_$RR_VERSION $OUTDIR

View File

@ -1,10 +1,23 @@
version: '3'
services: services:
ringracers: main-server:
tty: true
stdin_open: true
restart: unless-stopped
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
args:
- RR_VERSION=v2.3
ports: ports:
- 5029:5029/udp - 5029:5029/udp
volumes: volumes:
- ./data:/data/ringracers-data - ./data:/data/ringracers-data
addons-server:
restart: unless-stopped
build:
context: nginx
dockerfile: Dockerfile
ports:
- 8080:80/tcp
volumes:
- ./data/addons:/data:ro

1
data/addons/_placeholder Normal file
View File

@ -0,0 +1 @@
Put all of the mods here

3
nginx/Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM nginx:1.27-alpine
EXPOSE 80
COPY nginx.conf /etc/nginx/nginx.conf

12
nginx/nginx.conf Normal file
View File

@ -0,0 +1,12 @@
events {}
http {
server {
listen 80;
location / {
root /data;
autoindex on;
}
}
}

11
ringserv-template.cfg Normal file
View File

@ -0,0 +1,11 @@
servername "My Cool Server"
server_contact "<your_discord_username>"
password "<some random characters>"
http_source "http://<your-public-ip>:8080/"
maxplayers MAX
maxconnections MAX
bots MAX
gamespeed 0
randommap

11
run_server.sh Normal file
View File

@ -0,0 +1,11 @@
#! /bin/bash
RR_DOTFILES=/home/ringracers/.ringracers
SERVER_DIR=/home/ringracers/server
# Create new config from template and add the nginx server
[[ -d $RR_DOTFILES ]] || mkdir $RR_DOTFILES
cp $SERVER_DIR/ringserv-template.cfg $RR_DOTFILES/ringserv.cfg
# Load addons and start the game
find $RINGRACERSWADDIR/addons \( -name "*.pk3" -o -name "*.wad" -o -name "*.zip" \) \
| xargs $SERVER_DIR/ringracers_${RR_VERSION} -dedicated -file