Include default installation scripts, as well as ability to symlink a script

This commit is contained in:
Dane Everitt 2017-04-27 16:16:57 -04:00
parent 77b1a258d9
commit 30b4934013
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
12 changed files with 346 additions and 11 deletions

View file

@ -110,6 +110,27 @@ EOF;
private function addCoreOptions()
{
$script = <<<'EOF'
#!/bin/ash
# Vanilla MC Installation Script
#
# Server Files: /mnt/server
apk update
apk add curl
cd /mnt/server
LATEST_VERSION=`curl -s https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | grep -o "[[:digit:]]\.[0-9]*\.[0-9]" | head -n 1`
if [ -z "$VANILLA_VERSION" ] || [ "$VANILLA_VERSION" == "latest" ]; then
DL_VERSION=$LATEST_VERSION
else
DL_VERSION=$VANILLA_VERSION
fi
curl -o ${SERVER_JARFILE} https://s3.amazonaws.com/Minecraft.Download/versions/${DL_VERSION}/minecraft_server.${DL_VERSION}.jar
EOF;
$this->option['vanilla'] = ServiceOption::updateOrCreate([
'service_id' => $this->service->id,
'tag' => 'vanilla',
@ -123,8 +144,27 @@ EOF;
'config_stop' => 'stop',
'config_from' => null,
'startup' => null,
'script_install' => $script,
]);
$script = <<<'EOF'
#!/bin/ash
# Spigot Installation Script
#
# Server Files: /mnt/server
## Only download if a path is provided, otherwise continue.
if [ ! -z "${DL_PATH}" ]; then
apk update
apk add curl
cd /mnt/server
MODIFIED_DOWNLOAD=`eval echo $(echo ${DL_PATH} | sed -e 's/{{/${/g' -e 's/}}/}/g')`
curl -sSL -o ${SERVER_JARFILE} ${MODIFIED_DOWNLOAD}
fi
EOF;
$this->option['spigot'] = ServiceOption::updateOrCreate([
'service_id' => $this->service->id,
'tag' => 'spigot',
@ -138,8 +178,23 @@ EOF;
'config_stop' => null,
'config_from' => $this->option['vanilla']->id,
'startup' => null,
'script_install' => $script,
]);
$script = <<<'EOF'
#!/bin/ash
# Sponge Installation Script
#
# Server Files: /mnt/server
apk update
apk add curl
cd /mnt/server
curl -sSL "https://repo.spongepowered.org/maven/org/spongepowered/spongevanilla/${SPONGE_VERSION}/spongevanilla-${SPONGE_VERSION}.jar" -o ${SERVER_JARFILE}
EOF;
$this->option['sponge'] = ServiceOption::updateOrCreate([
'service_id' => $this->service->id,
'tag' => 'sponge',
@ -153,8 +208,26 @@ EOF;
'config_stop' => null,
'config_from' => $this->option['vanilla']->id,
'startup' => null,
'script_install' => $script,
]);
$script = <<<'EOF'
#!/bin/ash
# Bungeecord Installation Script
#
# Server Files: /mnt/server
apk update
apk add curl
cd /mnt/server
if [ -z "${BUNGEE_VERSION}" ] || [ "${BUNGEE_VERSION}" == "latest" ]; then
BUNGEE_VERSION="lastStableBuild"
fi
curl -o ${SERVER_JARFILE} https://ci.md-5.net/job/BungeeCord/${BUNGEE_VERSION}/artifact/bootstrap/target/BungeeCord.jar
EOF;
$this->option['bungeecord'] = ServiceOption::updateOrCreate([
'service_id' => $this->service->id,
'tag' => 'bungeecord',
@ -168,6 +241,7 @@ EOF;
'config_stop' => 'end',
'config_from' => null,
'startup' => null,
'script_install' => $script,
]);
}

View file

