diff --git a/Dockerfile b/Dockerfile index ecececcf..beab7c98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ FROM docker.io/itzg/minecraft-server:java8-multiarch -# RUN mkdir /mods/ && cd /mods/ && curl -sS -L -J -f -O https://github.com/OASIS-learn-study/swissarmyknife-minecraft-server-binaries/raw/master/LuckPerms-Sponge-5.3.98.jar +RUN mkdir /mods/ && cd /mods/ && curl -sS -L -J -f -O https://github.com/OASIS-learn-study/swissarmyknife-minecraft-server-binaries/raw/master/LuckPerms-Sponge-5.3.98.jar COPY web/build/libs/*-all.jar /mods/ -COPY minecraft-server/* /data-init/ +COPY minecraft-server/. /data-init/ ENV EULA=TRUE ENV TYPE=SPONGEVANILLA ENV OVERRIDE_SERVER_PROPERTIES=true -ENV ENABLE_RCON=false -ENV MOTD="\u00A7a\u00A7l/make\u00A7r your \u00A7bown\u00A7r Plugins/Mods, \u00A7l\u00A76with Scratch\!" +ENV MOTD="\u00A7a\u00A7l/make\u00A7r your \u00A7bown\u00A7r Plugins/Mods, \u00A7l\u00A76like Scratch\!" +ENV RCON_CMDS_STARTUP="lp user 73551f35-7acb-45c0-bc65-8083c53eec69 permission set luckperms.* true" EXPOSE 25565 25575 7070 8080 ENTRYPOINT [ "/data-init/start-custom" ] HEALTHCHECK --start-period=1m --timeout=3s --interval=17s --retries=1 CMD mc-health diff --git a/docs/ops.md b/docs/ops.md index 6a7e13f2..c4ea8b98 100644 --- a/docs/ops.md +++ b/docs/ops.md @@ -1,12 +1,28 @@ # Ops +See also https://www.learn.study/ops.html. + + +## Initial LuckPerms set-up + + /lp user michaelpapa7 permission set minecraft.command.function + /function lp:init + /lp user michaelpapa7 parent add groot + +NB: If you modify any `*.mcfunction`, then you would need to: + + /lp user michaelpapa7 permission set minecraft.command.reload + /reload + + +## Hostname, URLs, Ports + If you want to run on a different host then localhost, you'll need to set the following environment variables: storeys_gui = http://:7070/index.html -Also https://www.learn.study/ops.html (pending #276). -### GCP +## GCP A _Series N1: f1-micro (1 vCPU, 614 MB memory)_ is too small and crash loops; but a _Series N1: g1-small (1 vCPU, 1.7 GB memory)_ seems to suffice for 1 or 2 player; otherwise @@ -16,3 +32,8 @@ a _e2-medium (2 vCPU, 4 GB memory)_ or more is recommended. Remember to set the environment variables as above, add a persistent `/data` volume, and create an appropriate firewall rule. _TODO Cost: $x VM + $y PD + $7 (?) static IP + $z Ingress+Egress = $TBD._ + + +## Local Dev Test + + podman exec storeys rcon-cli help diff --git a/minecraft-server/README.md b/minecraft-server/README.md index f7d8215a..99742b88 100644 --- a/minecraft-server/README.md +++ b/minecraft-server/README.md @@ -1,3 +1,3 @@ -This directory contains configuration files for the Minecraft server, used by the `Dockerfile`. +This directory contains configuration files for the Minecraft server, used by the [`Dockerfile`](../Dockerfile). The storeys server's plugin code is not here, but in `../web`. diff --git a/minecraft-server/luckperms/init.cmds b/minecraft-server/luckperms/init.cmds new file mode 100644 index 00000000..325f8f50 --- /dev/null +++ b/minecraft-server/luckperms/init.cmds @@ -0,0 +1,83 @@ +/luckperms creategroup groot +/luckperms creategroup op +/luckperms creategroup admin +/luckperms creategroup boss +/luckperms creategroup fbi +/luckperms creategroup assistant +/luckperms creategroup verified +/luckperms group verified parent add default +/luckperms group assistant parent add verified +/luckperms group fbi parent add assistant +/luckperms group boss parent add fbi +/luckperms group admin parent add boss +/luckperms group op parent add admin +/luckperms group groot parent add op +/luckperms createtrack level +/luckperms track level append default +/luckperms track level append verified +/luckperms track level append assistant +/luckperms track level append fbi +/luckperms track level append boss +/luckperms group default permission set storeys.guard.adventure true +/luckperms group default permission set storeys.command.make true +/luckperms group default permission set storeys.command.make.beta true +/luckperms group verified permission set ch.vorburger.news.read true +/luckperms group verified permission set nucleus.hat.base true +/luckperms group verified permission set nucleus.nick.base true +/luckperms group verified permission set nucleus.realname.base true +/luckperms group verified permission set nucleus.rules.base true +/luckperms group verified permission set minecraft.command.seed true +/luckperms group verified permission set minecraft.command.say true +/luckperms group verified permission set nucleus.message.base true +/luckperms group assistant permission set storeys.guard.creative true +/luckperms group assistant permission set nucleus.teleport.teleport.base true +/luckperms group assistant permission set nucleus.back.base true +/luckperms group assistant permission set nucleus.ignite.others true +/luckperms group assistant permission set nucleus.hat.others true +/luckperms group assistant permission set nucleus.heal.base true +/luckperms group assistant permission set nucleus.feed.base true +/luckperms group assistant permission set nucleus.seen.base true +/luckperms group fbi permission set nucleus.jail.set.base true +/luckperms group fbi permission set nucleus.jail.list.base true +/luckperms group fbi permission set nucleus.jail.checkjail.base true +/luckperms group fbi permission set nucleus.jail.base true +/luckperms group fbi permission set nucleus.jail.offline true +/luckperms group fbi permission set nucleus.checkjailed.base true +/luckperms group boss permission set nucleus.jail.delete.base true +/luckperms group boss permission set luckperms.user.showtracks true +/luckperms group boss permission set luckperms.user.promote true +/luckperms group boss permission set luckperms.user.demote true +/luckperms group boss permission set nucleus.ignite.base true +/luckperms group boss permission set luckperms.log.notify true +/luckperms group boss permission set nucleus.firstjoinkit.base true +/luckperms group boss permission set nucleus.firstjoinkit.edit.base true +/luckperms group boss permission set nucleus.freezeplayer.base true +/luckperms group boss permission set nucleus.fly.base true +/luckperms group boss permission set nucleus.kit.give.base true +/luckperms group boss permission set nucleus.list.base true +/luckperms group boss permission set nucleus.seen.extended true +/luckperms group boss permission set nucleus.gamemode.base true +/luckperms group boss permission set nucleus.world.teleport.base true +/luckperms group boss permission set nucleus.world.teleport.others true +/luckperms group boss permission set luckperms.group.permission.set true +/luckperms group boss permission set nucleus.world.base true +/luckperms group boss permission set nucleus.world.list true +/luckperms group boss permission set world.command.tp true +/luckperms group boss permission set nucleus.back.targets.teleport true +/luckperms group admin permission set luckperms.group.permission.unset true +/luckperms group admin permission set ch.vorburger.news.add true +/luckperms group admin permission set nucleus.rules.add.base true +/luckperms group admin permission set nucleus.world.base true +/luckperms group admin permission set nucleus.time.base true +/luckperms group admin permission set nucleus.lockweather.base true +/luckperms group admin permission set nucleus.socialspy.base true +/luckperms group op permission set nucleus.rules.remove.base true +/luckperms group op permission set nucleus.jail.exempt.target true +/luckperms group groot permission set sponge true +/luckperms group groot permission set luckperms true +/luckperms group groot permission set nucleus.nucleus.setupperms.base true +/luckperms group verified meta set home-count 1' +/luckperms group verified meta addprefix 100 &5[V] +/luckperms group fbi meta addprefix 100 &5[FBI] +/luckperms group assistant meta addprefix 100 &5[A] +/luckperms group boss meta addprefix 100 &5[boss] diff --git a/minecraft-server/server.properties b/minecraft-server/server.properties index daab9a1d..2cd5e3f5 100644 --- a/minecraft-server/server.properties +++ b/minecraft-server/server.properties @@ -6,7 +6,7 @@ sync-chunk-writes=true force-gamemode=false allow-nether=true enforce-whitelist=false -gamemode=1 +gamemode=2 broadcast-console-to-ops=true enable-query=false player-idle-timeout=0 diff --git a/minecraft-server/start-custom b/minecraft-server/start-custom index f0811f3a..542b4089 100755 --- a/minecraft-server/start-custom +++ b/minecraft-server/start-custom @@ -1,7 +1,6 @@ #!/bin/bash set -euox pipefail -cp /data-init/server.properties /data/ -cp /data-init/server-icon.png /data/ +cp -vR /data-init/* /data /start diff --git a/minecraft-server/world/data/functions/lp/init.mcfunction b/minecraft-server/world/data/functions/lp/init.mcfunction new file mode 100644 index 00000000..d2f78c21 --- /dev/null +++ b/minecraft-server/world/data/functions/lp/init.mcfunction @@ -0,0 +1,83 @@ +luckperms creategroup groot +luckperms creategroup op +luckperms creategroup admin +luckperms creategroup boss +luckperms creategroup fbi +luckperms creategroup assistant +luckperms creategroup verified +luckperms group verified parent add default +luckperms group assistant parent add verified +luckperms group fbi parent add assistant +luckperms group boss parent add fbi +luckperms group admin parent add boss +luckperms group op parent add admin +luckperms group groot parent add op +luckperms createtrack level +luckperms track level append default +luckperms track level append verified +luckperms track level append assistant +luckperms track level append fbi +luckperms track level append boss +luckperms group default permission set storeys.guard.adventure true +luckperms group verified permission set storeys.command.make true +luckperms group verified permission set ch.vorburger.news.read true +luckperms group verified permission set nucleus.hat.base true +luckperms group verified permission set nucleus.nick.base true +luckperms group verified permission set nucleus.realname.base true +luckperms group verified permission set nucleus.rules.base true +luckperms group verified permission set minecraft.command.seed true +luckperms group verified permission set minecraft.command.say true +luckperms group verified permission set nucleus.message.base true +luckperms group assistant permission set storeys.guard.creative true +luckperms group assistant permission set storeys.command.make.beta true +luckperms group assistant permission set nucleus.teleport.teleport.base true +luckperms group assistant permission set nucleus.back.base true +luckperms group assistant permission set nucleus.ignite.others true +luckperms group assistant permission set nucleus.hat.others true +luckperms group assistant permission set nucleus.heal.base true +luckperms group assistant permission set nucleus.feed.base true +luckperms group assistant permission set nucleus.seen.base true +luckperms group fbi permission set nucleus.jail.set.base true +luckperms group fbi permission set nucleus.jail.list.base true +luckperms group fbi permission set nucleus.jail.checkjail.base true +luckperms group fbi permission set nucleus.jail.base true +luckperms group fbi permission set nucleus.jail.offline true +luckperms group fbi permission set nucleus.checkjailed.base true +luckperms group boss permission set nucleus.jail.delete.base true +luckperms group boss permission set luckperms.user.showtracks true +luckperms group boss permission set luckperms.user.promote true +luckperms group boss permission set luckperms.user.demote true +luckperms group boss permission set nucleus.ignite.base true +luckperms group boss permission set luckperms.log.notify true +luckperms group boss permission set nucleus.firstjoinkit.base true +luckperms group boss permission set nucleus.firstjoinkit.edit.base true +luckperms group boss permission set nucleus.freezeplayer.base true +luckperms group boss permission set nucleus.fly.base true +luckperms group boss permission set nucleus.kit.give.base true +luckperms group boss permission set nucleus.list.base true +luckperms group boss permission set nucleus.seen.extended true +luckperms group boss permission set nucleus.gamemode.base true +luckperms group boss permission set nucleus.world.teleport.base true +luckperms group boss permission set nucleus.world.teleport.others true +luckperms group boss permission set luckperms.group.permission.set true +luckperms group boss permission set nucleus.world.base true +luckperms group boss permission set nucleus.world.list true +luckperms group boss permission set world.command.tp true +luckperms group boss permission set nucleus.back.targets.teleport true +luckperms group admin permission set luckperms.group.permission.unset true +luckperms group admin permission set ch.vorburger.news.add true +luckperms group admin permission set nucleus.rules.add.base true +luckperms group admin permission set nucleus.world.base true +luckperms group admin permission set nucleus.time.base true +luckperms group admin permission set nucleus.lockweather.base true +luckperms group admin permission set nucleus.socialspy.base true +luckperms group op permission set nucleus.rules.remove.base true +luckperms group op permission set nucleus.jail.exempt.target true +luckperms group groot permission set sponge true +luckperms group groot permission set luckperms true +luckperms group groot permission set nucleus.nucleus.setupperms.base true +luckperms group verified meta set home-count 1' +luckperms group verified meta addprefix 100 &5[V] +luckperms group fbi meta addprefix 100 &5[FBI] +luckperms group assistant meta addprefix 100 &5[A] +luckperms group boss meta addprefix 100 &5[boss] diff --git a/test b/test index d30a6646..d181f5a7 100755 --- a/test +++ b/test @@ -6,7 +6,6 @@ set -euox pipefail docker stop --time 7 storeys || true docker run --name storeys --detach --rm \ - -e OPS=73551f35-7acb-45c0-bc65-8083c53eec69,fb79c1a9-72bd-34dc-9775-c2ac868d7ccf \ -e ONLINE_MODE=FALSE \ -v $PWD/minecraft-server-test-data:/data:Z -e UID=0 -e GID=0 \ -p 25565:25565 -p 8080:8080 -p 7070:7070 minecraft-storeys-maker