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

Add support for .properties files when patching

Open Player505 opened this issue 1 year ago • 5 comments

Enhancement Type

Improve an existing feature

Describe the enhancement

I noticed that when trying to set up a patch definition for simple voice chat to change the port it uses the .properties file type isn't recognized

The file format of /data/config/voicechat/voicechat-server.properties could not be identified

It would be nice to get support for these files since a few mods use them

Player505 avatar May 24 '24 14:05 Player505

Good idea. It's not going to be a trivial fit since properties files are "unstructured" compared to JSON, Yaml, and Toml; however the concept of the idea is great.

In the meantime, you can make use of variable substitution for managing container driven config file changes like that

https://docker-minecraft-server.readthedocs.io/en/latest/configuration/interpolating/

itzg avatar May 24 '24 15:05 itzg

Thanks! Yeah I did some more reading of the docs and saw that I could use variable substitution but it was my understanding that I need to provide the config file to the container rather than patching one that it makes?

Player505 avatar May 26 '24 05:05 Player505

Yes, by default the variable substitution is performed on files copied over from /config mount. You can have it process existing files with REPLACE_ENV_IN_PLACE however, that'll be a one-time replacement since the variable will be gone after replacement.

Patching requires the file to be patched to be pre-existing, so it sounds like that wasn't going to solve your scenario as is.

itzg avatar May 26 '24 13:05 itzg

I worked around patching the files by running the container twice. Once to generate the files and the second time to patch them.

I gave it some more thought and the packwiz capability might provide a better solution for my use case since packwiz can also deal with config files. My methodology is that I'd like to reduce the number of files required for reproducibility which is why I didn't want to mount a config folder.

Player505 avatar May 27 '24 06:05 Player505

My methodology is that I'd like to reduce the number of files required for reproducibility which is why I didn't want to mount a config folder.

💯

itzg avatar May 27 '24 13:05 itzg