Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to patch default config file spigot.yml #3211

Open
Krymonota opened this issue Dec 26, 2024 · 5 comments
Open

Unable to patch default config file spigot.yml #3211

Krymonota opened this issue Dec 26, 2024 · 5 comments
Labels

Comments

@Krymonota
Copy link

Describe the problem

Currently, it is not possible to patch default configuration files that are supposed to be located outside the /data/config directory, such as the spigot.yml file.

The spigot.yml file is downloaded as part of the default configuration files:

for c in paper-global.yml paper-world-defaults.yml spigot.yml; do
DOWNLOAD_DEFAULT_CONFIGS+=",${PAPER_CONFIG_DEFAULTS_REPO}/${VERSION}/$c"
done

Unfortunately, all default configuration files (so even if I add some more by providing the DOWNLOAD_DEFAULT_CONFIGS environment variable with additional files) are put in the /data/config directory:

if [[ $DOWNLOAD_DEFAULT_CONFIGS ]]; then
log "Downloading default configs, if needed"
if ! mc-image-helper mcopy \
--to /data/config \
--skip-existing --skip-up-to-date=false \
"$DOWNLOAD_DEFAULT_CONFIGS" 2> /dev/null; then
logWarning "One or more default config files were not available from $DOWNLOAD_DEFAULT_CONFIGS"
fi
fi

However, only the paper-global.yml and paper-world-defaults.yml files belong to the /data/config directory. The spigot.yml file and all other default configuration files that you may want to patch must be put in the /data directory, which is not the case at the moment.

Container definition

docker run -d -e DEBUG=true -e EULA=true -e TYPE=PAPER -e VERSION=1.21.1 -e PATCH_DEFINITIONS=/patches -v ./patches:/patches itzg/minecraft-server

File patches/spigot.yml.patch.json:

{
  "file": "/data/spigot.yml",
  "ops": [
    {
      "$set": {
        "path": "$.settings.bungeecord",
        "value": true
      }
    }
  ]
}

This patch does not work because /data/spigot.yml does not exist.

File patches/spigot2.yml.patch.json:

{
  "file": "/data/config/spigot.yml",
  "ops": [
    {
      "$set": {
        "path": "$.settings.bungeecord",
        "value": true
      }
    }
  ]
}

This patch works because the default spigot.yml file is put in /data/config, but it remains there and is not used by the server. Instead, the server generates a new file at /data/spigot.yml, as can be seen here (check settings.bungeecord):

root@c97b65306078 ~
❯ cat spigot.yml
# This is the main configuration file for Spigot.
# As you can see, there's tons to configure. Some options may impact gameplay, so use
# with caution, and make sure you know what each option does before configuring.
# For a reference for any variable inside this file, check out the Spigot wiki at
# http://www.spigotmc.org/wiki/spigot-configuration/
#
# If you need help with the configuration or have any questions related to Spigot,
# join us at the Discord or drop by our forums and leave a post.
#
# Discord: https://www.spigotmc.org/go/discord
# Forums: http://www.spigotmc.org/

settings:
  debug: false
  bungeecord: false
  save-user-cache-on-stop-only: false
  sample-count: 12
  player-shuffle: 0
  user-cache-size: 1000
  moved-wrongly-threshold: 0.0625
  moved-too-quickly-multiplier: 10.0
  timeout-time: 60
  restart-on-crash: true
  restart-script: ./start.sh
  netty-threads: 4
  attribute:
    maxAbsorption:
      max: 2048.0
    maxHealth:
      max: 2048.0
    movementSpeed:
      max: 2048.0
    attackDamage:
      max: 2048.0
  log-villager-deaths: true
  log-named-deaths: true
messages:
  whitelist: You are not whitelisted on this server!
  unknown-command: Unknown command. Type "/help" for help.
  server-full: The server is full!
  outdated-client: Outdated client! Please use {0}
  outdated-server: Outdated server! I'm still on {0}
  restart: Server is restarting
commands:
  tab-complete: 0
  send-namespaced: true
  log: true
  spam-exclusions:
  - /skill
  silent-commandblock-console: false
  replace-commands:
  - setblock
  - summon
  - testforblock
  - tellraw
advancements:
  disable-saving: false
  disabled:
  - minecraft:story/disabled
