From 6f844b2d86ce0e4e98e8f9f09669b85d40e7203f Mon Sep 17 00:00:00 2001 From: IhToN Date: Sat, 17 Jan 2026 21:10:52 +0100 Subject: [PATCH] feat: add a dmidecode shim and allow for disabling cleartext session tokens storage --- Dockerfile | 28 ++++++++++++++++++++++++++++ egg-hytale.pelican.json | 12 ++++++++++++ egg-hytale.pterodactyl.json | 10 ++++++++++ scripts/build-push-dev.sh | 2 +- 4 files changed, 51 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2ac2e69..d25b884 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,6 +49,34 @@ RUN mkdir -p /egg-hytale COPY --chmod=755 ./lib /egg-hytale/lib RUN sed -i 's/\r$//' /egg-hytale/lib/*.sh +# Create dmidecode shim for Docker usage +RUN echo "Creating local dmidecode for Docker usage." && \ + cat > /usr/local/bin/dmidecode << 'EOF' +#!/bin/sh +if [ "$1" = "-s" ] && [ "$2" = "system-uuid" ]; then + UUID_FILE="$HOME/.hytale_system_uuid" + + if [ -f "$UUID_FILE" ]; then + cat "$UUID_FILE" + else + if command -v uuidgen >/dev/null 2>&1; then + uuidgen | tr "A-Z" "a-z" | tee "$UUID_FILE" >/dev/null + else + cat /proc/sys/kernel/random/uuid | tee "$UUID_FILE" >/dev/null + fi + cat "$UUID_FILE" + fi + + printf "\n" + exit 0 +fi + +echo "dmidecode shim: unsupported args: $*" >&2 +exit 1 +EOF +RUN chmod +x /usr/local/bin/dmidecode +RUN sed -i 's/\r$//' /entrypoint.sh + # Create the container user RUN useradd -m -d /home/container -s /bin/bash container diff --git a/egg-hytale.pelican.json b/egg-hytale.pelican.json index 5d9caf4..873bfb8 100644 --- a/egg-hytale.pelican.json +++ b/egg-hytale.pelican.json @@ -309,6 +309,18 @@ ], "sort": 24 }, + { + "name": "Unencrypted Auth Session", + "description": "Enable it to store the Authorization Session as a token in the root server. Needed if the server is not able to store an encrypted auth session. Intended for game server providers.", + "env_variable": "UNENCRYPTED_AUTH_SESSION", + "default_value": "0", + "user_viewable": true, + "user_editable": true, + "rules": [ + "boolean" + ], + "sort": 23 + }, { "name": "Patchline", "description": "What release channel you want to use", diff --git a/egg-hytale.pterodactyl.json b/egg-hytale.pterodactyl.json index d3801cb..fc29705 100644 --- a/egg-hytale.pterodactyl.json +++ b/egg-hytale.pterodactyl.json @@ -260,6 +260,16 @@ "rules": "required|integer|between:1,65535", "field_type": "text" }, + { + "name": "Unencrypted Auth Session", + "description": "Enable it to store the Authorization Session as a token in the root server. Needed if the server is not able to store an encrypted auth session. Intended for game server providers.", + "env_variable": "UNENCRYPTED_AUTH_SESSION", + "default_value": "0", + "user_viewable": true, + "user_editable": true, + "rules": "required|boolean", + "field_type": "text" + }, { "name": "Override Session Token", "description": "Optional session token used to override the normal server authentication process. This option only takes effect when both override tokens are set. If left empty, the server will request authentication on startup. Intended for game server providers.", diff --git a/scripts/build-push-dev.sh b/scripts/build-push-dev.sh index 04c2c9a..5c20d1d 100644 --- a/scripts/build-push-dev.sh +++ b/scripts/build-push-dev.sh @@ -4,4 +4,4 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_DIR="$(dirname "$SCRIPT_DIR")" echo "Building and pushing dev image..." -docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/natroutter/egg-hytale:dev --push "$PROJECT_DIR" \ No newline at end of file +docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/ihton/egg-hytale:dev --push "$PROJECT_DIR" \ No newline at end of file