-
Notifications
You must be signed in to change notification settings - Fork 43
/
egg-pocketmine-m-p.json
47 lines (47 loc) · 6.11 KB
/
egg-pocketmine-m-p.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL",
"meta": {
"version": "PLCN_v1",
"update_url": null
},
"exported_at": "2024-11-29T10:54:34+00:00",
"name": "PocketmineMP",
"author": "[email protected]",
"uuid": "4c3baab1-67ad-48c7-8acd-eb3deaa0a462",
"description": "Pocketmine Egg\r\nby onekintaro from swisscrafting.ch\r\nwith the nice help from #eggs Channel on Pterodactyl-Discord :)",
"features": null,
"docker_images": {
"ghcr.io\/parkervcp\/yolks:debian": "ghcr.io\/parkervcp\/yolks:debian"
},
"file_denylist": [],
"startup": ".\/bin\/php7\/bin\/php .\/PocketMine-MP.phar --no-wizard",
"config": {
"files": "{\r\n \"server.properties\": {\r\n \"parser\": \"properties\",\r\n \"find\": {\r\n \"server-ip\": \"0.0.0.0\",\r\n \"enable-query\": \"true\",\r\n \"server-port\": \"{{server.allocations.default.port}}\",\r\n \"query.port\": \"{{server.allocations.default.port}}\"\r\n }\r\n }\r\n}",
"startup": "{\r\n \"done\": \")! \"\r\n}",
"logs": "{}",
"stop": "stop"
},
"scripts": {
"installation": {
"script": "#!\/bin\/bash\r\n\r\napt-get update\r\napt-get install -y git curl wget jq file tar unzip zip\r\n\r\nmkdir -p \/mnt\/server\/ # Not required. Only here for parkervcp's local test setup\r\n\r\ncd \/mnt\/server || exit 1\r\n\r\nARCH=$([[ \"$(uname -m)\" == \"x86_64\" ]] && printf \"x86_64\" || printf \"arm64\")\r\n\r\n# Shouldn't be possible to be empty, but default to PM5 if it is and convert to uppercase\r\nVERSION=\"${VERSION:-PM5}\"\r\nVERSION=\"${VERSION^^}\"\r\n\r\n# Helper functions\r\n\r\ndownload_php_binary() {\r\n local php_binary_url\r\n if [[ \"$VERSION\" == \"PM5\" ]]; then\r\n php_binary_url=\"https:\/\/github.com\/pmmp\/PHP-Binaries\/releases\/download\/pm5-latest\/PHP-8.2-Linux-${ARCH}-PM5.tar.gz\"\r\n elif [[ \"$VERSION\" == \"PM4\" ]]; then\r\n php_binary_url=\"https:\/\/github.com\/pmmp\/PHP-Binaries\/releases\/download\/pm4-latest\/PHP-8.1-Linux-${ARCH}-PM4.tar.gz\"\r\n else\r\n printf \"Unsupported version: %s\\n\" \"${VERSION}\"\r\n exit 1\r\n fi\r\n\r\n printf \"Downloading PHP binary for %s from %s\\n\" \"$VERSION\" \"$php_binary_url\"\r\n curl --location --progress-bar \"$php_binary_url\" | tar -xzv\r\n}\r\n\r\nset_php_extension_dir() {\r\n printf \"Configuring php.ini\\n\"\r\n EXTENSION_DIR=$(find \"bin\" -name '*debug-zts*')\r\n grep -q '^extension_dir' bin\/php7\/bin\/php.ini && \\\r\n sed -i'bak' \"s{^extension_dir=.*{extension_dir=\\\"$EXTENSION_DIR\\\"{\" bin\/php7\/bin\/php.ini || \\\r\n echo \"extension_dir=\\\"$EXTENSION_DIR\\\"\" >>bin\/php7\/bin\/php.ini\r\n}\r\n\r\ndownload_pmmp() {\r\n DOWNLOAD_LINK=$(curl -sSL https:\/\/update.pmmp.io\/api?channel=\"$API_CHANNEL\" | jq -r '.download_url')\r\n printf \"Downloading %s from %s\\n\" \"$VERSION\" \"${DOWNLOAD_LINK}\"\r\n curl --location --progress-bar \"${DOWNLOAD_LINK}\" --output PocketMine-MP.phar\r\n}\r\n\r\n# We have to convert VERSION into an API channel\r\nif [[ \"${VERSION}\" == \"PM4\" ]]; then\r\n API_CHANNEL=\"4\"\r\n\r\nelif [[ \"${VERSION}\" == \"PM5\" ]]; then\r\n API_CHANNEL=\"stable\"\r\nelse\r\n printf \"Unsupported version: %s\\n\" \"${VERSION}\"\r\n exit 1\r\nfi\r\n\r\nREQUIRED_PHP_VERSION=$(curl -sSL https:\/\/update.pmmp.io\/api?channel=\"$API_CHANNEL\" | jq -r '.php_version')\r\n\r\nif [[ \"${ARCH}\" == \"x86_64\" ]]; then\r\n download_php_binary\r\n\r\n# There are no ARM64 PHP binaries yet, so we have to compile them\r\nelse\r\n apt-get install -y make autoconf automake m4 bzip2 bison g++ cmake pkg-config re2c libtool-bin\r\n \r\n mkdir -p \/mnt\/server\/build_cache\/archives\r\n mkdir -p \/mnt\/server\/build_cache\/compilation\r\n \r\n # Each PHP version has its own compile script, so we have to download the correct one\r\n echo \"Running curl to download compile.sh for PHP version $REQUIRED_PHP_VERSION\"\r\n curl --location --progress-bar --remote-name https:\/\/raw.githubusercontent.com\/pmmp\/PHP-Binaries\/latest\/compile.sh\r\n chmod +x compile.sh\r\n\r\n cat <<EOF\r\n----------------------------------------\r\n| |\r\n| Compiling PHP Binary for ARM64 |\r\n| |\r\n| This is a time consuming process |\r\n----------------------------------------\r\nEOF\r\n\r\n printf \"\\n\\nCompiling PHP binary, this is a slow process and will take time\\n\"\r\n THREADS=$(grep -c ^processor \/proc\/cpuinfo) || THREADS=1\r\n .\/compile.sh -j \"${THREADS}\" -c \/mnt\/server\/build_cache\/archives -l \/mnt\/server\/build_cache\/compilation -z \"${REQUIRED_PHP_VERSION}\"\r\n rm compile.sh\r\n rm -rf install_data\/\r\n\r\nfi\r\n\r\n# Steps below are the same for both architectures\r\ndownload_pmmp\r\nset_php_extension_dir || exit 1\r\n\r\nif [[ ! -f server.properties ]]; then\r\n printf \"Downloading default server.properties template\\n\"\r\n curl --location --progress-bar --remote-name https:\/\/raw.githubusercontent.com\/parkervcp\/eggs\/master\/game_eggs\/minecraft\/bedrock\/pocketmine_mp\/server.properties\r\nfi\r\n\r\nprintf \"Creating default file and folder structure\\n\"\r\ntouch banned-ips.txt banned-players.txt ops.txt white-list.txt server.log\r\nmkdir -p players worlds plugins resource_packs\r\n\r\ncat <<EOF\r\n----------------------------------------\r\n| |\r\n| PocketMine-MP Installation Done |\r\n| |\r\n----------------------------------------\r\nEOF",
"container": "ghcr.io\/parkervcp\/installers:debian",
"entrypoint": "bash"
}
},
"variables": [
{
"name": "Version to install",
"description": "Latest PocketMine version to install.",
"env_variable": "VERSION",
"default_value": "PM5",
"user_viewable": true,
"user_editable": true,
"rules": [
"required",
"string",
"in:PM5,PM4"
],
"sort": null
}
]
}