The official general gameserver repository for onFOSS events.
Go to file
DeathByDenim 2a0b338d01
Use headless Hypersomnia image and fix config
2024-03-06 21:16:06 -05:00
configs Fix SuperTuxKart deploy 2023-09-16 20:15:20 -04:00
scripts Use headless Hypersomnia image and fix config 2024-03-06 21:16:06 -05:00
services Add score recording to SuperTuxKart 2023-09-16 15:28:56 -04:00
website add updated events and games data 2024-02-16 09:34:57 +01:00
.gitignore Copy of gameserver with minimal website 2023-05-26 16:41:57 -04:00
LICENSE Initial commit 2023-05-25 12:51:55 +02:00
README.md Add "how to update games" into readme 2024-03-04 15:32:59 +01:00
Server Management.md Add reference doc for server commands 2024-02-17 17:19:35 -05:00
deploy.sh Add forwarding script to Tank of Freedom II 2024-02-11 14:23:51 -05:00
pack_web_offline.sh Match style to onfoss.org 2023-06-23 15:51:12 -04:00

README.md

Game server

This is a collection of scripts to deploy game servers on Debian 11 or 12. All game servers are wrapped in SystemD units and can be controlled by systemctl.

It also comes with a web front end which features the games hosted as well as their respective download link. It also displays server stats and has an admin panel for game servers that have interactive shells.

The following games are deployed:

  • Armagetron Advanced
  • Bzflag
  • Hedgewars
  • Hypersomnia
  • Lix
  • Mindustry
  • Minetest (Blockbomber and Capture the Flag mods)
  • Odamex
  • OpenHV
  • OpenSpades
  • OpenSoldat
  • Shattered Paradise
  • SuperTuxKart
  • Super Tux Party
  • Teeworlds (optionally as DDrace)
  • UFO: Alien Invasion
  • Unvanquished
  • Wasted
  • Xonotic (optionally as Battle Royale)

It is based on https://git.libregaming.org/c/onFOSS-LAN-Serverconfiguration

Installation

First, make sure your domain and www.domain is set up to the IP of the server, e.g. play.onfoss.org and www.play.onfoss.org if you want to use a domain and SSL.

Start with a clean Debian installation and prepare a root shell.

Update the server, install git and clone this repository:

apt update -y && apt upgrade -y
apt install --assume-yes git
cd /tmp/
git clone https://git.libregaming.org/onFOSS/Gameserver.git
cd Gameserver/

The main script is deploy.sh. You only need to give if your domain name and your own name.

DOMAINNAME=play.onfoss.org HOSTEDBYNAME=onFOSS ./deploy.sh

This will download all the game servers, install them, configure them, and start them up. It should take less than an hour for all game servers to be up and running. You can also run the deploy script with nohup as a background task and pipe output to a logfile.

If you don't have a domainname, just use the IP address.

It also retrieves a certificate for Let's Encrypt for the web interface. If you don't want the certificate, you can also specify NOSSL=1. This will also convert all internal links to http, meaning that if you add a certificate later things will break due to modern browser not allowing mixed http/https content.

There is also support for generating just the website without the game server which is useful if you want to host the website somewhere else while your main server is down.

DOMAINNAME=play.onfoss.org HOSTEDBYNAME=onFOSS ./pack_web_offline.sh

The webpage will display "OFFLINE" and not attempt to show the server stats.

The password for the admin panel as well as for game servers that support admin password is stored in /etc/gameserverpassword. The username for the admin panel is just onfoss.

Conflicting games

Wasted is a mod of SuperTuxKart and use much of the same infrastructure, including the ports. Only one can run at the same time, but they are implemented as conflicting SystemD units so if you start one, it will automatically stop the other first. SuperTuxKart is the default. If you want Wasted instead, start it using

systemctl start wasted

Xonotic and Xonotic Battle Royale also have conflicting SystemD units. By default, it will run plain Xonotic, but if you want the Battle Royale version, run

systemctl start xonotic-br

Minetest has two mods, but only one can run at the same time. The default is Blockbomber. To change to Capture the flag, edit /etc/systemd/system/minetest.service and change blockbomber to capturetheflag. Then delete ~onfoss/.minetest/worlds. Then:

systemctl daemon-reload
systemctl restart minetest

Website

The website is generated using Jekyll which uses a _config.yml that is generated by the deploy script. You can apply your own custom colour palette by adding a new theme in website/_sass. Name your new theme as HOSTEDBYNAME.scss and then edit website/assets/css/main.scss to add your theme to the available_themes.

Additionally, there is a YAML file called events.yml in the _data directory where events are stored. The formatting is:

- date: 2022-12-17T14:00:00UTC
  intro: "onFOSS-LAN hosted by DeathByDenim"
  games:
    - time: "14:00"
      title: "Get together"
    - time: "14:30"
      title: "Doom (ODAMEX) XMAS mod"
    - time: "15:15"
      title: "Teeworlds"
      tournament: true
    - time: "16:00"
      title: "OpenSpades"
    - time: "17:00"
      title: "Break"
    - time: "18:00"
      title: "Lix"
    - time: "18:30"
      title: "Free Play!"
      extras: ["Shattered Paradise"]

Each game must have a title and it optionally can have a time as well. The optional field extras lists games that were played as part of a bigger category, in this example the free play section.

Finally, you can also specify tournament which will make this game appear in the tournament page.

How to update games

The general problem: we only really support updated game server on a clean install, not like updating after everything is installed. There are other tools like LinuxGSM that are better suited for 24/7 servers!

Not every game is the same to update, most games download or build the "latest" version, so there is no need to do anything if a game doesn't do a breaking change.

Xonotic, for example, is as simple as change the version number in the main deploy.sh scrip, there you can also see what games use "latest" or manual version. Otherwise, look into the specific script of the game.

Repository

The main version of this git repository is on git.libregaming.org. There is a mirror on Github