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

Feature/docker minecraft support #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rainbowdashlabs
Copy link

This patch adds support for the https://github.com/itzg/docker-minecraft-server docker image when using bin mounts.

Commands are executed via the integrated rcon-cli. The screen name is used as the container name

@nicolaschan
Copy link
Owner

Thanks for your PR! A couple questions:

  • Does rcon-cli need a password passed in?
  • Why do it this way instead of port forward the RCON server port from the docker container to the host? Something like -p 25575:25575 in the docker run command.

@codecov-commenter
Copy link

Codecov Report

Merging #30 (a7318b0) into master (8a04318) will decrease coverage by 0.36%.
The diff coverage is 0.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff             @@
##            master      #30      +/-   ##
===========================================
- Coverage   100.00%   99.64%   -0.36%     
===========================================
  Files            1        1              
  Lines          284      285       +1     
===========================================
  Hits           284      284              
- Misses           0        1       +1     
Impacted Files Coverage Δ
backup.sh 99.64% <0.00%> (-0.36%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rainbowdashlabs
Copy link
Author

rainbowdashlabs commented Feb 6, 2023

Does rcon-cli need a password passed in?

No the rcon-cli is only reachable inside the container and not meant to be exposed. It has no password. The only purpose of the rcon-cli is sending commands into the server runnint inside the container.

Why do it this way instead of port forward the RCON server port from the docker container to the host? Something like -p 25575:25575 in the docker run command.

Because that would not work with a multi server setup. I have 8 servers running on my host and use a loop to go though all my servers. In order to keep configuration minimal by only entering a screen/container name and the path, all servers need the same configuration and the same rcon-cli access method. Also I want to avoid exposing the rcon-cli to my host network. I trust my firewall, but human errors are still the biggest threat.

Also exposing the port would increase maintainability work on the host since I need to make sure to not reuse ports used by another server. Simply executing the commands via docker exec is the less errorprone way and also the easiest.

@nicolaschan
Copy link
Owner

Thanks! That makes sense. Although I am pretty sure rcon-cli will ask for a password if there is an rcon password configured for your Minecraft server. Here's what I see for mine:

minecraft@minecraft-minecraft-58966fcd66-svlrq:~$ rcon-cli
2023/02/08 04:17:35 Failed to connect to RCON serverrcon: authentication failed

This PR looks good. I'll merge once we have a test for this case. If I have some free time I'll work a bit on creating one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants