Compare commits

...

5 Commits

Author SHA1 Message Date
e13bdd6e2a drone docker hub
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-30 12:12:06 +01:00
83ef311fec added sourcemod admin 2021-11-16 21:05:27 +01:00
248559cc4a update url env 2021-11-16 16:55:36 +01:00
4a3e7ad0c7 added insecure mode 2021-11-15 00:02:04 +01:00
19e1f366c8 added source/meta mod 2021-11-15 00:01:25 +01:00
5 changed files with 52 additions and 6 deletions

View File

@@ -5,5 +5,10 @@ steps:
- name: docker
image: plugins/docker
settings:
repo: docker.kapelle.org/l4d2
registry: docker.kapelle.org
repo: djeeberjr/l4d2-docker
username: djeeberjr
password:
from_secret: DOCKER_HUB_TOKEN
trigger:
branch:
- master

View File

@@ -3,4 +3,6 @@ RUN mkdir -p /home/steam/server
COPY start.sh /home/steam/start.sh
VOLUME "/home/steam/server"
WORKDIR /home/steam/
ENV METAMOD_DL_URL "https://mms.alliedmods.net/mmsdrop/1.11/mmsource-1.11.0-git1145-linux.tar.gz"
ENV SOURCEMOD_DL_URL "https://sm.alliedmods.net/smdrop/1.10/sourcemod-1.10.0-git6524-linux.tar.gz"
ENTRYPOINT /home/steam/start.sh

View File

@@ -1,4 +1,6 @@
Left 4 dead 2 server.
Left 4 dead 2 server. With Metamod and Sourcemod.
[Github](https://github.com/Djeeberjr/l4d2-docker)
# Ports
- 27015
@@ -15,3 +17,8 @@ So for example to set the RCON password set the enviroment variable `CVAR_RCON_P
Try to avoid variables with the word `CVAR_` and avoid `=` in it.
A list of available cvars can be found [here](https://developer.valvesoftware.com/wiki/List_of_L4D2_Cvars).
Add your steam ids to `SM_ADMIN` to be added as a sourcemod admin.
If there is a new version of Metamod or Sourcemod and is not yet set in the image you can manually set the download URL in `METAMOD_DL_URL` and `SOURCEMOD_DL_URL`.
It will only get update if the addon directory is empty.

View File

@@ -7,9 +7,11 @@ services:
- CVAR_HOSTNAME=My left 4 dead server
- CVAR_RCON_PASSWORD=password123
- CVAR_SV_ALLOW_LOBBY_CONNECT_ONLY=0
- CVAR_SV_CONSISTENCY=1
- CVAR_SV_CONSISTENCY=0
- CAVR_SV_VOICEENABLE=1
- CVAR_MP_DISABLE_AUTOKICK=1
- SM_ADMIN=STEAM_0:1:123,STEAM_0:1:456
- INSECURE=true
- "MOTD_FILE_CONTENT=Put your MODT here. \n
Multiline is also supported."
- "HOST_FILE_CONTENT=Same with the host file \n

View File

@@ -2,7 +2,30 @@
set -e
/home/steam/steamcmd/steamcmd.sh +login anonymous +force_install_dir "$HOME/server" +app_update 222860 validate +quit
/home/steam/steamcmd/steamcmd.sh +login anonymous +force_install_dir "$HOME/server" +app_update 222860 +quit
if [ ! -e "$HOME/server/left4dead2/addons/metamod.vdf" ]; then
echo "Installing Metamod"
curl "$METAMOD_DL_URL" -o /tmp/metamod.tar.gz
tar -xf /tmp/metamod.tar.gz -C "$HOME/server/left4dead2"
rm /tmp/metamod.tar.gz
echo "Install Sourcemod"
curl "$SOURCEMOD_DL_URL" -o /tmp/sourcemod.tar.gz
tar -xf /tmp/sourcemod.tar.gz -C "$HOME/server/left4dead2"
rm /tmp/sourcemod.tar.gz
fi
mkdir -p "$HOME/server/left4dead2/addons/sourcemod/configs/"
echo "// Autogenerated. DO NOT EDIT. Sourcemod admin can be added with the SM_ADMIN environment variable" \
> "$HOME/server/left4dead2/addons/sourcemod/configs/admins_simple.ini"
for id in $(echo "$SM_ADMIN" | sed 's/,/\n/g')
do
echo "\"$id\" \"99:z\"" >> "$HOME/server/left4dead2/addons/sourcemod/configs/admins_simple.ini"
done
echo -n "$MOTD_FILE_CONTENT" > "$HOME/server/left4dead2/motd.txt"
@@ -12,4 +35,11 @@ env | awk -F "=" '/^CVAR_/ {sub("CVAR_","",$1); print tolower($1),($2 ~ /^[0-9]+
cat /home/steam/server/left4dead2/cfg/server.cfg
"$HOME/server/srcds_run" -console -game left4dead2 +maxplayers 16 -maxclients 16 -ip 0.0.0.0
SRCDS_ARGS=""
if [ -n "$INSECURE" ]; then
SRCDS_ARGS="${SRCDS_ARGS} -insecure"
echo "Running with VAC disabled."
fi
"$HOME/server/srcds_run" -console -game left4dead2 +maxplayers 16 -maxclients 16 -ip 0.0.0.0 $SRCDS_ARGS