Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pterodactyl egg #81

Open
SaiCode-DEV opened this issue Sep 14, 2022 · 4 comments
Open

Pterodactyl egg #81

SaiCode-DEV opened this issue Sep 14, 2022 · 4 comments

Comments

@SaiCode-DEV
Copy link

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/

@AL1L
Copy link
Contributor

AL1L commented Sep 18, 2022

{
    "_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

@tony-ist
Copy link

@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?

@AL1L
Copy link
Contributor

AL1L commented Jul 23, 2023

@StackDoubleFlow

@tony-ist
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants