MCHPRS icon indicating copy to clipboard operation
MCHPRS copied to clipboard

Pterodactyl egg

Open SaiCode-DEV opened this issue 2 years ago • 4 comments

I'd love to deploy MCHPRS with Pterodactyl. Sadly there are no eggs available and using the Linux executable like a normal jar doest work properly (Ram doest get detected properly, because it's using docker containers)

Could you please create an egg (egg = deployment script) for it?

https://pterodactyl.io/

SaiCode-DEV avatar Sep 14 '22 14:09 SaiCode-DEV

{
    "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
    "meta": {
        "version": "PTDL_v2",
        "update_url": null
    },
    "exported_at": "2022-09-18T18:22:51-05:00",
    "name": "MCHPRS",
    "author": "[email protected]",
    "description": "Minecraft High Performance Redstone Server",
    "features": null,
    "docker_images": {
        "ghcr.io\/pterodactyl\/yolks:alpine": "ghcr.io\/pterodactyl\/yolks:alpine"
    },
    "file_denylist": [],
    "startup": "\/home\/container\/MCHPRS\/target\/release\/mchprs",
    "config": {
        "files": "{}",
        "startup": "{\r\n    \"done\": \"Done! Start took\"\r\n}",
        "logs": "{}",
        "stop": "^C"
    },
    "scripts": {
        "installation": {
            "script": "#!\/bin\/ash\r\n\r\necho installing\r\n\r\nset -e\r\n\r\necho isntalling extra depends\r\napk -U upgrade\r\napk add openssl-dev libressl-dev curl gcc build-base\r\n\r\necho making dir\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\necho installing rust\r\n\r\nif [ ! -d $HOME\/.cargo ] || [ ! -d $HOME\/.rustup ]; then \\\r\n    curl \u2013proto \u2018=https\u2019 \u2013tlsv1.2 -sSf https:\/\/sh.rustup.rs | sh -s -- -y \r\nfi\r\n\r\nsource $HOME\/.cargo\/env\r\n\r\n\r\nif [ ! -d \/mnt\/server\/MCHPRS ]; then \\\r\n    echo cloning\r\n    git clone --branch $REPOSITORY_REF --single-branch --depth 1  $REPOSITORY_LINK MCHPRS\r\nfi\r\n\r\ncd MCHPRS\r\n\r\necho setting nightly\r\nrustup override set nightly\r\n\r\necho building\r\ncargo build --release",
            "container": "ghcr.io\/pterodactyl\/installers:alpine",
            "entrypoint": "ash"
        }
    },
    "variables": [
        {
            "name": "Repository Link",
            "description": "Link to clone the GitHub repository for MCHPRS",
            "env_variable": "REPOSITORY_LINK",
            "default_value": "https:\/\/github.com\/MCHPR\/MCHPRS.git",
            "user_viewable": false,
            "user_editable": false,
            "rules": "required|string|max:256",
            "field_type": "text"
        },
        {
            "name": "Repository Ref",
            "description": "Repository ref to clone, can be commit hash or branch",
            "env_variable": "REPOSITORY_REF",
            "default_value": "master",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|string|max:20",
            "field_type": "text"
        }
    ]
}

@StackDoubleFlow maybe add this to the repo somewhere? Here's the install script (ya it's ugly, but whatever)

#!/bin/ash

echo installing

set -e

echo isntalling extra depends
apk -U upgrade
apk add openssl-dev libressl-dev curl gcc build-base

echo making dir
mkdir -p /mnt/server
cd /mnt/server

echo installing rust

if [ ! -d $HOME/.cargo ] || [ ! -d $HOME/.rustup ]; then \
    curl –proto ‘=https’ –tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 
fi

source $HOME/.cargo/env


if [ ! -d /mnt/server/MCHPRS ]; then \
    echo cloning
    git clone --branch $REPOSITORY_REF --single-branch --depth 1  $REPOSITORY_LINK MCHPRS
fi

cd MCHPRS

echo setting nightly
rustup override set nightly

echo building
cargo build --release

AL1L avatar Sep 18 '22 23:09 AL1L

@AL1L, this seems to give

ERROR: openssl-dev-3.1.1-r3: trying to overwrite usr/lib/pkgconfig/libcrypto.pc owned by libressl-dev-3.7.3-r0.
ERROR: openssl-dev-3.1.1-r3: trying to overwrite usr/lib/pkgconfig/libssl.pc owned by libressl-dev-3.7.3-r0.
ERROR: openssl-dev-3.1.1-r3: trying to overwrite usr/lib/pkgconfig/openssl.pc owned by libressl-dev-3.7.3-r0.
Executing busybox-1.36.1-r1.trigger
1 error; 290 MiB in 55 packages

And later

env: can't execute '/home/container/MCHPRS/target/release/mchprs': No such file or directory

Any updates?

tony-ist avatar Jul 22 '23 11:07 tony-ist

@StackDoubleFlow

AL1L avatar Jul 23 '23 02:07 AL1L

I built a docker image for arm64 and amd64 in a not very efficient way (using rust:nightly-slim) and posted egg to docker hub here: https://hub.docker.com/repository/docker/refruity/mchprs/general

tony-ist avatar Jul 23 '23 02:07 tony-ist