add server software
This commit is contained in:
@@ -15,6 +15,8 @@ ini_set("display_startup_errors", 1);
|
|||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
class mcServApi {
|
class mcServApi {
|
||||||
|
private $api_keys;
|
||||||
|
|
||||||
public function getConf() {
|
public function getConf() {
|
||||||
$env = parse_ini_file(__DIR__ . "/../.env");
|
$env = parse_ini_file(__DIR__ . "/../.env");
|
||||||
return $env;
|
return $env;
|
||||||
|
|||||||
18
api/servers/server_software_list.php
Normal file
18
api/servers/server_software_list.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
require "../api.php";
|
||||||
|
|
||||||
|
$api = new mcServApi();
|
||||||
|
|
||||||
|
if (!$api->checkAuth()) {
|
||||||
|
die('{"status":"500", "error":"Unauthorized"}');
|
||||||
|
}
|
||||||
|
|
||||||
|
$config = $api->getConf();
|
||||||
|
|
||||||
|
$file = file_get_contents($config["PATH"]. "/assets/server_software.json");
|
||||||
|
|
||||||
|
$json["status"] = 200;
|
||||||
|
$json["server_software"] = json_decode($file, true);
|
||||||
|
|
||||||
|
die(json_encode($json, JSON_UNESCAPED_SLASHES));
|
||||||
|
?>
|
||||||
50
assets/server_software.json
Normal file
50
assets/server_software.json
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name":"vanilla",
|
||||||
|
"display_name":"Vanilla",
|
||||||
|
"mods":false,
|
||||||
|
"plugins":false,
|
||||||
|
"download_url":"https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"paper",
|
||||||
|
"display_name":"Paper",
|
||||||
|
"mods":false,
|
||||||
|
"plugins":[
|
||||||
|
"bukkit",
|
||||||
|
"spigot",
|
||||||
|
"paper"
|
||||||
|
],
|
||||||
|
"download_url":"https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/497/downloads/paper-1.20.4-497.jar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"purpur",
|
||||||
|
"display_name":"Purpur",
|
||||||
|
"mods":false,
|
||||||
|
"plugins":[
|
||||||
|
"bukkit",
|
||||||
|
"spigot",
|
||||||
|
"paper",
|
||||||
|
"purpur"
|
||||||
|
],
|
||||||
|
"download_url":"https://api.purpurmc.org/v2/purpur/1.20.4/2184/download"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"fabric",
|
||||||
|
"display_name":"Fabric",
|
||||||
|
"mods":[
|
||||||
|
"fabric"
|
||||||
|
],
|
||||||
|
"plugins":false,
|
||||||
|
"download_url":"https://meta.fabricmc.net/v2/versions/loader/1.20.4/0.15.7/1.0.1/server/jar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"forge",
|
||||||
|
"display_name":"Forge",
|
||||||
|
"mods":[
|
||||||
|
"forge"
|
||||||
|
],
|
||||||
|
"plugins":false,
|
||||||
|
"download_url":"https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.4-49.0.31/forge-1.20.4-49.0.31-installer.jar"
|
||||||
|
}
|
||||||
|
]
|
||||||
1
front/authorized_keys
Normal file
1
front/authorized_keys
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFR8w8TgFa9ZJ9NOflyGyHdlid7SiyXL5ga33aQzxKL8 Generated By Termius
|
||||||
3
front/panel/.htaccess
Normal file
3
front/panel/.htaccess
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
RewriteEngine On
|
||||||
|
|
||||||
|
RewriteRule ^server/([a-zA-Z0-9_-]+)$ server.php?server=$1 [L]
|
||||||
2145
front/panel/create_server.html
Normal file
2145
front/panel/create_server.html
Normal file
File diff suppressed because it is too large
Load Diff
15
front/panel/server.php
Normal file
15
front/panel/server.php
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
require "../main.php";
|
||||||
|
$mcServ = new mcServ();
|
||||||
|
|
||||||
|
if(!$mcServ->checkLogin()) {
|
||||||
|
header("Location: /login.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$path = $_GET["server"];
|
||||||
|
|
||||||
|
if ($path == "create") {
|
||||||
|
die(file_get_contents("src/server/create.html"));
|
||||||
|
}
|
||||||
|
?>
|
||||||
11
front/panel/src/server/create.html
Normal file
11
front/panel/src/server/create.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Hello World!</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
1563
tailadmin/src/create_server.html
Normal file
1563
tailadmin/src/create_server.html
Normal file
File diff suppressed because it is too large
Load Diff
0
tailadmin/src/server.php
Normal file
0
tailadmin/src/server.php
Normal file
@@ -1 +1 @@
|
|||||||
{"578":{"session_id":"1dbb7c9b5650f1aba796a7a6589952735e5f694dd7bd3389d9faff81b5c95358"}}
|
{"528":{"session_id":"97733ecf9094cd46bf1236545016e423287a7fcb21a2154da354ee6c6f3153fe"}}
|
||||||
Reference in New Issue
Block a user