world-settings:
  default:
    below-zero-generation-in-existing-chunks: true
    view-distance: default
    simulation-distance: default
    merge-radius:
      item: 0.5
      exp: -1.0
    mob-spawn-range: 8
    item-despawn-rate: 6000
    arrow-despawn-rate: 1200
    trident-despawn-rate: 1200
    zombie-aggressive-towards-villager: true
    nerf-spawner-mobs: false
    enable-zombie-pigmen-portal-spawns: true
    wither-spawn-sound-radius: 0
    end-portal-sound-radius: 0
    hanging-tick-frequency: 100
    thunder-chance: 100000
    unload-frozen-chunks: false
    growth:
      cactus-modifier: 100
      cane-modifier: 100
      melon-modifier: 100
      mushroom-modifier: 100
      pumpkin-modifier: 100
      sapling-modifier: 100
      beetroot-modifier: 100
      carrot-modifier: 100
      potato-modifier: 100
      torchflower-modifier: 100
      wheat-modifier: 100
      netherwart-modifier: 100
      vine-modifier: 100
      cocoa-modifier: 100
      bamboo-modifier: 100
      sweetberry-modifier: 100
      kelp-modifier: 100
      twistingvines-modifier: 100
      weepingvines-modifier: 100
      cavevines-modifier: 100
      glowberry-modifier: 100
      pitcherplant-modifier: 100
    entity-activation-range:
      animals: 32
      monsters: 32
      raiders: 64
      misc: 16
      water: 16
      villagers: 32
      flying-monsters: 32
      wake-up-inactive:
        animals-max-per-tick: 4
        animals-every: 1200
        animals-for: 100
        monsters-max-per-tick: 8
        monsters-every: 400
        monsters-for: 100
        villagers-max-per-tick: 4
        villagers-every: 600
        villagers-for: 100
        flying-monsters-max-per-tick: 8
        flying-monsters-every: 200
        flying-monsters-for: 100
      villagers-work-immunity-after: 100
      villagers-work-immunity-for: 20
      villagers-active-for-panic: true
      tick-inactive-villagers: true
      ignore-spectators: false
    entity-tracking-range:
      players: 128
      animals: 96
      monsters: 96
      misc: 96
      display: 128
      other: 64
    ticks-per:
      hopper-transfer: 8
      hopper-check: 1
    hopper-amount: 1
    hopper-can-load-chunks: false
    dragon-death-sound-radius: 0
    seed-village: 10387312
    seed-desert: 14357617
    seed-igloo: 14357618
    seed-jungle: 14357619
    seed-swamp: 14357620
    seed-monument: 10387313
    seed-shipwreck: 165745295
    seed-ocean: 14357621
    seed-outpost: 165745296
    seed-endcity: 10387313
    seed-slime: 987234911
    seed-nether: 30084232
    seed-mansion: 10387319
    seed-fossil: 14357921
    seed-portal: 34222645
    seed-ancientcity: 20083232
    seed-trailruins: 83469867
    seed-trialchambers: 94251327
    seed-buriedtreasure: 10387320
    seed-mineshaft: default
    seed-stronghold: default
    hunger:
      jump-walk-exhaustion: 0.05
      jump-sprint-exhaustion: 0.2
      combat-exhaustion: 0.1
      regen-exhaustion: 6.0
      swim-multiplier: 0.01
      sprint-multiplier: 0.1
      other-multiplier: 0.0
    max-tnt-per-tick: 100
    max-tick-time:
      tile: 50
      entity: 50
    verbose: false
players:
  disable-saving: false
config-version: 12
stats:
  disable-saving: false
  forced-stats: {}
root@c97b65306078 ~
❯ cat /data/config/spigot.yml
messages:
  whitelist: You are not whitelisted on this server!
  unknown-command: Unknown command. Type "/help" for help.
  server-full: The server is full!
  outdated-client: "Outdated client! Please use {0}"
  outdated-server: "Outdated server! I'm still on {0}"
  restart: Server is restarting
settings:
  bungeecord: true
  netty-threads: 4
  attribute:
    maxAbsorption:
      max: 2048.0
    maxHealth:
      max: 2048.0
    movementSpeed:
      max: 2048.0
    attackDamage:
      max: 2048.0
  log-villager-deaths: true
  log-named-deaths: true
  player-shuffle: 0
  user-cache-size: 1000
  moved-wrongly-threshold: 0.0625
  moved-too-quickly-multiplier: 10.0
  timeout-time: 60
  restart-on-crash: true
  restart-script: ./start.sh
  save-user-cache-on-stop-only: false
  sample-count: 12
  debug: false
commands:
  tab-complete: 0
  send-namespaced: true
  log: true
  spam-exclusions:
  - /skill
  silent-commandblock-console: false
  replace-commands:
  - setblock
  - summon
  - testforblock
  - tellraw
advancements:
  disable-saving: false
  disabled:
  - minecraft:story/disabled
players:
  disable-saving: false
world-settings:
  default:
    below-zero-generation-in-existing-chunks: true
    view-distance: default
    simulation-distance: default
    thunder-chance: 100000
    merge-radius:
      item: 0.5
      exp: -1.0
    mob-spawn-range: 8
    item-despawn-rate: 6000
    arrow-despawn-rate: 1200
    trident-despawn-rate: 1200
    zombie-aggressive-towards-villager: true
    nerf-spawner-mobs: false
    enable-zombie-pigmen-portal-spawns: true
    wither-spawn-sound-radius: 0
    end-portal-sound-radius: 0
    hanging-tick-frequency: 100
    unload-frozen-chunks: false
    growth:
      cactus-modifier: 100
      cane-modifier: 100
      melon-modifier: 100
      mushroom-modifier: 100
      pumpkin-modifier: 100
      sapling-modifier: 100
      beetroot-modifier: 100
      carrot-modifier: 100
      potato-modifier: 100
      torchflower-modifier: 100
      wheat-modifier: 100
      netherwart-modifier: 100
      vine-modifier: 100
      cocoa-modifier: 100
      bamboo-modifier: 100
      sweetberry-modifier: 100
      kelp-modifier: 100
      twistingvines-modifier: 100
      weepingvines-modifier: 100
      cavevines-modifier: 100
      glowberry-modifier: 100
      pitcherplant-modifier: 100
    entity-activation-range:
      animals: 32
      monsters: 32
      raiders: 64
      misc: 16
      water: 16
      villagers: 32
      flying-monsters: 32
      wake-up-inactive:
        animals-max-per-tick: 4
        animals-every: 1200
        animals-for: 100
        monsters-max-per-tick: 8
        monsters-every: 400
        monsters-for: 100
        villagers-max-per-tick: 4
        villagers-every: 600
        villagers-for: 100
        flying-monsters-max-per-tick: 8
        flying-monsters-every: 200
        flying-monsters-for: 100
      villagers-work-immunity-after: 100
      villagers-work-immunity-for: 20
      villagers-active-for-panic: true
      tick-inactive-villagers: true
      ignore-spectators: false
    entity-tracking-range:
      players: 128
      animals: 96
      monsters: 96
      misc: 96
      display: 128
      other: 64
    ticks-per:
      hopper-transfer: 8
      hopper-check: 1
    hopper-amount: 1
    hopper-can-load-chunks: false
    dragon-death-sound-radius: 0
    seed-village: 10387312
    seed-desert: 14357617
    seed-igloo: 14357618
    seed-jungle: 14357619
    seed-swamp: 14357620
    seed-monument: 10387313
    seed-shipwreck: 165745295
    seed-ocean: 14357621
    seed-outpost: 165745296
    seed-endcity: 10387313
    seed-slime: 987234911
    seed-nether: 30084232
    seed-mansion: 10387319
    seed-fossil: 14357921
    seed-portal: 34222645
    seed-ancientcity: 20083232
    seed-trailruins: 83469867
    seed-trialchambers: 94251327
    seed-buriedtreasure: 10387320
    seed-mineshaft: default
    seed-stronghold: default
    hunger:
      jump-walk-exhaustion: 0.05
      jump-sprint-exhaustion: 0.2
      combat-exhaustion: 0.1
      regen-exhaustion: 6.0
      swim-multiplier: 0.01
      sprint-multiplier: 0.1
      other-multiplier: 0.0
    max-tnt-per-tick: 100
    max-tick-time:
      tile: 50
      entity: 50
    verbose: false
config-version: 12
stats:
  disable-saving: false
  forced-stats: {}

Container logs