@ -69,6 +69,27 @@ class SourceServiceTableSeeder extends Seeder
private function addCoreOptions()
{
$script = <<<'EOF'
#!/bin/bash
# SRCDS Base Installation Script
#
# Server Files: /mnt/server
apt update
apt install curl
cd /tmp
curl -sSL -o steamcmd.tar.gz http://media.steampowered.com/installer/steamcmd_linux.tar.gz
mkdir /mnt/server/steamcmd
tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd
cd /mnt/server/steamcmd
./steamcmd.sh +login anonymous +force_install_dir /mnt/server +app_update ${SRCDS_APPID} +quit
mkdir -p /mnt/server/.steam/sdk32
cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so
EOF;
$this->option['source'] = ServiceOption::updateOrCreate([
'service_id' => $this->service->id,
'tag' => 'source',
@ -82,6 +103,9 @@ class SourceServiceTableSeeder extends Seeder
'config_stop' => 'quit',
'config_from' => null,
'startup' => null,
'script_install' => $script,
'script_entry' => 'bash',
'script_container' => 'ubuntu:16.04',
]);
$this->option['insurgency'] = ServiceOption::updateOrCreate([
@ -97,6 +121,7 @@ class SourceServiceTableSeeder extends Seeder
'config_stop' => null,
'config_from' => $this->option['source']->id,
'startup' => './srcds_run -game {{SRCDS_GAME}} -console -port {{SERVER_PORT}} +map {{SRCDS_MAP}} +ip 0.0.0.0 -strictportbind -norestart',
'copy_script_from' => $this->option['source']->id,
]);
$this->option['tf2'] = ServiceOption::updateOrCreate([
@ -112,8 +137,34 @@ class SourceServiceTableSeeder extends Seeder
'config_stop' => null,
'config_from' => $this->option['source']->id,
'startup' => './srcds_run -game {{SRCDS_GAME}} -console -port {{SERVER_PORT}} +map {{SRCDS_MAP}} +ip 0.0.0.0 -strictportbind -norestart',
'copy_script_from' => $this->option['source']->id,
]);
$script = <<<'EOF'
#!/bin/bash
# ARK: Installation Script
#
# Server Files: /mnt/server
apt update
apt install curl
cd /tmp
curl -sSL -o steamcmd.tar.gz http://media.steampowered.com/installer/steamcmd_linux.tar.gz
mkdir /mnt/server/steamcmd
mkdir -p /mnt/server/Engine/Binaries/ThirdParty/SteamCMD/Linux
tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd
tar -xzvf steamcmd.tar.gz -C /mnt/server/Engine/Binaries/ThirdParty/SteamCMD/Linux
cd /mnt/server/steamcmd
./steamcmd.sh +login anonymous +force_install_dir /mnt/server +app_update 376030 +quit
mkdir -p /mnt/server/.steam/sdk32
cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so
EOF;
$this->option['ark'] = ServiceOption::updateOrCreate([
'service_id' => $this->service->id,
'tag' => 'ark',
@ -127,6 +178,9 @@ class SourceServiceTableSeeder extends Seeder
'config_stop' => '^C',
'config_from' => $this->option['source']->id,
'startup' => './ShooterGame/Binaries/Linux/ShooterGameServer TheIsland?listen?ServerPassword={{ARK_PASSWORD}}?ServerAdminPassword={{ARK_ADMIN_PASSWORD}}?Port={{SERVER_PORT}}?MaxPlayers={{SERVER_MAX_PLAYERS}}',
'script_install' => $script,
'script_entry' => 'bash',
'script_container' => 'ubuntu:16.04',
]);
}

View file

@ -69,6 +69,21 @@ class TerrariaServiceTableSeeder extends Seeder
private function addCoreOptions()
{
$script = <<<'EOF'
#!/bin/ash
# TShock Installation Script
#
# Server Files: /mnt/server
apk update
apk add curl unzip
cd /tmp
curl -sSLO https://github.com/NyxStudios/TShock/releases/download/v${T_VERSION}/tshock_${T_VERSION}.zip
unzip -o tshock_${T_VERSION}.zip -d /mnt/server
EOF;
$this->option['tshock'] = ServiceOption::updateOrCreate([
'service_id' => $this->service->id,
'tag' => 'tshock',
@ -82,6 +97,7 @@ class TerrariaServiceTableSeeder extends Seeder
'config_logs' => '{"custom": false, "location": "ServerLog.txt"}',
'config_stop' => 'exit',
'startup' => null,
'script_install' => $script,
]);
}

View file

@ -69,6 +69,22 @@ class VoiceServiceTableSeeder extends Seeder
private function addCoreOptions()
{
$script = <<<'EOF'
#!/bin/ash
# Mumble Installation Script
#
# Server Files: /mnt/server
apk update
apk add tar curl
cd /tmp
curl -sSLO https://github.com/mumble-voip/mumble/releases/download/${MUMBLE_VERSION}/murmur-static_x86-${MUMBLE_VERSION}.tar.bz2
tar -xjvf murmur-static_x86-${MUMBLE_VERSION}.tar.bz2
cp -r murmur-static_x86-${MUMBLE_VERSION}/* /mnt/server
EOF;
$this->option['mumble'] = ServiceOption::updateOrCreate([
'service_id' => $this->service->id,
'tag' => 'mumble',
@ -82,8 +98,46 @@ class VoiceServiceTableSeeder extends Seeder
'config_stop' => '^C',
'config_from' => null,
'startup' => './murmur.x86 -fg',
'script_install' => $script,
]);
$script = <<<'EOF'
#!/bin/ash
# TS3 Installation Script
#
# Server Files: /mnt/server
apk update
apk add tar curl
cd /tmp
curl -sSLO http://dl.4players.de/ts/releases/${TS_VERSION}/teamspeak3-server_linux_amd64-${TS_VERSION}.tar.bz2
tar -xjvf teamspeak3-server_linux_amd64-${TS_VERSION}.tar.bz2
cp -r teamspeak3-server_linux_amd64/* /mnt/server
echo "machine_id=
default_voice_port=${SERVER_PORT}
voice_ip=0.0.0.0
licensepath=
filetransfer_port=30033
filetransfer_ip=
query_port=${SERVER_PORT}
query_ip=0.0.0.0
query_ip_whitelist=query_ip_whitelist.txt
query_ip_blacklist=query_ip_blacklist.txt
dbplugin=ts3db_sqlite3
dbpluginparameter=
dbsqlpath=sql/
dbsqlcreatepath=create_sqlite/
dbconnections=10
logpath=logs
logquerycommands=0
dbclientkeepdays=30
logappend=0
query_skipbruteforcecheck=0" > /mnt/server/ts3server.ini
EOF;
$this->option['ts3'] = ServiceOption::updateOrCreate([
'service_id' => $this->service->id,
'tag' => 'ts3',
@ -97,6 +151,7 @@ class VoiceServiceTableSeeder extends Seeder
'config_stop' => '^C',
'config_from' => null,
'startup' => './ts3server_minimal_runscript.sh default_voice_port={{SERVER_PORT}} query_port={{SERVER_PORT}}',
'script_install' => $script,
]);
}