minecraft-overviewer icon indicating copy to clipboard operation
minecraft-overviewer copied to clipboard

Add rcon-cli support for server interaction

Open magneticflux- opened this issue 4 years ago • 14 comments

Closes #53

I'm currently testing this on my own deployment to see how well it works.

magneticflux- avatar Mar 20 '20 19:03 magneticflux-

Looks good!

anthr76 avatar Mar 23 '20 15:03 anthr76

Nice - thank you for the contribution!

Everyone has different workflows, so I generally support this - I really like the way this is optional (if people don't configure the RCON variables, it won't attempt to run any RCON commands).

I'm not sure how I feel about the added complexity of easy-add and some of the copied code, I wonder if there is any other way to handle RCON - It may be that is the "best" way in which case it's fine. I did this once before in mide/minecraft but that was just for stop, and no other RCON commands.

I'll continue to think about this, but I really do appreciate the contribution.

mide avatar Mar 28 '20 22:03 mide

easy-add might be able to be removed, I just added it because it was how @itzg did it in https://github.com/itzg/docker-minecraft-server/blob/fb92a74084da3ebfcd41a1043566d5c0638e7365/Dockerfile#L29-L57.

You could probably just download the rcon-cli binary and manually extract it if you're concerned about saving image size. easy-add just makes it easy to support difference architectures and versions at build-time.

As far as the code itself, it's been working fine in my own distribution and I haven't had any tile corruption since starting. I'm also using an Ofelia container to restart my overviewer container every hour.

magneticflux- avatar Mar 29 '20 04:03 magneticflux-

I thought I would just mention that yes, easy-add is bit a overkill for adding a single binary. I also put this in easy-add's README, but here's one alternative I used to use:

ADD https://github.com/itzg/rcon-cli/releases/download/1.4.7/rcon-cli_1.4.7_linux_amd64.tar.gz /tmp/rcon-cli.tgz
RUN tar -xf /tmp/rcon-cli.tgz -C /usr/local/bin rcon-cli && rm /tmp/rcon-cli.tgz

itzg avatar Mar 29 '20 13:03 itzg

How can you specify the RCON password?

mide avatar Apr 03 '20 01:04 mide

rcon-cli has a --password flag that I use. I don't expose the RCON port at all, so there's no real point in a secure password.

magneticflux- avatar Apr 04 '20 01:04 magneticflux-

easy-add was about 15MB. I removed it and downloaded rcon-cli manually and it's only 3MB.

@itzg Maybe you could run some kind of optimization step on the Golang binaries when you build them? Remove debug info and compress maybe? 15MB seems like a pretty big static binary for a one-file Golang program...

magneticflux- avatar Apr 08 '20 03:04 magneticflux-

easy-add was about 15MB. I removed it and downloaded rcon-cli manually and it's only 3MB.

@itzg Maybe you could run some kind of optimization step on the Golang binaries when you build them? Remove debug info and compress maybe? 15MB seems like a pretty big static binary for a one-file Golang program...

@magneticflux- I had already offered my advise to remove the use of easy-add, so I found this comment was not helpful. First of all, the easy-add binary is only 7MB if you look at the release assets here: https://github.com/itzg/easy-add/releases/tag/0.7.1 . The size of Go binaries is already a source of contention way outside my control; there's even an official blog article about their efforts to reduce that https://blog.golang.org/go1.7-binary-size . Finally, you're welcome to look into the module dependency graph and build definition of easy-add and contribute specific improvements.

itzg avatar Apr 08 '20 12:04 itzg

I appreciate the build improvements, but can we try to keep this PR for just the rcon-cli? It's starting to expand to build improvements and shellcheck fixes. I like 'one PR per thing'.

For example, most of the other suggestions are solid and minor so I'd just merge them in, this one is a bit larger for me to consider.

mide avatar Apr 08 '20 22:04 mide

@magneticflux- I had already offered my advise to remove the use of easy-add, so I found this comment was not helpful.

Sorry, I didn't mean to offend!

keep this PR for just the rcon-cli

Sure, I'll rebase with just the rcon-cli specific stuff.

magneticflux- avatar Apr 08 '20 22:04 magneticflux-

I did a massive rebase and moved everything to do exclusively with Shellcheck and build improvements to https://github.com/mide/minecraft-overviewer/pull/65.

I think this is the optimal way to add everything now!

magneticflux- avatar Apr 08 '20 23:04 magneticflux-

@magneticflux- I added a commit with some suggestions, please let me know what you think. We can revert if needed.

mide avatar Apr 25 '20 05:04 mide

That cleans it up nicely, thanks!

magneticflux- avatar Apr 25 '20 05:04 magneticflux-

Super. I'd like to test this (I haven't yet tested against a live running server). If everything looks good, I'll merge when I get a chance.

mide avatar Apr 25 '20 05:04 mide