itzg/docker-mc-proxy

Allow env interpolation for .toml files

Closed this issue · 8 comments

As of currently the interpolater does not go through toml files which causes anything that uses toml files, especially Velocity to be largely unusable if they require runtime variables

itzg commented

When it gets invoked in the minecraft-server image it passes toml as one of the suffixes

https://github.com/itzg/docker-minecraft-server/blob/05bbb45046721ac4997b0f61cd7158c3dc6f9c4c/scripts/start-setupMounts#L8

however, I could see it being a good idea to include that as a default.

Ok so I'm a little confused, does it interpolate into toml or not by default?

itzg commented

For mc-image-helper I just double checked and there is no default. --replace-env-file-suffixes is a required and there is no default. The two docker images do include toml in their defaults.

So, now I'm confused. Was there a specific problem you observed or are you just asking/speculating?

Yeah, so whenever I try to use the env stuff I get com.electronwill.nightconfig.core.io.ParsingException: Invalid value: lobby,

my velocity .toml is

	lobby=${lobby}
	survival=${survival}
	creative=${creative}

and I have this in my docker-compose

    environment:
    - TYPE=VELOCITY
    - REPLACE_ENV_VARIABLES="true"
    # Pass through the ip adresses for the servers

    - lobby= hub
    - survial= LCS
    - creative= LCC
  • hub, LCS, and LCC all are other servers in the same compose file

I originally made this issue because after looking through the source code I wrongly assumed how it worked and thought toml wasn't one of the interpolated file types

itzg commented

Ah, the documentation wording here is slightly wrong

https://github.com/itzg/docker-bungeecord#replacing-variables-inside-configs

It implies REPLACE_ENV_VARIABLE_PREFIX is optional, but that's because it defaults to "CFG_". You can explicitly set it to an empty string to use no prefix.

I'm going to move this issue over since it's a documentation problem in the bungeecord repo.

itzg commented

README has been updated. Sorry for the confusion.