Compare commits

...

17 Commits

Author SHA1 Message Date
dependabot[bot] 20830d001b build(deps): bump the updates group with 3 updates
Bumps the updates group with 3 updates: [docker/metadata-action](https://github.com/docker/metadata-action), [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) and [docker/login-action](https://github.com/docker/login-action).


Updates `docker/metadata-action` from 6.1.0 to 6.2.0
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/v6.1.0...v6.2.0)

Updates `docker/setup-qemu-action` from 4.1.0 to 4.2.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v4.1.0...v4.2.0)

Updates `docker/login-action` from 4.2.0 to 4.4.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v4.2.0...v4.4.0)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: updates
- dependency-name: docker/setup-qemu-action
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: updates
- dependency-name: docker/login-action
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: updates
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-08 08:32:39 +00:00
renovate[bot] 702d05e60c Update dependency itzg/mc-monitor to v0.16.10 (#4148)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-07 18:52:58 -05:00
David Gaag 32b026d0df Fix GTNH versions.json parsing (#4146) 2026-07-06 06:59:21 -05:00
Leon Kampwerth d9ee3ee68c Refactor deploy gtnh (#4141) 2026-07-05 07:43:43 -05:00
Geoff Bourne ab505fa43c Pass GH_TOKEN to containers started during tests (#4136) 2026-07-04 23:17:54 -05:00
dependabot[bot] 78ecbb5749 build(deps): bump click from 8.4.1 to 8.4.2 in /docs in the patches group (#4143) 2026-07-01 07:08:31 -05:00
renovate[bot] e992e71988 Update dependency itzg/mc-monitor to v0.16.8 (#4142) 2026-06-30 19:56:26 -05:00
Samuel Stanley 3cc2e64163 Add example for loading mods from a local directory (#4138) 2026-06-28 07:50:59 -05:00
Chip Wolf ‮ f1dd0f3d71 packwiz: re-load LOAD_ENV_FROM_FILE after the installer runs (#4137) 2026-06-26 10:18:53 -05:00
Harrison Black 292b2f757e paper: Fix boolean flag always return true (#4134) 2026-06-25 12:36:59 -05:00
Harrison Black 82043d556e Add purpur support for ServerLibraryCleaner (#4133) 2026-06-25 12:35:29 -05:00
Geoff Bourne d9bf26cc17 GTNH: allow for spaces in GTNH_PACK_VERSION (#4132) 2026-06-25 10:21:50 -05:00
dependabot[bot] 8b076e4868 build(deps): bump docker/build-push-action from 6 to 7 (#4124) 2026-06-24 12:20:04 -05:00
dependabot[bot] 4c534490f2 build(deps): bump pymdown-extensions from 10.21.3 to 11.0 in /docs (#4128) 2026-06-24 07:13:00 -05:00
dependabot[bot] 314beec407 build(deps): bump the patches group in /docs with 4 updates (#4127) 2026-06-24 06:54:41 -05:00
Geoff Bourne 2ecf6776e2 Handle non-specific file types in start-utils extraction logic (#4121) 2026-06-23 07:34:36 -05:00
Geoff Bourne dadecdac28 Improved and refactored sponsor labeler workflow (#4123) 2026-06-22 15:19:38 -05:00
16 changed files with 206 additions and 138 deletions
+8 -8
View File
@@ -104,14 +104,14 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v6.0.3 uses: actions/checkout@v7
with: with:
# for build-files step # for build-files step
fetch-depth: 0 fetch-depth: 0
- name: Docker meta - name: Docker meta
id: meta id: meta
uses: docker/metadata-action@v6.1.0 uses: docker/metadata-action@v6.2.0
with: with:
# NOTE for forks: if your Docker Hub organization doesn't match your Github repo's, # NOTE for forks: if your Docker Hub organization doesn't match your Github repo's,
# then the use of ${{ github.repository_owner }} will need to be replaced. # then the use of ${{ github.repository_owner }} will need to be replaced.
@@ -141,13 +141,13 @@ jobs:
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com> org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
- name: Setup Docker Buildx - name: Setup Docker Buildx
uses: docker/setup-buildx-action@v4.1.0 uses: docker/setup-buildx-action@v4
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v4.1.0 uses: docker/setup-qemu-action@v4.2.0
- name: Build for test - name: Build for test
uses: docker/build-push-action@v7.2.0 uses: docker/build-push-action@v7
with: with:
platforms: linux/amd64 platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }} tags: ${{ env.IMAGE_TO_TEST }}
@@ -172,14 +172,14 @@ jobs:
tests/test.sh tests/test.sh
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v4.2.0 uses: docker/login-action@v4.4.0
if: env.HAS_IMAGE_REPO_ACCESS if: env.HAS_IMAGE_REPO_ACCESS
with: with:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GHCR - name: Login to GHCR
uses: docker/login-action@v4.2.0 uses: docker/login-action@v4.4.0
if: env.HAS_IMAGE_REPO_ACCESS if: env.HAS_IMAGE_REPO_ACCESS
with: with:
registry: ghcr.io registry: ghcr.io
@@ -187,7 +187,7 @@ jobs:
password: ${{ github.token }} password: ${{ github.token }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v7.2.0 uses: docker/build-push-action@v7
if: github.actor == github.repository_owner if: github.actor == github.repository_owner
with: with:
platforms: ${{ matrix.platforms }} platforms: ${{ matrix.platforms }}
+6 -13
View File
@@ -1,4 +1,5 @@
name: Label Sponsor Contributions name: Sponsor Labeler
on: on:
issues: issues:
types: types:
@@ -9,15 +10,7 @@ on:
jobs: jobs:
label-sponsor: label-sponsor:
runs-on: ubuntu-latest uses: itzg/github-workflows/.github/workflows/sponsor-labeler.yml@main
permissions: with:
pull-requests: write author: ${{ github.event.issue.user.login || github.event.pull_request.user.login }}
issues: write number: ${{ github.event.issue.number || github.event.pull_request.number }}
steps:
- name: Check if sponsor
uses: JasonEtco/is-sponsor-label-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
label: sponsor
+3 -3
View File
@@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v7
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v4
- name: Build docs image - name: Build docs image
uses: docker/build-push-action@v6 uses: docker/build-push-action@v7
with: with:
context: . context: .
file: docs/Dockerfile file: docs/Dockerfile
+4 -4
View File
@@ -53,16 +53,16 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v6.0.3 uses: actions/checkout@v7
with: with:
# for build-files step # for build-files step
fetch-depth: 0 fetch-depth: 0
- name: Setup Docker Buildx - name: Setup Docker Buildx
uses: docker/setup-buildx-action@v4.1.0 uses: docker/setup-buildx-action@v4
- name: Confirm multi-arch build - name: Confirm multi-arch build
uses: docker/build-push-action@v7.2.0 uses: docker/build-push-action@v7
with: with:
platforms: ${{ matrix.platforms }} platforms: ${{ matrix.platforms }}
# ensure latest base image is used # ensure latest base image is used
@@ -73,7 +73,7 @@ jobs:
cache-from: type=gha,scope=${{ matrix.variant }} cache-from: type=gha,scope=${{ matrix.variant }}
- name: Build for test - name: Build for test
uses: docker/build-push-action@v7.2.0 uses: docker/build-push-action@v7
with: with:
# Only build single platform since loading multi-arch image into daemon fails with # Only build single platform since loading multi-arch image into daemon fails with
# "docker exporter does not currently support exporting manifest lists" # "docker exporter does not currently support exporting manifest lists"
+1 -1
View File
@@ -43,7 +43,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz --from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
# renovate: datasource=github-releases packageName=itzg/mc-monitor # renovate: datasource=github-releases packageName=itzg/mc-monitor
ARG MC_MONITOR_VERSION=0.16.7 ARG MC_MONITOR_VERSION=0.16.10
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${MC_MONITOR_VERSION} --var app=mc-monitor --file {{.app}} \ --var version=${MC_MONITOR_VERSION} --var app=mc-monitor --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz --from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
+5 -2
View File
@@ -26,7 +26,10 @@ docker run -d --pull=always \
By default, supported server types remove stale server libraries during installation by setting `CLEAN_SERVER_LIBRARIES` to `true`. Set `CLEAN_SERVER_LIBRARIES` to `false` to disable this cleanup if it causes unexpected behavior. By default, supported server types remove stale server libraries during installation by setting `CLEAN_SERVER_LIBRARIES` to `true`. Set `CLEAN_SERVER_LIBRARIES` to `false` to disable this cleanup if it causes unexpected behavior.
Currently, library cleanup is supported by `TYPE=PAPER`. Other server jar types are not yet supported. Currently, library cleanup is supported by
- `TYPE=PAPER`
- `TYPE=PURPUR`
## Running as alternate user/group ID ## Running as alternate user/group ID
@@ -244,4 +247,4 @@ To also include the timestamp with each log, set `LOG_TIMESTAMP` to "true". The
``` ```
[init] 2022-02-05 16:58:33+00:00 Starting the Minecraft server... [init] 2022-02-05 16:58:33+00:00 Starting the Minecraft server...
``` ```
+13
View File
@@ -42,6 +42,19 @@ There are optional volume paths that can be attached to supply content to be cop
`/mods` `/mods`
: content in this directory is synchronized into `/data/mods` for server types that use mods, [as described above](#mods-vs-plugins). For special cases, the source can be changed by setting `COPY_MODS_SRC` and destination by setting `COPY_MODS_DEST`. : content in this directory is synchronized into `/data/mods` for server types that use mods, [as described above](#mods-vs-plugins). For special cases, the source can be changed by setting `COPY_MODS_SRC` and destination by setting `COPY_MODS_DEST`.
!!! example "Loading mods from a local directory"
This is the most basic example, where `./mods` is mounted as `/mods`. If the directory with the server's mods is located somewhere else, `./mods` can be modified accordingly.
```yaml
environment:
EULA: "TRUE"
TYPE: "NEOFORGE"
volumes:
- "./data:/data"
- "./mods:/mods"
```
`/config` `/config`
: contents are synchronized into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`. For example, `-v ./config:/config -e COPY_CONFIG_DEST=/data` will allow you to copy over files like `bukkit.yml` and so on directly into the server directory. The source can be changed by setting `COPY_CONFIG_SRC`. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/config` to take precedence over newer files in `/data/config`. : contents are synchronized into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`. For example, `-v ./config:/config -e COPY_CONFIG_DEST=/data` will allow you to copy over files like `bukkit.yml` and so on directly into the server directory. The source can be changed by setting `COPY_CONFIG_SRC`. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/config` to take precedence over newer files in `/data/config`.
+2
View File
@@ -13,6 +13,8 @@ docker run -d --pull=always \
packwiz modpack definitions are processed before other mod definitions (`MODPACK`, `MODS`, etc.) to allow for additional processing/overrides you may want to perform (in case of mods not available via Modrinth/CurseForge, or you do not maintain the pack). packwiz modpack definitions are processed before other mod definitions (`MODPACK`, `MODS`, etc.) to allow for additional processing/overrides you may want to perform (in case of mods not available via Modrinth/CurseForge, or you do not maintain the pack).
If the pack ships a `.env` file that you reference with `LOAD_ENV_FROM_FILE`, that file is re-loaded immediately after the packwiz installer runs, so the freshly downloaded values are applied to the remaining startup stages. Note that `TYPE` and `VERSION` are resolved earlier (before the deploy is dispatched), so a pack-provided `.env` cannot change those from within packwiz; use `LOAD_ENV_FROM_GENERIC_PACK` or `LOAD_ENV_FROM_ARCHIVE` for those.
!!! note !!! note
packwiz is pre-configured to only download server mods. If client-side mods are downloaded and cause issues, check your pack.toml configuration, and make sure any client-only mods are not set to `"both"`, but rather `"client"` for the side configuration item. packwiz is pre-configured to only download server mods. If client-side mods are downloaded and cause issues, check your pack.toml configuration, and make sure any client-only mods are not set to `"both"`, but rather `"client"` for the side configuration item.
+6 -6
View File
@@ -1,8 +1,8 @@
click==8.4.1 click==8.4.2
colorama==0.4.6 colorama==0.4.6
deepmerge==2.0 deepmerge==2.1.0
ghp-import==2.1.0 ghp-import==2.1.0
griffe==2.0.2 griffe==2.1.0
Jinja2==3.1.6 Jinja2==3.1.6
Markdown==3.10.2 Markdown==3.10.2
MarkupSafe==3.0.3 MarkupSafe==3.0.3
@@ -11,15 +11,15 @@ mkdocs==1.6.1
mkdocs-autorefs==1.4.4 mkdocs-autorefs==1.4.4
mkdocs-get-deps==0.2.2 mkdocs-get-deps==0.2.2
mkdocstrings==1.0.4 mkdocstrings==1.0.4
mkdocstrings-python==2.0.4 mkdocstrings-python==2.0.5
packaging==26.2 packaging==26.2
pathspec==1.1.1 pathspec==1.1.1
platformdirs==4.10.0 platformdirs==4.10.0
Pygments==2.20.0 Pygments==2.20.0
pymdown-extensions==10.21.3 pymdown-extensions==11.0
python-dateutil==2.9.0.post0 python-dateutil==2.9.0.post0
PyYAML==6.0.3 PyYAML==6.0.3
pyyaml_env_tag==1.1 pyyaml_env_tag==1.1
six==1.17.0 six==1.17.0
watchdog==6.0.0 watchdog==6.0.0
zensical==0.0.45 zensical==0.0.46
@@ -35,7 +35,7 @@ For optimal performance choose java25 with GTNH 2.8.0 and later.
## Config backups ## Config backups
During version upgrade, the server will replace all config files to make sure all new features are setup as intended. The old config files are stored in a backup folder in the data directory, for you to use as reference for manual reapplication of your changed settings. Set the environment variable `GTNH_DELETE_BACKUPS` to true to delete all backup folders at startup. During version upgrade, the server will replace all config files to make sure all new features are setup as intended. The old config files are stored in a backup folder in the data directory, for you to use as reference for manual reapplication of your changed settings. The folder name starts with `gtnh-upgrade-` followed by a timestamp. Set the environment variable `GTNH_DELETE_BACKUPS` to true to delete all backup folders at startup.
## server.properties defaults ## server.properties defaults
+120 -93
View File
@@ -7,13 +7,14 @@
function getGTNHdownloadPath(){ function getGTNHdownloadPath(){
gtnh_download_path="" gtnh_download_path=""
local release_object="" local release_object=""
local current_java_version=$(mc-image-helper java-release) local current_java_version=""
current_java_version=$(mc-image-helper java-release)
# Select release JSON object # Select release JSON object
if [ "$GTNH_PACK_VERSION" == "latest-dev" ]; then if [ "$GTNH_PACK_VERSION" == "latest-dev" ]; then
if ! release_object="$( if ! release_object="$(
curl -fsSL "https://downloads.gtnewhorizons.com/versions.json" \ curl -fsSL "https://downloads.gtnewhorizons.com/versions.json" \
| jq -r '.versions|to_entries|sort_by(.value.releaseDate)|map(select(.value.title=="Beta release"))|.[-1]' | jq -r '(.versions // .)|to_entries|sort_by(.value.releaseDate)|map(select(.value.title=="Beta release"))|.[-1]'
)"; then logError "Failed to retrieve release from https://downloads.gtnewhorizons.com/versions.json" )"; then logError "Failed to retrieve release from https://downloads.gtnewhorizons.com/versions.json"
exit 1 exit 1
fi fi
@@ -22,7 +23,7 @@ function getGTNHdownloadPath(){
elif [ "$GTNH_PACK_VERSION" == "latest" ]; then elif [ "$GTNH_PACK_VERSION" == "latest" ]; then
if ! release_object="$( if ! release_object="$(
curl -fsSL "https://downloads.gtnewhorizons.com/versions.json" \ curl -fsSL "https://downloads.gtnewhorizons.com/versions.json" \
| jq -r '.versions|to_entries|sort_by(.value.releaseDate)|map(select(.value.title=="Stable release"))|.[-1]' | jq -r '(.versions // .)|to_entries|sort_by(.value.releaseDate)|map(select(.value.title=="Stable release"))|.[-1]'
)"; then logError "Failed to retrieve release from https://downloads.gtnewhorizons.com/versions.json" )"; then logError "Failed to retrieve release from https://downloads.gtnewhorizons.com/versions.json"
exit 1 exit 1
fi fi
@@ -31,13 +32,18 @@ function getGTNHdownloadPath(){
else else
if ! release_object="$( if ! release_object="$(
curl -fsSL "https://downloads.gtnewhorizons.com/versions.json" \ curl -fsSL "https://downloads.gtnewhorizons.com/versions.json" \
| jq -r --arg USRIN $GTNH_PACK_VERSION '.versions|to_entries|sort_by(.value.releaseDate)|map(select(.key==$USRIN))|.[]' | jq -r --arg USRIN "$GTNH_PACK_VERSION" '(.versions // .)|to_entries|sort_by(.value.releaseDate)|map(select(.key==$USRIN))|.[]'
)"; then logError "Failed to retrieve release from https://downloads.gtnewhorizons.com/versions.json" )"; then logError "Failed to retrieve release from https://downloads.gtnewhorizons.com/versions.json"
exit 1 exit 1
fi fi
log "Selected $(jq -r '.key' <<< "$release_object") as matching version for download." log "Selected $(jq -r '.key' <<< "$release_object") as matching version for download."
fi fi
if [[ -z $release_object ]]; then
logError "No release found for GTNH_PACK_VERSION=$GTNH_PACK_VERSION. Please check if the version is valid."
exit 1
fi
# Select compatible server files for java version # Select compatible server files for java version
if (( current_java_version == 8 )); then if (( current_java_version == 8 )); then
@@ -59,6 +65,10 @@ function getGTNHdownloadPath(){
fi fi
if [[ -z $gtnh_download_path ]]; then
logError "Server files not found! Please check if the selected GTNH_PACK_VERSION=$GTNH_PACK_VERSION is valid."
exit 1
fi
debug "Download source URL: $gtnh_download_path" debug "Download source URL: $gtnh_download_path"
} }
@@ -70,80 +80,125 @@ function deleteGTNHbackup(){
fi fi
} }
function downloadGTNH(){
local gtnh_download=""
base_dir=/data/.tmp/gtnh_base
debug "Creating temporary /data/.tmp/packs folder for GTNH download"
mkdir -p /data/.tmp/packs
trap 'rm -rf /data/.tmp' EXIT
log "Downloading $gtnh_download_path."
if ! gtnh_download=$(mc-image-helper get -o /data/.tmp/packs --output-filename --skip-up-to-date "$gtnh_download_path"); then
logError "Failed to download $gtnh_download_path"
exit 1
fi
debug "Downloaded GTNH server files to $gtnh_download"
# Unpacking Server files into temporary directory
log "Unpacking Server Files into $base_dir"
mkdir -p "${base_dir}"
extract "${gtnh_download}" "${base_dir}"
# Remove any eula file since container manages it
debug "Removing eula.txt from $base_dir"
rm -f "${base_dir}/eula.txt"
# recalculate the actual base directory of content
if ! base_dir=$(mc-image-helper find \
--max-depth=3 --type=directory --name=mods,config \
--only-shallowest --fail-no-matches --format '%h' \
"$base_dir"); then
logError "Unable to find content base of downloaded Server Files"
exit 1
fi
debug "Base directory of unpacked Server Files: $base_dir"
}
function updateGTNHresource(){
local resource="$1"
local new_resource="$2"
log "Trying to update $resource"
if [[ -z "$resource" ]]; then
logWarning "No resource specified for update"
return 0
fi
if [[ -e "$resource" ]]; then
log "Deleting existing resource: $resource"
if ! rm -rf "$resource"; then
logError "Failed to delete resource: $resource"
exit 1
fi
fi
if [[ -d "$new_resource" ]]; then
log "Copying $new_resource to /data"
if ! cp -r "$new_resource" "/data/"; then
logError "Failed to copy $new_resource to /data"
exit 1
fi
return 0
fi
if [[ -f "$new_resource" ]]; then
log "Copying $new_resource to /data"
if ! cp "$new_resource" "/data/"; then
logError "Failed to copy $new_resource to /data"
exit 1
fi
return 0
fi
logWarning "Resource update failed: $new_resource does not exist!"
return 0
}
function updateGTNH(){ function updateGTNH(){
# Get the current date and time # Get the current date and time
current_datetime=$(date +%Y-%m-%dT%H:%M) local current_datetime=""
current_datetime=$(date +%Y-%m-%dT+%H%M)
# Define folders and files to update # Define folders and files to update
folders_to_update=("libraries" "mods" "resources" "scripts") # base_dir is already defined in handleGTNH function
files_to_update=("lwjgl3ify-forgePatches.jar" "java9args.txt" "startserver-java9.bat" "startserver-java9.sh" "forge-1.7.10-10.13.4.1614-1.7.10-universal.jar" "startserver.bat" "startserver.sh" "server-icon.png") local folders_to_update=("libraries" "mods" "resources" "scripts")
config_folder="config" local files_to_update=("lwjgl3ify-forgePatches.jar" "java9args.txt" "startserver-java9.bat" "startserver-java9.sh" "forge-1.7.10-10.13.4.1614-1.7.10-universal.jar" "startserver.bat" "startserver.sh" "server-icon.png")
backup_folder="/data/gtnh-upgrade-$current_datetime" local config_folder="config"
journey_map_folder="JourneyMapServer" local backup_folder="/data/gtnh-upgrade-$current_datetime"
local journey_map_folder="JourneyMapServer"
# Delete specified folders if they exist
for folder in "${folders_to_update[@]}"; do
folder_path="/data/$folder"
if [[ -d "$folder_path" ]]; then
log "Deleting folder: $folder_path"
rm -rf "$folder_path"
fi
done
# Delete specific files if they exist
for file in "${files_to_update[@]}"; do
file_path="/data/$file"
if [[ -f "$file_path" ]]; then
log "Deleting file: $file_path"
rm -f "$file_path"
fi
done
# Backup the config folder # Backup the config folder
if [[ -d "/data/$config_folder" ]]; then if [[ -d "/data/$config_folder" ]]; then
log "Creating backup of /data/$config_folder at $backup_folder" log "Creating backup of /data/$config_folder at $backup_folder"
cp -r "/data/$config_folder" "$backup_folder" cp -r "/data/$config_folder" "$backup_folder"
log "Deleting original /data/$config_folder"
rm -rf "/data/$config_folder"
fi fi
# Updating the required folders in data directory # Update resources from unpacked server files to /data
for folder in "${folders_to_update[@]}" "$config_folder"; do for resource in "${folders_to_update[@]}" "$config_folder" "${files_to_update[@]}"; do
if [[ -d "$base_dir/$folder" ]]; then local resource_path="/data/$resource"
log "Copying $folder to /data" local new_resource_path="$base_dir/$resource"
cp -r "$base_dir/$folder" "/data/"
else
logWarning "Folder $folder not found in the unzipped data!"
fi
done
# Copy specific files to the /data directory
for file in "${files_to_update[@]}"; do
if [[ -f "$base_dir/$file" ]]; then
log "Copying $file to /data"
cp "$base_dir/$file" "/data/"
else
logWarning "File $file not found in the unzipped data!"
fi
done
# Ensure the config folder exists debug "Updating resource: $resource_path with new resource: $new_resource_path"
if [[ ! -d "$config_folder" ]]; then updateGTNHresource "$resource_path" "$new_resource_path"
log "$config_folder does not exist. Creating it now." done
mkdir -p "$config_folder"
fi
# Restore JourneyMapServer folder from backup # Restore JourneyMapServer folder from backup
if [[ -d "$backup_folder/$journey_map_folder" ]]; then if [[ -d "$backup_folder/$journey_map_folder" ]]; then
log "Restoring $journey_map_folder to $config_folder" if [[ ! -d "/data/$config_folder" ]]; then
cp -r "$backup_folder/$journey_map_folder" "$config_folder/" log "/data/$config_folder folder does not exist. Creating it now."
mkdir -p "/data/$config_folder"
fi
log "Restoring $journey_map_folder to /data/$config_folder"
cp -r "$backup_folder/$journey_map_folder" "/data/$config_folder/"
else else
logWarning "$journey_map_folder not found in backup!" logWarning "$journey_map_folder not found in backup!"
fi fi
# Copy the changelog file to /data # Copy the changelog file to /data
local gtnh_changelog_file=""
gtnh_changelog_file=$(mc-image-helper find --max-depth=1 --type=file --name=changelog*.md "$base_dir") gtnh_changelog_file=$(mc-image-helper find --max-depth=1 --type=file --name=changelog*.md "$base_dir")
if [[ -n "$gtnh_changelog_file" ]]; then if [[ -n "$gtnh_changelog_file" ]]; then
debug "Found changelog file: $gtnh_changelog_file"
log "Copying changelog file to /data" log "Copying changelog file to /data"
cp -f "$gtnh_changelog_file" /data/ cp -f "$gtnh_changelog_file" /data/
fi fi
@@ -160,49 +215,19 @@ function handleGTNH() {
deleteGTNHbackup deleteGTNHbackup
fi fi
if [[ -n $GTNH_PACK_VERSION ]] && isFalse "$SKIP_GTNH_UPDATE_CHECK" ; then if [[ -n "$GTNH_PACK_VERSION" ]] && isFalse "$SKIP_GTNH_UPDATE_CHECK" ; then
getGTNHdownloadPath getGTNHdownloadPath
if [[ -z $gtnh_download_path ]]; then
logError "Server files not found for GTNH_PACK_VERSION=$GTNH_PACK_VERSION! Download not possible!"
exit 1
fi
log "Server files located! Will proceed update $gtnh_download_path." log "Server files located! Will proceed update $gtnh_download_path."
# Decide if update or install is needed or not. # Decide if update or install is needed or not.
if [[ ! -f /data/.gtnh-version || "$(basename "$gtnh_download_path")" != "$(cat /data/.gtnh-version)" ]]; then if [[ ! -f /data/.gtnh-version || "$(basename "$gtnh_download_path")" != "$(cat /data/.gtnh-version)" ]]; then
log "Update/Install required: /data/.gtnh-version is missing or does not match the selected version $(basename "$gtnh_download_path")." log "Update/Install required: /data/.gtnh-version is missing or does not match the selected version $(basename "$gtnh_download_path")."
mkdir -p /data/packs # Download and unpack GTNH server files
log "Downloading $gtnh_download_path." downloadGTNH
if ! gtnh_download=$(mc-image-helper get -o /data/packs --output-filename --skip-up-to-date "$gtnh_download_path"); then log "GTNH server files downloaded and unpacked to $base_dir."
logError "Failed to download $gtnh_download_path"
exit 1
fi
# Unpacking Server files into temporary directory
log "Unpacking Server Files..."
original_base_dir=/data/.tmp/gtnh_base
base_dir=$original_base_dir
rm -rf "${base_dir}"
mkdir -p "${base_dir}"
extract "${gtnh_download}" "${base_dir}"
trap 'rm -rf /data/.tmp' EXIT
# Removing downloaded zip
rm -f "$gtnh_download"
# Remove any eula file since container manages it
rm -f "${base_dir}/eula.txt"
# recalculate the actual base directory of content
if ! base_dir=$(mc-image-helper find \
--max-depth=3 --type=directory --name=mods,config \
--only-shallowest --fail-no-matches --format '%h' \
"$base_dir"); then
logError "Unable to find content base of downloaded Server Files"
exit 1
fi
# Split installation from update path. Check for version file. # Split installation from update path. Check for version file.
if [[ -f /data/.gtnh-version ]]; then if [[ -f /data/.gtnh-version ]]; then
@@ -212,10 +237,12 @@ function handleGTNH() {
log "No .gtnh-version file detected! Assuming no old server exists. Proceed installing new server..." log "No .gtnh-version file detected! Assuming no old server exists. Proceed installing new server..."
cp -R -f "${base_dir}"/* /data cp -R -f "${base_dir}"/* /data
fi fi
# Update .gtnh-version # Update .gtnh-version
basename "$gtnh_download_path" > /data/.gtnh-version basename "$gtnh_download_path" > /data/.gtnh-version
# Cleaning up
rm -rf "$original_base_dir" # Cleaning up temporary files
rm -rf /data/.tmp
else else
log "No update required: /data/.gtnh-version matches the selected version $(basename "$gtnh_download_path")." log "No update required: /data/.gtnh-version matches the selected version $(basename "$gtnh_download_path")."
+2 -2
View File
@@ -24,7 +24,7 @@ elif [[ $PAPER_DOWNLOAD_URL ]]; then
--url="$PAPER_DOWNLOAD_URL" --url="$PAPER_DOWNLOAD_URL"
) )
if [[ $CLEAN_SERVER_LIBRARIES ]]; then if isTrue $CLEAN_SERVER_LIBRARIES; then
args+=(--clean-libraries) args+=(--clean-libraries)
fi fi
@@ -45,7 +45,7 @@ else
args+=(--build="$PAPER_BUILD") args+=(--build="$PAPER_BUILD")
fi fi
if [[ $CLEAN_SERVER_LIBRARIES ]]; then if isTrue $CLEAN_SERVER_LIBRARIES; then
args+=(--clean-libraries) args+=(--clean-libraries)
fi fi
+13 -4
View File
@@ -5,6 +5,7 @@ IFS=$'\n\t'
: "${PURPUR_BUILD:=LATEST}" : "${PURPUR_BUILD:=LATEST}"
: "${PURPUR_DOWNLOAD_URL:=}" : "${PURPUR_DOWNLOAD_URL:=}"
: "${PURPUR_CONFIG_REPO:=}" : "${PURPUR_CONFIG_REPO:=}"
: "${CLEAN_SERVER_LIBRARIES:=true}"
# shellcheck source=start-utils # shellcheck source=start-utils
. "$(dirname "$0")/start-utils" . "$(dirname "$0")/start-utils"
@@ -13,10 +14,15 @@ isDebugging && set -x
resultsFile=/data/.purpur.env resultsFile=/data/.purpur.env
if [[ $PURPUR_DOWNLOAD_URL ]]; then if [[ $PURPUR_DOWNLOAD_URL ]]; then
if ! mc-image-helper install-purpur \ args=(
--output-directory=/data \ --output-directory=/data
--results-file="$resultsFile" \ --results-file="$resultsFile"
--url="${PURPUR_DOWNLOAD_URL}"; then --url="${PURPUR_DOWNLOAD_URL}"
)
if isTrue "$CLEAN_SERVER_LIBRARIES"; then
args+=(--clean-libraries)
fi
if ! mc-image-helper install-purpur "${args[@]}"; then
logError "Failed to download from custom Purpur URL" logError "Failed to download from custom Purpur URL"
exit 1 exit 1
fi fi
@@ -29,6 +35,9 @@ else
if [[ $PURPUR_BUILD ]]; then if [[ $PURPUR_BUILD ]]; then
args+=(--build="$PURPUR_BUILD") args+=(--build="$PURPUR_BUILD")
fi fi
if isTrue "$CLEAN_SERVER_LIBRARIES"; then
args+=(--clean-libraries)
fi
if ! mc-image-helper install-purpur "${args[@]}"; then if ! mc-image-helper install-purpur "${args[@]}"; then
logError "Failed to download Purpur" logError "Failed to download Purpur"
exit 1 exit 1
+10
View File
@@ -50,6 +50,16 @@ function handlePackwiz() {
logError "Failed to run packwiz installer" logError "Failed to run packwiz installer"
exit 1 exit 1
fi fi
# packwiz may have just downloaded/updated the env file referenced by
# LOAD_ENV_FROM_FILE. The initial load in start-configuration happened
# before this point, so re-load it now to pick up the pack's values for
# the remaining setup stages (server.properties, JVM args, etc.).
if [[ ${LOAD_ENV_FROM_FILE:-} ]]; then
if ! loadEnvFromFile "${LOAD_ENV_FROM_FILE}"; then
exit 1
fi
fi
fi fi
} }
+11
View File
@@ -560,6 +560,17 @@ function extract() {
# remaining args are paths within the archive to extract; if none, extract everything # remaining args are paths within the archive to extract; if none, extract everything
type=$(file -b --mime-type "${src}") type=$(file -b --mime-type "${src}")
if [[ "$type" == application/octet-stream ]]; then
logWarning "Detected non-specific file type $type for $src"
case "$src" in
*.zip)
log "Assuming zip from extension"
type=application/zip
;;
# otherwise fall through to
esac
fi
case "${type}" in case "${type}" in
application/zip) application/zip)
unzip -o -q -d "${destDir}" "${src}" "$@" unzip -o -q -d "${destDir}" "${src}" "$@"
+1 -1
View File
@@ -46,7 +46,7 @@ setupOnlyMinecraftTest(){
start=$(date +%s) start=$(date +%s)
status=PASSED status=PASSED
verify= verify=
if ! logs=$(docker compose run --rm -e SETUP_ONLY=true -e DEBUG="${DEBUG:-false}" mc 2>&1); then if ! logs=$(docker compose run --rm -e SETUP_ONLY=true -e DEBUG="${DEBUG:-false}" -e GH_TOKEN="${GH_TOKEN:-}" mc 2>&1); then
status=FAILED status=FAILED
outputContainerLog "$logs" outputContainerLog "$logs"
result=1 result=1