+ export HOME=/data
+ HOME=/data
++ id -u
++ id -g
++ ls -lnd /data
+ log 'Running as uid=1000 gid=1000 with /data as '\''drwxr-x--- 1 1000 1000 0 Dec 14 21:39 /data'\'''
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2024-12-26 12:13:56+00:00 Running as uid=1000 gid=1000 with /data as 'drwxr-x--- 1 1000 1000 0 Dec 14 21:39 /data'
+ '[' '!' -e /data/eula.txt ']'
+ isTrue true
+ case "${1,,}" in
+ return 0
+ writeEula
++ date
+ echo '# Generated via Docker
# Thu Dec 26 12:13:56 PM UTC 2024
eula=true
'
+ isTrue false
+ case "${1,,}" in
+ return 1
+ isTrue true
+ case "${1,,}" in
+ return 0
+ set +x
+ isTrue false
+ case "${1,,}" in
+ return 1
+ isTrue false
+ case "${1,,}" in
+ return 1
+ [[ -n '' ]]
+ fixJavaPath
+ which java
+ cd /data
+ export DECLARED_TYPE=PAPER
+ DECLARED_TYPE=PAPER
+ export DECLARED_VERSION=1.21.1
+ DECLARED_VERSION=1.21.1
+ isTrue false
+ case "${1,,}" in
+ return 1
+ isTrue false
+ case "${1,,}" in
+ return 1
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ : ''
+ [[ -n '' ]]
+ case "${TYPE^^}" in
+ [[ -n '' ]]
+ log 'Resolving type given PAPER'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2024-12-26 12:13:56+00:00 Resolving type given PAPER
+ case "${TYPE^^}" in
+ exec /start-deployPaper
+ : paper
+ : ''
+ : default
+ : ''
+ : ''
+ : https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main
+ resultsFile=/data/.paper.env
+ [[ -n '' ]]
+ [[ -n '' ]]
+ args=(--output-directory=/data --results-file="$resultsFile" --project="$PAPER_PROJECT" --version="$VERSION" --channel="$PAPER_CHANNEL")
+ [[ -n '' ]]
+ mc-image-helper install-paper --output-directory=/data --results-file=/data/.paper.env --project=paper --version=1.21.1 --channel=default
[mc-image-helper] 12:13:57.116 DEBUG : Retrieving latest build for project=paper, version=1.21.1
[mc-image-helper] 12:13:57.385 DEBUG : JSON FETCH: uri=https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds headers=[user-agent: itzg/mc-image-helper/1.40.6 (cmd=install-paper), x-fetch-session: f814b8de-1173-44d7-bfa3-17a6fe5ff227, accept: application/json, host: api.papermc.io]
[mc-image-helper] 12:13:57.562 DEBUG : JSON FETCH: uri=https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/132 headers=[user-agent: itzg/mc-image-helper/1.40.6 (cmd=install-paper), x-fetch-session: f814b8de-1173-44d7-bfa3-17a6fe5ff227, accept: application/json, host: api.papermc.io]
[mc-image-helper] 12:13:57.634 DEBUG : Downloading /data/paper-1.21.1-132.jar
[mc-image-helper] 12:13:57.634 DEBUG : FILE FETCH: uri=https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/132/downloads/paper-1.21.1-132.jar headers=[user-agent: itzg/mc-image-helper/1.40.6 (cmd=install-paper), x-fetch-session: f814b8de-1173-44d7-bfa3-17a6fe5ff227, host: api.papermc.io, accept: */*]
[mc-image-helper] 12:14:07.472 INFO  : Downloaded /data/paper-1.21.1-132.jar
[mc-image-helper] 12:14:07.476 DEBUG : Download of https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/132/downloads/paper-1.21.1-132.jar took 9s 842ms at 5017 KB/s
[mc-image-helper] 12:14:07.479 DEBUG : Writing SERVER="/data/paper-1.21.1-132.jar" to results file
[mc-image-helper] 12:14:07.479 DEBUG : Writing TYPE="PAPER" to results file
[mc-image-helper] 12:14:07.479 DEBUG : Writing VERSION="1.21.1" to results file
+ applyResultsFile /data/.paper.env
+ set -a
+ source /data/.paper.env
++ SERVER=/data/paper-1.21.1-132.jar
++ TYPE=PAPER
++ VERSION=1.21.1
+ set +a
+ for c in paper-global.yml paper-world-defaults.yml spigot.yml
+ DOWNLOAD_DEFAULT_CONFIGS+=,https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/paper-global.yml
+ for c in paper-global.yml paper-world-defaults.yml spigot.yml
+ DOWNLOAD_DEFAULT_CONFIGS+=,https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/paper-world-defaults.yml
+ for c in paper-global.yml paper-world-defaults.yml spigot.yml
+ DOWNLOAD_DEFAULT_CONFIGS+=,https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/spigot.yml
+ export DOWNLOAD_DEFAULT_CONFIGS
+ export FAMILY=SPIGOT
+ FAMILY=SPIGOT
+ exec /start-spiget
+ : ''
+ : 5
+ : false
+ : ''
+ : '*.jar,*-version.json'
+ : '1 '
+ acceptArgs=(--accept application/zip --accept application/java-archive --accept application/octet-stream)
+ [[ -n '' ]]
+ exec /start-setupWorld
+ [[ world =~ ^/.*$ ]]
+ '[' PAPER = CURSEFORGE ']'
+ worldDest=/data/world
+ [[ -n '' ]]
+ exec /start-setupDatapack
+ out_dir=/data/world/datapacks
+ isTrue false
+ case "${1,,}" in
+ return 1
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ exec /start-setupModpack
+ CURSE_URL_BASE=https://minecraft.curseforge.com/projects
+ isTrue false
+ case "${1,,}" in
+ return 1
+ handlePackwiz
+ [[ -n '' ]]
+ handleModpackZip
+ [[ -n '' ]]
+ handleListings
+ usesMods
+ case "$FAMILY" in
+ return 1
+ usesPlugins
+ case "$FAMILY" in
+ return 0
+ outDir=/data/mods
+ usesPlugins
+ case "$FAMILY" in
+ return 0
+ outDir=/data/plugins
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ handleGenericPacks
+ : ''
+ : ''
+ : ''
+ [[ -n '' ]]
+ handleModrinthProjects
+ : ''
+ : release
+ : none
+ [[ -v MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES ]]
+ [[ -n '' ]]
+ usesMods
+ case "$FAMILY" in
+ return 1
+ usesPlugins
+ case "$FAMILY" in
+ return 0
+ handleCurseForgeFiles
+ args=()
+ usesMods
+ case "$FAMILY" in
+ return 1
+ usesPlugins
+ case "$FAMILY" in
+ return 0
+ usesMods
+ case "$FAMILY" in
+ return 1
+ args+=(--default-category bukkit-plugins)
+ case "${TYPE,,}" in
+ isFamily HYBRID
+ for f in "${@}"
+ [[ SPIGOT == \H\Y\B\R\I\D ]]
+ return 1
+ mc-image-helper curseforge-files --default-category bukkit-plugins
+ [[ -n '' ]]
+ exec /start-setupMounts
+ isTrue true
+ case "${1,,}" in
+ return 0
+ updateArg=--skip-newer-in-destination
+ isTrue true
+ case "${1,,}" in
+ return 0
+ subcommand=sync-and-interpolate
+ : /plugins
+ : /data/plugins
+ usesPlugins
+ case "$FAMILY" in
+ return 0
+ '[' -d /plugins ']'
+ : /mods
+ : /data/mods
+ usesMods
+ case "$FAMILY" in
+ return 1
+ : /config
+ : /data/config
+ '[' -d /config ']'
+ exec /start-setupServerProperties
[init] 2024-12-26 12:14:08+00:00 Creating server properties in /data/server.properties
[init] 2024-12-26 12:14:08+00:00 Disabling whitelist functionality
+ mc-image-helper set-properties --definitions /image/property-definitions.json /data/server.properties
[mc-image-helper] 12:14:08.431 DEBUG : Setting property enable-rcon to new value 'true'
[mc-image-helper] 12:14:08.431 DEBUG : Setting property rcon.password to new value '***'
[mc-image-helper] 12:14:08.431 DEBUG : Setting property rcon.port to new value '25575'
[mc-image-helper] 12:14:08.431 DEBUG : Setting property white-list to new value 'false'
[mc-image-helper] 12:14:08.431 INFO  : Created/updated 4 properties in /data/server.properties
+ isTrue ''
+ case "${1,,}" in
+ return 1
+ isTrue false
+ case "${1,,}" in
+ return 1
+ exec /start-setupEnvVariables
+ : false
+ : /data
+ : yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml
+ : CFG_
+ : ''
+ : ''
+ : /patches
+ : true
+ : ,https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/paper-global.yml,https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/paper-world-defaults.yml,https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/spigot.yml
+ isTrue false
+ case "${1,,}" in
+ return 1
+ [[ -n ,https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/paper-global.yml,https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/paper-world-defaults.yml,https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/spigot.yml ]]
+ log 'Downloading default configs, if needed'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2024-12-26 12:14:08+00:00 Downloading default configs, if needed
+ mc-image-helper mcopy --to /data/config --skip-existing --skip-up-to-date=false ,https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/paper-global.yml,https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/paper-world-defaults.yml,https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/spigot.yml
[mc-image-helper] 12:14:09.033 INFO  : Downloading /data/config/paper-global.yml from https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/paper-global.yml
[mc-image-helper] 12:14:09.033 INFO  : Downloading /data/config/spigot.yml from https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/spigot.yml
[mc-image-helper] 12:14:09.033 INFO  : Downloading /data/config/paper-world-defaults.yml from https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main/1.21.1/paper-world-defaults.yml
+ [[ -n /patches ]]
+ log 'Applying patch definitions from /patches'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2024-12-26 12:14:09+00:00 Applying patch definitions from /patches
+ mc-image-helper patch --patch-env-prefix=CFG_ /patches
[mc-image-helper] 12:14:09.743 DEBUG : patchSet=PatchSet(patches=[PatchDefinition(file=/data/spigot.yml, fileFormat=null, ops=[PatchSetOperation(path=$.settings.bungeecord, value=true, valueType=null)]), PatchDefinition(file=/data/config/spigot.yml, fileFormat=null, ops=[PatchSetOperation(path=$.settings.bungeecord, value=true, valueType=null)])])
[mc-image-helper] 12:14:09.747 WARN  : /data/spigot.yml is not an existing file
[mc-image-helper] 12:14:09.747 DEBUG : Detected file=/data/config/spigot.yml is yaml
+ exec /start-setupRbac
+ [[ -v APPEND_OPS ]]
+ [[ -v OVERRIDE_OPS ]]
+ [[ -v APPEND_WHITELIST ]]
+ [[ -v OVERRIDE_WHITELIST ]]
+ sharedArgs=(--version="$VERSION")
+ [[ -n '' ]]
+ sharedArgs+=(--output-directory=/data)
+ [[ -v OPS_FILE ]]
+ [[ -v OPS ]]
+ [[ -v WHITELIST_FILE ]]
+ [[ -v WHITELIST ]]
+ exec /start-finalExec
+ baseDataDir=/data
+ tmpServerIconPath=/tmp/icon.img
+ serverIconPath=/data/server-icon.png
+ mcHealthEnvPath=/data/.mc-health.env
+ bootstrapPath=/data/bootstrap.txt
+ '[' -n '' ']'
+ canUseRollingLogs=true
+ useFallbackJvmFlag=false
+ SERVER_DIR=/data
+ [[ -n '' ]]
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ false
+ versionLessThan 1.7
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ compare_version 1.21.1 lt 1.7
+ local left_version=1.21.1
+ local comparison=lt
+ local right_version=1.7
+ [[ -z 1.21.1 ]]
+ [[ -z 1.7 ]]
+ [[ 1.21.1 == a* ]]
+ [[ 1.21.1 == b* ]]
+ [[ 1.7 == a* ]]
+ [[ 1.7 == b* ]]
+ local left_version_channel=1
+ [[ 1 =~ [0-9] ]]
+ left_version_channel=r
+ local right_version_channel=1
+ [[ 1 =~ [0-9] ]]
+ right_version_channel=r
+ [[ lt == \l\t ]]
+ [[ r < r ]]
+ [[ lt == \l\t ]]
+ [[ r > r ]]
+ [[ lt == \g\t ]]
+ [[ lt == \g\t ]]
+ [[ lt == \l\e ]]
+ [[ lt == \l\e ]]
+ [[ lt == \g\e ]]
+ [[ lt == \g\e ]]
+ [[ lt == \e\q ]]
+ local result=1
+ case $comparison in
++ echo -e '1.21.1\n1.7'
++ sort -V
++ head -n1
+ [[ 1.7 == \1\.\2\1\.\1 ]]
+ return 1
+ versionLessThan 1.18.1
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ compare_version 1.21.1 lt 1.18.1
+ local left_version=1.21.1
+ local comparison=lt
+ local right_version=1.18.1
+ [[ -z 1.21.1 ]]
+ [[ -z 1.18.1 ]]
+ [[ 1.21.1 == a* ]]
+ [[ 1.21.1 == b* ]]
+ [[ 1.18.1 == a* ]]
+ [[ 1.18.1 == b* ]]
+ local left_version_channel=1
+ [[ 1 =~ [0-9] ]]
+ left_version_channel=r
+ local right_version_channel=1
+ [[ 1 =~ [0-9] ]]
+ right_version_channel=r
+ [[ lt == \l\t ]]
+ [[ r < r ]]
+ [[ lt == \l\t ]]
+ [[ r > r ]]
+ [[ lt == \g\t ]]
+ [[ lt == \g\t ]]
+ [[ lt == \l\e ]]
+ [[ lt == \l\e ]]
+ [[ lt == \g\e ]]
+ [[ lt == \g\e ]]
+ [[ lt == \e\q ]]
+ local result=1
+ case $comparison in
++ echo -e '1.21.1\n1.18.1'
++ sort -V
++ head -n1
+ [[ 1.18.1 == \1\.\2\1\.\1 ]]
+ return 1
+ isTrue false
+ case "${1,,}" in
+ return 1
+ versionLessThan 1.14
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ compare_version 1.21.1 lt 1.14
+ local left_version=1.21.1
+ local comparison=lt
+ local right_version=1.14
+ [[ -z 1.21.1 ]]
+ [[ -z 1.14 ]]
+ [[ 1.21.1 == a* ]]
+ [[ 1.21.1 == b* ]]
+ [[ 1.14 == a* ]]
+ [[ 1.14 == b* ]]
+ local left_version_channel=1
+ [[ 1 =~ [0-9] ]]
+ left_version_channel=r
+ local right_version_channel=1
+ [[ 1 =~ [0-9] ]]
+ right_version_channel=r
+ [[ lt == \l\t ]]
+ [[ r < r ]]
+ [[ lt == \l\t ]]
+ [[ r > r ]]
+ [[ lt == \g\t ]]
+ [[ lt == \g\t ]]
+ [[ lt == \l\e ]]
+ [[ lt == \l\e ]]
+ [[ lt == \g\e ]]
+ [[ lt == \g\e ]]
+ [[ lt == \e\q ]]
+ local result=1
+ case $comparison in
++ echo -e '1.21.1\n1.14'
++ sort -V
++ head -n1
+ [[ 1.14 == \1\.\2\1\.\1 ]]
+ return 1
+ [[ '' = false ]]
+ expandedDOpts=
+ '[' -n '' ']'
+ isTrue ''
+ case "${1,,}" in
+ return 1
+ isTrue ''
+ case "${1,,}" in
+ return 1
+ isTrue ''
+ case "${1,,}" in
+ return 1
+ isTrue ''
+ case "${1,,}" in
+ return 1
+ [[ -n 1G ]]
+ log 'Setting initial memory to 1G and max to 1G'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2024-12-26 12:14:09+00:00 Setting initial memory to 1G and max to 1G
+ [[ -n 1G ]]
+ JVM_OPTS='-Xms1G '
+ [[ -n 1G ]]
+ JVM_OPTS='-Xmx1G -Xms1G '
+ versionLessThan b1.8
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ compare_version 1.21.1 lt b1.8
+ local left_version=1.21.1
+ local comparison=lt
+ local right_version=b1.8
+ [[ -z 1.21.1 ]]
+ [[ -z b1.8 ]]
+ [[ 1.21.1 == a* ]]
+ [[ 1.21.1 == b* ]]
+ [[ b1.8 == a* ]]
+ [[ b1.8 == b* ]]
+ right_version=1.8
+ local left_version_channel=1
+ [[ 1 =~ [0-9] ]]
+ left_version_channel=r
+ local right_version_channel=1
+ [[ 1 =~ [0-9] ]]
+ right_version_channel=r
+ [[ lt == \l\t ]]
+ [[ r < r ]]
+ [[ lt == \l\t ]]
+ [[ r > r ]]
+ [[ lt == \g\t ]]
+ [[ lt == \g\t ]]
+ [[ lt == \l\e ]]
+ [[ lt == \l\e ]]
+ [[ lt == \g\e ]]
+ [[ lt == \g\e ]]
+ [[ lt == \e\q ]]
+ local result=1
+ case $comparison in
++ echo -e '1.21.1\n1.8'
++ sort -V
++ head -n1
+ [[ 1.8 == \1\.\2\1\.\1 ]]
+ return 1
+ versionLessThan 1.7
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
+ compare_version 1.21.1 lt 1.7
+ local left_version=1.21.1
+ local comparison=lt
+ local right_version=1.7
+ [[ -z 1.21.1 ]]
+ [[ -z 1.7 ]]
+ [[ 1.21.1 == a* ]]
+ [[ 1.21.1 == b* ]]
+ [[ 1.7 == a* ]]
+ [[ 1.7 == b* ]]
+ local left_version_channel=1
+ [[ 1 =~ [0-9] ]]
+ left_version_channel=r
+ local right_version_channel=1
+ [[ 1 =~ [0-9] ]]
+ right_version_channel=r
+ [[ lt == \l\t ]]
+ [[ r < r ]]
+ [[ lt == \l\t ]]
+ [[ r > r ]]
+ [[ lt == \g\t ]]
+ [[ lt == \g\t ]]
+ [[ lt == \l\e ]]
+ [[ lt == \l\e ]]
+ [[ lt == \g\e ]]
+ [[ lt == \g\e ]]
+ [[ lt == \e\q ]]
+ local result=1
+ case $comparison in
++ echo -e '1.21.1\n1.7'
++ sort -V
++ head -n1
+ [[ 1.7 == \1\.\2\1\.\1 ]]
+ return 1
+ isTrue ''
+ case "${1,,}" in
+ return 1
+ rm -f /data/.mc-health.env
+ mcServerRunnerArgs=(--stop-duration "${STOP_DURATION:-60}s")
+ isTrue false
+ case "${1,,}" in
+ return 1
+ [[ -n '' ]]
+ isTrue ''
+ case "${1,,}" in
+ return 1
+ [[ PAPER == \C\U\R\S\E\F\O\R\G\E ]]
+ [[ PAPER == \C\U\R\S\E\F\O\R\G\E ]]
+ [[ /data/paper-1.21.1-132.jar =~ run.sh ]]
+ '[' -f /data/bootstrap.txt ']'
+ log 'Starting the Minecraft server...'
+ local oldState
++ shopt -po xtrace
+ oldState='set -o xtrace'
+ shopt -u -o xtrace
[init] 2024-12-26 12:14:09+00:00 Starting the Minecraft server...
+ finalArgs=($JVM_XX_OPTS $JVM_OPTS $expandedDOpts)
+ [[ -n '' ]]
+ finalArgs+=(-jar "$SERVER")
+ finalArgs+=("$@" $EXTRA_ARGS)
+ isTrue false
+ case "${1,,}" in
+ return 1
+ isTrue false
+ case "${1,,}" in
+ return 1
+ isTrue false
+ case "${1,,}" in
+ return 1
+ exec mc-server-runner --stop-duration 60s java -Xmx1G -Xms1G -jar /data/paper-1.21.1-132.jar
Downloading mojang_1.21.1.jar
@Krymonota
Copy link
Author

Since it is kind of related: Note that I explicitly specified VERSION=1.21.1 because dayyeeet/minecraft-default-configs does not host default configuration files for newer versions yet (@dayyeeet). I have created a pull request to add them, along with the configurations that are missing for some older Minecraft versions and automation to keep them up to date for future Paper releases: dayyeeet/minecraft-default-configs#7

Apart from the bug I reported here, my goal would be to also be able to patch the configuration files paper.yml (Minecraft versions older than 1.19) and bukkit.yml, which I also added in my pull request. For example, to consistently enforce configuration settings in relation to Velocity and BungeeCord support. Those files are currently also not considered as default configuration files by this image, but it would be great to add them so they can also be patched right away 🙂

@itzg
Copy link
Owner

itzg commented Dec 26, 2024

Sorry, there was too much to read. What's the problem to fix? Are you saying the defaults need to download some to non-config directory? Or are you saying patching seems to be limited to /data/config only? But using an absolute path worked around that?

@Krymonota
Copy link
Author

Krymonota commented Dec 26, 2024

What's the problem to fix? Are you saying the defaults need to download some to non-config directory

Yes. spigot.yml, and potentially other configuration files passed through DOWNLOAD_DEFAULT_CONFIGS, need to be downloaded to the root directory of the server (/data) instead of /data/config. Paper expects only paper-global.yml and paper-world-defaults.yml in the /data/config directory.

Or are you saying patching seems to be limited to /data/config only? But using an absolute path worked around that?

No, that is not the problem. I just wanted to demonstrate that there is currently no way to patch spigot.yml if it is not part of a mounted volume. You cannot patch /data/spigot.yml because it is downloaded to /data/config/spigot.yml. If you patch /data/config/spigot.yml, however, the server does not care as it is not in the server's root directory.

@dayyeeet
Copy link

I just merged the workflow stuff in the config repo, this should at least resolve on some versions default configs are not being populated.

@itzg
Copy link
Owner

itzg commented Dec 26, 2024

Thanks for clarifying @Krymonota

Ok yeah, I see now that I need to have it declare the resulting file name relative to /data yet download from the defaults repo using the flattened path.

FYI /data is the volume path and /data/config is just a subdirectory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

3 participants