Update regex checking for minecraft services

closes #193
This commit is contained in:
Dane Everitt 2016-12-02 19:06:14 -05:00
parent e39c750563
commit 777e7138e6
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 88 additions and 7 deletions

View file

@ -12,9 +12,11 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
### Changed ### Changed
* File uploads now account for a maximum file size that is assigned for the daemon, and gives cleaner errors when that limit is reached. * File uploads now account for a maximum file size that is assigned for the daemon, and gives cleaner errors when that limit is reached.
* File upload limit can now be controlled from the panel. * File upload limit can now be controlled from the panel.
* Updates regex and default values for some Minecraft services to reflect current technology.
### Fixed ### Fixed
* Fixes potential for generated password to not meet own validation requirements. * Fixes potential for generated password to not meet own validation requirements.
* Fixes some regex checking issues with newer versions of Minecraft.
## v0.5.3 (Bodacious Boreopterus) ## v0.5.3 (Bodacious Boreopterus)
### Fixed ### Fixed

View file

@ -0,0 +1,79 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CorrectServiceVariables extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::transaction(function () {
// Modify Default Spigot Startup Line
DB::table('service_options')->where([
['name', 'Spigot'],
['tag', 'spigot'],
['startup', '-Xms128M -Xmx{{SERVER_MEMORY}}M -Djline.terminal=jline.UnsupportedTerminal -jar {{SERVER_JARFILE}}'],
])->update([
'startup' => null,
]);
// Correct Spigot Version Checking
DB::table('service_variables')->where([
['name', 'Spigot Version'],
['env_variable', 'DL_VERSION'],
['default_value', 'latest'],
['regex', '/^(latest|[a-zA-Z0-9_\.-]{5,6})$/'],
])->update([
'regex' => '/^(latest|[a-zA-Z0-9_\.-]{3,7})$/',
]);
// Correct Vanilla Version Checking (as well as naming)
DB::table('service_variables')->where([
['name', 'Server Jar File'],
['env_variable', 'VANILLA_VERSION'],
['default_value', 'latest'],
['regex', '/^(latest|[a-zA-Z0-9_\.-]{5,6})$/']
])->update([
'name' => 'Server Version',
'regex' => '/^(latest|[a-zA-Z0-9_\.-]{3,7})$/',
]);
// Update Sponge Version Checking and Update Default Version
DB::table('service_variables')->where([
['name', 'Sponge Version'],
['env_variable', 'SPONGE_VERSION'],
['default_value', '1.8.9-4.2.0-BETA-351'],
['regex', '/^(.*)$/'],
])->update([
'default_value' => '1.10.2-5.1.0-BETA-359',
'regex' => '/^([a-zA-Z0-9.\-_]+)$/',
]);
// Update Bungeecord Version Checking
DB::table('service_variables')->where([
['name', 'Bungeecord Version'],
['env_variable', 'BUNGEE_VERSION'],
['default_value', 'latest'],
['regex', '/^(latest|[\d]{3,5})$/'],
])->update([
'regex' => '/^(latest|[\d]{1,6})$/',
]);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// do nothing
}
}

View file

@ -84,7 +84,7 @@ class MinecraftServiceTableSeeder extends Seeder
'tag' => 'spigot', 'tag' => 'spigot',
'docker_image' => 'quay.io/pterodactyl/minecraft:spigot', 'docker_image' => 'quay.io/pterodactyl/minecraft:spigot',
'executable' => null, 'executable' => null,
'startup' => '-Xms128M -Xmx{{SERVER_MEMORY}}M -Djline.terminal=jline.UnsupportedTerminal -jar {{SERVER_JARFILE}}' 'startup' => '-Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}'
]); ]);
$this->option['sponge'] = Models\ServiceOptions::create([ $this->option['sponge'] = Models\ServiceOptions::create([
@ -132,14 +132,14 @@ class MinecraftServiceTableSeeder extends Seeder
Models\ServiceVariables::create([ Models\ServiceVariables::create([
'option_id' => $this->option['vanilla']->id, 'option_id' => $this->option['vanilla']->id,
'name' => 'Server Jar File', 'name' => 'Server Version',
'description' => 'The version of Minecraft Vanilla to install. Use "latest" to install the latest version.', 'description' => 'The version of Minecraft Vanilla to install. Use "latest" to install the latest version.',
'env_variable' => 'VANILLA_VERSION', 'env_variable' => 'VANILLA_VERSION',
'default_value' => 'latest', 'default_value' => 'latest',
'user_viewable' => 1, 'user_viewable' => 1,
'user_editable' => 1, 'user_editable' => 1,
'required' => 1, 'required' => 1,
'regex' => '/^(latest|[a-zA-Z0-9_\.-]{5,6})$/' 'regex' => '/^(latest|[a-zA-Z0-9_\.-]{3,7})$/'
]); ]);
} }
@ -166,7 +166,7 @@ class MinecraftServiceTableSeeder extends Seeder
'user_viewable' => 1, 'user_viewable' => 1,
'user_editable' => 1, 'user_editable' => 1,
'required' => 1, 'required' => 1,
'regex' => '/^(latest|[a-zA-Z0-9_\.-]{5,6})$/' 'regex' => '/^(latest|[a-zA-Z0-9_\.-]{3,7})$/'
]); ]);
Models\ServiceVariables::create([ Models\ServiceVariables::create([
@ -189,11 +189,11 @@ class MinecraftServiceTableSeeder extends Seeder
'name' => 'Sponge Version', 'name' => 'Sponge Version',
'description' => 'The version of SpongeVanilla to download and use.', 'description' => 'The version of SpongeVanilla to download and use.',
'env_variable' => 'SPONGE_VERSION', 'env_variable' => 'SPONGE_VERSION',
'default_value' => '1.8.9-4.2.0-BETA-351', 'default_value' => '1.10.2-5.1.0-BETA-359',
'user_viewable' => 1, 'user_viewable' => 1,
'user_editable' => 0, 'user_editable' => 0,
'required' => 1, 'required' => 1,
'regex' => '/^(.*)$/' 'regex' => '/^([a-zA-Z0-9.\-_]+)$/'
]); ]);
Models\ServiceVariables::create([ Models\ServiceVariables::create([
@ -220,7 +220,7 @@ class MinecraftServiceTableSeeder extends Seeder
'user_viewable' => 1, 'user_viewable' => 1,
'user_editable' => 1, 'user_editable' => 1,
'required' => 1, 'required' => 1,
'regex' => '/^(latest|[\d]{3,5})$/' 'regex' => '/^(latest|[\d]{1,6})$/'
]); ]);
Models\ServiceVariables::create([ Models\ServiceVariables::create([