docker-minecraft-server icon indicating copy to clipboard operation
docker-minecraft-server copied to clipboard

Refresh whitelist when detected change to whitelist file

Open Player505 opened this issue 1 year ago • 3 comments

Enhancement Type

Improve an existing feature

Describe the enhancement

Currently when adding players to the whitelist file provided to the WHITELIST_FILE environment variable the change isn't reflected till the container restarts which kinda sucks because to whitelist new players you have to basically kick any currently logged in players.

I propose using something akin to incrond to monitor changes in the whitelist file provided to the WHITELIST_FILE environment variable and when a change is detected running the relevant script based on the EXISTING_WHITELIST_FILE environment variable then sending an rcon command the server to reload the whitelist.

Player505 avatar Feb 13 '24 15:02 Player505

I prefer not to run additional processes inside of the container. The automation you described can be performed by a sidecar container via rcon.

itzg avatar Feb 13 '24 16:02 itzg

That's understandable, I might see if I can make a sidecar container to do that

Player505 avatar Feb 13 '24 17:02 Player505

You might be able to draw some inspiration from the mc-backup container since it has similar cross container rcon interactions

https://github.com/itzg/docker-mc-backup/blob/master/scripts/opt/backup-loop.sh

itzg avatar Feb 13 '24 20:02 itzg