Egg Repository

Pterodactyl Community Egg Repository

rust generic

Creates a container that runs rust with cargo.

Read Me

Rust Language Generic

This egg is designed to run any generic Rust application with Cargo, allowing users to pull their own Rust source code from a GitHub repository.

Configuration

The server will be stuck as starting until the egg Start Configuration is modified. You have to edit the text to match something your bot will print for Pterodactyl panel to detect it as running. image

You can use arrays to have multiple different values when different bots are being used

{
  "done":[
    "change this text 1",
    "change this text 2"
  ]
}
Yolks
NameTag
ghcr.io/ptero-eggs/yolks:rust_latestghcr.io/ptero-eggs/yolks:rust_latest
ghcr.io/ptero-eggs/yolks:rust_1.60ghcr.io/ptero-eggs/yolks:rust_1.60
ghcr.io/ptero-eggs/yolks:rust_1.56ghcr.io/ptero-eggs/yolks:rust_1.56
ghcr.io/ptero-eggs/yolks:rust_1.31ghcr.io/ptero-eggs/yolks:rust_1.31
Variables and Startup

Startup Command

if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == "1" ]]; then git pull; fi; cargo run --release

Variables

Git Repo Address

Git repo to clone I.E. https://github.com/parkervcp/repo_name

Environment Variable: GIT_ADDRESS
Default Value:
User Viewable:
User Editable:
Git Branch

What branch to pull from github. Default is blank to pull the repo default branch

Environment Variable: BRANCH
Default Value:
User Viewable:
User Editable:
Auto Update

Pull the latest files on startup when using a GitHub repo.

Environment Variable: AUTO_UPDATE
Default Value: 0
User Viewable:
User Editable:
Git Username

Username to auth with git.

Environment Variable: USERNAME
Default Value:
User Viewable:
User Editable:
Git Access Token

Password to use with git. It's best practice to use a Personal Access Token. https://github.com/settings/tokens https://gitlab.com/-/profile/personal_access_tokens

Environment Variable: ACCESS_TOKEN
Default Value:
User Viewable:
User Editable:
Install Script
#!/bin/bash
# Rust Bot Installation Script
#
# Server Files: /mnt/server
apt update
apt install -y git

mkdir -p /mnt/server
cd /mnt/server

## add git ending if it's not on the address
if [[ ${GIT_ADDRESS} != *.git ]]; then
    GIT_ADDRESS=${GIT_ADDRESS}.git
fi

if [ -z "${USERNAME}" ] && [ -z "${ACCESS_TOKEN}" ]; then
    echo -e "using anon api call"
else
    GIT_ADDRESS="https://${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d/ -f3-)"
fi

## pull git js bot repo
if [ "$(ls -A /mnt/server)" ]; then
    echo -e "/mnt/server directory is not empty."
    if [ -d .git ]; then
        echo -e ".git directory exists"
        if [ -f .git/config ]; then
            echo -e "loading info from git config"
            ORIGIN=$(git config --get remote.origin.url)
        else
            echo -e "files found with no git config"
            echo -e "closing out without touching things to not break anything"
            exit 10
        fi
    fi

    if [ "${ORIGIN}" == "${GIT_ADDRESS}" ]; then
        echo "pulling latest from github"
        git pull
    fi
else
    echo -e "/mnt/server is empty.\ncloning files into repo"
    if [ -z ${BRANCH} ]; then
        echo -e "cloning default branch"
        git clone ${GIT_ADDRESS} .
    else
        echo -e "cloning ${BRANCH}'"
        git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .
    fi

fi

export HOME=/mnt/server

echo -e "install complete"
exit 0
Installation Imageghcr.io/ptero-eggs/installers:debianInstallation Entrypointbash