Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add various servers and rework caching solution #25

Open
wants to merge 71 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
1733723
Fixed OpenTTD so that it builds
matthewh86 Aug 21, 2018
03b75ad
Functional OpenTTD configuration
matthewh86 Aug 21, 2018
bfd569a
Minor space formatting
matthewh86 Aug 21, 2018
98e257b
Add Left4Dead2 metamod
matthewh86 Aug 22, 2018
179e0be
Add Insurgency
matthewh86 Aug 22, 2018
f8ddd43
Add readme
matthewh86 Aug 22, 2018
b31559f
Add GunGame and Hide+Seek
matthewh86 Aug 23, 2018
8e23c20
Add ABM
matthewh86 Aug 25, 2018
5f37157
Change FULL_ADMINS variable (doesn't seem to work)
matthewh86 Aug 25, 2018
35b69cf
Add L4DToolZ and mission changer plugins
matthewh86 Aug 27, 2018
43aad58
Rename l4d2-abm to l4d2-moreslots
matthewh86 Aug 27, 2018
ce409a0
Removed environment/config variables which did not work
matthewh86 Aug 27, 2018
64a2052
Add TICKRATE and update readme with build notes
matthewh86 Aug 27, 2018
f5d6c67
Standardised the css directory contents
matthewh86 Aug 27, 2018
b8fef32
Renamed start scripts
matthewh86 Aug 27, 2018
cd9be2f
Download Trackmania as part of Docker build
matthewh86 Aug 21, 2018
eab7324
Added extra environment variables for configuration
matthewh86 Aug 27, 2018
4b49366
use /openttd as path and set default passwords
matthewh86 Apr 15, 2019
8e9e7fc
Merge remote-tracking branch 'origin/master' into fix-openttd
matthewh86 Apr 15, 2019
f6a5992
Merge pull request #1 from noxtech/fix-openttd
matthewh86 Apr 15, 2019
d5e0971
Merge remote-tracking branch 'origin/master' into fix-trackmania
matthewh86 Apr 15, 2019
0168f3d
Merge pull request #2 from noxtech/fix-trackmania
matthewh86 Apr 15, 2019
2243e2c
Merge remote-tracking branch 'origin/master' into l4d2-metamod
matthewh86 Apr 15, 2019
5ee7490
Merge pull request #3 from noxtech/l4d2-metamod
matthewh86 Apr 15, 2019
c5cda91
Merge remote-tracking branch 'origin/master' into css-hideandseek-gun…
matthewh86 Apr 15, 2019
b17944e
Merge pull request #4 from noxtech/css-hideandseek-gungame
matthewh86 Apr 15, 2019
c5aad24
Merge remote-tracking branch 'origin/master' into add-insurgency
matthewh86 Apr 15, 2019
8f33a65
Merge pull request #5 from noxtech/add-insurgency
matthewh86 Apr 15, 2019
41fd8d0
Merge remote-tracking branch 'origin/master' into l4d2-moreslots
matthewh86 Apr 15, 2019
fc376d5
Merge pull request #6 from noxtech/l4d2-moreslots
matthewh86 Apr 15, 2019
27634c4
Merge remote-tracking branch 'osl/master'
matthewh86 Apr 15, 2019
03ea8a8
Merge remote-tracking branch 'origin/master' into merge-osl
matthewh86 Apr 15, 2019
857f7b0
Merge pull request #7 from noxtech/merge-osl
matthewh86 Apr 15, 2019
38ba50f
remove utility files from CSGO
matthewh86 Apr 15, 2019
b4206a8
update openttd
matthewh86 Apr 16, 2019
7510983
remove common scripts
matthewh86 Apr 16, 2019
c9ef5fd
remove build scripts
matthewh86 Apr 16, 2019
af0a42c
update source readmes with LAN troubleshooting
matthewh86 Apr 16, 2019
85679a2
update l4d2 and steamcmd
matthewh86 Apr 16, 2019
ed7d166
update csgo
matthewh86 Apr 16, 2019
a775d6c
add SCPSL and new caching build script
matthewh86 Aug 22, 2021
64a405f
Merge remote-tracking branch 'osl/master'
matthewh86 Aug 25, 2021
7d98f4e
update csgo and remove build.sh files
matthewh86 Aug 25, 2021
f803030
SCP Secret Laboratory
matthewh86 Aug 22, 2022
9bc3919
l4d2 multislot
matthewh86 Aug 26, 2022
94a98f9
Update SCP EXILED and plugins
matthewh86 Jul 26, 2024
2f5354f
set noninteractive for base
matthewh86 Aug 5, 2024
5931eaf
fix l4d2 and multislot after mod updates
matthewh86 Aug 5, 2024
94fef7d
conform tf2 to new pattern, add metamod and mvm
matthewh86 Aug 5, 2024
d2016be
update scpsl-exiled plugins
matthewh86 Aug 5, 2024
beee73c
conform insurgency to new pattern
matthewh86 Aug 5, 2024
1acdcd3
conform css to new pattern, metamod and gungame
matthewh86 Aug 5, 2024
082f6ad
add EulaAccepted config file
matthewh86 Aug 8, 2024
34e3049
use DOCKER_BUILDKIT
matthewh86 Aug 8, 2024
79fc6eb
tidy up l4d2 filenames
matthewh86 Aug 8, 2024
2b936b9
base and steamcmd minor refactor
matthewh86 Aug 14, 2024
6c988cb
update l4d2
matthewh86 Aug 14, 2024
6bdaf3e
update css
matthewh86 Aug 14, 2024
dfabfca
add cleanup script
matthewh86 Aug 14, 2024
8df3112
update insurgency
matthewh86 Aug 14, 2024
0f90466
update hl2dm
matthewh86 Aug 14, 2024
962a348
move old build servers into legacy folder
matthewh86 Aug 14, 2024
2fadbb3
add wip to wips
matthewh86 Aug 14, 2024
969d15b
refactor base, steamcmd, and update l4d2
matthewh86 Aug 29, 2024
38de9c6
remove legacy .cache-info remnants
matthewh86 Aug 29, 2024
7113fcd
l4d2 start.sh fix
matthewh86 Aug 30, 2024
d393a10
css updates
matthewh86 Aug 30, 2024
8ca9873
move DOCKER_BUILDKIT from docker build
matthewh86 Aug 30, 2024
dc5c445
use COPY instead of ADD
matthewh86 Aug 30, 2024
04792b3
css and gungame improvements
matthewh86 Aug 30, 2024
7e92a5b
rework css configuration and add deathmatch
matthewh86 Sep 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ gamedata/
/data
wads/
RemoteControlExamples/

.cache/

server_files/
.cache
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# gameservers-docker

Putting game servers in Docker containers. Because it makes life easier.

Expand All @@ -8,25 +9,29 @@ or sourcemod for srcds), making it almost one command to install a server.
No binaries are stored in this repo, so make sure you have internet to
download them with.

Includes a utility script `start_server.sh` which mounts save data to an
external volume and sorts out networking for you.
Includes utility scripts:

- `start_server.sh` - mounts save data to an external volume and sorts out networking for you
- `docker_build.sh` - builds the specified list of containers. e.g. `docker_build.sh css,css-metamod,tf2`

## Quick start

Assuming you are on a blank server with Git and docker installed:

```
git clone https://github.com/OpenSourceLAN/gameservers-docker.git .
./build.sh factorio
```
Check the game directory for existing templates and make your configurations before building.
```
./docker_build.sh factorio

./start_server.sh factorio
# Or
docker run -it --net=host -e "SERVER_NAME=Some really cool server"\
-v `pwd`/save:`cat factorio/mounts` --name factorio factorio

```

Most servers have environment variables that can be used to configure them.
Most servers have environment variables that can be used to configure them after building them.
Read the README.md file in each directory to see what is available.

## Tutorial
Expand Down
7 changes: 4 additions & 3 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM ubuntu:16.04
ARG DISTRO="focal"

FROM ubuntu:${DISTRO}

ARG TZ="Etc/UTC"
RUN sed -i 's/archive.ubuntu.com/au.archive.ubuntu.com/' /etc/apt/sources.list
RUN apt-get update && apt-get dist-upgrade -y &&\
apt-get install -y unzip p7zip-full curl wget lib32gcc1 iproute2 vim-tiny bzip2 jq software-properties-common apt-transport-https lib32stdc++6 && \
apt-get clean
RUN echo "$TZ" > /etc/timezone
RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime

# add to base install:
5 changes: 0 additions & 5 deletions base/build.sh

This file was deleted.

7 changes: 0 additions & 7 deletions build.sh

This file was deleted.

37 changes: 0 additions & 37 deletions common.sh

This file was deleted.

4 changes: 2 additions & 2 deletions csgo-gg/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM csgo:latest
WORKDIR /steam/csgo
ADD start-gg.sh /steam/csgo/
ADD start.sh /steam/csgo/
ADD gamemode_armsrace.cfg /steam/csgo/csgo/cfg/

