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 2 years ago
parent
commit
dfebbd022e
  1. 10
      minecraft/hooks/init
  2. 10
      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"

10
minecraft/lib/common

@ -64,3 +64,13 @@ minecraft:make-ops() {
})' })'
} > "$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