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

LuckPerms #424

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edewit wait a second for you this won't work! I originally had x2 ENV RCON_CMDS_STARTUP but that was dumb. I need to figure out how to have 2 commands here, to add your UUID...

EXPOSE 25565 25575 7070 8080
ENTRYPOINT [ "/data-init/start-custom" ]
HEALTHCHECK --start-period=1m --timeout=3s --interval=17s --retries=1 CMD mc-health
Expand Down
25 changes: 23 additions & 2 deletions docs/ops.md
Original file line number Diff line number Diff line change
@@ -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://<EXTERNAL-IP>: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
Expand All @@ -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
2 changes: 1 addition & 1 deletion minecraft-server/README.md
Original file line number Diff line number Diff line change
@@ -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`.
83 changes: 83 additions & 0 deletions minecraft-server/luckperms/init.cmds
Original file line number Diff line number Diff line change
@@ -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]
2 changes: 1 addition & 1 deletion minecraft-server/server.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions minecraft-server/start-custom
Original file line number Diff line number Diff line change
@@ -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
83 changes: 83 additions & 0 deletions minecraft-server/world/data/functions/lp/init.mcfunction
Original file line number Diff line number Diff line change
@@ -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]
1 change: 0 additions & 1 deletion test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down