diff --git a/Dockerfile b/Dockerfile index 9d447a2..43cc995 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,6 +42,34 @@ COPY --chmod=755 ./entrypoint.sh /entrypoint.sh # Strip Windows line endings (\r) just in case the file was edited on Windows RUN sed -i 's/\r$//' /entrypoint.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 + # Copy lib directory COPY --chmod=755 ./lib /lib RUN sed -i 's/\r$//' /lib/*.sh diff --git a/egg-hytale.pelican.json b/egg-hytale.pelican.json index 81603ac..f3a0989 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 65cc0ad..5490e06 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/entrypoint.sh b/entrypoint.sh index 931d6d3..34bf469 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -73,7 +73,7 @@ if [ -n "$OVERRIDE_SESSION_TOKEN" ] && [ -n "$OVERRIDE_IDENTITY_TOKEN" ]; then logger info "Using provided session and identity tokens..." SESSION_TOKEN="$OVERRIDE_SESSION_TOKEN" IDENTITY_TOKEN="$OVERRIDE_IDENTITY_TOKEN" -else +else if [ "${UNENCRYPTED_AUTH_SESSION}" = "1" ]; then # Standard mode: perform authentication if check_cached_tokens && load_cached_tokens; then logger info "Using cached authentication..." 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