CMD ["./start-gg.sh"]
CMD ["./start.sh"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like most of the dockerfiles you've touched have been standardised on using entrypoint rather than cmd... seems reasonable to make them all entrypoint

3 changes: 0 additions & 3 deletions csgo-gg/build.sh

This file was deleted.

File renamed without changes.
19 changes: 19 additions & 0 deletions csgo-metamod/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM csgo

WORKDIR /steam/csgo/
USER steam
ADD download.sh .
RUN ./download.sh

RUN tar -xf mm*.tar.gz -C csgo/ && \
tar -xf sourcemod*.tar.gz -C csgo/ && \
mv csgo/addons/sourcemod/plugins/disabled/mapchooser.smx csgo/addons/sourcemod/plugins/mapchooser.smx && \
mv csgo/addons/sourcemod/plugins/disabled/nominations.smx csgo/addons/sourcemod/plugins/nominations.smx && \
mv csgo/addons/sourcemod/plugins/disabled/randomcycle.smx csgo/addons/sourcemod/plugins/randomcycle.smx && \
mv csgo/addons/sourcemod/plugins/disabled/rockthevote.smx csgo/addons/sourcemod/plugins/rockthevote.smx

ADD metamod.vdf csgo/

ADD start.sh .

ENTRYPOINT [ "./start.sh" ]
8 changes: 8 additions & 0 deletions csgo-metamod/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# CSGO (with MetaMod)

This has sourcemod and metamod installed, with the following additional plugins enabled by default:

* mapchooser
* nominations
* randomcycle
* rockthevote
17 changes: 17 additions & 0 deletions csgo-metamod/download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

MMVERSION=$( curl https://www.sourcemm.net/downloads.php/?branch=stable | grep -o "mmsource-[0-9\.]*-git[0-9]\+-linux.tar.gz" | head -n 1 )

MMMAJORVERSION=$(echo $MMVERSION | cut -d '-' -f 2 | cut -d '.' -f 1,2 )

curl -o $MMVERSION https://mms.alliedmods.net/mmsdrop/$MMMAJORVERSION/$MMVERSION

SMVERSION=$( curl http://www.sourcemod.net/downloads.php?branch=stable | grep -Eo "sourcemod-.*?-linux.tar.gz" | head -n 1 )

SMMAJORVERSION=$( echo $SMVERSION | grep -Eo "\-[0-9]*\.[0-9]*" | grep -Eo "[0-9]*\.[0-9]*")

echo $SMVERSION
echo $SMMAJORVERSION

SMURL="http://www.sourcemod.net/smdrop/$SMMAJORVERSION/$SMVERSION"
curl -o $SMVERSION $SMURL
File renamed without changes.
6 changes: 6 additions & 0 deletions csgo-metamod/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

echo "$FULL_ADMINS" "@Full Admins" > css/addons/sourcemod/configs/admins_simple.ini

./configure.sh
./launch.sh
1 change: 1 addition & 0 deletions csgo/.cache-info
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/steam/csgo
7 changes: 7 additions & 0 deletions csgo/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/config-templates
Dockerfile
README.md
.cache-info
.dockerignore
.env
.gitignore
1 change: 1 addition & 0 deletions csgo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
server.cfg
27 changes: 20 additions & 7 deletions csgo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
FROM steamcmd

# Dear srcds, plz don't crash. We have brought you these offerings.
USER root
RUN dpkg --add-architecture i386; apt-get update; apt-get install -y libstdc++6:i386 libcurl4-gnutls-dev:i386

ENV GAME=csgo
ENV APP_ID=740

USER steam
WORKDIR /steam/steamcmd_linux
RUN mkdir -p /steam/csgo
RUN mkdir -p /steam/${GAME}/.cache/ \
&& touch /steam/${GAME}/.cache/empty
WORKDIR /steam/${GAME}/
COPY .cache .

RUN chown -R steam /steam/${GAME}/ \
&& mv .cache/* . \
&& rm -fr .cache

RUN ./steamcmd.sh +login anonymous +force_install_dir ../csgo +app_update 740 +quit
COPY server.cfg \
configure.sh \
launch.sh \
start.sh \
./

ADD start.sh /steam/csgo/
USER steam

WORKDIR /steam/csgo
RUN /steam/steamcmd_linux/steamcmd.sh +login anonymous +force_install_dir ../${GAME} +app_update ${APP_ID} +quit

CMD ["./start.sh"]
ENTRYPOINT ["./start.sh"]
8 changes: 6 additions & 2 deletions csgo/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CSGO

Base CSGO start script which supports these environmetn variables:
Copy and rename server.template.cfg into csgo to set additional config to build.

# Environment variables

The following configuration is available via setting environment variables

* `SV_HOSTNAME` - sets the `hostname` of the server
* `SERVER_TOKEN` - GSLT
Expand All @@ -11,4 +16,3 @@ Base CSGO start script which supports these environmetn variables:
* `RCON_PASSWORD` - rcon password
* `OTHER_ARGS` - other arguments to pass to command line
* `SOURCETV_ADDR` - make this server be a source TV relay and join the server specified

3 changes: 0 additions & 3 deletions csgo/build.sh

This file was deleted.

126 changes: 126 additions & 0 deletions csgo/config-templates/server.template.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
log on //This is set to turn on logging!
sv_region "255" //The region of the world to report this server in.
sv_tags "" //Server tags. Used to provide extra information to clients when they're browsing for servers
//
//
// The Bot Convars
bot_difficulty 1 //Defines the skill of bots joining the game. Values are: 0=easy, 1=normal, 2=hard, 3=expert.
bot_chatter "off" //Control how bots talk. Allowed values: 'off', 'radio', 'minimal', or 'normal
bot_join_after_player 1 //If nonzero, bots wait until a player joins before entering the game.
bot_quota 10 //Determines the total number of bots in the game.
bot_quota_mode "fill" //Determines the type of quota. Allowed values: 'normal', 'fill', and 'match
//
// Server Convars
sv_pausable "0" //Is the server pausable.
sv_allow_lobby_connect_only "0" //If set, players may only join this server from matchmaking lobby, may not connect directly.
sv_allow_votes "1" //Allow voting?
sv_allow_wait_command "1" //Allow or disallow the wait command on clients connected to this server.
sv_alltalk "1" //Players can hear all other players' voice communication, no team restrictions
sv_alternateticks "0" //If set, server only simulates entities on even numbered ticks.
sv_cheats "0" //Allow cheats on server
sv_deadtalk "0" //Dead players can speak (voice, text) to the living
sv_downloadurl"0" //Location from which clients can download missing files
sv_forcepreload "0" //Force server side preloading
sv_friction "4" //World friction."
sv_full_alltalk "1" //Any player (including Spectator team) can speak to any other player
sv_infinite_ammo "0" //Player's active weapon will never run out of ammo
//
// Server Logging
sv_log_onefile "0" //Log server information to only one file.
sv_logbans "0" //Log server bans in the server logs.
sv_logecho "1" //Echo log information to the console.
sv_logfile "1" //Log server information in the log file.
sv_logflush "0" //Flush the log file to disk on each write (slow).
sv_logsdir "0" //Folder in the game directory where server logs will be stored.
//
// Server Downloads
//sv_downloadurl "0" //Location from which clients can download missing files
sv_allowdownload 1
sv_allowupload 1
net_maxfilesize 100
//
// Pure Options
//sv_pure_kick_clients "1" //If set to 1, the server will kick clients with mismatching files.
//sv_pure_trace "0" //If set to 1, the server will print a message whenever a client is verifying a CRC for a file.
//
// Round Convars
mp_match_end_restart "0" //Restart the map at the end of round limit
mp_afterroundmoney "0" //Amount of money awarded to every player after each round
mp_playercashawards "1" //Players can earn money by performing in-game actions
mp_teamcashawards "1" //Teams can earn money by performing in-game actions
mp_maxrounds "30" //Maximum amount of rounds per map
mp_timelimit "0" //How many minutes for the whole map
mp_roundtime "2" //How many minutes each round takes.
mp_freezetime"5" //how many seconds to keep players frozen when the round starts
mp_buytime "45" //How many seconds after round start players can buy items for.
mp_forcecamera "1" //Set to 1 for team only spectating.
mp_defuser_allocation "2" //How to allocate defusers to CTs at start or round: 0=none, 1=random, 2=everyone
mp_death_drop_defuser "1" //Drop defuser on player death
mp_death_drop_grenade "2" //Which grenade to drop on player death: 0=none, 1=best, 2=current or best
mp_death_drop_gun "1" //Which gun to drop on player death: 0=none, 1=best, 2=current or best
//
// Friendly Fire
mp_friendlyfire "1" //Enable Friendly Fire 1 =Enable 0 =Disable
//ff_damage_reduction_grenade "0" //How much to reduce damage done to teammates by a thrown grenade.
//ff_damage_reduction_bullets "0" //How much to reduce damage done to teammates when shot.
//ff_damage_reduction_other "0" //How much to reduce damage done to teammates by things other than bullets and grenades.
//
// Game Convars
mp_autokick "1" //Kick idle/team-killing players
mp_autoteambalance "1" //Auto balances teams
mp_buytime "45" //How many seconds after round start players can buy items for.
mp_c4timer "45" //how long from when the C4 is armed until it blows
mp_do_warmup_period "1" //Whether or not to do a warmup period at the start of a match.
mp_force_pick_time "15" //The amount of time a player has on the team screen to make a selection before being auto-teamed
mp_halftime_duration "15" //Number of seconds that halftime lasts
mp_join_grace_time "15 //Number of seconds after round start to allow a player to join a game
mp_limitteams "2" //Max # of players 1 team can have over another (0 disables check)
mp_match_end_restart "1" //At the end of the match, perform a restart instead of loading a new map
mp_maxrounds "30" //Max amount of rounds per map
mp_playercashawards "1" //Players can earn money by performing in-game actions
mp_playerid "0" //Controls what information player see in the status bar: 0 all names; 1 team names; 2 no names
mp_playerid_delay "0" //Number of seconds to delay showing information in the status bar
mp_playerid_hold "0" //Number of seconds to keep showing old information in the status bar
mp_restartgame "0" //If non-zero, game will restart in the specified number of seconds
mp_round_restart_delay "7" //Number of seconds to delay before restarting a round after a win
mp_roundtime "3" //How many minutes each round takes.
mp_tkpunish "0" //Will a TK'er be punished in the next round? {0=no, 1=yes}
mp_warmuptime "25" //If true, there will be a warmup period/round at the start of each match to allow to connect.
mp_win_panel_display_time "5" //The amount of time to show the win panel between matches / halfs
//
// Cash Convars
mp_startmoney "400" //Amount of money each player gets when they reset.
mp_maxmoney "12000" //Maximum amount of money allowed in a player's account.
cash_team_terrorist_win_bomb "2200" //How much the team will win for the bomb.
cash_team_elimination_hostage_map "2200" //How much a player earns when they eliminate all hostages.
cash_team_elimination_bomb_map "2200" //How much the team will win when the bomb is eliminated.
cash_team_win_by_time_running_out "2200" //How much the team will win when the time runs out.
cash_team_win_by_defusing_bomb "2200" //How much the team will win when bomb has been defused.
cash_team_win_by_hostage_rescue "2200" //How much the team will win when all hostages have been rescued.
cash_team_loser_bonus "2000" //How much the team will win when when the team looses.
cash_team_loser_bonus_consecutive_rounds "500" //How much the team will win when the team looses consecutive rounds.
cash_team_rescued_hostage "100" //How much the team will win when team has recued a hostage.
cash_team_hostage_alive "0" //How much the team will win when a hostage is still alive
cash_team_planted_bomb_but_defused "200" //How much the team will win when when a team has planted a bomb and been defused
cash_team_hostage_interaction "50" //How much the team will win when hostages are saved
cash_player_killed_teammate "-3300" //How much the player will loose when a teammate has been team killed
cash_player_killed_enemy_default "200" //How much the player will win when killing an enemy
cash_player_killed_enemy_factor "0.5" //How much the player will win when killing an enemy
cash_player_bomb_planted "200" //How much the player will win when the bomb has been planted.
cash_player_bomb_defused "200" //How much the player will win when the bomb has been defused
cash_player_rescued_hostage "200" //How much the player will win when rescuing hostages
cash_player_interact_with_hostage "0" //How much the player will win when interacting with hostages
cash_player_damage_hostage "-30" //How much the player will loose when damaging a hostage
cash_player_killed_hostage "-1000" //How much the player will loose when a hostage has been killed
//
// Voting Options
sv_vote_allow_spectators "0" //Allow spectators to vote?
sv_vote_command_delay "2" //How long after a vote passes until the action happens
sv_vote_creation_time "120" //How often someone can individually call a vote.
sv_vote_failure_timer "300" //A vote that fails cannot be re-submitted for this long
sv_vote_quorum_ratio "0" //The minimum ratio of players needed to vote on an issue to resolve it.
sv_vote_timer_duration "15" //How long to allow voting on an issue
//
// TV Options
//tv_nochat "0" //Don't receive chat messages from other SourceTV spectators
//tv_port "check" //Host SourceTV port
Loading