Compare commits

..

3 Commits

10 changed files with 45 additions and 22 deletions

View File

@ -15,7 +15,7 @@ The following games are deployed:
* Mindustry * Mindustry
* OpenHV * OpenHV
* OpenSpades * OpenSpades
* Soldat * OpenSoldat
* SuperTuxKart * SuperTuxKart
* Super Tux Party * Super Tux Party
* Teeworlds (optionally as DDrace) * Teeworlds (optionally as DDrace)
@ -28,9 +28,11 @@ It is based on https://git.libregaming.org/c/onFOSS-LAN-Serverconfiguration
The main script is `deploy.sh`. You only need to give if your domain name and your own name. The main script is `deploy.sh`. You only need to give if your domain name and your own name.
``` ```
DOMAINNAME=play.jarno.ca HOSTEDBYNAME=DeathByDenim ./deploy.sh DOMAINNAME=play.jarno.ca HOSTEDBYNAME=DeathByDenim ./deploy.sh
``` ```
This will download all the game servers, install them, configure them, and start them up. 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 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.
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`.
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. 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.
``` ```
@ -39,3 +41,7 @@ DOMAINNAME=play.jarno.ca HOSTEDBYNAME=DeathByDenim ./pack_web_offline.sh
The webpage will display "OFFLINE" and not attempt to show the server stats. 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`. 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`.
## Repository
The main version of this git repository is on [git.libregaming.org](https://git.libregaming.org/DeathByDenim/gameserver). There is a mirror on [Github](https://github.com/DeathByDenim/gameserver)

View File

@ -18,15 +18,15 @@ if [ -z $HOSTEDBYNAME ]; then
exit 1 exit 1
fi fi
export stk_version="1.3" export stk_version="latest"
export bzflag_version="2.4" export bzflag_version="2.4"
export mindustry_version="135" export mindustry_version="latest"
export openhv_version="20220221" export openhv_version="latest"
export teeworlds_version="0.7.5" export teeworlds_version="latest"
export teeworldsddrace_version="16.1" export teeworldsddrace_version="16.1"
export unvanquished_version="0.52.1" export unvanquished_version="latest"
export xonotic_version="0.8.2" export xonotic_version="0.8.5"
export lix_version="0.9.41" export lix_version="latest"
export systemuser="onfoss" export systemuser="onfoss"
export letsencryptemail="jarno@jarno.ca" export letsencryptemail="jarno@jarno.ca"
@ -49,7 +49,7 @@ apt install --assume-yes \
fuse g++ gcc curl firewalld automake autoconf libtool \ fuse g++ gcc curl firewalld automake autoconf libtool \
libcurl3-dev libc-ares-dev zlib1g-dev libncurses-dev make python3-aiohttp \ libcurl3-dev libc-ares-dev zlib1g-dev libncurses-dev make python3-aiohttp \
nginx-core certbot python3-certbot-nginx sudo python3-psutil \ nginx-core certbot python3-certbot-nginx sudo python3-psutil \
ldc dub libenet-dev python3-bcrypt ldc dub libenet-dev python3-bcrypt jq
# Create the user for running the game servers # Create the user for running the game servers
if ! getent passwd ${systemuser}; then if ! getent passwd ${systemuser}; then

View File

@ -18,7 +18,7 @@ cd bzflag
make make
make install make install
if ! [ -L /usr/games/bzfs ]; then if ! [ -L /usr/games/bzfs ]; then
ln -s /opt/bzflag-2.4/bin/bzfs /usr/games/ ln -s /opt/bzflag-${bzflag_version}/bin/bzfs /usr/games/
fi fi
rm -rf ${TMPDIR:-/tmp}/bzflag-build rm -rf ${TMPDIR:-/tmp}/bzflag-build

View File

@ -5,6 +5,10 @@ if [ -e /etc/systemd/system/lix.service ]; then
systemctl stop lix systemctl stop lix
fi fi
if [ -z ${lix_version} ] || [ "${lix_version}" = "latest" ]; then
lix_version=$(curl -s https://api.github.com/repos/SimonN/LixD/releases/latest | jq -r '.["tag_name"]' | cut -c2-)
fi
# Install Lix # Install Lix
mkdir -p ${TMPDIR:-/tmp}/lix-build mkdir -p ${TMPDIR:-/tmp}/lix-build
cd ${TMPDIR:-/tmp}/lix-build cd ${TMPDIR:-/tmp}/lix-build

View File

@ -5,9 +5,13 @@ if [ -e /etc/systemd/system/mindustry.service ]; then
systemctl stop mindustry systemctl stop mindustry
fi fi
if [ -z ${mindustry_version} ] || [ "${mindustry_version}" = "latest" ]; then
mindustry_version=$(curl -s https://api.github.com/repos/Anuken/Mindustry/releases?per_page=1 | jq -r '.[0]["tag_name"]' | cut -c2-)
fi
# Mindustry # Mindustry
mkdir -p /opt/mindustry-v${mindustry_version} mkdir -p /opt/mindustry-${mindustry_version}
curl --location https://github.com/Anuken/Mindustry/releases/download/v${mindustry_version}/server-release.jar > /opt/mindustry-v${mindustry_version}/mindustry.jar curl --location https://github.com/Anuken/Mindustry/releases/download/v${mindustry_version}/server-release.jar > /opt/mindustry-${mindustry_version}/mindustry.jar
mkdir -p /var/lib/mindustry mkdir -p /var/lib/mindustry
chown -R ${systemuser} /var/lib/mindustry chown -R ${systemuser} /var/lib/mindustry
@ -18,7 +22,7 @@ After=network.target
[Service] [Service]
WorkingDirectory=/var/lib/mindustry WorkingDirectory=/var/lib/mindustry
ExecStart=/usr/bin/console2web -p 62548 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -jar /opt/mindustry-v${mindustry_version}/mindustry.jar "config autosave true","config autosaveSpacing 120","host" ExecStart=/usr/bin/console2web -p 62548 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -jar /opt/mindustry-${mindustry_version}/mindustry.jar "config autosave true","config autosaveSpacing 120","host"
Restart=on-failure Restart=on-failure
User=${systemuser} User=${systemuser}

View File

@ -6,7 +6,7 @@ if [ -e /etc/systemd/system/openhv.service ]; then
fi fi
if [ -z ${openhv_version} ] || [ "${openhv_version}" = "latest" ]; then if [ -z ${openhv_version} ] || [ "${openhv_version}" = "latest" ]; then
openhv_version=$(git ls-remote --refs --sort="version:refname" --tags https://github.com/OpenHV/OpenHV | tail -n1 | cut -d'/' -f3) openhv_version=$(curl -s https://api.github.com/repos/OpenHV/OpenHV/releases/latest | jq -r '.["tag_name"]')
fi fi
# Install OpenHV # Install OpenHV

View File

@ -6,16 +6,16 @@ if [ -e /etc/systemd/system/supertuxkart.service ]; then
systemctl stop supertuxkart systemctl stop supertuxkart
fi fi
if [ -z ${stk_version} ] || [ "${stk_version}" = "latest" ]; then
stk_version=$(curl -s https://api.github.com/repos/supertuxkart/stk-code/releases/latest | jq -r '.["tag_name"]')
fi
# Install SuperTuxKart # Install SuperTuxKart
stk_dir="/opt/SuperTuxKart-${stk_version}" stk_dir="/opt/SuperTuxKart-${stk_version}"
mkdir -p ${stk_dir} mkdir -p ${stk_dir}
curl --location "https://github.com/supertuxkart/stk-code/releases/download/${stk_version}/SuperTuxKart-${stk_version}-linux-64bit.tar.xz" | tar --extract --xz --no-same-owner --strip-components=1 --directory=${stk_dir} curl --location "https://github.com/supertuxkart/stk-code/releases/download/${stk_version}/SuperTuxKart-${stk_version}-linux-64bit.tar.xz" | tar --extract --xz --no-same-owner --strip-components=1 --directory=${stk_dir}
ln -s ${stk_dir}/bin/supertuxkart /usr/games/supertuxkart ln -s ${stk_dir}/bin/supertuxkart /usr/games/supertuxkart
# Add firewall rules
firewall-cmd --zone=public --add-port=2757/udp --permanent
firewall-cmd --zone=public --add-port=2759/udp --permanent
# Configuration # Configuration
cp $(dirname $0)/../configs/supertuxkart.xml /etc/supertuxkart.xml cp $(dirname $0)/../configs/supertuxkart.xml /etc/supertuxkart.xml
@ -37,5 +37,6 @@ EOF
systemctl daemon-reload systemctl daemon-reload
systemctl enable --now supertuxkart.service systemctl enable --now supertuxkart.service
firewall-cmd --zone=public --add-port=2759/udp --permanent # Add firewall rules
firewall-cmd --zone=public --add-port=2757/udp --permanent firewall-cmd --zone=public --add-port=2757/udp --permanent
firewall-cmd --zone=public --add-port=2759/udp --permanent

View File

@ -5,6 +5,10 @@ if [ -e /etc/systemd/system/teeworlds.service ]; then
systemctl stop teeworlds systemctl stop teeworlds
fi fi
if [ -z ${teeworlds_version} ] || [ "${teeworlds_version}" = "latest" ]; then
teeworlds_version=$(curl -s https://api.github.com/repos/teeworlds/teeworlds/releases/latest | jq -r '.["tag_name"]')
fi
# Teeworlds # Teeworlds
teeworld_directory="/opt/teeworlds-${teeworlds_version}" teeworld_directory="/opt/teeworlds-${teeworlds_version}"
mkdir -p ${teeworld_directory} mkdir -p ${teeworld_directory}

View File

@ -5,6 +5,10 @@ if [ -e /etc/systemd/system/unvanquished.service ]; then
systemctl stop unvanquished systemctl stop unvanquished
fi fi
if [ -z ${unvanquished_version} ] || [ "${unvanquished_version}" = "latest" ]; then
unvanquished_version=$(curl -s https://api.github.com/repos/Unvanquished/Unvanquished/releases/latest | jq -r '.["tag_name"]' | cut -c2-)
fi
# Unvanquished # Unvanquished
unvanquished_directory="/opt/unvanquished-${unvanquished_version}" unvanquished_directory="/opt/unvanquished-${unvanquished_version}"
curl --location "https://github.com/Unvanquished/Unvanquished/releases/download/v${unvanquished_version}/unvanquished_${unvanquished_version}.zip" > ${TMPDIR:-/tmp}/unvanquished.zip curl --location "https://github.com/Unvanquished/Unvanquished/releases/download/v${unvanquished_version}/unvanquished_${unvanquished_version}.zip" > ${TMPDIR:-/tmp}/unvanquished.zip

View File

@ -136,7 +136,7 @@
</table> </table>
<p>Enjoy!</p> <p>Enjoy!</p>
<h1>Code</h1> <h1>Code</h1>
<p>Code for setting up server is on <a href="https://github.com/DeathByDenim/gameserver">Github</a></p> <p>Code for setting up server is on <a href="https://git.libregaming.org/DeathByDenim/gameserver">git.libregaming.org</a></p>
</div> </div>
<div class="col-6 col-md-4"> <div class="col-6 col-md-4">
<h5>Live stats</h5> <h5>Live stats</h5>