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

Add support for .properties files when patching #2844

Open
Player505 opened this issue May 24, 2024 · 5 comments
Open

Add support for .properties files when patching #2844

Player505 opened this issue May 24, 2024 · 5 comments

Comments

@Player505
Copy link

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

@itzg
Copy link
Owner

itzg commented May 24, 2024

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/

@Player505
Copy link
Author

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?

@itzg
Copy link
Owner

itzg commented May 26, 2024

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.

@Player505
Copy link
Author

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.

@itzg
Copy link
Owner

itzg commented May 27, 2024

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.

💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants