OpenFactorioServerManager / factorio-server-manager

A tool to help manage Factorio multiplayer servers including mods and save games.
MIT License
541 stars 129 forks source link

Unraid FSM image has extra whitespace character at the end of 'FACTORIO_VERSION' environment variable #382

Closed sainsley1 closed 4 months ago

sainsley1 commented 4 months ago

The Unraid FSM image contains the environment variable 'FACTORIO_VERSION' to control which version of Factorio is installed. However, currently the Unraid FSM image automatically installs the latest experimental version, even when this environment variable is set to 'stable' (as it is by default). This is because the environment variable is actually created as 'FACTORIO_VERSION ', with a single whitespace character at the end. I have verified this through removing/readding the container a few times and each time the variable is recreated the same way. I removed the offending whitespace character and now my server downloads the correct stable version. Please let me know if additional info is needed.

Mattie112 commented 4 months ago

If I take a quick look at the code. And then especially the docker/entrypoint.sh I don´t see a space there.

https://github.com/search?q=repo%3AOpenFactorioServerManager%2Ffactorio-server-manager%20FACTORIO_VERSION&type=code

image

(assuming linux / docker) the name of an environment variable cannot contain a space: https://www.gnu.org/software/bash/manual/html_node/Definitions.html#index-name

name
A word consisting solely of letters, numbers, and underscores, and beginning with a letter or underscore. Names are used as shell variable and function names. Also referred to as an identifier.

So exactly what place are you seeing a space?

sainsley1 commented 4 months ago

Hi Mattie112,

Steps to reproduce:

  1. Deploy FactorioServerManager container via the Unraid 'Apps' from lordfiSh's repository using all default settings
  2. Edit the newly created FactorioServerManager container
  3. Observe that the Environment Variable 'FACTORIO_VERSION' contains an extra space at the end, and that the Container has, by default, been installed on the latest experimental version as opposed to the latest stable version, despite the 'FACTORIO_VERSION ' environment variable being set to 'stable' by defualt image image Note how you can see my cursor in the 'FACTORIO_VERSION ' section. This is illustrating the extra whitespace which is causing the problem. If you remove this single whitespace character and restart the server, the Factorio version will now change from Experimental latest, to Stable latest.

Please let me know if I can provide any additional information to clarify. Sorry for my late night question written without all needed context. :)

Mattie112 commented 4 months ago

No problem thanks for the clarification. The thing is: this is the repo for the actual implementation of the server. The Unraid template is somewhere different. So this is not really a bug for here. I would report it at https://github.com/lordfiSh/unraid-docker-images/blob/main/repo/OpenFactorioServerManager.xml instead.

sainsley1 commented 4 months ago

Apologies, entirely correct - the Unraid template 'support' link comes here, but that's a much more appropriate place. Thanks!! Closing

Mattie112 commented 4 months ago

No problem! At least you took the effort to report it :)