Browse Source

new: [minecraft] support of ``properties`` option

Notice that ``whitelist`` related ``properties`` will be overriden to
make sure it is taken into account. To disable whitelist, simply
remove it by commenting the ``whitelist`` full entry in your service
``options``.
odoo_fix_webhook_url
Valentin Lab 1 year ago
parent
commit
dfebbd022e
  1. 10
      minecraft/hooks/init
  2. 12
      minecraft/lib/common

10
minecraft/hooks/init

@ -24,9 +24,19 @@ mem=$(options-get mem) || exit 1
minecraft:init-command "$threads" "$mem" minecraft:init-command "$threads" "$mem"
properties=$(options-get properties) || true
whitelist=$(options-get whitelist) || true whitelist=$(options-get whitelist) || true
minecraft:make-whitelist "$whitelist" minecraft:make-whitelist "$whitelist"
if [ -n "$whitelist" ]; then
properties="$(
e "$properties" |
yq '.white-list = true, .enforce-whitelist = true'
)"
fi
ops=$(options-get ops) || true ops=$(options-get ops) || true
minecraft:make-ops "$ops" minecraft:make-ops "$ops"
minecraft:make-properties "$properties"

12
minecraft/lib/common

@ -63,4 +63,14 @@ minecraft:make-ops() {
"bypassesPlayerLimit": .value.bypassesPlayerLimit "bypassesPlayerLimit": .value.bypassesPlayerLimit
})' })'
} > "$SERVICE_DATASTORE/${MINECRAFT_DATA}/ops.json" } > "$SERVICE_DATASTORE/${MINECRAFT_DATA}/ops.json"
}
}
minecraft:make-properties() {
local properties="$1"
{
e "$properties" |
yq 'to_entries | map(.key + "=" + .value) | .[]'
} > "$SERVICE_DATASTORE/${MINECRAFT_DATA}/server.properties"
}
Loading…
Cancel
Save