Skip to content

Commit af55247

Browse files
Merge pull request #35 from indifferentbroccoli/Skip-Update-on-First-Boot
ARM Support, Commandline script, version checking fixes, patchline
2 parents 8e0df71 + 1b29a16 commit af55247

7 files changed

Lines changed: 81 additions & 11 deletions

File tree

.github/workflows/developer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ jobs:
2828
- name: Docker - Build / Push
2929
uses: docker/build-push-action@v6
3030
with:
31-
platforms: linux/amd64
31+
platforms: linux/amd64,linux/arm64
3232
push: true
3333
tags: '${{ steps.meta.outputs.tags }}'

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
id: docker_build
3333
uses: docker/build-push-action@v6
3434
with:
35-
platforms: 'linux/amd64'
35+
platforms: 'linux/amd64,linux/arm64'
3636
push: true
3737
tags: '${{ steps.meta.outputs.tags }}'
3838
- name: Docker Hub - Update README

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
99
unzip \
1010
wget \
1111
ca-certificates \
12+
qemu-user-static \
1213
&& apt-get clean \
1314
&& rm -rf /var/lib/apt/lists/*
1415

@@ -35,6 +36,7 @@ ENV HOME=/home/hytale \
3536
AUTH_MODE=authenticated \
3637
ACCEPT_EARLY_PLUGINS=false \
3738
DOWNLOAD_ON_START=true \
39+
PATCHLINE=release \
3840
SESSION_TOKEN="" \
3941
IDENTITY_TOKEN="" \
4042
OWNER_UUID=""

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ A Docker container for running a Hytale dedicated server with automatic download
3131
> - Server resource usage depends heavily on player count and view distance
3232
> - Higher view distances significantly increase RAM usage
3333
> - Hytale uses **QUIC over UDP** (not TCP) on port **5520**
34+
> - **ARM64/Apple Silicon supported** - The x86_64 downloader runs via QEMU emulation, while the Java server runs natively
3435
3536
> [!IMPORTANT]
3637
> **First-Time Setup: Authentication Required**
@@ -117,6 +118,7 @@ You can use the following values to change the settings of the server on boot.
117118
| MIN_MEMORY | | Minimum JVM heap size (e.g., 4G). Leave unset to omit -Xms flag |
118119
| MAX_MEMORY | 8G | Maximum JVM heap size (e.g., 8G, 8192M) |
119120
| JVM_ARGS | | Custom JVM arguments (optional) |
121+
| PATCHLINE | release | Selects the patchline for the game (`release` or `pre-release`) |
120122
| DOWNLOAD_ON_START | true | Automatically download/update server files on startup |
121123

122124
## Port Configuration
@@ -194,6 +196,17 @@ Server files are automatically updated on restart if `DOWNLOAD_ON_START=true`. T
194196
docker-compose restart
195197
```
196198

199+
### Send commands to the server console
200+
```bash
201+
# Send a command to the running server
202+
docker exec -u hytale hytale command.sh "/auth status"
203+
204+
# Other examples
205+
docker exec -u hytale hytale command.sh "/eventtitle 'Hello Indifferent Server'"
206+
docker exec -u hytale hytale command.sh "/kick player"
207+
docker exec -u hytale hytale command.sh "/op add player"
208+
```
209+
197210
## Support
198211

199212
- [Official Hytale Server Manual](https://support.hytale.com/hc/en-us/articles/45326769420827-Hytale-Server-Manual)

scripts/command.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Helper script to send commands to the Hytale server console
4+
# Usage: send-command.sh <command>
5+
# Example: send-command.sh "/auth status"
6+
7+
if [ $# -eq 0 ]; then
8+
echo "Usage: $(basename "$0") <command>"
9+
echo "Example: $(basename "$0") \"/auth status\""
10+
exit 1
11+
fi
12+
13+
# Find the hytale input pipe
14+
INPUT_PIPE=$(find /tmp -name "hytale_input_*" -type p 2>/dev/null | head -1)
15+
16+
if [ -z "$INPUT_PIPE" ]; then
17+
echo "Error: Hytale server input pipe not found. Is the server running?"
18+
exit 1
19+
fi
20+
21+
# Send the command
22+
echo "$*" > "$INPUT_PIPE"
23+
24+
echo "Command sent: $*"

scripts/functions.sh

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ Log() {
4242
download_server() {
4343
LogAction "Checking server version"
4444

45+
# Check architecture and log if using QEMU
46+
local ARCH=$(uname -m)
47+
if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
48+
LogInfo "Running on ARM64 architecture"
49+
LogInfo "x86_64 downloader will use QEMU emulation"
50+
else
51+
LogInfo "Running on $ARCH architecture"
52+
fi
53+
4554
local SERVER_FILES="/home/hytale/server-files"
4655
local DOWNLOADER_URL="https://downloader.hytale.com/hytale-downloader.zip"
4756
local DOWNLOADER_ZIP="$SERVER_FILES/hytale-downloader.zip"
@@ -81,22 +90,30 @@ download_server() {
8190
local CREDENTIALS_FILE="$DOWNLOADER_DIR/.hytale-downloader-credentials.json"
8291
local latest_version=""
8392
local current_version=""
93+
local PATCHLINE="${PATCHLINE:-release}"
94+
local DOWNLOADER_BASENAME
95+
DOWNLOADER_BASENAME="$(basename "$DOWNLOADER_EXEC")"
96+
97+
# Build downloader command with patchline
98+
local DOWNLOADER_CMD="./$DOWNLOADER_BASENAME"
99+
if [ "$PATCHLINE" != "release" ]; then
100+
DOWNLOADER_CMD="$DOWNLOADER_CMD -patchline $PATCHLINE"
101+
LogInfo "Using patchline: $PATCHLINE"
102+
fi
84103

85104
if [ ! -f "$CREDENTIALS_FILE" ]; then
86105
# First boot - no credentials yet, skip version check
87106
LogInfo "First time setup - authentication required"
88107
else
89108
# Check latest available version
90109
LogInfo "Checking latest version..."
91-
latest_version=$(./$(basename "$DOWNLOADER_EXEC") -print-version)
92-
93-
if [ -z "$latest_version" ]; then
110+
if latest_version=$(eval "$DOWNLOADER_CMD -print-version" 2>/dev/null) && [ -n "$latest_version" ]; then
111+
LogInfo "Latest available version: $latest_version"
112+
else
94113
LogError "Failed to get latest version"
95114
return 1
96115
fi
97116

98-
LogInfo "Latest available version: $latest_version"
99-
100117
# Check current installed version
101118
if [ -f "$VERSION_FILE" ]; then
102119
current_version=$(cat "$VERSION_FILE")
@@ -116,7 +133,8 @@ download_server() {
116133
fi
117134

118135
LogInfo "Downloading server files (this may take a while)..."
119-
./$(basename "$DOWNLOADER_EXEC") -download-path "$SERVER_FILES/game.zip" || {
136+
cd "$(dirname "$DOWNLOADER_EXEC")" || exit 1
137+
eval "$DOWNLOADER_CMD -download-path '$SERVER_FILES/game.zip'" || {
120138
LogError "Failed to download server files"
121139
return 1
122140
}
@@ -141,6 +159,14 @@ download_server() {
141159
return 1
142160
fi
143161

162+
# Get version if we don't have it yet (first boot or version check was skipped)
163+
if [ -z "$latest_version" ]; then
164+
cd "$(dirname "$DOWNLOADER_EXEC")" || exit 1
165+
if latest_version=$(eval "$DOWNLOADER_CMD -print-version" 2>/dev/null) && [ -n "$latest_version" ]; then
166+
LogInfo "Server version: $latest_version"
167+
fi
168+
fi
169+
144170
# Remove outdated AOT cache only if this was an update
145171
if [ -n "$current_version" ] && [ "$current_version" != "$latest_version" ]; then
146172
if [ -f "$SERVER_FILES/Server/HytaleServer.aot" ]; then
@@ -150,9 +176,12 @@ download_server() {
150176
fi
151177

152178
# Save version
153-
echo "$latest_version" > "$VERSION_FILE"
154-
155-
LogSuccess "Server download completed (version $latest_version)"
179+
if [ -n "$latest_version" ]; then
180+
echo "$latest_version" > "$VERSION_FILE"
181+
LogSuccess "Server download completed (version $latest_version)"
182+
else
183+
LogSuccess "Server download completed"
184+
fi
156185
}
157186

158187
# Attempt to shutdown the server gracefully

scripts/init.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export ACCEPT_EARLY_PLUGINS
7272
export MIN_MEMORY
7373
export MAX_MEMORY
7474
export JVM_ARGS
75+
export PATCHLINE
7576
export SESSION_TOKEN
7677
export IDENTITY_TOKEN
7778
export OWNER_UUID
@@ -92,6 +93,7 @@ su hytale -c "export PATH=\"$PATH\" && cd /home/hytale/server && \
9293
MIN_MEMORY='${MIN_MEMORY}' \
9394
MAX_MEMORY='${MAX_MEMORY}' \
9495
JVM_ARGS='${JVM_ARGS}' \
96+
PATCHLINE='${PATCHLINE}' \
9597
SESSION_TOKEN='${SESSION_TOKEN}' \
9698
IDENTITY_TOKEN='${IDENTITY_TOKEN}' \
9799
OWNER_UUID='${OWNER_UUID}' \

0 commit comments

Comments
 (0)